9#include "BmnDrawHist.h"
10#include "BmnDrawOnline.h"
11#include "BmnHistManager.h"
12#include "BmnReportElement.h"
56 Out() <<
"<hr>" << endl;
66 Out() <<
"<h2>Results only for primaries presented</h2>" << endl;
67 Out() <<
"<h2>Number of events: " <<
HM()->
H1(
"hen_EventNo_TrackingQa")->
GetEntries() <<
"</h2>" << endl;
68 Out() <<
"<h2>Mean multiplicity: " <<
HM()->
H1(
"Multiplicity")->
GetMean() <<
"</h2>" << endl;
69 Out() <<
"<hr>" << endl;
70 Out() <<
"<h3><font color=\"red\">Reconstructable</font> MC-track:</h3>"
71 <<
"Monte Carlo track with at least <font color=\"red\">4</font> Monte Carlo points in GEM" << endl;
72 Out() <<
"<h3><font color=\"red\">Good</font> track:</h3>"
73 <<
"Reconstructed track with at least <font color=\"red\">4</font> hits in GEM and <font "
74 "color=\"red\">60%</font> of them corresponded the same MC-track"
76 Out() <<
"<h3><font color=\"red\">Clone</font> tracks:</h3>";
77 Out() <<
"Two or more reconstructed tracks with reference to the same MC-track." << endl;
78 Out() <<
"The number of clones is subtracted from number of good tracks before efficiency calculation." << endl;
79 Out() <<
"<hr>" << endl;
81 inTiming.open(
"timing.txt");
82 if (inTiming.is_open()) {
85 while (!inTiming.eof()) {
86 inTiming >> a1 >> a2 >> a3 >> workTime;
88 <<
"Average time of " << a1 <<
" " << a2 <<
": "
89 << workTime /
HM()->
H1(
"hen_EventNo_TrackingQa")->
GetEntries() * 1000.0 <<
" ms/event "
104 TString pNamesIn[5] = {
"Sim_vs_P",
"Rec_vs_P",
"Well_vs_P",
"Ghost_vs_P",
"Split_vs_P"};
105 TString pNamesOut[3] = {
"Eff_vs_P",
"Fake_vs_P",
"SplitEff_vs_P"};
108 TString pNamesInWide[5] = {
"Sim_vs_P_wide",
"Rec_vs_P_wide",
"Well_vs_P_wide",
"Ghost_vs_P_wide",
110 TString pNamesOutWide[3] = {
"Eff_vs_P_wide",
"Fake_vs_P_wide",
"SplitEff_vs_P_wide"};
111 DrawEffGem(
fPrefix +
"Efficiency on momentum in wide range", pNamesInWide, pNamesOutWide);
113 TString etaNamesIn[5] = {
"Sim_vs_Eta",
"Rec_vs_Eta",
"Well_vs_Eta",
"Ghost_vs_Eta",
"Split_vs_Eta"};
114 TString etaNamesOut[3] = {
"Eff_vs_Eta",
"Fake_vs_Eta",
"SplitEff_vs_Eta"};
117 TString thetaNamesIn[5] = {
"Sim_vs_Theta",
"Rec_vs_Theta",
"Well_vs_Theta",
"Ghost_vs_Theta",
"Split_vs_Theta"};
118 TString thetaNamesOut[3] = {
"Eff_vs_Theta",
"Fake_vs_Theta",
"SplitEff_vs_Theta"};
121 TString nhNamesIn[5] = {
"Sim_vs_Nh",
"Rec_vs_Nh",
"Well_vs_Nh",
"Ghost_vs_Nh",
"Split_vs_Nh"};
122 TString nhNamesOut[3] = {
"Eff_vs_Nh",
"Fake_vs_Nh",
"SplitEff_vs_Nh"};
127 DrawTwoH2(
fPrefix +
"Distribution of tracks over number of hits and Pseudorapidity",
"Nh_sim_Eta_sim",
129 DrawTwoH2(
fPrefix +
"Distribution of tracks over number of hits and Momentum",
"Nh_sim_P_sim",
"Nh_rec_P_rec",
131 DrawTwoH2(
fPrefix +
"Distribution of tracks over number of hits and Theta",
"Nh_sim_Theta_sim",
"Nh_rec_Theta_rec",
133 DrawTwoH2(
fPrefix +
"Distribution of tracks over Pseudorapidity and Momentum",
"EtaP_sim",
"EtaP_rec", 2 *
baseW,
140 Float_t content = (denom < 0.001) ? 0.0 : nom / denom * 100.0;
150 Float_t content = (denom < 0.001) ? 0.0 : nom / denom * 100.0;
160 Float_t content = (denom < 0.001) ? 0.0 : nom / denom * 100.0;
167 DrawThreeH2(
fPrefix +
"Distribution of Efficiency, Ghosts and Clones over Pseudorapidity and Momentum",
168 "Eff_vs_EtaP",
"Clones_vs_EtaP",
"Fakes_vs_EtaP");
169 DrawOneH2(
fPrefix +
"Correlation between number of points in MC-track and number of hits in Reco-track",
173 DrawOneH2(
fPrefix +
"Pseudorapidity_reco vs Pseudorapidity_mc",
"Eta_rec_Eta_sim");
174 DrawMomResGem(
fPrefix +
"Eta resolution",
"EtaRes_2D",
"EtaRes_1D",
"EtaMean_1D",
"EtaRes_Mean");
175 DrawTwoH2(
fPrefix +
"Tx_reco vs Tx_mc (left) and Ty_reco vs Ty_mc (right) for GLOB",
"Tx_rec_Tx_sim",
179 DrawThreeH2(
fPrefix +
"Reco vs MC for X-, Y- and Z-component of Momentum",
"Px_rec_Px_sim",
"Py_rec_Py_sim",
181 DrawMomResGem(
fPrefix +
"Momentum resolution",
"momRes_2D",
"momRes_1D",
"momMean_1D",
"momRes_Mean");
185 DrawMomResGem(
fPrefix +
"Momentum resolution vs. theta",
"MomRes_vs_Theta",
"MomRes_vs_Theta_1D",
186 "MomMean_vs_Theta_1D",
"momRes_Mean");
187 DrawMomResGem(
fPrefix +
"Momentum resolution and momentum vs. length of tracks",
"MomRes_vs_Length",
188 "MomRes_vs_Length_1D",
"MomMean_vs_Length_1D",
"momRes_Mean");
189 DrawMomResGem(
fPrefix +
"Momentum resolution vs. Number of hits",
"MomRes_vs_nHits",
"MomRes_vs_nHits_1D",
190 "MomMean_vs_nHits_1D",
"momRes_Mean");
212 TString namesParF[5] = {
"X_f",
"Y_f",
"Tx_f",
"Ty_f",
"Qp_f"};
213 TString namesParL[5] = {
"X_l",
"Y_l",
"Tx_l",
"Ty_l",
"Qp_l"};
217 DrawThreeH2(
fPrefix +
"Vertex vs number of tracks in event",
"VertX_vs_Ntracks",
"VertY_vs_Ntracks",
220 DrawThreeH1(
fPrefix +
"Vertex distribution for X and Y directions",
"VertX",
"VertY",
"VertZ");
222 TString multNamesIn[5] = {
"Sim_vs_mult",
"Rec_vs_mult",
"Well_vs_mult",
"Ghost_vs_mult",
"Split_vs_mult"};
223 TString multNamesOut[3] = {
"Eff_vs_mult",
"Fake_vs_mult",
"SplitEff_vs_mult"};
231 TString namesResPullsF[15] = {
"ResX_f",
"ResY_f",
"ResTx_f",
"ResTy_f",
"ResQp_f",
232 "ErrX_f",
"ErrY_f",
"ErrTx_f",
"ErrTy_f",
"ErrQp_f",
233 "PullX_f",
"PullY_f",
"PullTx_f",
"PullTy_f",
"PullQp_f"};
234 TString namesResPullsL[15] = {
"ResX_l",
"ResY_l",
"ResTx_l",
"ResTy_l",
"ResQp_l",
235 "ErrX_l",
"ErrY_l",
"ErrTx_l",
"ErrTy_l",
"ErrQp_l",
236 "PullX_l",
"PullY_l",
"PullTx_l",
"PullTy_l",
"PullQp_l"};
240 TString pNamesInTof400[5] = {
"Sim_vs_P_tof400",
"Rec_vs_P_tof400",
"Well_vs_P_tof400",
"Ghost_vs_P_tof400",
241 "Split_vs_P_tof400"};
242 TString pNamesOutTof400[3] = {
"Eff_vs_P_tof400",
"Fake_vs_P_tof400",
"SplitEff_vs_P_tof400"};
243 DrawEffGem(
fPrefix +
"Distribution of MC-tracks, reco-tracks, fakes and clones vs P_sim per event for TOF-400",
244 pNamesInTof400, pNamesOutTof400);
245 TString pNamesInTof700[5] = {
"Sim_vs_P_tof700",
"Rec_vs_P_tof700",
"Well_vs_P_tof700",
"Ghost_vs_P_tof700",
246 "Split_vs_P_tof700"};
247 TString pNamesOutTof700[3] = {
"Eff_vs_P_tof700",
"Fake_vs_P_tof700",
"SplitEff_vs_P_tof700"};
248 DrawEffGem(
fPrefix +
"Distribution of MC-tracks, reco-tracks, fakes and clones vs P_sim per event for TOF-700",
249 pNamesInTof700, pNamesOutTof700);
251 DrawTwoH2(
fPrefix +
"Distribution of tracks over velocity and rigidity (track and hit have same MCID)",
252 "banana_tof400_good",
"banana_tof700_good", 2 *
baseW,
baseH);
253 DrawThreeH2(
fPrefix +
"Mass correlation and banana plots for TOF-400 and TOF-700",
"Mass_correlation",
254 "banana_tof400",
"banana_tof700");
255 DrawTwoH1(
fPrefix +
"Distribution of TOF-400 residuals for correct matching",
"x_residuals_tof400_good",
256 "y_residuals_tof400_good",
"",
kTRUE);
257 DrawTwoH1(
fPrefix +
"Distribution of TOF-700 residuals for correct matching",
"x_residuals_tof700_good",
258 "y_residuals_tof700_good",
"",
kTRUE);
259 DrawTwoH1(
fPrefix +
"Distribution of TOF-400 residuals for wrong matching",
"x_residuals_tof400_bad",
260 "y_residuals_tof400_bad",
"",
kTRUE);
261 DrawTwoH1(
fPrefix +
"Distribution of TOF-700 residuals for wrong matching",
"x_residuals_tof700_bad",
262 "y_residuals_tof700_bad",
"",
kTRUE);
263 DrawTwoH2(
fPrefix +
"Residuals over rigidity for TOF-400",
"x_resi_vs_mom_tof400_good",
"y_resi_vs_mom_tof400_good",
265 DrawTwoH2(
fPrefix +
"Residuals over rigidity for TOF-700",
"x_resi_vs_mom_tof700_good",
"y_resi_vs_mom_tof700_good",
271 TString pNamesInCsc[5] = {
"Sim_vs_P_csc",
"Rec_vs_P_csc",
"Well_vs_P_csc",
"Ghost_vs_P_csc",
"Split_vs_P_csc"};
272 TString pNamesOutCsc[3] = {
"Eff_vs_P_csc",
"Fake_vs_P_csc",
"SplitEff_vs_P_csc"};
273 DrawEffGem(
fPrefix +
"Distribution of MC-tracks, reco-tracks, fakes and clones vs P_sim per event for CSC",
274 pNamesInCsc, pNamesOutCsc);
275 DrawTwoH1(
fPrefix +
"Distribution of CSC residuals for correct matching",
"x_residuals_csc_good",
276 "y_residuals_csc_good",
"",
kTRUE);
277 DrawTwoH1(
fPrefix +
"Distribution of CSC residuals for wrong matching",
"x_residuals_csc_bad",
278 "y_residuals_csc_bad",
"",
kTRUE);
279 DrawTwoH2(
fPrefix +
"Residuals over rigidity for CSC",
"x_resi_vs_mom_csc_good",
"y_resi_vs_mom_csc_good",
285 TString pNamesInDch1[5] = {
"Sim_vs_P_dch1",
"Rec_vs_P_dch1",
"Well_vs_P_dch1",
"Ghost_vs_P_dch1",
287 TString pNamesOutDch1[3] = {
"Eff_vs_P_dch1",
"Fake_vs_P_dch1",
"SplitEff_vs_P_dch1"};
288 DrawEffGem(
fPrefix +
"Distribution of MC-tracks, reco-tracks, fakes and clones vs P_sim per event for DCH1",
289 pNamesInDch1, pNamesOutDch1);
290 DrawTwoH1(
fPrefix +
"Distribution of DCH1 residuals for correct matching",
"x_residuals_dch1_good",
291 "y_residuals_dch1_good",
"",
kTRUE);
292 DrawTwoH1(
fPrefix +
"Distribution of DCH1 residuals for wrong matching",
"x_residuals_dch1_bad",
293 "y_residuals_dch1_bad",
"",
kTRUE);
294 DrawTwoH2(
fPrefix +
"Residuals over rigidity for DCH1",
"x_resi_vs_mom_dch1_good",
"y_resi_vs_mom_dch1_good",
298 TString pNamesInDch2[5] = {
"Sim_vs_P_dch2",
"Rec_vs_P_dch2",
"Well_vs_P_dch2",
"Ghost_vs_P_dch2",
300 TString pNamesOutDch2[3] = {
"Eff_vs_P_dch2",
"Fake_vs_P_dch2",
"SplitEff_vs_P_dch2"};
301 DrawEffGem(
fPrefix +
"Distribution of MC-tracks, reco-tracks, fakes and clones vs P_sim per event for DCH2",
302 pNamesInDch2, pNamesOutDch2);
303 DrawTwoH1(
fPrefix +
"Distribution of DCH2 residuals for correct matching",
"x_residuals_dch2_good",
304 "y_residuals_dch2_good",
"",
kTRUE);
305 DrawTwoH1(
fPrefix +
"Distribution of DCH2 residuals for wrong matching",
"x_residuals_dch2_bad",
306 "y_residuals_dch2_bad",
"",
kTRUE);
307 DrawTwoH2(
fPrefix +
"Residuals over rigidity for DCH2",
"x_resi_vs_mom_dch2_good",
"y_resi_vs_mom_dch2_good",
459 vector<TH1*> histos1;
460 histos1.push_back(
HM()->H1(sim));
461 histos1.push_back(
HM()->H1(well));
462 histos1.push_back(
HM()->H1(ghost));
463 histos1.push_back(
HM()->H1(split));
464 vector<string> labels1;
465 labels1.push_back(
"MC tracks");
466 labels1.push_back(
"Good tracks");
467 labels1.push_back(
"Ghost tracks");
468 labels1.push_back(
"Clones");
469 drawHist->DrawH1(canvas, histos1, labels1,
kLinear,
kLinear,
true, 0.5, 0.81, 1.0, 0.93,
"PE1",
kFALSE);
472 vector<string> labels2;
473 labels2.push_back(
"Efficiency");
474 labels2.push_back(
"Ghosts");
475 labels2.push_back(
"Clones");
477 HM()->
H1(eff)->
Divide(
HM()->H1(well),
HM()->H1(sim), 1., 1.,
"B");
479 HM()->
H1(fake)->
Divide(
HM()->H1(ghost),
HM()->H1(rec), 1., 1.,
"B");
481 HM()->
H1(clon)->
Divide(
HM()->H1(split),
HM()->H1(rec), 1., 1.,
"B");
487 if (
HM()->H1(eff)->GetBinContent(
i) > 100.0) {
491 if (
HM()->H1(fake)->GetBinContent(
i) > 100.0) {
495 if (
HM()->H1(clon)->GetBinContent(
i) > 100.0) {
499 if (
HM()->H1(eff)->GetBinContent(
i) < 0.0) {
503 if (
HM()->H1(fake)->GetBinContent(
i) < 0.0) {
507 if (
HM()->H1(clon)->GetBinContent(
i) < 0.0) {
520 vector<TH1*> histos2;
521 histos2.push_back(
HM()->H1(eff));
522 histos2.push_back(
HM()->H1(fake));
523 histos2.push_back(
HM()->H1(clon));
524 drawHist->DrawH1(canvas, histos2, labels2,
kLinear,
kLinear,
true, 0.5, 0.81, 1.0, 0.93,
"PE1X0",
kTRUE);
533 HM()->
H1(
"Well_vs_Nh")->
Scale(1. / nofEvents);
535 HM()->
H1(
"Ghost_vs_Nh")->
Scale(1. / nofEvents);
536 vector<TH1*> histos1;
537 histos1.push_back(
HM()->H1(
"Well_vs_Nh"));
538 histos1.push_back(
HM()->H1(
"Ghost_vs_Nh"));
539 vector<string> labels1;
540 labels1.push_back(
"Good tracks");
541 labels1.push_back(
"Ghosts");
542 drawHist->DrawH1(canvas, histos1, labels1,
kLinear,
kLinear,
true, 0.5, 0.81, 1.0, 0.9,
"PE1",
kFALSE);
551 drawHist->DrawH1(canvas,
HM()->H1(
"Impact parameter"),
kLinear,
kLinear,
"",
kRed, 2, 1, 1.1, 20, 33);
553 drawHist->DrawH1(canvas,
HM()->H1(
"Multiplicity"),
kLinear,
kLinear,
"",
kRed, 2, 1, 1.1, 20, 33);
589 HM()->
H1(nameAver)->
Fit(
"gaus",
"RQWW",
"", -2, 2);
595 new TPaveStats(3.0,
HM()->H1(nameAver)->GetMaximum() / 1.5, 10.0,
HM()->H1(nameAver)->GetMaximum());
612 HM()->
H1(inNames[
i])->
Fit(
"gaus",
"RQWW",
"", -20, 20);
664 proj->
Fit(
"gaus",
"SQRww",
"", -5.0, 5.0);
686 HM()->
H1(name1dX)->
Fit(
"gaus",
"RQWW",
"", -1, 1);
690 HM()->
H1(name1dY)->
Fit(
"gaus",
"RQWW",
"", -1, 1);
694 HM()->
H1(name1dZ)->
Fit(
"gaus",
"RQWW",
"", -2, 2);
734 HM()->
H1(name1)->
Fit(
"gaus",
"WWQ");
740 HM()->
H1(name2)->
Fit(
"gaus",
"WWQ");
Create report for tracking QA.
FairTask for tracking performance calculation.
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
TH2 * H2(const TString &name) const
Return pointer to TH2 histogram.
TH1 * H1(const TString &name) const
Return pointer to TH1 histogram.
virtual string Title(int size, const string &title) const =0
Return string with title.
virtual string DocumentBegin() const =0
Return string with open tags for document.
virtual string DocumentEnd() const =0
Return string with close tags of the document.
void SetReportName(TString name)
void PrintCanvases() const
Print images created from canvases in the report.
const BmnReportElement * R() const
Accessor to BmnReportElement object.
TCanvas * CreateCanvas(const char *name, const char *title, Int_t ww, Int_t wh)
Create canvas and put it to vector of TCanvases.
ostream & Out() const
All text output goes to this stream.
BmnHistManager * HM() const
Return pointer to Histogram manager.
BmnSimulationReport()
Constructor.
Bool_t GetOnlyPrimes() const
void DrawOneH2(const TString canvasName, const TString name1)
void DrawMomResGem(const TString canvasName, TString name2d, TString nameSigma, TString nameMean, TString nameAver)
void DrawTwoH2(const TString canvasName, const TString name1, const TString name2, Int_t w=1000, Int_t h=500)
void DrawPar(const TString canvasName, TString *inNames)
vector< string > fGlobalTrackVariants
void DrawTwoH1(const TString canvasName, const TString name1, const TString name2, const TString drawOpt, Bool_t doFit)
BmnTrackingQaReport()
Constructor.
void DrawMuSigma(TVirtualPad *pad, TH1 *h)
virtual ~BmnTrackingQaReport()
Destructor.
virtual void Draw()
Inherited from BmnSimulationReport.
void DrawThreeH2(const TString canvasName, const TString name1, const TString name2, const TString name3)
void DrawResAndPull(const TString canvasName, TString *inNames)
void DrawOneH1(const TString canvasName, const TString name1, const TString drawOpt)
virtual void Create()
Inherited from BmnSimulationReport.
void DrawEffGem(const TString canvasName, TString *inNames, TString *outNames)
void FillAndFitSlice(TString nameSigma, TString nameMean, TString name2d)
void DrawNhitsGem(const TString canvasName)
void DrawVertResGem(const TString canvasName, TString name1dX, TString name1dY, TString name1dZ)
void DrawThreeH1(const TString canvasName, const TString name1, const TString name2, const TString name3)
void DrawEventsInfo(const TString canvasName)
virtual void SetFillColor(Color_t fcolor)
TVirtualPad * cd(Int_t subpadnumber=0) override
virtual Double_t GetParameter(const TString &name) const
virtual Double_t GetParError(const char *name) const
virtual Double_t GetMean(Int_t axis=1) const
virtual TFitResultPtr Fit(const char *formula, Option_t *option="", Option_t *goption="", Double_t xmin=0, Double_t xmax=0)
virtual Double_t GetMaximum(Double_t maxval=FLT_MAX) const
virtual Int_t GetNbinsX() const
virtual void SetMaximum(Double_t maximum=-1111)
virtual void SetBinError(Int_t bin, Double_t error)
virtual void SetMinimum(Double_t minimum=-1111)
virtual void SetBinContent(Int_t bin, Double_t content)
virtual Double_t GetEntries() const
virtual TF1 * GetFunction(const char *name) const
virtual Double_t GetBinContent(Int_t bin) const
virtual Bool_t Divide(const TH1 *h1)
virtual void Scale(Double_t c1=1, Option_t *option="")
virtual void Sumw2(Bool_t flag=kTRUE)
TH1D * ProjectionY(const char *name="_py", Int_t firstxbin=0, Int_t lastxbin=-1, Option_t *option="") const
void SetBinContent(Int_t bin, Double_t content) override
virtual Double_t GetBinContent(Int_t bin) const
virtual const char * GetTitle() const
void SetGrid(Int_t valuex=1, Int_t valuey=1) override
void Divide(Int_t nx=1, Int_t ny=1, Float_t xmargin=0.01, Float_t ymargin=0.01, Int_t color=0) override
virtual TText * AddText(const char *label)
void Draw(Option_t *option="") override
virtual void SetShadowColor(Int_t color)
const char * Data() const
virtual TVirtualPad * cd(Int_t subpadnumber=0)=0
void SetDefaultDrawStyle()