CbmRoot
Loading...
Searching...
No Matches
CbmTofGeometryQa.cxx
Go to the documentation of this file.
1/* Copyright (C) 2015-2021 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Pierre-Alain Loizeau [committer] */
4
10#include "CbmTofGeometryQa.h"
11
12// TOF Classes and includes
13#include "CbmTofAddress.h" // in cbmdata/tof
14#include "CbmTofCell.h" // in tof/TofData
15#include "CbmTofDetectorId_v12b.h" // in cbmdata/tof
16#include "CbmTofDetectorId_v14a.h" // in cbmdata/tof
17#include "CbmTofGeoHandler.h" // in tof/TofTools
18#include "CbmTofPoint.h" // in cbmdata/tof
19
20// CBMroot classes and includes
21#include "CbmMCTrack.h"
22#include "CbmMatch.h"
23
24// FAIR classes and includes
25#include "FairMCEventHeader.h"
26#include "FairRootManager.h"
27#include "FairRunAna.h"
28#include "FairRuntimeDb.h"
29#include <Logger.h>
30
31// ROOT Classes and includes
32#include "TClonesArray.h"
33#include "TFile.h"
34#include "TH1.h"
35#include "TH2.h"
36#include "TH3.h"
37#include "TMath.h"
38#include "TProfile2D.h"
39#include "TROOT.h"
40#include "TRandom.h"
41#include "TString.h"
42
43#include "Riostream.h"
44
45using std::cout;
46using std::endl;
47
48//___________________________________________________________________
49// Constants definitions: Particles list
50const Int_t kiNbPart = 13;
51const TString ksPartTag[kiNbPart] = {"others", "ep", "em", "pip", "pim", "kp", "km", "p", "pbar", "d", "t", "he", "a"};
52const Int_t kiPartPdgCode[kiNbPart] = {0, 11, -11, 211, -211, 321, -321,
53 2212, -2212, 1000010020, 1000010030, 1000020030, 1000020040};
54const TString ksPartName[kiNbPart] = {"any other part.", "e+", "e-", "#pi+", "#pi-", "k+", "k-", "p",
55 "anti-p", "d", "t", "he", "#alpha"};
56const Int_t kiMinNbStsPntAcc = 3; // Number of STS Pnt for Trk to be reconstructable
57const Int_t kiMinNbMuchPntAcc = 10; // Number of MUCH Pnt for Trk to be reconstructable
58//___________________________________________________________________
59
60
61//___________________________________________________________________
62//
63// CbmTofGeometryQa
64//
65// Task for QA of TOF geometry
66//
67// ------------------------------------------------------------------
69 : FairTask("CbmTofGeometryQa")
70 , fEvents(0)
71 , fGeoHandler(new CbmTofGeoHandler())
72 , fTofId(NULL)
73 , fChannelInfo(NULL)
74 , iNbSmTot(0)
75 , fvTypeSmOffs()
76 , iNbRpcTot(0)
77 , fvSmRpcOffs()
78 , fiNbChTot(0)
79 , fvRpcChOffs()
80 , fMCEventHeader(NULL)
81 , fTofPointsColl(NULL)
82 , fMcTracksColl(NULL)
83 , fRealTofPointsColl(NULL)
84 , fRealTofMatchColl(NULL)
85 , fbRealPointAvail(kFALSE)
86 , fsHistoOutFilename("./tofQa.hst.root")
87 , fdWallPosZ(1000)
88 , fbCentDepOn(kFALSE)
89 , fvhTrackAllStartZCent()
90 , // Beam pipe check
91 fvhTrackSecStartZCent()
92 , // Beam pipe check
93 fvhTrackAllStartXZCent()
94 , // Beam pipe check
95 fvhTofPntAllAngCent()
96 , // Beam pipe check
97 fvhTrackAllStartXZ()
98 , // Beam pipe check
99 fvhTrackAllStartYZ()
100 , // Beam pipe check
101 fhTrackMapXY(NULL)
102 , // Only when creating normalization histos
103 fhTrackMapXZ(NULL)
104 , // Only when creating normalization histos
105 fhTrackMapYZ(NULL)
106 , // Only when creating normalization histos
107 fhTrackMapAng(NULL)
108 , // Only when creating normalization histos
109 fhTrackMapSph(NULL)
110 , // Only when creating normalization histos
111 fhTrackMapAngPrimAll(NULL)
112 , // For angular acceptance study
113 fhTrackMapAngPrimSts(NULL)
114 , // For angular acceptance study
115 fhTrackMapAngPrimRich(NULL)
116 , // For angular acceptance study
117 fhTrackMapAngPrimMuch(NULL)
118 , // For angular acceptance study
119 fhTrackMapAngPrimTrd(NULL)
120 , // For angular acceptance study
121 fhTrackMapAngPrimTof(NULL)
122 , // For angular acceptance study
123 fhPointMapXY(NULL)
124 , fhPointMapXZ(NULL)
125 , fhPointMapYZ(NULL)
126 , fhPointMapAng(NULL)
127 , fhPointMapSph(NULL)
128 , fhRealPointMapXY(NULL)
129 , fhRealPointMapXZ(NULL)
130 , fhRealPointMapYZ(NULL)
131 , fhRealPointMapAng(NULL)
132 , fhRealPointMapSph(NULL)
133 , fhPointMapAngWithSts(NULL)
134 , fhPointMapAngWithRich(NULL)
135 , fhPointMapAngWithMuch(NULL)
136 , fhPointMapAngWithTrd(NULL)
137 , fbSphAppOn(kFALSE)
138 , fhPointSphAprRadiusErrMapXY(NULL)
139 , fhPointSphAprRadiusErrMapXZ(NULL)
140 , fhPointSphAprRadiusErrMapYZ(NULL)
141 , fhPointSphAprRadiusErrMapAng(NULL)
142 , fhPointSphAprRadiusErrMapSph(NULL)
143 , fhPointSphAprZposErrMapXY(NULL)
144 , fhPointSphAprZposErrMapXZ(NULL)
145 , fhPointSphAprZposErrMapYZ(NULL)
146 , fhPointSphAprZposErrMapAng(NULL)
147 , fhPointSphAprZposErrMapSph(NULL)
148 , fvhPtmRapGenTrk()
149 , fvhPtmRapStsPnt()
150 , fvhPtmRapTofPnt()
151 , fvhPtmRapSecGenTrk()
152 , fvhPtmRapSecStsPnt()
153 , fvhPtmRapSecTofPnt()
154 , fvhPlabGenTrk()
155 , fvhPlabStsPnt()
156 , fvhPlabTofPnt()
157 , fvhPlabSecGenTrk()
158 , fvhPlabSecStsPnt()
159 , fvhPlabSecTofPnt()
160 , fvhPtmRapGenTrkTofPnt()
161 , fvhPlabGenTrkTofPnt()
162 , fvhPlabStsTrkTofPnt()
163 , fvhPtmRapSecGenTrkTofPnt()
164 , fvhPlabSecGenTrkTofPnt()
165 , fvhPlabSecStsTrkTofPnt()
166{
167 cout << "CbmTofGeometryQa: Task started " << endl;
168}
169// ------------------------------------------------------------------
170
171// ------------------------------------------------------------------
172CbmTofGeometryQa::CbmTofGeometryQa(const char* name, Int_t verbose)
173 : FairTask(name, verbose)
174 , fEvents(0)
175 , fGeoHandler(new CbmTofGeoHandler())
176 , fTofId(NULL)
177 , fChannelInfo(NULL)
178 , iNbSmTot(0)
179 , fvTypeSmOffs()
180 , iNbRpcTot(0)
181 , fvSmRpcOffs()
182 , fiNbChTot(0)
183 , fvRpcChOffs()
184 , fMCEventHeader(NULL)
185 , fTofPointsColl(NULL)
186 , fMcTracksColl(NULL)
187 , fRealTofPointsColl(NULL)
188 , fRealTofMatchColl(NULL)
189 , fbRealPointAvail(kFALSE)
190 , fsHistoOutFilename("./tofQa.hst.root")
191 , fdWallPosZ(1000)
192 , fbCentDepOn(kFALSE)
193 , fvhTrackAllStartZCent()
194 , // Beam pipe check
195 fvhTrackSecStartZCent()
196 , // Beam pipe check
197 fvhTrackAllStartXZCent()
198 , // Beam pipe check
199 fvhTofPntAllAngCent()
200 , // Beam pipe check
201 fvhTrackAllStartXZ()
202 , // Beam pipe check
203 fvhTrackAllStartYZ()
204 , // Beam pipe check
205 fhTrackMapXY(NULL)
206 , // Only when creating normalization histos
207 fhTrackMapXZ(NULL)
208 , // Only when creating normalization histos
209 fhTrackMapYZ(NULL)
210 , // Only when creating normalization histos
211 fhTrackMapAng(NULL)
212 , // Only when creating normalization histos
213 fhTrackMapSph(NULL)
214 , // Only when creating normalization histos
215 fhTrackMapAngPrimAll(NULL)
216 , // For angular acceptance study
217 fhTrackMapAngPrimSts(NULL)
218 , // For angular acceptance study
219 fhTrackMapAngPrimRich(NULL)
220 , // For angular acceptance study
221 fhTrackMapAngPrimMuch(NULL)
222 , // For angular acceptance study
223 fhTrackMapAngPrimTrd(NULL)
224 , // For angular acceptance study
225 fhTrackMapAngPrimTof(NULL)
226 , // For angular acceptance study
227 fhPointMapXY(NULL)
228 , fhPointMapXZ(NULL)
229 , fhPointMapYZ(NULL)
230 , fhPointMapAng(NULL)
231 , fhPointMapSph(NULL)
232 , fhRealPointMapXY(NULL)
233 , fhRealPointMapXZ(NULL)
234 , fhRealPointMapYZ(NULL)
235 , fhRealPointMapAng(NULL)
236 , fhRealPointMapSph(NULL)
237 , fhPointMapAngWithSts(NULL)
238 , fhPointMapAngWithRich(NULL)
239 , fhPointMapAngWithMuch(NULL)
240 , fhPointMapAngWithTrd(NULL)
241 , fbSphAppOn(kFALSE)
242 , fhPointSphAprRadiusErrMapXY(NULL)
243 , fhPointSphAprRadiusErrMapXZ(NULL)
244 , fhPointSphAprRadiusErrMapYZ(NULL)
245 , fhPointSphAprRadiusErrMapAng(NULL)
246 , fhPointSphAprRadiusErrMapSph(NULL)
247 , fhPointSphAprZposErrMapXY(NULL)
248 , fhPointSphAprZposErrMapXZ(NULL)
249 , fhPointSphAprZposErrMapYZ(NULL)
250 , fhPointSphAprZposErrMapAng(NULL)
251 , fhPointSphAprZposErrMapSph(NULL)
252 , fvhPtmRapGenTrk()
253 , fvhPtmRapStsPnt()
254 , fvhPtmRapTofPnt()
255 , fvhPtmRapSecGenTrk()
256 , fvhPtmRapSecStsPnt()
257 , fvhPtmRapSecTofPnt()
258 , fvhPlabGenTrk()
259 , fvhPlabStsPnt()
260 , fvhPlabTofPnt()
261 , fvhPlabSecGenTrk()
262 , fvhPlabSecStsPnt()
263 , fvhPlabSecTofPnt()
264 , fvhPtmRapGenTrkTofPnt()
265 , fvhPlabGenTrkTofPnt()
266 , fvhPlabStsTrkTofPnt()
267 , fvhPtmRapSecGenTrkTofPnt()
268 , fvhPlabSecGenTrkTofPnt()
269 , fvhPlabSecStsTrkTofPnt()
270{
271}
272// ------------------------------------------------------------------
273
274// ------------------------------------------------------------------
276{
277 // Destructor
278}
279// ------------------------------------------------------------------
280/************************************************************************************/
281// FairTasks inherited functions
283{
284 if (kFALSE == RegisterInputs()) return kFATAL;
285
286 // Initialize the TOF GeoHandler
287 Bool_t isSimulation = kFALSE;
288 Int_t iGeoVersion = fGeoHandler->Init(isSimulation);
289 LOG(info) << "CbmTofGeometryQa::Init with GeoVersion " << iGeoVersion;
290
291 if (k12b > iGeoVersion) {
292 LOG(error) << "CbmTofGeometryQa::Init => Only compatible with geometries "
293 "after v12b !!!";
294 return kFATAL;
295 } // if( k12b > iGeoVersion )
296
297 if (NULL != fTofId) LOG(info) << "CbmTofGeometryQa::Init with GeoVersion " << fGeoHandler->GetGeoVersion();
298 else {
299 switch (iGeoVersion) {
300 case k12b: fTofId = new CbmTofDetectorId_v12b(); break;
301 case k14a: fTofId = new CbmTofDetectorId_v14a(); break;
302 default: LOG(error) << "CbmTofGeometryQa::Init => Invalid geometry!!!" << iGeoVersion; return kFATAL;
303 } // switch(iGeoVersion)
304 } // else of if(NULL != fTofId)
305
306 if (kFALSE == LoadGeometry()) return kFATAL;
307
308 if (kFALSE == CreateHistos()) return kFATAL;
309
310 return kSUCCESS;
311}
312
314{
315 LOG(info) << " CbmTofGeometryQa => Get the digi parameters for tof";
316
317 // Get Base Container
318 /*
319 FairRunAna* ana = FairRunAna::Instance();
320 FairRuntimeDb* rtdb=ana->GetRuntimeDb();
321*/
322}
323
324void CbmTofGeometryQa::Exec(Option_t* /*option*/)
325{
326 // Task execution
327
328 LOG(debug) << " CbmTofGeometryQa => New event";
329
330 FillHistos();
331
332 if (0 == (fEvents % 1000) && 0 < fEvents) {
333 LOG(info) << "CbmTofGeometryQa::Exec : "
334 << "event " << fEvents << " processed." << endl;
335 }
336 fEvents += 1;
337}
338
340{
341 // Normalisations
342 cout << "CbmTofGeometryQa::Finish up with " << fEvents << " analyzed events " << endl;
343
344 WriteHistos();
345 // Prevent them from being sucked in by the CbmHadronAnalysis WriteHistograms method
346 DeleteHistos();
347}
348
349/************************************************************************************/
350// Functions common for all clusters approximations
352{
353 FairRootManager* fManager = FairRootManager::Instance();
354
355 fMCEventHeader = (FairMCEventHeader*) fManager->GetObject("MCEventHeader.");
356 if (NULL == fMCEventHeader) {
357 LOG(error) << "CbmTofGeometryQa::RegisterInputs => Could not get the "
358 "MCEventHeader object!!!";
359 return kFALSE;
360 }
361
362 fTofPointsColl = (TClonesArray*) fManager->GetObject("TofPoint");
363 if (NULL == fTofPointsColl) {
364 LOG(error) << "CbmTofGeometryQa::RegisterInputs => Could not get the "
365 "TofPoint TClonesArray!!!";
366 return kFALSE;
367 } // if( NULL == fTofPointsColl)
368
369 fMcTracksColl = (TClonesArray*) fManager->GetObject("MCTrack");
370 if (NULL == fMcTracksColl) {
371 LOG(error) << "CbmTofGeometryQa::RegisterInputs => Could not get the "
372 "MCTrack TClonesArray!!!";
373 return kFALSE;
374 } // if( NULL == fMcTracksColl)
375
376 fRealTofPointsColl = (TClonesArray*) fManager->GetObject("RealisticTofPoint");
377 fRealTofMatchColl = (TClonesArray*) fManager->GetObject("TofRealPntMatch");
378 if (NULL != fRealTofPointsColl && NULL != fRealTofMatchColl) {
379 fbRealPointAvail = kTRUE;
380 LOG(info) << "CbmTofGeometryQa::RegisterInputs => Both fRealTofPointsColl & "
381 "fRealTofMatchColl there, realistic mean TOF MC point used for QA";
382 } // if( NULL != fRealTofPointsColl && NULL != fRealTofMatchColl )
383
384 return kTRUE;
385}
386/************************************************************************************/
388{
389 /*
390 Type 0: 5 RPC/SM, 24 SM, 32 ch/RPC => 3840 ch , 120 RPC ,
391 Type 1: 5 RPC/SM, 142 SM, 32 ch/RPC => 22720 ch => 26560 , 710 RPC => 830 , => 166
392 Type 3: 3 RPC/SM, 50 SM, 56 ch/RPC => 8400 ch => 34960 , 150 RPC => 980 , => 216
393 Type 4: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 38800 , 40 RPC => 1020 , => 224
394 Type 5: 5 RPC/SM, 8 SM, 96 ch/RPC => 3840 ch => 42640 , 40 RPC => 1060 , => 232
395 Type 6: 2 RPC/SM, 10 SM, 96 ch/RPC => 1920 ch => 44560 , 20 RPC => 1080 , => 242
396 */
397 /*
398 // Count the total number of channels and
399 // generate an array with the global channel index of the first channe in each RPC
400 Int_t iNbSmTypes = fDigiBdfPar->GetNbSmTypes();
401 fvTypeSmOffs.resize( iNbSmTypes );
402 fvSmRpcOffs.resize( iNbSmTypes );
403 fvRpcChOffs.resize( iNbSmTypes );
404 iNbSmTot = 0;
405 iNbRpcTot = 0;
406 fiNbChTot = 0;
407 for( Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++ )
408 {
409 Int_t iNbSm = fDigiBdfPar->GetNbSm( iSmType);
410 Int_t iNbRpc = fDigiBdfPar->GetNbRpc( iSmType);
411
412 fvTypeSmOffs[iSmType] = iNbSmTot;
413 iNbSmTot += iNbSm;
414
415 fvSmRpcOffs[iSmType].resize( iNbSm );
416 fvRpcChOffs[iSmType].resize( iNbSm );
417
418 for( Int_t iSm = 0; iSm < iNbSm; iSm++ )
419 {
420 fvSmRpcOffs[iSmType][iSm] = iNbRpcTot;
421 iNbRpcTot += iNbRpc;
422
423 fvRpcChOffs[iSmType][iSm].resize( iNbRpc );
424 for( Int_t iRpc = 0; iRpc < iNbRpc; iRpc++ )
425 {
426 fvRpcChOffs[iSmType][iSm][iRpc] = fiNbChTot;
427 fiNbChTot += fDigiBdfPar->GetNbChan( iSmType, iRpc );
428 } // for( Int_t iRpc = 0; iRpc < iNbRpc; iRpc++ )
429 } // for( Int_t iSm = 0; iSm < iNbSm; iSm++ )
430 } // for( Int_t iSmType = 0; iSmType < iNbSmTypes; iSmType++ )
431*/
432 return kTRUE;
433}
434/************************************************************************************/
435// ------------------------------------------------------------------
436Bool_t CbmTofGeometryQa::SetWallPosZ(Double_t dWallPosCm)
437{
438 fdWallPosZ = dWallPosCm;
439 LOG(info) << "CbmTofGeometryQa::SetWallPosZ => Change histograms center on Z axis to " << dWallPosCm << " cm";
440 return kTRUE;
441}
443{
444 // Create histogramms
445
446 TDirectory* oldir = gDirectory; // <= To prevent histos from being sucked in by the param file of the TRootManager!
447 gROOT->cd(); // <= To prevent histos from being sucked in by the param file of the TRootManager !
448 /*
449 Double_t ymin=-1.;
450 Double_t ymax=4.;
451 Double_t ptmmax=2.5;
452 Int_t ptm_nbx=30;
453 Int_t ptm_nby=30;
454
455 Double_t v1_nbx=20.;
456 Double_t v1_nby=20.;
457 Double_t yvmax=1.3;
458*/
459 // xy - hit densities and rates
460 Int_t nbinx = 1500;
461 Int_t nbiny = 1000;
462 Int_t nbinz = 1500;
463 Double_t xrange = 750.;
464 Double_t yrange = 500.;
465 Double_t zmin = fdWallPosZ - 50.;
466 Double_t zmax = fdWallPosZ + 200.;
467
468 // angular densities for overlap check
469 Int_t iNbBinThetaX = 1200;
470 Double_t dThetaXMin = -60.0;
471 Double_t dThetaXMax = 60.0;
472 Int_t iNbBinThetaY = 900;
473 Double_t dThetaYMin = -45.0;
474 Double_t dThetaYMax = 45.0;
475
476 Int_t iNbBinTheta = 180;
477 Double_t dThetaMin = 0;
478 Double_t dThetaMax = TMath::Pi() * 90 / 180;
479 Int_t iNbBinPhi = 180;
480 Double_t dPhiMin = -TMath::Pi();
481 Double_t dPhiMax = TMath::Pi();
482
483 // Mapping
484 // Dependence of Track origin on centrality
485 Int_t iNbBinsStartZ = 1250;
486 Double_t dMinStartZ = -50.0;
487 Double_t dMaxStartZ = 1200.0;
488 Int_t iNbBinsStartXY = 1200;
489 Double_t dMinStartXY = -600.0;
490 Double_t dMaxStartXY = 600.0;
491 Int_t iNbBinsCentr = 16;
492 Double_t dNbMinCentr = 0.0;
493 Double_t dNbMaxCentr = 16.0;
494
495 if (kTRUE == fbCentDepOn) {
500 } // if( kTRUE == fbCentDepOn )
503 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
504 // Track origin for tracks reaching TOF
505 if (kTRUE == fbCentDepOn) {
506 fvhTrackAllStartZCent[iPartIdx] =
507 new TH2D(Form("TofTests_TrackAllStartZCent_%s", ksPartTag[iPartIdx].Data()),
508 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, %s, "
509 "all tracks; Start Z [cm]; B [fm]; # []",
510 ksPartName[iPartIdx].Data()),
511 iNbBinsStartZ, dMinStartZ, dMaxStartZ, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
512 fvhTrackSecStartZCent[iPartIdx] =
513 new TH2D(Form("TofTests_TrackSecStartZCent_%s", ksPartTag[iPartIdx].Data()),
514 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, %s, "
515 "secondary tracks; Start Z [cm]; B [fm]; # []",
516 ksPartName[iPartIdx].Data()),
517 iNbBinsStartZ, dMinStartZ, dMaxStartZ, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
518 if (2 == iPartIdx) // 3D plot only for e-
519 fvhTrackAllStartXZCent[iPartIdx] = new TH3D(Form("TofTests_TrackAllStartXZCent_%s", ksPartTag[iPartIdx].Data()),
520 Form("Centrality vs Start Z distribution for MC tracks w/ TOF Pnt, "
521 "%s, all tracks; Start X [cm]; Start Z [cm]; B [fm];",
522 ksPartName[iPartIdx].Data()),
523 iNbBinsStartXY / 2, dMinStartXY, dMaxStartXY, iNbBinsStartZ / 2,
524 dMinStartZ, dMaxStartZ, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
525 fvhTofPntAllAngCent[iPartIdx] = new TH3D(Form("TofTests_TofPntAllAngCent_%s", ksPartTag[iPartIdx].Data()),
526 Form("Centrality vs Angular position of TOF Pnt, %s, all tracks; "
527 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; B [fm];",
528 ksPartName[iPartIdx].Data()),
529 iNbBinThetaX / 2, dThetaXMin, dThetaXMax, iNbBinThetaY / 2, dThetaYMin,
530 dThetaYMax, iNbBinsCentr, dNbMinCentr, dNbMaxCentr);
531 } // if( kTRUE == fbCentDepOn )
532 fvhTrackAllStartXZ[iPartIdx] =
533 new TH2D(Form("TofTests_TrackAllStartXZ_%s", ksPartTag[iPartIdx].Data()),
534 Form("Start X vs Z distribution for MC tracks w/ TOF Pnt, %s, "
535 "all tracks; Start Z [cm]; Start X [cm]; # []",
536 ksPartName[iPartIdx].Data()),
537 iNbBinsStartZ / 2, dMinStartZ, dMaxStartZ, iNbBinsStartXY, dMinStartXY, dMaxStartXY);
538 fvhTrackAllStartYZ[iPartIdx] =
539 new TH2D(Form("TofTests_TrackAllStartYZ_%s", ksPartTag[iPartIdx].Data()),
540 Form("Start Y vs Z distribution for MC tracks w/ TOF Pnt, %s, "
541 "all tracks; Start Z [cm]; Start Y [cm]; # []",
542 ksPartName[iPartIdx].Data()),
543 iNbBinsStartZ / 2, dMinStartZ, dMaxStartZ, iNbBinsStartXY, dMinStartXY, dMaxStartXY);
544 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
545
546 // tracks
548 new TH2D("TofTests_TracksMapXY", "Position of the MC Tracks assuming along Z axis; X[cm]; Y[cm]; # [Tracks]", nbinx,
549 -xrange, xrange, nbiny, -yrange, yrange);
551 new TH2D("TofTests_TracksMapXZ", "Position of the MC Tracks assuming along Z axis; X[cm]; Z[cm]; # [Tracks]", nbinx,
552 -xrange, xrange, nbinz, zmin, zmax);
554 new TH2D("TofTests_TracksMapYZ", "Position of the MC Tracks assuming along Z axis; Y[cm]; Z[cm]; # [Tracks]", nbiny,
555 -yrange, yrange, nbinz, zmin, zmax);
556 fhTrackMapAng = new TH2D("TofTests_TracksMapAng",
557 "Position of the MC Tracks assuming from origin; "
558 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
559 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
560 fhTrackMapSph = new TH2D("TofTests_TracksMapSph",
561 "Position of the MC Tracks assuming from origin; "
562 "#theta[rad.]; #phi[rad.]; # [Tracks]",
563 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
564 // Tracks in angular coordinates with detectors points, For angular acceptance study
565 fhTrackMapAngPrimAll = new TH2D("TofTests_TracksMapAngPrimAll",
566 "Position of the MC Tracks assuming from origin, primary only; "
567 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
568 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
569 fhTrackMapAngPrimSts = new TH2D("TofTests_TracksMapAngPrimSts",
570 "Position of the MC Tracks w/ STS Pnts assuming from origin, "
571 "primary only; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
572 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
573 fhTrackMapAngPrimRich = new TH2D("TofTests_TracksMapAngPrimRich",
574 "Position of the MC Tracks w/ RICH Pnts assuming from origin, "
575 "primary only; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
576 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
577 fhTrackMapAngPrimMuch = new TH2D("TofTests_TracksMapAngPrimMuch",
578 "Position of the MC Tracks w/ MUCH Pnts assuming from origin, "
579 "primary only; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
580 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
581 fhTrackMapAngPrimTrd = new TH2D("TofTests_TracksMapAngPrimTrd",
582 "Position of the MC Tracks w/ TRD Pnts assuming from origin, "
583 "primary only; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
584 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
585 fhTrackMapAngPrimTof = new TH2D("TofTests_TracksMapAngPrimTof",
586 "Position of the MC Tracks w/ TOF Pnts assuming from origin, "
587 "primary only; #theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Tracks]",
588 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
589 // points
590 fhPointMapXY = new TH2D("TofTests_PointsMapXY", "Position of the Tof Points; X[cm]; Y[cm]; # [Points]", nbinx,
591 -xrange, xrange, nbiny, -yrange, yrange);
592 fhPointMapXZ = new TH2D("TofTests_PointsMapXZ", "Position of the Tof Points; X[cm]; Z[cm]; # [Points]", nbinx,
593 -xrange, xrange, nbinz, zmin, zmax);
594 fhPointMapYZ = new TH2D("TofTests_PointsMapYZ", "Position of the Tof Points; Y[cm]; Z[cm]; # [Points]", nbiny,
595 -yrange, yrange, nbinz, zmin, zmax);
596 fhPointMapAng = new TH2D("TofTests_PointsMapAng",
597 "Position of the Tof Points; #theta_{x}[Deg.]; "
598 "#theta_{y}[Deg.]; # [Points]",
599 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
600 fhPointMapSph = new TH2D("TofTests_PointsMapSph", "Position of the Tof Points; #theta[rad.]; #phi[rad.]; # [Points]",
601 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
602 // real (mean over all gaps) points
604 new TH2D("TofTests_RealPointsMapXY", "Position of the Tof Points (mean o/ gaps); X[cm]; Y[cm]; # [Points]", nbinx,
605 -xrange, xrange, nbiny, -yrange, yrange);
607 new TH2D("TofTests_RealPointsMapXZ", "Position of the Tof Points (mean o/ gaps); X[cm]; Z[cm]; # [Points]", nbinx,
608 -xrange, xrange, nbinz, zmin, zmax);
610 new TH2D("TofTests_RealPointsMapYZ", "Position of the Tof Points (mean o/ gaps); Y[cm]; Z[cm]; # [Points]", nbiny,
611 -yrange, yrange, nbinz, zmin, zmax);
612 fhRealPointMapAng = new TH2D("TofTests_RealPointsMapAng",
613 "Position of the Tof Points (mean o/ gaps); "
614 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
615 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
616 fhRealPointMapSph = new TH2D("TofTests_RealPointsMapSph",
617 "Position of the Tof Points (mean o/ gaps); "
618 "#theta[rad.]; #phi[rad.]; # [Points]",
619 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
620 // Pints in angular coordinates with other detectors points in track, For angular acceptance study
621 fhPointMapAngWithSts = new TH2D("TofTests_PointsMapAngWithSts",
622 "Position of the Tof Points with enough STS points in Track; "
623 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
624 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
625 fhPointMapAngWithRich = new TH2D("TofTests_PointsMapAngWithRich",
626 "Position of the Tof Points with RICH points in Track; "
627 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
628 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
629 fhPointMapAngWithMuch = new TH2D("TofTests_PointsMapAngWithMuch",
630 "Position of the Tof Points with enough MUCH points in Track; "
631 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
632 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
633 fhPointMapAngWithTrd = new TH2D("TofTests_PointsMapAngWithTrd",
634 "Position of the Tof Points with TRD points in Track; "
635 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; # [Points]",
636 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
637
638 // Errors relative to spherical approx
639 if (kTRUE == fbSphAppOn) {
640 // Radius error (distance from target)
641 fhPointSphAprRadiusErrMapXY = new TProfile2D("TofTests_PointSphAprRadiusErrMapXY",
642 "Radius error (distance from target) in spherical approx. "
643 "(mean o/ gaps); X[cm]; Y[cm]; Rp - Rwall [cm]",
644 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
645 fhPointSphAprRadiusErrMapXZ = new TProfile2D("TofTests_PointSphAprRadiusErrMapXZ",
646 "Radius error (distance from target) in spherical approx. "
647 "(mean o/ gaps); X[cm]; Z[cm]; Rp - Rwall [cm]",
648 nbinx, -xrange, xrange, nbinz, zmin, zmax);
649 fhPointSphAprRadiusErrMapYZ = new TProfile2D("TofTests_PointSphAprRadiusErrMapYZ",
650 "Radius error (distance from target) in spherical approx. "
651 "(mean o/ gaps); Y[cm]; Z[cm]; Rp - Rwall [cm]",
652 nbiny, -yrange, yrange, nbinz, zmin, zmax);
654 new TProfile2D("TofTests_PointSphAprRadiusErrMapAng",
655 "Radius error (distance from target) in spherical approx. (mean o/ "
656 "gaps); #theta_{x}[Deg.]; #theta_{y}[Deg.]; Rp - Rwall [cm]",
657 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
658 fhPointSphAprRadiusErrMapSph = new TProfile2D("TofTests_PointSphAprRadiusErrMapSph",
659 "Radius error (distance from target) in spherical approx. (mean o/ "
660 "gaps); #theta[rad.]; #phi[rad.]; Rp - Rwall [cm]",
661 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
662 // Z position error
663 fhPointSphAprZposErrMapXY = new TProfile2D("TofTests_PointSphAprZposErrMapXY",
664 "Z Position error of the Tof Points in spherical approx. "
665 "(mean o/ gaps); X[cm]; Y[cm]; Zp - Zsph(X,Y) [cm]",
666 nbinx, -xrange, xrange, nbiny, -yrange, yrange);
667 fhPointSphAprZposErrMapXZ = new TProfile2D("TofTests_PointSphAprZposErrMapXZ",
668 "Position of the Tof Points in spherical approx. (mean o/ "
669 "gaps); X[cm]; Z[cm]; Zp - Zsph(X,Y) [cm]",
670 nbinx, -xrange, xrange, nbinz, zmin, zmax);
671 fhPointSphAprZposErrMapYZ = new TProfile2D("TofTests_PointSphAprZposErrMapYZ",
672 "Position of the Tof Points in spherical approx. (mean o/ "
673 "gaps); Y[cm]; Z[cm]; Zp - Zsph(X,Y) [cm]",
674 nbiny, -yrange, yrange, nbinz, zmin, zmax);
676 new TProfile2D("TofTests_PointSphAprZposErrMapAng",
677 "Position of the Tof Points in spherical approx. (mean o/ gaps); "
678 "#theta_{x}[Deg.]; #theta_{y}[Deg.]; Zp - Zsph(X,Y) [cm]",
679 iNbBinThetaX, dThetaXMin, dThetaXMax, iNbBinThetaY, dThetaYMin, dThetaYMax);
680 fhPointSphAprZposErrMapSph = new TProfile2D("TofTests_PointSphAprZposErrMapSph",
681 "Position of the Tof Points in spherical approx. (mean o/ "
682 "gaps); #theta[rad.]; #phi[rad.]; Zp - Zsph(X,Y) [cm]",
683 iNbBinTheta, dThetaMin, dThetaMax, iNbBinPhi, dPhiMin, dPhiMax);
684 } // if( kTRUE == fbSphAppOn )
685
686 // Physics coord mapping, 1 per particle type
687 // Phase space
688 Int_t iNbBinsY = 30;
689 Double_t dMinY = -1.;
690 Double_t dMaxY = 4.;
691 Int_t iNbBNinsPtm = 30;
692 Double_t dMinPtm = 0.0;
693 Double_t dMaxPtm = 2.5;
700 // PLab
701 Int_t iNbBinsPlab = 100;
702 Double_t dMinPlab = 0.0;
703 Double_t dMaxPlab = 10.0;
704 fvhPlabGenTrk.resize(kiNbPart);
705 fvhPlabStsPnt.resize(kiNbPart);
706 fvhPlabTofPnt.resize(kiNbPart);
710 // MC Tracks losses
717 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
718 // Phase space
719 fvhPtmRapGenTrk[iPartIdx] = new TH2D(Form("TofTests_PtmRapGenTrk_%s", ksPartTag[iPartIdx].Data()),
720 Form("P_{t}/M vs y distribution for MC tracks, %s, primary "
721 "tracks; y; P_{t}/M; # []",
722 ksPartName[iPartIdx].Data()),
723 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
724 fvhPtmRapStsPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapStsPnt_%s", ksPartTag[iPartIdx].Data()),
725 Form("P_{t}/M vs y distribution from MC Track with STS points, "
726 "%s, primary tracks; y; P_{t}/M; # []",
727 ksPartName[iPartIdx].Data()),
728 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
729 fvhPtmRapTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapTofPnt_%s", ksPartTag[iPartIdx].Data()),
730 Form("P_{t}/M vs y distribution from MC Track for TOF points, "
731 "%s, primary tracks; y; P_{t}/M; # []",
732 ksPartName[iPartIdx].Data()),
733 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
734 // PLab
735 fvhPlabGenTrk[iPartIdx] = new TH1D(Form("TofTests_PlabGenTrk_%s", ksPartTag[iPartIdx].Data()),
736 Form("P_{lab} distribution for MC tracks, %s, primary tracks; "
737 "P_{lab} [GeV/c]; # []",
738 ksPartName[iPartIdx].Data()),
739 iNbBinsPlab, dMinPlab, dMaxPlab);
740 fvhPlabStsPnt[iPartIdx] = new TH1D(Form("TofTests_PlabStsPnt_%s", ksPartTag[iPartIdx].Data()),
741 Form("P_{lab} distribution from MC Track with STS points, %s, "
742 "primary tracks; P_{lab} [GeV/c]; # []",
743 ksPartName[iPartIdx].Data()),
744 iNbBinsPlab, dMinPlab, dMaxPlab);
745 fvhPlabTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabTofPnt_%s", ksPartTag[iPartIdx].Data()),
746 Form("P_{lab} distribution from MC Track for TOF points, %s, "
747 "primary tracks; P_{lab} [GeV/c]; # []",
748 ksPartName[iPartIdx].Data()),
749 iNbBinsPlab, dMinPlab, dMaxPlab);
750
751
752 // MC Tracks losses
753 fvhPtmRapGenTrkTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
754 Form("P_{t}/M vs y distribution for MC tracks with TOF Point(s), %s, "
755 "primary tracks; y; P_{t}/M; # []",
756 ksPartName[iPartIdx].Data()),
757 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
758
759 fvhPlabGenTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
760 Form("P_{lab} distribution for MC tracks with TOF Point(s), %s, "
761 "primary tracks; P_{lab} [GeV/c]; # []",
762 ksPartName[iPartIdx].Data()),
763 iNbBinsPlab, dMinPlab, dMaxPlab);
764 fvhPlabStsTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabStsTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
765 Form("P_{lab} distribution for MC tracks with STS and TOF "
766 "Point(s), %s, primary tracks; P_{lab} [GeV/c]; # []",
767 ksPartName[iPartIdx].Data()),
768 iNbBinsPlab, dMinPlab, dMaxPlab);
769
770 // Secondary tracks
771 // Phase space
772 fvhPtmRapSecGenTrk[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecGenTrk_%s", ksPartTag[iPartIdx].Data()),
773 Form("P_{t}/M vs y distribution for MC tracks, %s, secondary "
774 "tracks; y; P_{t}/M; # []",
775 ksPartName[iPartIdx].Data()),
776 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
777 fvhPtmRapSecStsPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecStsPnt_%s", ksPartTag[iPartIdx].Data()),
778 Form("P_{t}/M vs y distribution from MC Track with STS points, "
779 "%s, secondary tracks; y; P_{t}/M; # []",
780 ksPartName[iPartIdx].Data()),
781 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
782 fvhPtmRapSecTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecTofPnt_%s", ksPartTag[iPartIdx].Data()),
783 Form("P_{t}/M vs y distribution from MC Track for TOF points, "
784 "%s, secondary tracks; y; P_{t}/M; # []",
785 ksPartName[iPartIdx].Data()),
786 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
787 // PLab
788 fvhPlabSecGenTrk[iPartIdx] = new TH1D(Form("TofTests_PlabSecGenTrk_%s", ksPartTag[iPartIdx].Data()),
789 Form("P_{lab} distribution for MC tracks, %s, secondary tracks; "
790 "P_{lab} [GeV/c]; # []",
791 ksPartName[iPartIdx].Data()),
792 iNbBinsPlab, dMinPlab, dMaxPlab);
793 fvhPlabSecStsPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecStsPnt_%s", ksPartTag[iPartIdx].Data()),
794 Form("P_{lab} distribution from MC Track with STS points, %s, "
795 "secondary tracks; P_{lab} [GeV/c]; # []",
796 ksPartName[iPartIdx].Data()),
797 iNbBinsPlab, dMinPlab, dMaxPlab);
798 fvhPlabSecTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecTofPnt_%s", ksPartTag[iPartIdx].Data()),
799 Form("P_{lab} distribution from MC Track for TOF points, %s, "
800 "secondary tracks; P_{lab} [GeV/c]; # []",
801 ksPartName[iPartIdx].Data()),
802 iNbBinsPlab, dMinPlab, dMaxPlab);
803
804
805 // MC Tracks losses
806 fvhPtmRapSecGenTrkTofPnt[iPartIdx] = new TH2D(Form("TofTests_PtmRapSecGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
807 Form("P_{t}/M vs y distribution for MC tracks with TOF Point(s), %s, "
808 "secondary tracks; y; P_{t}/M; # []",
809 ksPartName[iPartIdx].Data()),
810 iNbBinsY, dMinY, dMaxY, iNbBNinsPtm, dMinPtm, dMaxPtm);
811
812 fvhPlabSecGenTrkTofPnt[iPartIdx] = new TH1D(Form("TofTests_PlabSecGenTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
813 Form("P_{lab} distribution for MC tracks with TOF Point(s), %s, "
814 "secondary tracks; P_{lab} [GeV/c]; # []",
815 ksPartName[iPartIdx].Data()),
816 iNbBinsPlab, dMinPlab, dMaxPlab);
817
818 fvhPlabSecStsTrkTofPnt[iPartIdx] =
819 new TH1D(Form("TofTests_PlabSecStsTrkTofPnt_%s", ksPartTag[iPartIdx].Data()),
820 Form("P_{lab} distribution for MC tracks with STS and TOF Point(s), %s, "
821 "secondary tracks; P_{lab} [GeV/c]; # []",
822 ksPartName[iPartIdx].Data()),
823 iNbBinsPlab, dMinPlab, dMaxPlab);
824 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
825
826 gDirectory->cd(oldir->GetPath()); // <= To prevent histos from being sucked in by the param file of the TRootManager!
827
828 return kTRUE;
829}
830
831// ------------------------------------------------------------------
833{
834 // Declare variables outside the loop
835 CbmMCTrack* pMcTrk;
836 CbmTofPoint* pTofPoint;
837
838 Int_t iNbTracks, iNbTofPts, iNbTofRealPts;
839
840 iNbTracks = fMcTracksColl->GetEntriesFast();
841 iNbTofPts = fTofPointsColl->GetEntriesFast();
842 if (kTRUE == fbRealPointAvail) iNbTofRealPts = fRealTofPointsColl->GetEntriesFast();
843 else
844 iNbTofRealPts = 0;
845
846 // Tracks Info
847 Int_t iNbTofTracks = 0;
848 Int_t iNbTofTracksPrim = 0;
849 std::vector<Bool_t> vbTrackHasHit(iNbTracks, kFALSE);
850 // Are MC tracks reconstructable in STS?
851 // std::vector< Bool_t > vbTrackStsRecOk( iNbTracks kFALSE);
852 for (Int_t iTrkInd = 0; iTrkInd < iNbTracks; iTrkInd++) {
853 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(iTrkInd);
854
855 // Is track reconstructable in STS
856 /*
857 UInt_t uNbStsPnts = pMcTrk->GetNPoints(ECbmModuleId::kSts);
858
859 // True criterium is whether enough STS stations are crossed
860 // but if already less STS points, can escape looping
861 if( kiMinNbStsPntAcc <= uNbStsPnts )
862 {
863 std::vector< UInt_t > vStsStationsId();
864 for( UInt_t uStsPntIdx = 0; uStsPntIdx < uNbStsPnts; uStsPntIdx++)
865 {
866 UInt_t uStation = CbmStsAddress::GetElementId(
867 (dynamic_cast<CbmStsPoint*>fStsPointsColl->At( uStsPntIdx ))->GetDetectorID(), 1);
868 if( kiMinNbStsPntAcc <= vStsStationsId.size() )
869 {
870 vbTrackStsRecOk[iTrkInd] = kTRUE;
871 break;
872 }
873 } // for( UInt_t uStsPntIdx = 0; uStsPntIdx < uNbStsPnts; uStsPntIdx++)
874 } // if( kiMinNbStsPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kSts) )
875 */
876
877 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
878 iNbTofTracks++;
879 // Keep track of MC tracks with at least one TOF Point
880
881 if (-1 == pMcTrk->GetMotherId()) { iNbTofTracksPrim++; } // if( -1 == pMcTrk->GetMotherId() )
882 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) )
883
884 // tracks mapping: Only when creating normalization histos
885 // Assume only TOF in setup, no field (only straight tracks)
886 // and all tracks reach TOF (protons)
887 // XYZ mapping: assume tracks along Z axis
888 if (pMcTrk->GetPz() == pMcTrk->GetP()) {
889 fhTrackMapXY->Fill(pMcTrk->GetStartX(), pMcTrk->GetStartY());
890 // fhTrackMapXZ->Fill( pMcTrk->GetStartX(), fdWallPosZ ); // Not sure how to get Z here
891 // fhTrackMapYZ->Fill( pMcTrk->GetStartY(), fdWallPosZ ); // Not sure how to get Z here
892 } // if( pMcTrk->GetPz() == pMcTrk->GetP() )
893
894 // Angular mapping: assume tracks all coming from origin and not necess. along Z axis
895 // track with non zero Z momentum + non spectator (at least deflected in X or Y)
896 if (0 != pMcTrk->GetPz() && ((0 != pMcTrk->GetPx()) || (0 != pMcTrk->GetPy()))) {
897 Double_t dThetaX = TMath::ATan2(pMcTrk->GetPx(), pMcTrk->GetPz()) * 180.0 / TMath::Pi();
898 Double_t dThetaY = TMath::ATan2(pMcTrk->GetPy(), pMcTrk->GetPz()) * 180.0 / TMath::Pi();
899
900 fhTrackMapAng->Fill(dThetaX, dThetaY);
901
902 // Primary tracks
903 if (-1 == pMcTrk->GetMotherId()) {
904 fhTrackMapAngPrimAll->Fill(dThetaX, dThetaY);
905
906 if (kiMinNbStsPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kSts)) fhTrackMapAngPrimSts->Fill(dThetaX, dThetaY);
907
908 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kRich)) fhTrackMapAngPrimRich->Fill(dThetaX, dThetaY);
909
910 if (kiMinNbMuchPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kMuch)) fhTrackMapAngPrimMuch->Fill(dThetaX, dThetaY);
911
912 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTrd)) fhTrackMapAngPrimTrd->Fill(dThetaX, dThetaY);
913
914 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) fhTrackMapAngPrimTof->Fill(dThetaX, dThetaY);
915 } // if( -1 == pMcTrk->GetMotherId() )
916 } // if( 0 != pMcTrk->GetPz() && ( (0 != pMcTrk->GetPx() ) || (0 != pMcTrk->GetPy() ) ))
917
918 // Spherical mapping: assume tracks all coming from origin and not necess. along Z axis
919 if (0 != pMcTrk->GetPz() && 0 != pMcTrk->GetPx())
920 fhTrackMapSph->Fill(TMath::ATan2(pMcTrk->GetPt(), pMcTrk->GetPz()),
921 TMath::ATan2(pMcTrk->GetPy(), pMcTrk->GetPx()));
922
923 // Physics coord mapping, 1 per particle type
924 Int_t iPdgCode = pMcTrk->GetPdgCode();
925 Int_t iPartIdx = -1;
926 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
927 if (kiPartPdgCode[iPart] == iPdgCode) {
928 iPartIdx = iPart;
929 break;
930 } // if( kiPartPdgCode[iPart] == iPdgCode )
931 if (-1 == iPartIdx) iPartIdx = 0;
932
933 // Dependence of Track origin on centrality or position
934 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
935 if (kTRUE == fbCentDepOn) {
936 fvhTrackAllStartZCent[iPartIdx]->Fill(pMcTrk->GetStartZ(), fMCEventHeader->GetB());
937 if (2 == iPartIdx) // 3D plot only for e-
938 fvhTrackAllStartXZCent[iPartIdx]->Fill(pMcTrk->GetStartX(), pMcTrk->GetStartZ(), fMCEventHeader->GetB());
939 } // if( kTRUE == fbCentDepOn )
940 fvhTrackAllStartXZ[iPartIdx]->Fill(pMcTrk->GetStartZ(), pMcTrk->GetStartX());
941 fvhTrackAllStartYZ[iPartIdx]->Fill(pMcTrk->GetStartZ(), pMcTrk->GetStartY());
942 }
943
944 if (-1 == pMcTrk->GetMotherId()) {
945 // primary track
946 // Phase space
947 fvhPtmRapGenTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
948 // PLab
949 fvhPlabGenTrk[iPartIdx]->Fill(pMcTrk->GetP());
950 // Do the same for tracks within STS acceptance
952 fvhPtmRapStsPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
953 fvhPlabStsPnt[iPartIdx]->Fill(pMcTrk->GetP());
954 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kSts) )
955 // Do the same for tracks within STS acceptance
956 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
957 fvhPtmRapGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
958 fvhPlabGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
959
961 fvhPlabStsTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
962 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) )
963 } // if( -1 == pMcTrk->GetMotherId() )
964 else {
965 // secondary track
966 // Dependence of Track origin on centrality
967 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) && kTRUE == fbCentDepOn)
968 fvhTrackSecStartZCent[iPartIdx]->Fill(pMcTrk->GetStartZ(), fMCEventHeader->GetB());
969
970 // Phase space
971 fvhPtmRapSecGenTrk[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
972 // PLab
973 fvhPlabSecGenTrk[iPartIdx]->Fill(pMcTrk->GetP());
974 // Do the same for tracks within STS acceptance
976 fvhPtmRapSecStsPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
977 fvhPlabSecStsPnt[iPartIdx]->Fill(pMcTrk->GetP());
978 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kSts) )
979 // Do the same for tracks within STS acceptance
980 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTof)) {
981 fvhPtmRapSecGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
982 fvhPlabSecGenTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
983
985 fvhPlabSecStsTrkTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
986 } // if( 0 < pMcTrk->GetNPoints(ECbmModuleId::kTof) )
987 } // else of if( -1 == pMcTrk->GetMotherId() )
988 } // for(Int_t iTrkInd = 0; iTrkInd < nMcTracks; iTrkInd++)
989
990 // Loop over Points and map them?
991 for (Int_t iPntInd = 0; iPntInd < iNbTofPts; iPntInd++) {
992 // Get a pointer to the TOF point
993 pTofPoint = (CbmTofPoint*) fTofPointsColl->At(iPntInd);
994 // Get a pointer to the corresponding MC Track
995 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
996
997 // Obtain position
998 TVector3 vPntPos;
999 pTofPoint->Position(vPntPos);
1000
1001 Double_t dX = vPntPos.X();
1002 Double_t dY = vPntPos.Y();
1003 Double_t dZ = vPntPos.Z();
1004
1005 // tracks mapping: Only when creating normalization histos
1006 // Assume only TOF in setup, no field (only straight tracks)
1007 // and all tracks reach TOF (protons)
1008 // XYZ mapping: assume tracks along Z axis
1009 if (pMcTrk->GetPz() == pMcTrk->GetP() && pMcTrk->GetStartX() == dX && pMcTrk->GetStartY() == dY) {
1010 fhTrackMapXZ->Fill(dX, dZ); // only way to get Z here?
1011 fhTrackMapYZ->Fill(dY, dZ); // only way to get Z here?
1012 } // if( pMcTrk->GetPz() == pMcTrk->GetP() )
1013
1014 fhPointMapXY->Fill(dX, dY);
1015 fhPointMapXZ->Fill(dX, dZ);
1016 fhPointMapYZ->Fill(dY, dZ);
1017
1018 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
1019 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
1020 fhPointMapAng->Fill(dThetaX, dThetaY);
1021
1022 if (-1 == pMcTrk->GetMotherId()) {
1023 // primary track
1024 if (kiMinNbStsPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kSts)) fhPointMapAngWithSts->Fill(dThetaX, dThetaY);
1025
1026 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kRich)) fhPointMapAngWithRich->Fill(dThetaX, dThetaY);
1027
1028 if (kiMinNbMuchPntAcc <= pMcTrk->GetNPoints(ECbmModuleId::kMuch)) fhPointMapAngWithMuch->Fill(dThetaX, dThetaY);
1029
1030 if (0 < pMcTrk->GetNPoints(ECbmModuleId::kTrd)) fhPointMapAngWithTrd->Fill(dThetaX, dThetaY);
1031 } // if( -1 == pMcTrk->GetMotherId() )
1032
1033 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY), dZ); // *180.0/TMath::Pi();
1034 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
1035 fhPointMapSph->Fill(dTheta, dPhi);
1036
1037 // Errors relative to spherical approx
1038 if (kTRUE == fbSphAppOn) {
1039 // Radius error (distance from target)
1040 Double_t dSphereRadius = fdWallPosZ + 115; // Make constant a user parameter!!!
1041 Double_t dRadiusError = TMath::Sqrt(dX * dX + dY * dY + dZ * dZ) - dSphereRadius;
1042 fhPointSphAprRadiusErrMapXY->Fill(dX, dY, dRadiusError);
1043 fhPointSphAprRadiusErrMapXZ->Fill(dX, dZ, dRadiusError);
1044 fhPointSphAprRadiusErrMapYZ->Fill(dY, dZ, dRadiusError);
1045 fhPointSphAprRadiusErrMapAng->Fill(dThetaX, dThetaY, dRadiusError);
1046 fhPointSphAprRadiusErrMapSph->Fill(dTheta, dPhi, dRadiusError);
1047 // Z position error
1048 Double_t dZposErr =
1049 dZ - TMath::Sqrt(dX * dX + dY * dY) / TMath::Tan(TMath::ASin(TMath::Sqrt(dX * dX + dY * dY) / dSphereRadius));
1050 fhPointSphAprZposErrMapXY->Fill(dX, dY, dZposErr);
1051 fhPointSphAprZposErrMapXZ->Fill(dX, dZ, dZposErr);
1052 fhPointSphAprZposErrMapYZ->Fill(dY, dZ, dZposErr);
1053 fhPointSphAprZposErrMapAng->Fill(dThetaX, dThetaY, dZposErr);
1054 fhPointSphAprZposErrMapSph->Fill(dTheta, dPhi, dZposErr);
1055 } // if( kTRUE == fbSphAppOn )
1056
1057 // Physics coord mapping, 1 per particle type
1058 Int_t iPdgCode = pMcTrk->GetPdgCode();
1059 Int_t iPartIdx = -1;
1060 for (Int_t iPart = 0; iPart < kiNbPart; iPart++)
1061 if (kiPartPdgCode[iPart] == iPdgCode) {
1062 iPartIdx = iPart;
1063 break;
1064 } // if( kiPartPdgCode[iPart] == iPdgCode )
1065 if (-1 == iPartIdx) iPartIdx = 0;
1066
1067 // Beam pipe check
1068 if (kTRUE == fbCentDepOn) fvhTofPntAllAngCent[iPartIdx]->Fill(dThetaX, dThetaY, fMCEventHeader->GetB());
1069
1070 if (-1 == pMcTrk->GetMotherId()) {
1071 // primary track
1072 // Phase space
1073 fvhPtmRapTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
1074 // PLab
1075 fvhPlabTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
1076 } // if( -1 == pMcTrk->GetMotherId() )
1077 else {
1078 // secondary track
1079 // Phase space
1080 fvhPtmRapSecTofPnt[iPartIdx]->Fill(pMcTrk->GetRapidity(), pMcTrk->GetPt() / pMcTrk->GetMass());
1081 // PLab
1082 fvhPlabSecTofPnt[iPartIdx]->Fill(pMcTrk->GetP());
1083 } // else of if( -1 == pMcTrk->GetMotherId() )
1084 } // for (Int_t iPntInd = 0; iPntInd < nTofPoint; iPntInd++ )
1085
1086 // Loop over Real Points and map them, only in case of protons
1087 if (kTRUE == fbRealPointAvail)
1088 for (Int_t iPntInd = 0; iPntInd < iNbTofRealPts; iPntInd++) {
1089 // Get a pointer to the TOF point
1090 pTofPoint = (CbmTofPoint*) fRealTofPointsColl->At(iPntInd);
1091 // Get a pointer to the corresponding MC Track
1092 pMcTrk = (CbmMCTrack*) fMcTracksColl->At(pTofPoint->GetTrackID());
1093
1094 // Physics coord mapping, 1 per particle type
1095 // Int_t iPdgCode = pMcTrk->GetPdgCode();
1096 // if( 2212 == iPdgCode ) // Protons cut, comment to get all
1097 {
1098 // Obtain position
1099 TVector3 vPntPos;
1100 pTofPoint->Position(vPntPos);
1101
1102 Double_t dX = vPntPos.X();
1103 Double_t dY = vPntPos.Y();
1104 Double_t dZ = vPntPos.Z();
1105
1106 fhRealPointMapXY->Fill(dX, dY);
1107 fhRealPointMapXZ->Fill(dX, dZ);
1108 fhRealPointMapYZ->Fill(dY, dZ);
1109
1110 Double_t dThetaX = TMath::ATan2(dX, dZ) * 180.0 / TMath::Pi();
1111 Double_t dThetaY = TMath::ATan2(dY, dZ) * 180.0 / TMath::Pi();
1112 fhRealPointMapAng->Fill(dThetaX, dThetaY);
1113
1114 Double_t dTheta = TMath::ATan2(TMath::Sqrt(dX * dX + dY * dY),
1115 dZ); // *180.0/TMath::Pi();
1116 Double_t dPhi = TMath::ATan2(dY, dX); // *180.0/TMath::Pi();
1117 fhRealPointMapSph->Fill(dTheta, dPhi);
1118 } // if( 2212 == iPdgCode )
1119 } // for (Int_t iPntInd = 0; iPntInd < iNbTofRealPts; iPntInd++ )
1120
1121 return kTRUE;
1122}
1123// ------------------------------------------------------------------
1124
1125Bool_t CbmTofGeometryQa::SetHistoFileName(TString sFilenameIn)
1126{
1127 fsHistoOutFilename = sFilenameIn;
1128 return kTRUE;
1129}
1131{
1132 // TODO: add sub-folders ?
1133
1135 TFile* oldFile = gFile;
1136 TDirectory* oldDir = gDirectory;
1137
1138 // Write histogramms to the file
1139 TFile* fHist = new TFile(fsHistoOutFilename, "RECREATE");
1140 fHist->cd();
1141
1142 // Mapping
1143 TDirectory* cdGeomMap = fHist->mkdir("GeomMap");
1144 cdGeomMap->cd(); // make the "GeomMap" directory the current directory
1145 fhTrackMapXY->Write();
1146 fhTrackMapXZ->Write();
1147 fhTrackMapYZ->Write();
1148 fhTrackMapAng->Write();
1149 fhTrackMapSph->Write();
1150
1151 fhTrackMapAngPrimAll->Write();
1152 fhTrackMapAngPrimSts->Write();
1153 fhTrackMapAngPrimRich->Write();
1154 fhTrackMapAngPrimMuch->Write();
1155 fhTrackMapAngPrimTrd->Write();
1156 fhTrackMapAngPrimTof->Write();
1157
1158 fhPointMapXY->Write();
1159 fhPointMapXZ->Write();
1160 fhPointMapYZ->Write();
1161 fhPointMapAng->Write();
1162 fhPointMapSph->Write();
1163 fhRealPointMapXY->Write();
1164 fhRealPointMapXZ->Write();
1165 fhRealPointMapYZ->Write();
1166 fhRealPointMapAng->Write();
1167 fhRealPointMapSph->Write();
1168
1169 fhPointMapAngWithSts->Write();
1170 fhPointMapAngWithRich->Write();
1171 fhPointMapAngWithMuch->Write();
1172 fhPointMapAngWithTrd->Write();
1173
1174 // Errors relative to spherical approx
1175 if (kTRUE == fbSphAppOn) {
1176 TDirectory* cdSphApprox = fHist->mkdir("SphApprox");
1177 cdSphApprox->cd(); // make the "SphApprox" directory the current directory
1188
1189 fHist->cd(); // make the file root the current directory
1190 } // if( kTRUE == fbSphAppOn )
1191
1192 TDirectory* cdStartZ = fHist->mkdir("StartZ");
1193 cdStartZ->cd(); // make the "MixMap" directory the current directory
1194 // Dependence of Track origin on centrality
1195 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1196 if (kTRUE == fbCentDepOn) {
1197 fvhTrackAllStartZCent[iPartIdx]->Write();
1198 fvhTrackSecStartZCent[iPartIdx]->Write();
1199 if (2 == iPartIdx) // 3D plot only for e-
1200 fvhTrackAllStartXZCent[iPartIdx]->Write();
1201 fvhTofPntAllAngCent[iPartIdx]->Write();
1202 } // if( kTRUE == fbCentDepOn )
1203 fvhTrackAllStartXZ[iPartIdx]->Write();
1204 fvhTrackAllStartYZ[iPartIdx]->Write();
1205 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1206
1207 TDirectory* cdPhysMap = fHist->mkdir("PhysMap");
1208 cdPhysMap->cd(); // make the "PhysMap" directory the current directory
1209 // Physics coord mapping, 1 per particle type
1210 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1211 // Phase space
1212 fvhPtmRapGenTrk[iPartIdx]->Write();
1213 fvhPtmRapStsPnt[iPartIdx]->Write();
1214 fvhPtmRapTofPnt[iPartIdx]->Write();
1215 // PLab
1216 fvhPlabGenTrk[iPartIdx]->Write();
1217 fvhPlabStsPnt[iPartIdx]->Write();
1218 fvhPlabTofPnt[iPartIdx]->Write();
1219 // MC Tracks losses
1220 fvhPtmRapGenTrkTofPnt[iPartIdx]->Write();
1221 fvhPlabGenTrkTofPnt[iPartIdx]->Write();
1222 fvhPlabStsTrkTofPnt[iPartIdx]->Write();
1223 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1224
1225 TDirectory* cdPhysMapSec = fHist->mkdir("PhysMapSec");
1226 cdPhysMapSec->cd(); // make the "PhysMap" directory the current directory
1227 // Physics coord mapping, 1 per particle type
1228 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1229 // Phase space
1230 fvhPtmRapSecGenTrk[iPartIdx]->Write();
1231 fvhPtmRapSecStsPnt[iPartIdx]->Write();
1232 fvhPtmRapSecTofPnt[iPartIdx]->Write();
1233 // PLab
1234 fvhPlabSecGenTrk[iPartIdx]->Write();
1235 fvhPlabSecStsPnt[iPartIdx]->Write();
1236 fvhPlabSecTofPnt[iPartIdx]->Write();
1237 // MC Tracks losses
1238 fvhPtmRapSecGenTrkTofPnt[iPartIdx]->Write();
1239 fvhPlabSecGenTrkTofPnt[iPartIdx]->Write();
1240 fvhPlabSecStsTrkTofPnt[iPartIdx]->Write();
1241 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1242
1243 fHist->cd(); // make the file root the current directory
1244
1246 gFile = oldFile;
1247 gDirectory = oldDir;
1248
1249 fHist->Close();
1250
1251 return kTRUE;
1252}
1254{
1255 // Mapping
1256 // Physics coord mapping, 1 per particle type
1257 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1258 if (kTRUE == fbCentDepOn) {
1259 delete fvhTrackAllStartZCent[iPartIdx];
1260 delete fvhTrackSecStartZCent[iPartIdx];
1261 if (2 == iPartIdx) // 3D plot only for e-
1262 delete fvhTrackAllStartXZCent[iPartIdx];
1263 delete fvhTofPntAllAngCent[iPartIdx];
1264 } // if( kTRUE == fbCentDepOn )
1265 delete fvhTrackAllStartXZ[iPartIdx];
1266 delete fvhTrackAllStartYZ[iPartIdx];
1267 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1268 if (kTRUE == fbCentDepOn) {
1269 fvhTrackAllStartZCent.clear();
1270 fvhTrackSecStartZCent.clear();
1271 fvhTrackAllStartXZCent.clear();
1272 fvhTofPntAllAngCent.clear();
1273 } // if( kTRUE == fbCentDepOn )
1274 fvhTrackAllStartXZ.clear();
1275 fvhTrackAllStartYZ.clear();
1276
1277 delete fhTrackMapXY;
1278 delete fhTrackMapXZ;
1279 delete fhTrackMapYZ;
1280 delete fhTrackMapAng;
1281 delete fhTrackMapSph;
1282
1283 delete fhTrackMapAngPrimAll;
1284 delete fhTrackMapAngPrimSts;
1285 delete fhTrackMapAngPrimRich;
1286 delete fhTrackMapAngPrimMuch;
1287 delete fhTrackMapAngPrimTrd;
1288 delete fhTrackMapAngPrimTof;
1289
1290 delete fhPointMapXY;
1291 delete fhPointMapXZ;
1292 delete fhPointMapYZ;
1293 delete fhPointMapAng;
1294 delete fhPointMapSph;
1295 delete fhRealPointMapXY;
1296 delete fhRealPointMapXZ;
1297 delete fhRealPointMapYZ;
1298 delete fhRealPointMapAng;
1299 delete fhRealPointMapSph;
1300
1301 delete fhPointMapAngWithSts;
1302 delete fhPointMapAngWithRich;
1303 delete fhPointMapAngWithMuch;
1304 delete fhPointMapAngWithTrd;
1305
1306 if (kTRUE == fbSphAppOn) {
1317 } // if( kTRUE == fbSphAppOn )
1318
1319 // Physics coord mapping, 1 per particle type
1320 for (Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++) {
1321 // Phase space
1322 delete fvhPtmRapGenTrk[iPartIdx];
1323 delete fvhPtmRapStsPnt[iPartIdx];
1324 delete fvhPtmRapTofPnt[iPartIdx];
1325 // PLab
1326 delete fvhPlabGenTrk[iPartIdx];
1327 delete fvhPlabStsPnt[iPartIdx];
1328 delete fvhPlabTofPnt[iPartIdx];
1329 // MC Tracks losses
1330 delete fvhPtmRapGenTrkTofPnt[iPartIdx];
1331 delete fvhPlabGenTrkTofPnt[iPartIdx];
1332
1333 // Secondary tracks
1334 // Phase space
1335 delete fvhPtmRapSecGenTrk[iPartIdx];
1336 delete fvhPtmRapSecStsPnt[iPartIdx];
1337 delete fvhPtmRapSecTofPnt[iPartIdx];
1338 // PLab
1339 delete fvhPlabSecGenTrk[iPartIdx];
1340 delete fvhPlabSecStsPnt[iPartIdx];
1341 delete fvhPlabSecTofPnt[iPartIdx];
1342 // MC Tracks losses
1343 delete fvhPtmRapSecGenTrkTofPnt[iPartIdx];
1344 delete fvhPlabSecGenTrkTofPnt[iPartIdx];
1345 delete fvhPlabSecStsTrkTofPnt[iPartIdx];
1346 } // for( Int_t iPartIdx = 0; iPartIdx < kiNbPart; iPartIdx++)
1347 // Phase space
1348 fvhPtmRapGenTrk.clear();
1349 fvhPtmRapStsPnt.clear();
1350 fvhPtmRapTofPnt.clear();
1351 // PLab
1352 fvhPlabGenTrk.clear();
1353 fvhPlabStsPnt.clear();
1354 fvhPlabTofPnt.clear();
1355 // MC Tracks losses
1356 fvhPtmRapGenTrkTofPnt.clear();
1357 fvhPlabGenTrkTofPnt.clear();
1358 fvhPlabStsTrkTofPnt.clear();
1359
1360 // Secondary tracks
1361 // Phase space
1362 fvhPtmRapSecGenTrk.clear();
1363 fvhPtmRapSecStsPnt.clear();
1364 fvhPtmRapSecTofPnt.clear();
1365 // PLab
1366 fvhPlabSecGenTrk.clear();
1367 fvhPlabSecStsPnt.clear();
1368 fvhPlabSecTofPnt.clear();
1369 // MC Tracks losses
1371 fvhPlabSecGenTrkTofPnt.clear();
1372 fvhPlabSecStsTrkTofPnt.clear();
1373
1374 return kTRUE;
1375}
1376
1377
@ kTrd
Transition Radiation Detector.
@ kTof
Time-of-flight Detector.
@ kSts
Silicon Tracking System.
@ kMuch
Muon detection system.
@ kRich
Ring-Imaging Cherenkov Detector.
static TFile * fHist
@ k12b
@ k14a
const TString ksPartTag[kiNbPart]
ClassImp(CbmTofGeometryQa)
const TString ksPartName[kiNbPart]
const Int_t kiNbPart
const Int_t kiMinNbMuchPntAcc
const Int_t kiPartPdgCode[kiNbPart]
const Int_t kiMinNbStsPntAcc
double GetPz() const
Definition CbmMCTrack.h:72
double GetPt() const
Definition CbmMCTrack.h:97
double GetP() const
Definition CbmMCTrack.h:98
double GetPx() const
Definition CbmMCTrack.h:70
double GetStartZ() const
Definition CbmMCTrack.h:75
int32_t GetMotherId() const
Definition CbmMCTrack.h:69
double GetMass() const
Mass of the associated particle.
double GetStartX() const
Definition CbmMCTrack.h:73
int32_t GetPdgCode() const
Definition CbmMCTrack.h:68
double GetStartY() const
Definition CbmMCTrack.h:74
double GetPy() const
Definition CbmMCTrack.h:71
double GetRapidity() const
int32_t GetNPoints(ECbmModuleId detId) const
Int_t Init(Bool_t isSimulation=kFALSE)
QA class for the TOF event based Hit finder tasks (clusterizers, ...)
std::vector< TH2 * > fvhTrackSecStartZCent
std::vector< TH2 * > fvhPtmRapSecGenTrk
std::vector< TH1 * > fvhPlabStsTrkTofPnt
TProfile2D * fhPointSphAprZposErrMapXZ
std::vector< TH2 * > fvhPtmRapSecStsPnt
std::vector< TH1 * > fvhPlabSecStsPnt
std::vector< TH2 * > fvhPtmRapStsPnt
std::vector< TH1 * > fvhPlabTofPnt
TProfile2D * fhPointSphAprRadiusErrMapAng
TClonesArray * fMcTracksColl
std::vector< TH1 * > fvhPlabSecStsTrkTofPnt
TProfile2D * fhPointSphAprZposErrMapXY
std::vector< TH3 * > fvhTofPntAllAngCent
Bool_t LoadGeometry()
Load the geometry: for now just resizing the Digis temporary vectors.
TProfile2D * fhPointSphAprRadiusErrMapXZ
std::vector< TH2 * > fvhPtmRapSecGenTrkTofPnt
TClonesArray * fRealTofMatchColl
TProfile2D * fhPointSphAprZposErrMapSph
std::vector< TH1 * > fvhPlabSecGenTrk
std::vector< TH2 * > fvhTrackAllStartYZ
std::vector< TH2 * > fvhPtmRapGenTrkTofPnt
CbmTofDetectorId * fTofId
Bool_t SetHistoFileName(TString sFilenameIn)
std::vector< TH1 * > fvhPlabGenTrkTofPnt
virtual void Finish()
std::vector< TH2 * > fvhPtmRapSecTofPnt
std::vector< TH2 * > fvhTrackAllStartXZ
std::vector< TH2 * > fvhTrackAllStartZCent
virtual void Exec(Option_t *option)
TProfile2D * fhPointSphAprZposErrMapYZ
FairMCEventHeader * fMCEventHeader
std::vector< TH1 * > fvhPlabStsPnt
virtual void SetParContainers()
Inherited from FairTask.
CbmTofGeoHandler * fGeoHandler
TProfile2D * fhPointSphAprRadiusErrMapYZ
virtual InitStatus Init()
std::vector< TH2 * > fvhPtmRapGenTrk
TClonesArray * fRealTofPointsColl
TProfile2D * fhPointSphAprZposErrMapAng
TClonesArray * fTofPointsColl
std::vector< TH3 * > fvhTrackAllStartXZCent
Bool_t SetWallPosZ(Double_t dWallPosCm=1000)
std::vector< TH1 * > fvhPlabSecGenTrkTofPnt
std::vector< TH1 * > fvhPlabGenTrk
TProfile2D * fhPointSphAprRadiusErrMapSph
TProfile2D * fhPointSphAprRadiusErrMapXY
std::vector< TH1 * > fvhPlabSecTofPnt
std::vector< TH2 * > fvhPtmRapTofPnt
Geometric intersection of a MC track with a TOFb detector.
Definition CbmTofPoint.h:44