22#include <boost/assign/list_of.hpp>
24using boost::assign::list_of;
30using std::stringstream;
58 char eLossModelChar[buf_size];
61 if (eLossModel ==
CbmStsELoss::kUrban) snprintf(eLossModelChar, buf_size - 1,
"non-uniform");
65 Out() <<
"Number of events: " <<
HM()->
H1(
"h_EventNo_DigitizeQa")->GetEntries() << endl;
67 Out() <<
"Digitizer parameters: " << endl;
68 Out() <<
"\t noise \t\t\t" << noise <<
" e" << endl;
69 Out() <<
"\t threshold \t\t" << threshold <<
" e" << endl;
70 Out() <<
"\t dynamic range \t\t" << dynRange <<
" e" << endl;
71 Out() <<
"\t number of ADC \t\t" << nAdc << endl;
72 Out() <<
"\t time resolution \t" << timeResolution <<
" ns" << endl;
73 Out() <<
"\t dead time \t\t" << deadTime <<
" ns" << endl;
75 Out() <<
"Detector response model takes into account: " << endl;
76 Out() <<
"\t energy loss model: \t" << eLossModelChar << endl;
77 Out() <<
"\t diffusion: \t\t" << (diffusion ?
"On" :
"Off") << endl;
78 Out() <<
"\t Lorentz shift: \t" << (lorentz ?
"On" :
"Off") << endl;
79 Out() <<
"\t cross talk: \t\t" << (crossTalk ?
"On" :
"Off") << endl;
100 string name =
"h_NofObjects_";
101 if (!
HM()->Exists(name +
"Points") && !
HM()->Exists(name +
"Digis") && !
HM()->Exists(name +
"Digis_Station")
102 && !
HM()->Exists(name +
"Points_Station"))
105 TCanvas* canvas =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
109 vector<string> labels = list_of(
"Points")(
"Digis");
110 vector<TH1*> histos = list_of(
HM()->
H1(name +
"Points"))(
HM()->
H1(name +
"Digis"));
113 vector<TH1*> histos1 = list_of(
HM()->
H1(name +
"Points_Station"))(
HM()->
H1(name +
"Digis_Station"));
115 TCanvas* canvas1 =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
123 string name =
"h_DigisPerChip_Station";
125 if (!
HM()->Exists(Form(
"h_DigisPerChip_Station%i", stationId))
126 && !
HM()->Exists(Form(
"h_PointsMap_Station%i", stationId))
127 && !
HM()->Exists(Form(
"h_MeanAngleMap_Station%i", stationId))
128 && !
HM()->Exists(Form(
"h_RMSAngleMap_Station%i", stationId)))
132 TCanvas* canvas =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 2400, 600);
133 canvas->Divide(4, 2);
136 string name1 =
"h_PointsMap_Station";
138 TCanvas* canvas1 =
CreateCanvas(canvasName1.c_str(), canvasName1.c_str(), 2400, 600);
139 canvas1->Divide(4, 2);
142 string name2 =
"h_MeanAngleMap_Station";
144 TCanvas* canvas2 =
CreateCanvas(canvasName2.c_str(), canvasName2.c_str(), 2400, 600);
145 canvas2->Divide(4, 2);
148 string name3 =
"h_RMSAngleMap_Station";
150 TCanvas* canvas3 =
CreateCanvas(canvasName3.c_str(), canvasName3.c_str(), 2400, 600);
151 canvas3->Divide(4, 2);
155 canvas->cd(stationId + 1);
158 canvas1->cd(stationId + 1);
161 canvas2->cd(stationId + 1);
164 canvas3->cd(stationId + 1);
173 if (!
HM()->Exists(name +
"PointsInDigiLog") && !
HM()->Exists(name +
"DigisByPointLog"))
return;
174 string canvasName =
GetReportName() + name +
"PointsInDigiLog";
175 TCanvas* canvas =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
179 vector<TH1*> histos = list_of(
HM()->
H1(name +
"PointsInDigiLog"));
180 vector<string> labels =
181 list_of(Form(
"Points in digi, \n mean = %.2f",
HM()->
H1(name +
"PointsInDigiLog")->GetMean()));
185 vector<TH1*> histos1 = list_of(
HM()->
H1(name +
"DigisByPointLog"));
186 vector<string> labels1 =
187 list_of(Form(
"Digis by point, \n mean = %.2f",
HM()->
H1(name +
"DigisByPointLog")->GetMean()));
188 TCanvas* canvas1 =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
198 if (!
HM()->Exists(name +
"PointsInDigi") && !
HM()->Exists(name +
"DigisByPoint"))
return;
200 TCanvas* canvas =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
203 vector<TH1*> histos = list_of(
HM()->
H1(name +
"PointsInDigi"));
204 vector<string> labels = list_of(Form(
"Points in digi, \n mean = %.2f",
HM()->
H1(name +
"PointsInDigi")->GetMean()));
208 vector<TH1*> histos1 = list_of(
HM()->
H1(name +
"DigisByPoint"));
209 vector<string> labels1 = list_of(Form(
"Digis by point, \n mean = %.2f",
HM()->
H1(name +
"DigisByPoint")->GetMean()));
210 TCanvas* canvas1 =
CreateCanvas(canvasName.c_str(), canvasName.c_str(), 800, 500);
219 Int_t nofEvents =
HM()->
H1(
"h_EventNo_DigitizeQa")->GetEntries();
220 if (nofEvents == 0) nofEvents = 1;
ClassImp(CbmConverterManager)
void DrawH1(TH1 *hist, HistScale logx, HistScale logy, const string &drawOpt, Int_t color, Int_t lineWidth, Int_t lineStyle, Int_t markerSize, Int_t markerStyle)
void DrawH2(TH2 *hist, HistScale logx, HistScale logy, HistScale logz, const string &drawOpt)
Helper functions for drawing 1D and 2D histograms and graphs.
Abstract class for basic report elements (headers, tables, images etc.).
CbmStsELoss
Energy loss model used in simulation.
void ShrinkEmptyBinsH1ByPattern(const std::string &pattern)
Shrink empty bins in H1.
void ScaleByPattern(const std::string &pattern, Double_t scale)
Scale histograms which name matches specified pattern.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
virtual std::string Title(int size, const std::string &title) const =0
Return string with title.
virtual std::string DocumentBegin() const =0
Return string with open tags for document.
virtual std::string DocumentEnd() const =0
Return string with close tags of the document.
std::ostream & Out() const
All text output goes to this stream.
void SetReportName(const std::string &name)
void PrintCanvases() const
Print images created from canvases in the report.
const std::string & GetReportName() const
const CbmReportElement * R() const
Accessor to CbmReportElement object. User has to write the report using available tags from CbmReport...
TCanvas * CreateCanvas(const char *name, const char *title, Int_t ww, Int_t wh)
Create canvas and put it to vector of TCanvases. Canvases created with this function will be automati...
Base class for simulation reports.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void DrawH1ByPattern(const std::string &histNamePattern)
Select by pattern TH1 histograms and draw each histogram on separate canvas.
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
CbmHistManager * HM() const
Return pointer to Histogram manager.
virtual ~CbmStsDigitizeQaReport()
virtual void Draw()
Pure abstract function which is called from public Create() function. This function has to draw all n...
const CbmStsParSim * fSettings
void DrawNofObjectsHistograms()
const CbmStsParAsic * fAsicPar
CbmStsDigitizeQaReport(CbmStsSetup *setup, const CbmStsParSim *settings, const CbmStsParAsic *asicPar)
virtual void Create()
Inherited from CbmReport. Pure abstract function which is called from public Create() function.
Parameters of the STS readout ASIC.
double GetDynRange() const
Dynamic range of ADC.
uint16_t GetNofAdc() const
Number of ADC channels.
double GetNoise() const
Electronic noise RMS.
double GetThreshold() const
ADC Threshold.
double GetTimeResol() const
Time resolution.
double GetDeadTime() const
Single-channel dead time.
Settings for STS simulation (digitizer)
Bool_t LorentzShift() const
Check whether Lorentz shift is applied.
CbmStsELoss ELossModel() const
Energy loss model.
Bool_t CrossTalk() const
Check whether cross-talk is applied.
Bool_t Diffusion() const
Check whether diffusion is applied.
Class representing the top level of the STS setup.
Int_t GetNofStations() const
string FindAndReplace(const string &name, const string &oldSubstr, const string &newSubstr)
vector< string > Split(const string &name, char delimiter)
std::string NumberToString(const T &value, int precision=1)