CbmRoot
Loading...
Searching...
No Matches
alignment/CbmRichRecoQa.cxx
Go to the documentation of this file.
1/* Copyright (C) 2017-2021 Justus-Liebig-Universitaet Giessen, Giessen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Jordan Bendarouach [committer] */
4
5#include "CbmRichRecoQa.h"
6
7#include "CbmDrawHist.h"
8#include "CbmGlobalTrack.h"
9#include "CbmHistManager.h"
10#include "CbmMCTrack.h"
11#include "CbmMatchRecoToMC.h"
12#include "CbmRichDraw.h"
13#include "CbmRichGeoManager.h"
14#include "CbmRichHit.h"
15#include "CbmRichPoint.h"
16#include "CbmRichRing.h"
17#include "CbmRichUtil.h"
18#include "CbmTrackMatchNew.h"
19#include "CbmUtils.h"
20#include "FairMCPoint.h"
21#include "FairTrackParam.h"
22#include "TCanvas.h"
23#include "TClonesArray.h"
24#include "TEllipse.h"
25#include "TF1.h"
26#include "TH1.h"
27#include "TH1D.h"
28#include "TMCProcess.h"
29#include "TMarker.h"
30#include "TStyle.h"
32
33#include <boost/assign/list_of.hpp>
34
35#include <iostream>
36#include <sstream>
37#include <string>
38
39using namespace std;
40using boost::assign::list_of;
41
43 : FairTask("CbmRichRecoQa")
44 , fHM(nullptr)
45 , fEventNum(0)
46 , fOutputDir("")
47 , fMCTracks(nullptr)
48 , fRichPoints(nullptr)
49 , fRichDigis(nullptr)
50 , fRichHits(nullptr)
51 , fRichRings(nullptr)
52 , fRichRingMatches(nullptr)
53 , fGlobalTracks(nullptr)
54 , fStsTracks(nullptr)
55 , fStsTrackMatches(nullptr)
56 , fRichProjections(nullptr)
57 , fNofHitsInRingMap()
58 , fCanvas()
59 , fCorrection("")
60{
61}
62
64{
65 cout << "CbmRichRecoQa::Init" << endl;
66 FairRootManager* ioman = FairRootManager::Instance();
67 if (nullptr == ioman) {
68 Fatal("CbmRichRecoQa::Init", "RootManager not instantised!");
69 }
70
71 fMCTracks = (TClonesArray*) ioman->GetObject("MCTrack");
72 if (nullptr == fMCTracks) {
73 Fatal("CbmRichRecoQa::Init", "No MC Tracks!");
74 }
75
76 fRichPoints = (TClonesArray*) ioman->GetObject("RichPoint");
77 if (nullptr == fRichPoints) {
78 Fatal("CbmRichRecoQa::Init", "No Rich Points!");
79 }
80
81 fRichDigis = (TClonesArray*) ioman->GetObject("RichDigi");
82 if (nullptr == fRichDigis) {
83 Fatal("CbmRichRecoQa::Init", "No Rich Digis!");
84 }
85
86 fRichHits = (TClonesArray*) ioman->GetObject("RichHit");
87 if (nullptr == fRichHits) {
88 Fatal("CbmRichRecoQa::Init", "No RichHits!");
89 }
90
91 fRichRings = (TClonesArray*) ioman->GetObject("RichRing");
92 if (nullptr == fRichRings) {
93 Fatal("CbmRichRecoQa::Init", "No RichRings!");
94 }
95
96 fRichRingMatches = (TClonesArray*) ioman->GetObject("RichRingMatch");
97 if (nullptr == fRichRingMatches) {
98 Fatal("CbmRichRecoQa::Init", "No RichRingMatch array!");
99 }
100
101 fGlobalTracks = (TClonesArray*) ioman->GetObject("GlobalTrack");
102 if (nullptr == fGlobalTracks) {
103 Fatal("CbmRichRecoQa::Init", "No GlobalTrack array!");
104 }
105
106 fStsTracks = (TClonesArray*) ioman->GetObject("StsTrack");
107 if (nullptr == fStsTracks) {
108 Fatal("CbmRichRecoQa::Init", ": No StsTrack array!");
109 }
110
111 fStsTrackMatches = (TClonesArray*) ioman->GetObject("StsTrackMatch");
112 if (nullptr == fStsTrackMatches) {
113 Fatal("CbmRichRecoQa::Init", ": No StsTrackMatch array!");
114 }
115
116 fRichProjections = (TClonesArray*) ioman->GetObject("RichProjection");
117 if (nullptr == fRichProjections) {
118 Fatal("CbmRichUrqmdTest::Init", "No fRichProjections array!");
119 }
120
122
123 // CbmLitGlobalElectronId::GetInstance();
124
125 return kSUCCESS;
126}
127
129{
130 fHM = new CbmHistManager();
131
132 // 2D histogramm XY
133 double xMin = -120.;
134 double xMax = 120.;
135 int nBinsX = 30;
136 double yMin = -208;
137 double yMax = 208.;
138 int nBinsY = 52;
139
140 // 1D histogram X or Y
141 int nBinsX1 = 60;
142 int xMin1 = -120;
143 int xMax1 = 120;
144 int nBinsY1 = 25;
145 int yMin1 = 100;
146 int yMax1 = 200;
147
148 for (Int_t i = 0; i < 4; i++) {
149 string s;
150 if (i == 0) s = "Primel";
151 if (i == 1) s = "Pi";
152 if (i == 2) s = "PrimelPlus";
153 if (i == 3) s = "PrimelMinus";
154
155 // Ring-Track VS momentum: (20, 0., 10., 100, 0., 5.)
156 fHM->Create2<TH2D>("fhRingTrackDistVsMomTruematch" + s,
157 "fhRingTrackDistVsMomTruematch" + s + ";P [GeV/c];Ring-track distance [cm];Yield (a.u.)", 40, 0.,
158 10., 120, 0., 3.);
159 fHM->Create2<TH2D>("fhRingTrackDistVsMomWrongmatch" + s,
160 "fhRingTrackDistVsMomWrongmatch" + s + ";P [GeV/c];Ring-track distance [cm];Yield (a.u.)", 20,
161 0., 10., 100, 0., 5.);
162
163 // Ring-Track VS nb hits found in ring: (40, -.5, 39.5, 100, 0., 5.)
164 fHM->Create2<TH2D>("fhRingTrackDistVsNofHitsTruematch" + s,
165 "fhRingTrackDistVsNofHitsTruematch" + s
166 + ";Nof hits in found ring;Ring-track distance [cm];Yield (a.u.)",
167 41, -.5, 40.5, 100, 0., 5.);
168 // Ring-Track 3D: (nBinsX, xMin, xMax, nBinsY, yMin, yMax, 100, 0., 5.)
169 fHM->Create3<TH3D>("fhRingTrackDistVsXYTruematch" + s,
170 "fhRingTrackDistVsXYTruematch" + s + ";X [cm];Y [cm];Ring-track distance [cm]", 240, xMin, xMax,
171 416, -200., 200., 400, 0., 5.);
172 fHM->Create2<TH2D>("fhRingTrackDistVsXTruematch" + s,
173 "fhRingTrackDistVsXTruematch" + s + ";X [cm];Ring-track distance [cm]", nBinsX1, xMin1, xMax1,
174 100, 0., 5.);
175 // Ring-Track VS Absolute Y distance: (nBinsY1, yMin1, yMax1, 100, 0., 5.)
176 fHM->Create2<TH2D>("fhRingTrackDistVsYTruematch" + s,
177 "fhRingTrackDistVsYTruematch" + s + ";Abs(Y) [cm];Ring-track distance [cm]", 34, 110., yMax1,
178 100, 0., 5.);
179
180 Double_t range = 3., nbBinsX = 120., nbBinsY = 208;
181 fHM->Create3<TH3D>("fhRingTrackDistDiffXRingVsXYTruematchUp" + s,
182 "fhRingTrackDistDiffXRingVsXYTruematchUp" + s + ";X [cm];Y [cm];X Ring-track distance [cm]",
183 nbBinsX, xMin, xMax, nbBinsY, 110, 200, 200, -range, range);
184 fHM->Create3<TH3D>("fhRingTrackDistDiffYRingVsXYTruematchUp" + s,
185 "fhRingTrackDistDiffYRingVsXYTruematchUp" + s + ";X [cm];Y [cm];Y Ring-track distance [cm]",
186 nbBinsX, xMin, xMax, nbBinsY, 110, 200, 200, -range, range);
187 fHM->Create3<TH3D>("fhRingTrackDistDiffXTrackVsXYTruematchUp" + s,
188 "fhRingTrackDistDiffXTrackVsXYTruematchUp" + s + ";X [cm];Y [cm];X Track-ring distance [cm]",
189 nbBinsX, xMin, xMax, nbBinsY, 110, 200, 200, -range, range);
190 fHM->Create3<TH3D>("fhRingTrackDistDiffYTrackVsXYTruematchUp" + s,
191 "fhRingTrackDistDiffYTrackVsXYTruematchUp" + s + ";X [cm];Y [cm];Y Track-ring distance [cm]",
192 nbBinsX, xMin, xMax, nbBinsY, 110, 200, 200, -range, range);
193
194 fHM->Create3<TH3D>("fhRingTrackDistDiffXRingVsXYTruematchDown" + s,
195 "fhRingTrackDistDiffXRingVsXYTruematchDown" + s + ";X [cm];Y [cm];X Ring-track distance [cm]",
196 nbBinsX, xMin, xMax, nbBinsY, -200, -110, 200, -range, range);
197 fHM->Create3<TH3D>("fhRingTrackDistDiffYRingVsXYTruematchDown" + s,
198 "fhRingTrackDistDiffYRingVsXYTruematchDown" + s + ";X [cm];Y [cm];Y Ring-track distance [cm]",
199 nbBinsX, xMin, xMax, nbBinsY, -200, -110, 200, -range, range);
200 fHM->Create3<TH3D>("fhRingTrackDistDiffXTrackVsXYTruematchDown" + s,
201 "fhRingTrackDistDiffXTrackVsXYTruematchDown" + s + ";X [cm];Y [cm];X Track-ring distance [cm]",
202 nbBinsX, xMin, xMax, nbBinsY, -200, -110, 200, -range, range);
203 fHM->Create3<TH3D>("fhRingTrackDistDiffYTrackVsXYTruematchDown" + s,
204 "fhRingTrackDistDiffYTrackVsXYTruematchDown" + s + ";X [cm];Y [cm];Y Track-ring distance [cm]",
205 nbBinsX, xMin, xMax, nbBinsY, -200, -110, 200, -range, range);
206
207 fHM->Create3<TH3D>("fhRingTrackDistVsXYHalfUpTruematch" + s,
208 "fhRingTrackDistVsXYHalfUpTruematch" + s + ";X [cm];Y [cm];Ring-track distance [cm]", nbBinsX,
209 xMin, xMax, nbBinsY, 110., 200., 100, 0., range);
210 fHM->Create3<TH3D>("fhRingTrackDistVsXYHalfDownTruematch" + s,
211 "fhRingTrackDistVsXYHalfDownTruematch" + s + ";X [cm];Y [cm];Ring-track distance [cm]", nbBinsX,
212 xMin, xMax, nbBinsY, -200., -110., 100, 0., range);
213 }
214
215 // after electron identification
216 Double_t range_2 = 3.;
217 //fHM->Create2<TH2D>("fhRingTrackDistVsMomTruematchElId", "fhRingTrackDistVsMomTruematchElId;P [GeV/c];Ring-track distance [cm];Yield (a.u.)", 20, 0., 10., 100, 0., 5.);
218 fHM->Create2<TH2D>("fhRingTrackDistVsMomTruematchElId",
219 "fhRingTrackDistVsMomTruematchElId;P [GeV/c];Ring-track "
220 "distance [cm];Yield (a.u.)",
221 40, 0., 10., 120, 0., 3.);
222 fHM->Create3<TH3D>("fhRingTrackDistDiffXAfterEl",
223 "fhRingTrackDistDiffXAfterEl;X [cm];Y [cm];X Ring-track distance [cm]", 60, xMin, xMax, 104, 110,
224 200, 200, -range_2, range_2);
225 fHM->Create3<TH3D>("fhRingTrackDistDiffYAfterEl",
226 "fhRingTrackDistDiffYAfterEl;X [cm];Y [cm];Y Ring-track distance [cm]", 60, xMin, xMax, 104, 110,
227 200, 200, -range_2, range_2);
228
229 fHM->Create1<TH1D>("fhMismatchSource", "fhMismatchSource;Global track category;% from MC", 13, -0.5, 12.5);
230
231 fHM->Create1<TH1D>("fhMismatchSourceMomMc", "fhMismatchSourceMomMc;Momentum [GeV/c];Yield", 40, 0., 10.);
232 fHM->Create1<TH1D>("fhMismatchSourceMomSts", "fhMismatchSourceMomSts;Momentum [GeV/c];Yield", 40, 0., 10.);
233 fHM->Create1<TH1D>("fhMismatchSourceMomStsAccRich", "fhMismatchSourceMomStsAccRich;Momentum [GeV/c];Yield", 40, 0.,
234 10.);
235 fHM->Create1<TH1D>("fhMismatchSourceMomStsRich", "fhMismatchSourceMomStsRich;Momentum [GeV/c];Yield", 40, 0., 10.);
236 fHM->Create1<TH1D>("fhMismatchSourceMomStsRichTrue", "fhMismatchSourceMomStsRichTrue;Momentum [GeV/c];Yield", 40, 0.,
237 10.);
238 fHM->Create1<TH1D>("fhMismatchSourceMomStsNoRich", "fhMismatchSourceMomStsNoRich;Momentum [GeV/c];Yield", 40, 0.,
239 10.);
240 fHM->Create1<TH1D>("fhMismatchSourceMomStsNoRichRF", "fhMismatchSourceMomStsNoRichRF;Momentum [GeV/c];Yield", 40, 0.,
241 10.);
242 fHM->Create1<TH1D>("fhMismatchSourceMomStsNoRichRM", "fhMismatchSourceMomStsNoRichRM;Momentum [GeV/c];Yield", 40, 0.,
243 10.);
244 fHM->Create1<TH1D>("fhMismatchSourceMomStsNoRichNoRF", "fhMismatchSourceMomStsNoRichNoRF;Momentum [GeV/c];Yield", 40,
245 0., 10.);
246 fHM->Create1<TH1D>("fhMismatchSourceMomStsNoRichNoProj", "fhMismatchSourceMomStsNoRichNoProj;Momentum [GeV/c];Yield",
247 40, 0., 10.);
248 fHM->Create1<TH1D>("fhMismatchSourceMomStsRichWrong", "fhMismatchSourceMomStsRichWrong;Momentum [GeV/c];Yield", 40,
249 0., 10.);
250 fHM->Create1<TH1D>("fhMismatchSourceMomStsRichWrongRF", "fhMismatchSourceMomStsRichWrongRF;Momentum [GeV/c];Yield",
251 40, 0., 10.);
252 fHM->Create1<TH1D>("fhMismatchSourceMomStsRichWrongRM", "fhMismatchSourceMomStsRichWrongRM;Momentum [GeV/c];Yield",
253 40, 0., 10.);
254}
255
256void CbmRichRecoQa::Exec(Option_t* option)
257{
258 fEventNum++;
259 cout << "CbmRichRecoQa, event No. " << fEventNum << endl;
260
264}
265
267{
268 fNofHitsInRingMap.clear();
269 Int_t nofRichHits = fRichHits->GetEntriesFast();
270 for (Int_t iHit = 0; iHit < nofRichHits; iHit++) {
271 CbmRichHit* hit = static_cast<CbmRichHit*>(fRichHits->At(iHit));
272 if (nullptr == hit) continue;
273
275 for (UInt_t i = 0; i < motherIds.size(); i++) {
276 fNofHitsInRingMap[motherIds[i]]++;
277 }
278 }
279}
280
282{
283 Int_t nofMcTracks = fMCTracks->GetEntriesFast();
284 for (Int_t iTrack = 0; iTrack < nofMcTracks; iTrack++) {
285 const CbmMCTrack* mcTrack = static_cast<const CbmMCTrack*>(fMCTracks->At(iTrack));
286 if (mcTrack == nullptr) continue;
287 bool isEl = IsMcPrimaryElectron(mcTrack);
288 if (isEl) {
289 //MC
290 fHM->H1("fhMismatchSource")->Fill(0);
291 fHM->H1("fhMismatchSourceMomMc")->Fill(mcTrack->GetP());
292 }
293 }
294
295
296 Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
297 for (Int_t iTrack = 0; iTrack < nofGlobalTracks; iTrack++) {
298 const CbmGlobalTrack* globalTrack = static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iTrack));
299
300 Int_t stsId = globalTrack->GetStsTrackIndex();
301 if (stsId < 0) continue;
302 const CbmTrackMatchNew* stsTrackMatch = static_cast<const CbmTrackMatchNew*>(fStsTrackMatches->At(stsId));
303 if (stsTrackMatch == nullptr) continue;
304 int stsMcTrackId = stsTrackMatch->GetMatchedLink().GetIndex();
305
306 CbmMCTrack* mctrack = static_cast<CbmMCTrack*>(fMCTracks->At(stsMcTrackId));
307 if (mctrack == nullptr) continue;
308 Double_t mom = mctrack->GetP();
309
310 bool isEl = IsMcPrimaryElectron(mctrack);
311 if (!isEl) continue;
312
313 //STS
314 fHM->H1("fhMismatchSource")->Fill(1);
315 fHM->H1("fhMismatchSourceMomSts")->Fill(mom);
316
317 if (fNofHitsInRingMap[stsMcTrackId] >= 7) {
318 //Sts-AccRich
319 fHM->H1("fhMismatchSource")->Fill(2);
320 fHM->H1("fhMismatchSourceMomStsAccRich")->Fill(mctrack->GetP());
321 }
322
323 Int_t richId = globalTrack->GetRichRingIndex();
324
325 // No RICH segment
326 if (richId < 0) {
327 //STS-noRICH
328 fHM->H1("fhMismatchSource")->Fill(5);
329 fHM->H1("fhMismatchSourceMomStsNoRich")->Fill(mom);
330 bool ringFound = WasRingFound(stsMcTrackId);
331 bool ringMatched = WasRingMatched(stsMcTrackId);
332 bool hasProj = HasRichProjection(stsId);
333 if (ringFound) {
334 //STS-NoRich RF
335 fHM->H1("fhMismatchSource")->Fill(6);
336 fHM->H1("fhMismatchSourceMomStsNoRichRF")->Fill(mom);
337 }
338 else {
339 //STS-NoRich NoRF
340 fHM->H1("fhMismatchSource")->Fill(8);
341 fHM->H1("fhMismatchSourceMomStsNoRichNoRF")->Fill(mom);
342 }
343
344 if (ringMatched) {
345 //STS-NoRich RM
346 fHM->H1("fhMismatchSource")->Fill(7);
347 fHM->H1("fhMismatchSourceMomStsNoRichRM")->Fill(mom);
348 }
349
350 if (!hasProj) {
351 //STS-NoRich NoProj
352 fHM->H1("fhMismatchSource")->Fill(9);
353 fHM->H1("fhMismatchSourceMomStsNoRichNoProj")->Fill(mom);
354 }
355
356 continue;
357 }
358
359 //STS-RICH
360 fHM->H1("fhMismatchSource")->Fill(3);
361 fHM->H1("fhMismatchSourceMomStsRich")->Fill(mom);
362
363 const CbmTrackMatchNew* richRingMatch = static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(richId));
364 if (richRingMatch == nullptr) continue;
365 int richMcTrackId = richRingMatch->GetMatchedLink().GetIndex();
366 const CbmRichRing* ring = static_cast<const CbmRichRing*>(fRichRings->At(richId));
367 if (nullptr == ring) continue;
368
369 if (stsMcTrackId == richMcTrackId) {
370 //STS-RICH true
371 fHM->H1("fhMismatchSource")->Fill(4);
372 fHM->H1("fhMismatchSourceMomStsRichTrue")->Fill(mom);
373 }
374 else {
375 //STS-RICH wrong
376 fHM->H1("fhMismatchSource")->Fill(10);
377 fHM->H1("fhMismatchSourceMomStsRichWrong")->Fill(mom);
378 if (WasRingFound(stsMcTrackId)) {
379 //STS-RICH wrong RF
380 fHM->H1("fhMismatchSource")->Fill(11);
381 fHM->H1("fhMismatchSourceMomStsRichWrongRF")->Fill(mom);
382 }
383
384 if (WasRingFound(stsMcTrackId)) {
385 //STS-RICH wrong RM
386 fHM->H1("fhMismatchSource")->Fill(12);
387 fHM->H1("fhMismatchSourceMomStsRichWrongRM")->Fill(mom);
388 }
389 }
390 }
391}
392
393bool CbmRichRecoQa::WasRingFound(Int_t mcTrackId)
394{
395 Int_t nofRings = fRichRings->GetEntriesFast();
396 for (Int_t iR = 0; iR < nofRings; iR++) {
397 const CbmRichRing* ring = static_cast<const CbmRichRing*>(fRichRings->At(iR));
398 if (ring == nullptr) continue;
399 const CbmTrackMatchNew* richRingMatch = static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(iR));
400 if (richRingMatch == nullptr) continue;
401 int richMcTrackId = richRingMatch->GetMatchedLink().GetIndex();
402 if (richMcTrackId == mcTrackId) return true;
403 }
404 return false;
405}
406
407bool CbmRichRecoQa::WasRingMatched(Int_t mcTrackId)
408{
409 Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
410 for (Int_t iTrack = 0; iTrack < nofGlobalTracks; iTrack++) {
411 const CbmGlobalTrack* globalTrack = static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iTrack));
412
413 Int_t richId = globalTrack->GetRichRingIndex();
414 if (richId < 0) continue;
415 const CbmTrackMatchNew* richRingMatch = static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(richId));
416 if (richRingMatch == nullptr) continue;
417 int richMcTrackId = richRingMatch->GetMatchedLink().GetIndex();
418 if (richMcTrackId == mcTrackId) {
419 return true;
420 }
421 }
422
423 return false;
424}
425
427{
428 if (stsTrackId < 0) {
429 return false;
430 }
431 FairTrackParam* pTrack = (FairTrackParam*) fRichProjections->At(stsTrackId);
432 if (pTrack == nullptr) {
433 return false;
434 }
435
436 if (pTrack->GetX() == 0. && pTrack->GetY() == 0.) {
437 return false;
438 }
439 else {
440 return true;
441 }
442}
443
445{
446 Int_t nofGlobalTracks = fGlobalTracks->GetEntriesFast();
447 for (Int_t iTrack = 0; iTrack < nofGlobalTracks; iTrack++) {
448 const CbmGlobalTrack* globalTrack = static_cast<const CbmGlobalTrack*>(fGlobalTracks->At(iTrack));
449
450 Int_t stsId = globalTrack->GetStsTrackIndex();
451 Int_t richId = globalTrack->GetRichRingIndex();
452 if (stsId < 0 || richId < 0) continue;
453
454 const CbmTrackMatchNew* stsTrackMatch = static_cast<const CbmTrackMatchNew*>(fStsTrackMatches->At(stsId));
455 if (stsTrackMatch == nullptr) continue;
456 int stsMcTrackId = stsTrackMatch->GetMatchedLink().GetIndex();
457
458 const CbmTrackMatchNew* richRingMatch = static_cast<const CbmTrackMatchNew*>(fRichRingMatches->At(richId));
459 if (richRingMatch == nullptr) continue;
460 int richMcTrackId = richRingMatch->GetMatchedLink().GetIndex();
461 const CbmRichRing* ring = static_cast<const CbmRichRing*>(fRichRings->At(richId));
462 if (nullptr == ring) continue;
463
464 double rtDistance = CbmRichUtil::GetRingTrackDistance(iTrack);
465 double rtDistanceX = CbmRichUtil::GetRingTrackDistanceX(iTrack);
466 double rtDistanceY = CbmRichUtil::GetRingTrackDistanceY(iTrack);
467 double xc = ring->GetCenterX();
468 double yc = ring->GetCenterY();
469 int nofHits = ring->GetNofHits();
470
471 CbmMCTrack* mctrack = static_cast<CbmMCTrack*>(fMCTracks->At(stsMcTrackId));
472 if (mctrack == nullptr) continue;
473 double mom = mctrack->GetP();
474 int charge = mctrack->GetCharge();
475
476 bool isEl = IsMcPrimaryElectron(mctrack);
477 bool isPi = IsMcPion(mctrack);
478
479 if (!isEl && !isPi) continue;
480
481 string s = "";
482
483 for (int i = 0; i < 2; i++) {
484 if (i == 0) {
485 if (isEl) {
486 s = "Primel";
487 }
488 else if (isPi) {
489 s = "Pi";
490 }
491 else {
492 continue;
493 }
494 }
495 else if (i == 1) {
496 if (isEl) {
497 if (charge > 0) {
498 s = "PrimelPlus";
499 }
500 else if (charge < 0) {
501 s = "PrimelMinus";
502 }
503 else {
504 continue;
505 }
506 }
507 else {
508 continue;
509 }
510 }
511
512 if (stsMcTrackId == richMcTrackId) {
513 fHM->H2("fhRingTrackDistVsMomTruematch" + s)->Fill(mom, rtDistance);
514 fHM->H3("fhRingTrackDistVsXYTruematch" + s)->Fill(xc, yc, rtDistance);
515 fHM->H2("fhRingTrackDistVsXTruematch" + s)->Fill(xc, rtDistance);
516 fHM->H2("fhRingTrackDistVsYTruematch" + s)->Fill(abs(yc), rtDistance);
517 fHM->H2("fhRingTrackDistVsNofHitsTruematch" + s)->Fill(nofHits, rtDistance);
518
519 Double_t rtX = -1 * rtDistanceX;
520 Double_t rtY = -1 * rtDistanceY;
521
522 if (yc > 0) {
523 fHM->H3("fhRingTrackDistDiffXRingVsXYTruematchUp" + s)->Fill(xc, yc, rtDistanceX);
524 fHM->H3("fhRingTrackDistDiffYRingVsXYTruematchUp" + s)->Fill(xc, yc, rtDistanceY);
525 fHM->H3("fhRingTrackDistDiffXTrackVsXYTruematchUp" + s)->Fill(xc, yc, rtX);
526 fHM->H3("fhRingTrackDistDiffYTrackVsXYTruematchUp" + s)->Fill(xc, yc, rtY);
527 fHM->H3("fhRingTrackDistVsXYHalfUpTruematch" + s)->Fill(xc, yc, rtDistance);
528 }
529
530 else if (yc < 0) {
531 fHM->H3("fhRingTrackDistDiffXRingVsXYTruematchDown" + s)->Fill(xc, yc, rtDistanceX);
532 fHM->H3("fhRingTrackDistDiffYRingVsXYTruematchDown" + s)->Fill(xc, yc, rtDistanceY);
533 fHM->H3("fhRingTrackDistDiffXTrackVsXYTruematchDown" + s)->Fill(xc, yc, rtX);
534 fHM->H3("fhRingTrackDistDiffYTrackVsXYTruematchDown" + s)->Fill(xc, yc, rtY);
535 fHM->H3("fhRingTrackDistVsXYHalfDownTruematch" + s)->Fill(xc, yc, rtDistance);
536 }
537
538 //std::cout << "CbmRichRecoQa::FillRingTrackDistance:" << std::endl << "rtDistanceX & rtDistanceY = " << rtDistanceX << ", " << rtDistanceY << std::endl;
539
540 if (i == 0 && isEl) {
541 //if (CbmLitGlobalElectronId::GetInstance().IsRichElectron(iTrack, mom)){
542 fHM->H2("fhRingTrackDistVsMomTruematchElId")->Fill(mom, rtDistance);
543 fHM->H3("fhRingTrackDistDiffXAfterEl")->Fill(xc, yc, rtDistanceX);
544 fHM->H3("fhRingTrackDistDiffYAfterEl")->Fill(xc, yc, rtDistanceY);
545 //}
546 }
547 }
548 else {
549 fHM->H2("fhRingTrackDistVsMomWrongmatch" + s)->Fill(mom, rtDistance);
550 }
551 }
552 }
553}
554
556{
557 cout.precision(4);
558
559
561 //fHM->ScaleByPattern("fh_.*", 1./fEventNum);
562
563 {
564 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_truematch_comparison_primel",
565 "fh_ring_track_distance_truematch_comparison_primel", 800, 800);
566 TH1D* py_minus = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchPrimelMinus")
567 ->ProjectionY("fhRingTrackDistVsMomTruematchPrimelMinus_py")
568 ->Clone());
569 py_minus->Scale(1. / py_minus->Integral());
570 TH1D* py_plus = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchPrimelPlus")
571 ->ProjectionY("fhRingTrackDistVsMomTruematchPrimelPlus_py")
572 ->Clone());
573 py_plus->Scale(1. / py_plus->Integral());
574 DrawH1({py_minus, py_plus},
575 {"e_{prim}^{-} (" + this->GetMeanRmsOverflowString(py_minus, false) + ")",
576 "e_{prim}^{+} (" + this->GetMeanRmsOverflowString(py_plus, false) + ")"},
577 kLinear, kLog, true, 0.5, 0.85, 0.99, 0.99);
578 }
579
580 {
581 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_truematch_comparison_elpi",
582 "fh_ring_track_distance_truematch_comparison_elpi", 800, 800);
583 TH1D* py_el = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchPrimel")
584 ->ProjectionY("fhRingTrackDistVsMomTruematchPrimel_py")
585 ->Clone());
586 py_el->Scale(1. / py_el->Integral());
587 TH1D* py_pi =
588 (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchPi")->ProjectionY("fhRingTrackDistVsMomTruematchPi_py")->Clone());
589 py_pi->Scale(1. / py_pi->Integral());
590 DrawH1({py_el, py_pi},
591 {"e_{prim}^{#pm} (" + this->GetMeanRmsOverflowString(py_el, false) + ")",
592 "#pi^{#pm} (" + this->GetMeanRmsOverflowString(py_pi, false) + ")"},
593 kLinear, kLog, true, 0.5, 0.85, 0.99, 0.99);
594 }
595
596 {
597 gStyle->SetPaintTextFormat("4.1f");
598 TCanvas* c = fHM->CreateCanvas("fh_mismatch_source", "fh_mismatch_source", 1000, 800);
599 Double_t nofMcEl = fHM->H1("fhMismatchSource")->GetBinContent(1);
600 cout << "nofMcEl = " << nofMcEl << endl;
601 fHM->H1("fhMismatchSource")->Scale(100. / nofMcEl);
602 DrawH1(fHM->H1("fhMismatchSource"), kLinear, kLog, "hist text");
603 fHM->H1("fhMismatchSource")->SetMarkerSize(1.9);
604
605 vector<string> labels = {"MC",
606 "STS",
607 "STS-Acc RICH",
608 "STS-RICH",
609 "STS-RICH true",
610 "STS-NoRICH",
611 "STS-NoRICH RF",
612 "STS-NoRICH RM",
613 "STS-NoRICH NoRF",
614 "STS-NoRICH NoPrj",
615 "STS-RICH wrong",
616 "STS-RICH wrong RF",
617 "STS-RICH wrong RM"};
618 for (int i = 0; i < labels.size(); i++) {
619 fHM->H1("fhMismatchSource")->GetXaxis()->SetBinLabel(i + 1, labels[i].c_str());
620 }
621 fHM->H1("fhMismatchSource")->GetXaxis()->SetLabelSize(0.03);
622 }
623
624 {
625 TCanvas* c = fHM->CreateCanvas("fh_mismatch_source_mom", "fh_mismatch_source_mom", 1000, 800);
626 vector<string> labels = {"MC",
627 "STS",
628 "STS-Acc RICH",
629 "STS-RICH",
630 "STS-RICH true",
631 "STS-NoRICH",
632 "STS-NoRICH RF",
633 "STS-NoRICH RM",
634 "STS-NoRICH NoRF",
635 "STS-NoRICH NoPrj",
636 "STS-RICH wrong",
637 "STS-RICH wrong RF",
638 "STS-RICH wrong RM"};
639 vector<TH1*> hists = {fHM->H1("fhMismatchSourceMomMc"),
640 fHM->H1("fhMismatchSourceMomSts"),
641 fHM->H1("fhMismatchSourceMomStsAccRich"),
642 fHM->H1("fhMismatchSourceMomStsRich"),
643 fHM->H1("fhMismatchSourceMomStsRichTrue"),
644 fHM->H1("fhMismatchSourceMomStsNoRich"),
645 fHM->H1("fhMismatchSourceMomStsNoRichRF"),
646 fHM->H1("fhMismatchSourceMomStsNoRichRM"),
647 fHM->H1("fhMismatchSourceMomStsNoRichNoRF"),
648 fHM->H1("fhMismatchSourceMomStsNoRichNoProj"),
649 fHM->H1("fhMismatchSourceMomStsRichWrong"),
650 fHM->H1("fhMismatchSourceMomStsRichWrongRF"),
651 fHM->H1("fhMismatchSourceMomStsRichWrongRM")};
652
653 DrawH1(hists, labels, kLinear, kLog, true, 0.8, 0.35, 0.99, 0.99);
654 fHM->H1("fhMismatchSourceMomMc")->SetMinimum(0.9);
655 }
656
659 DrawRingTrackDistHistWithSuffix("PrimelMinus");
660 //DrawRingTrackDistHistWithSuffix("Pi");
661
663 //DrawRingTrackDistHistWithSuffixPmtHalf("PrimelPlus");
664 //DrawRingTrackDistHistWithSuffixPmtHalf("PrimelMinus");
665 //DrawRingTrackDistHistWithSuffixPmtHalf("Pi");
666
667 // before and after electron identification
668 {
669 TCanvas* c =
670 fHM->CreateCanvas("fh_ring_track_distance_truematch_elid", "fh_ring_track_distance_truematch_elid", 1400, 1400);
671 c->Divide(2, 2);
672 c->cd(1);
673 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsMomTruematchPrimel"), false, true);
674 fHM->H2("fhRingTrackDistVsMomTruematchPrimel")->GetYaxis()->SetRangeUser(0., 2.);
675 c->cd(2);
676 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsMomTruematchElId"), false, true);
677 fHM->H2("fhRingTrackDistVsMomTruematchElId")->GetYaxis()->SetRangeUser(0., 2.);
678 c->cd(3);
679 TH1D* py = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchPrimel")
680 ->ProjectionY(string("fhRingTrackDistVsMomTruematchPrimel_py2").c_str())
681 ->Clone());
682 TH1D* pyElId = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchElId")
683 ->ProjectionY(string("fhRingTrackDistVsMomTruematchElId_py").c_str())
684 ->Clone());
685 TH1D* pyElId2 = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematchElId")->ProjectionY("test_py", 0, 40));
686 // DrawH1({py, pyElId}, {string("before ElId (" + this->GetMeanRmsOverflowString(py) + ")"), string("after ElId (" + this->GetMeanRmsOverflowString(pyElId) + ")")},
687 // kLinear, kLog, true, 0.45, 0.2, 0.9, 0.35);
688 DrawH1({py}, {string("before ElId (" + this->GetMeanRmsOverflowString(py) + ")")}, kLinear, kLog, false, 0.45, 0.2,
689 0.9, 0.35);
690 c->cd(4);
691 DrawH1({pyElId}, {string("after ElId (" + this->GetMeanRmsOverflowString(pyElId) + ")")}, kLinear, kLog, false,
692 0.45, 0.2, 0.9, 0.35);
693 }
694
695 Double_t range = 2.5;
696 {
697 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_after_el",
698 "fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_after_el", 1800, 600);
699 c->Divide(2, 1);
700 c->cd(1);
701 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXAfterEl"), true, false, -range, range);
702 c->cd(2);
703 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYAfterEl"), true, false, -range, range);
704 }
705}
706
707string CbmRichRecoQa::GetMeanRmsOverflowString(TH1* h, Bool_t withOverflow)
708{
709 if (withOverflow) {
710 double overflow = h->GetBinContent(h->GetNbinsX() + 1);
711 return Cbm::NumberToString<Double_t>(h->GetMean(), 2) + " / " + Cbm::NumberToString<Double_t>(h->GetRMS(), 2)
712 + " / " + Cbm::NumberToString<Double_t>(100. * overflow / h->Integral(0, h->GetNbinsX() + 1), 2) + "%";
713 }
714 else {
715 return Cbm::NumberToString<Double_t>(h->GetMean(), 2) + " / " + Cbm::NumberToString<Double_t>(h->GetRMS(), 2);
716 }
717}
718
720{
721 {
722 TCanvas* c =
723 fHM->CreateCanvas("fh_ring_track_distance_truematch_" + s, "fh_ring_track_distance_truematch_" + s, 1800, 600);
724 c->Divide(3, 1);
725 c->cd(1);
726 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsMomTruematch" + s), false, true);
727 c->cd(2);
728 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsNofHitsTruematch" + s), false, true);
729 c->cd(3);
730 TH1D* py = (TH1D*) (fHM->H2("fhRingTrackDistVsMomTruematch" + s)
731 ->ProjectionY(("fhRingTrackDistVsMomTruematch_py" + s).c_str())
732 ->Clone());
733 DrawH1(py);
734 DrawTextOnPad(this->GetMeanRmsOverflowString(py), 0.2, 0.9, 0.8, 0.99);
735 gPad->SetLogy(true);
736
737 fHM->H2("fhRingTrackDistVsMomTruematch" + s)->GetYaxis()->SetRangeUser(0., 2.);
738 fHM->H2("fhRingTrackDistVsNofHitsTruematch" + s)->GetYaxis()->SetRangeUser(0., 2.);
739 }
740
741 {
742 TCanvas* c =
743 fHM->CreateCanvas("fh_ring_track_distance_wrongmatch" + s, "fh_ring_track_distance_wrongmatch" + s, 600, 600);
744 TH1D* py = (TH1D*) (fHM->H2("fhRingTrackDistVsMomWrongmatch" + s)
745 ->ProjectionY(("fhRingTrackDistVsMomWrongmatch_py" + s).c_str())
746 ->Clone());
747 DrawH1(py);
748 DrawTextOnPad(this->GetMeanRmsOverflowString(py), 0.2, 0.9, 0.8, 0.99);
749 gPad->SetLogy(true);
750 }
751
752 {
753 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_vs_xy_truematch" + s,
754 "fh_ring_track_distance_vs_xy_truematch" + s, 1800, 600);
755 c->Divide(3, 1);
756 c->cd(1);
757 DrawH3Profile(fHM->H3("fhRingTrackDistVsXYTruematch" + s), true, false, 0., 2.);
758 c->cd(2);
759 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsXTruematch" + s), false, true);
760 fHM->H2("fhRingTrackDistVsXTruematch" + s)->GetYaxis()->SetRangeUser(0., 1.5);
761 c->cd(3);
762 DrawH2WithProfile(fHM->H2("fhRingTrackDistVsYTruematch" + s), false, true);
763 fHM->H2("fhRingTrackDistVsYTruematch" + s)->GetYaxis()->SetRangeUser(0., 1.5);
764 }
765}
766
768{
769 {
770 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_vs_xy_truematch_half_" + s,
771 "fh_ring_track_distance_vs_xy_truematch_half_" + s, 1800, 600);
772 c->Divide(2, 1);
773 TH3D* h1 = (TH3D*) fHM->H3("fhRingTrackDistVsXYTruematch" + s)->Clone();
774 TH3D* h2 = (TH3D*) fHM->H3("fhRingTrackDistVsXYTruematch" + s)->Clone();
775 c->cd(1);
776 h1->GetYaxis()->SetRangeUser(110., 200.);
777 DrawH3Profile(h1, true, false, 0., 2.);
778 c->cd(2);
779 h2->GetYaxis()->SetRangeUser(-200., -110.);
780 DrawH3Profile(h2, true, false, 0., 2.);
781 }
782
783 {
784 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_projection_" + s,
785 "fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_projection_" + s, 1800, 600);
786 c->Divide(2, 1);
787 TH3D* h1 = (TH3D*) fHM->H3("fhRingTrackDistVsXYTruematch" + s)->Clone();
788 c->cd(1);
789 TH2D* h2 = (TH2D*) h1->Project3D("yx")->Clone();
790 h2->GetYaxis()->SetRangeUser(110., 200.);
791 h2->Scale(1. / .15);
792 h2->Draw("colz");
793 c->cd(2);
794 TH2D* h3 = (TH2D*) h1->Project3D("yx")->Clone();
795 h3->GetYaxis()->SetRangeUser(-200., -110.);
796 h3->Scale(1. / .15);
797 h3->Draw("colz");
798 }
799
800 Double_t range = 1.;
801 {
802 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_diff_x_y_ring_vs_xy_truematch_up_" + s,
803 "fh_ring_track_distance_diff_x_y_ring_vs_xy_truematch_up_" + s, 1800, 600);
804 c->Divide(2, 1);
805 c->cd(1);
806 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXRingVsXYTruematchUp" + s), true, false, -range, range);
807 c->cd(2);
808 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYRingVsXYTruematchUp" + s), true, false, -range, range);
809 }
810
811 {
812 TCanvas* c = fHM->CreateCanvas("fh_ring_track_distance_diff_x_y_ring_vs_xy_truematch_down_" + s,
813 "fh_ring_track_distance_diff_x_y_ring_vs_xy_truematch_down_" + s, 1800, 600);
814 c->Divide(2, 1);
815 c->cd(1);
816 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXRingVsXYTruematchDown" + s), true, false, -range, range);
817 c->cd(2);
818 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYRingVsXYTruematchDown" + s), true, false, -range, range);
819 }
820
821 /* {
822 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_diff_x_y_ring_single_vs_xy_truematch"+s, "fh_track_ring_distance_diff_x_y_ring_single_vs_xy_truematch"+s, 1800, 600);
823 c->Divide(2, 2);
824 c->cd(1);
825 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXRingVsXYTruematch"+s), true, false, 0, 2*range);
826 c->cd(2);
827 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXRingVsXYTruematch"+s), true, false, -2*range, 0);
828 c->cd(3);
829 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYRingVsXYTruematch"+s), true, false, 0, 2*range);
830 c->cd(4);
831 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYRingVsXYTruematch"+s), true, false, -2*range, 0);
832 }
833*/
834 {
835 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_up_" + s,
836 "fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_up_" + s, 1800, 600);
837 c->Divide(2, 1);
838 c->cd(1);
839 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXTrackVsXYTruematchUp" + s), true, false, -range, range);
840 c->cd(2);
841 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYTrackVsXYTruematchUp" + s), true, false, -range, range);
842 }
843
844 {
845 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_down_" + s,
846 "fh_track_ring_distance_diff_x_y_track_vs_xy_truematch_down_" + s, 1800, 600);
847 c->Divide(2, 1);
848 c->cd(1);
849 DrawH3Profile(fHM->H3("fhRingTrackDistDiffXTrackVsXYTruematchDown" + s), true, false, -range, range);
850 c->cd(2);
851 DrawH3Profile(fHM->H3("fhRingTrackDistDiffYTrackVsXYTruematchDown" + s), true, false, -range, range);
852 }
853
854 {
855 TCanvas* c = fHM->CreateCanvas("fh_track_ring_distance_vs_xy_truematch_halves_" + s,
856 "fh_track_ring_distance_vs_xy_truematch_halves_" + s, 1800, 600);
857 c->Divide(2, 1);
858 c->cd(1);
859 DrawH3Profile(fHM->H3("fhRingTrackDistVsXYHalfUpTruematch" + s), true, false, 0., range);
860 c->cd(2);
861 DrawH3Profile(fHM->H3("fhRingTrackDistVsXYHalfDownTruematch" + s), true, false, 0., range);
862 }
863}
864
866{
867 if (mctrack == nullptr) return false;
868 int pdg = TMath::Abs(mctrack->GetPdgCode());
869 if (mctrack->GetGeantProcessId() == kPPrimary && pdg == 11) return true;
870 return false;
871}
872
874{
875 if (mctrack == nullptr) return false;
876 int pdg = TMath::Abs(mctrack->GetPdgCode());
877 if (pdg == 211) return true;
878 return false;
879}
880
882{
883 DrawHist();
884
885 TDirectory* oldir = gDirectory;
886 TFile* outFile = FairRootManager::Instance()->GetOutFile();
887 if (outFile != NULL) {
888 fHM->WriteToFile();
889 // fHM->WriteToFileNew(fOutputDir + "/histos.root");
890 }
891 gDirectory->cd(oldir->GetPath());
892
894 //fHM->H3("fhRingTrackDistVsXYTruematchPrimel")->Write();
895}
896
897void CbmRichRecoQa::DrawFromFile(const string& fileName, const string& outputDir)
898{
899 fOutputDir = outputDir;
900
902 TFile* oldFile = gFile;
903 TDirectory* oldDir = gDirectory;
904
905 if (fHM != nullptr) delete fHM;
906
907 fHM = new CbmHistManager();
908 TFile* file = new TFile(fileName.c_str());
909 fHM->ReadFromFile(file);
910
911 DrawHist();
912
914
916 gFile = oldFile;
917 gDirectory = oldDir;
918}
919
ClassImp(CbmConverterManager)
void DrawH2WithProfile(TH2 *hist, Bool_t doGaussFit, Bool_t drawOnlyMean, const string &drawOpt2D, Int_t profileColor, Int_t profileLineWidth)
void DrawTextOnPad(const string &text, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
void SetDefaultDrawStyle()
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)
TH2D * DrawH3Profile(TH3 *h, Bool_t drawMean, Bool_t doGaussFit, Double_t zMin, Double_t zMax)
Helper functions for drawing 1D and 2D histograms and graphs.
@ kLinear
Definition CbmDrawHist.h:69
@ kLog
Definition CbmDrawHist.h:68
Histogram manager.
FairTask for matching RECO data to MC.
Generates beam ions for transport simulation.
int32_t GetStsTrackIndex() const
int32_t GetRichRingIndex() const
Histogram manager.
TCanvas * CreateCanvas(const std::string &name, const std::string &title, Int_t width, Int_t height)
Create and draw TCanvas and store pointer to it.
void SaveCanvasToImage(const std::string &outputDir, const std::string &options="png,eps")
Save all stored canvases to images.
TH2 * H2(const std::string &name) const
Return pointer to TH2 histogram.
void Create2(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY)
Helper function for creation of 2-dimensional histograms and profiles. Template argument is a real ob...
void ReadFromFile(TFile *file)
Read histograms from file.
void WriteToFile()
Write all objects to current opened file.
TH3 * H3(const std::string &name) const
Return pointer to TH3 histogram.
void Create1(const std::string &name, const std::string &title, Int_t nofBins, Double_t minBin, Double_t maxBin)
Helper function for creation of 1-dimensional histograms and profiles. Template argument is a real ob...
void Create3(const std::string &name, const std::string &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY, Int_t nofBinsZ, Double_t minBinZ, Double_t maxBinZ)
Helper function for creation of 3-dimensional histograms and profiles. Template argument is a real ob...
TH1 * H1(const std::string &name) const
Return pointer to TH1 histogram.
double GetCharge() const
Charge of the associated particle.
double GetP() const
Definition CbmMCTrack.h:98
uint32_t GetGeantProcessId() const
Definition CbmMCTrack.h:67
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
static std::vector< CbmLink > GetMcTrackMotherIdsForRichHit(CbmDigiManager *digiMan, const CbmRichHit *hit, CbmMCDataArray *richPoints, CbmMCDataArray *mcTracks)
Get CbmLinks of Mother MC Tracks for RICH hit.
const CbmLink & GetMatchedLink() const
Definition CbmMatch.h:41
TClonesArray * fRichProjections
void RingTrackMismatchSource()
Fill histograms related to study of the source of ring-track mismatch.
void DrawRingTrackDistHistWithSuffix(const string &suffix)
Draw histograms related to ring-track distance for pions or electrons (+/-).
TClonesArray * fGlobalTracks
std::map< Int_t, Int_t > fNofHitsInRingMap
TClonesArray * fRichDigis
void FillRingTrackDistance()
Fill histogramms related to ring track distance.
void InitHistograms()
Initialize histograms.
string GetMeanRmsOverflowString(TH1 *h, Bool_t withOverflow=true)
Return string with mean, RMS and overflow percent for input TH1.
static Bool_t IsMcPrimaryElectron(const CbmMCTrack *mctrack)
TClonesArray * fRichRings
virtual InitStatus Init()
Inherited from FairTask.
bool HasRichProjection(Int_t stsTrackId)
void DrawRingTrackDistHistWithSuffixPmtHalf(const string &suffix)
bool WasRingMatched(Int_t mcTrackId)
TClonesArray * fRichRingMatches
void DrawFromFile(const string &fileName, const string &outputDir)
Draw histogram from file.
TClonesArray * fStsTracks
TClonesArray * fStsTrackMatches
bool WasRingFound(Int_t mcTrackId)
static Bool_t IsMcPion(const CbmMCTrack *mctrack)
TClonesArray * fRichPoints
void DrawHist()
Draw histograms.
virtual void Exec(Option_t *option)
Inherited from FairTask.
CbmRichRecoQa()
Standard constructor.
virtual void Finish()
Inherited from FairTask.
void FillRichRingNofHits()
Fill map mcTrackId -> nof RICH hits.
int32_t GetNofHits() const
Definition CbmRichRing.h:37
float GetCenterX() const
Definition CbmRichRing.h:77
float GetCenterY() const
Definition CbmRichRing.h:78
static double GetRingTrackDistanceY(int globalTrackId)
static double GetRingTrackDistance(int globalTrackId)
static double GetRingTrackDistanceX(int globalTrackId)
std::string NumberToString(const T &value, int precision=1)
Definition CbmUtils.h:34
Hash for CbmL1LinkKey.