Belle II Software  release-08-01-10
PXDROIFinderAnalysisModule.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <tracking/modules/pxdDataReduction/PXDROIFinderAnalysisModule.h>
10 #include <framework/datastore/RelationArray.h>
11 #include <framework/datastore/RelationIndex.h>
12 
13 #include <svd/dataobjects/SVDCluster.h>
14 #include <pxd/dataobjects/PXDDigit.h>
15 #include <pxd/dataobjects/PXDTrueHit.h>
16 #include <Math/Vector3D.h>
17 
18 #include <vxd/geometry/GeoCache.h>
19 
20 #include <TMath.h>
21 
22 
23 using namespace Belle2;
24 
25 //-----------------------------------------------------------------
26 // Register the Module
27 //-----------------------------------------------------------------
28 REG_MODULE(PXDROIFinderAnalysis);
29 
30 //-----------------------------------------------------------------
31 // Implementation
32 //-----------------------------------------------------------------
33 
35  , m_writeToRoot(false)
36  , m_rootEvent(-1)
37  //pxd sensors
38  , m_nSensorsL1(0)
39  , m_nSensorsL2(0)
40 
41  //variables
42  , m_globalTime(0.)
43  , m_coorU(0.)
44  , m_coorV(0.)
45  , m_sigmaU(0.)
46  , m_sigmaV(0.)
47  , m_vxdID(-1)
48 
49  , m_coorUmc(0.)
50  , m_coorVmc(0.)
51  , m_Uidmc(-1)
52  , m_Vidmc(-1)
53  , m_vxdIDmc(-1)
54  , m_pTmc(0.)
55  , m_momXmc(0.)
56  , m_momYmc(0.)
57  , m_momZmc(0.)
58  , m_thetamc(0.)
59  , m_costhetamc(0.)
60  , m_phimc(0.)
61  , m_lambdamc(0.)
62 
63  , Ntrack(0)
64  , NtrackHit(0)
65  , n_notINtrack2(0)
66  , n_notINtrack3(0)
67  , n_notINtrack4(0)
68  , n_notINtrack5(0)
69 
70  , n_rois(0)
71  , n_intercepts(0)
72  , n_tracks(0)
73  , n_tracksWithDigits(0)
74  , n_tracksWithDigitsInROI(0)
75 
76 
77  , n_pxdDigit(0)
78  , n_pxdDigitInROI(0)
79  , n_notINdigit2(0)
80  , n_notINdigit3(0)
81  , n_notINdigit4(0)
82  , n_notINdigit5(0)
83 
84  //vectors
85  , npxdDigit{0}
86  , npxdDigitInROI{0}
87  , nnotINdigit2{0}
88  , nnotINdigit3{0}
89  , nnotINdigit4{0}
90  , nnotINdigit5{0}
91  , TrackOneDigiIn{0}
92  , nnotINtrack2{0}
93  , nnotINtrack3{0}
94  , nnotINtrack4{0}
95  , nnotINtrack5{0}
96 
97 {
98  //Set module properties
99  setDescription("This module performs the analysis of the PXDROIFinder module output");
100 
101  addParam("writeToRoot", m_writeToRoot,
102  "set true if you want to save the informations in a root file named by parameter 'rootFileName'", bool(true));
103 
104  addParam("rootFileName", m_rootFileName,
105  "fileName used for . Will be ignored if parameter 'writeToRoot' is false (standard)",
106  std::string("pxdDataRedAnalysis"));
107 
108  addParam("recoTrackListName", m_recoTrackListName,
109  "name of the input collection of RecoTracks", std::string(""));
110 
111  addParam("PXDInterceptListName", m_PXDInterceptListName,
112  "name of the list of interceptions", std::string(""));
113 
114  addParam("ROIListName", m_ROIListName,
115  "name of the list of ROIs", std::string(""));
116 
117  m_rootEvent = 0;
118 }
119 
120 
122 {
124  m_ROIs.isRequired(m_ROIListName);
127 
128  n_rois = 0;
129  n_intercepts = 0;
130  n_tracks = 0;
131  n_pxdDigit = 0;
132  n_pxdDigitInROI = 0;
133 
134  n_tracksWithDigits = 0;
136  NtrackHit = 0;
137  n_notINtrack2 = 0;
138  n_notINtrack3 = 0;
139  n_notINtrack4 = 0;
140  n_notINtrack5 = 0;
141 
142  for (int i = 0; i < 6; i++) {
143  npxdDigit[i] = 0;
144  npxdDigitInROI[i] = 0;
145  }
146 
147  if (m_writeToRoot == true) {
148  m_rootFileName += ".root";
149  m_rootFilePtr = new TFile(m_rootFileName.c_str(), "RECREATE");
150  } else
151  m_rootFilePtr = nullptr;
152 
153 
154  m_h1GlobalTime = new TH1F("hGlobalTime", "global time for PXDDigits contained in ROI", 100, 0, 1);
155  m_h1PullU = new TH1F("hPullU", "U pulls for PXDDigits contained in ROI", 100, -6, 6);
156  m_h1PullV = new TH1F("hPullV", "V pulls for PXDDigits contained in ROI", 100, -6, 6);
157  m_h2sigmaUphi = new TH2F("hsigmaUvsPhi", "sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.35);
158  m_h2sigmaVphi = new TH2F("hsigmaVvsPhi", "sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.4);
159  m_h1ResidU = new TH1F("hResidU", "U resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
160  m_h1ResidV = new TH1F("hResidV", "V resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
161  m_h2ResidUV = new TH2F("hResidUV", "U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
162  m_h1SigmaU = new TH1F("hSigmaU", "sigmaU for PXDDigits contained in ROI", 100, 0, 0.35);
163  m_h1SigmaV = new TH1F("hSigmaV", "sigmaV for PXDDigits contained in ROI", 100, 0, 0.35);
164  m_h2Mapglob = new TH2F("h2Mapglob", "global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
165  m_h2MaplocL1 = new TH2F("h2MaplocL1", "L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
166  m_h2MaplocL2 = new TH2F("h2MaplocL2", "L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
167  m_h2MaplocL1->GetXaxis()->SetTitle("v ID");
168  m_h2MaplocL1->GetYaxis()->SetTitle("u ID");
169  m_h2MaplocL2->GetXaxis()->SetTitle("v ID");
170  m_h2MaplocL2->GetYaxis()->SetTitle("u ID");
171 
172 
173  m_h1GlobalTime_out2 = new TH1F("hGlobalTime_out2", "global time for PXDDigits not contained in ROI", 100, 0, 1);
174  m_h2sigmaUphi_out2 = new TH2F("hsigmaUvsPhi_out2", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
175  m_h2sigmaVphi_out2 = new TH2F("hsigmaVvsPhi_out2", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
176  m_h1ResidU_out2 = new TH1F("hResidU_out2", "U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
177  m_h1ResidV_out2 = new TH1F("hResidV_out2", "V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
178  m_h2ResidUV_out2 = new TH2F("hResidUV_out2", "U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
179  m_h1SigmaU_out2 = new TH1F("hSigmaU_out2", "sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
180  m_h1SigmaV_out2 = new TH1F("hSigmaV_out2", "sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
181  m_h2Mapglob_out2 = new TH2F("h2Mapglob_out2", "global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
182  m_h2MaplocL1_out2 = new TH2F("h2MaplocL1_out2", "L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
183  m_h2MaplocL2_out2 = new TH2F("h2MaplocL2_out2", "L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
184 
185 
186  m_h1GlobalTime_out3 = new TH1F("hGlobalTime_out3", "global time for PXDDigits not contained in ROI", 100, 0, 1);
187  m_h2sigmaUphi_out3 = new TH2F("hsigmaUvsPhi_out3", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
188  m_h2sigmaVphi_out3 = new TH2F("hsigmaVvsPhi_out3", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
189  m_h1ResidU_out3 = new TH1F("hResidU_out3", "U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
190  m_h1ResidV_out3 = new TH1F("hResidV_out3", "V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
191  m_h2ResidUV_out3 = new TH2F("hResidUV_out3", "U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
192  m_h1SigmaU_out3 = new TH1F("hSigmaU_out3", "sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
193  m_h1SigmaV_out3 = new TH1F("hSigmaV_out3", "sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
194 
195  m_h2Mapglob_out3 = new TH2F("h2Mapglob_out3", "global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
196  m_h2MaplocL1_out3 = new TH2F("h2MaplocL1_out3", "L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
197  m_h2MaplocL2_out3 = new TH2F("h2MaplocL2_out3", "L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
198 
199 
200  m_h1GlobalTime_out4 = new TH1F("hGlobalTime_out4", "global time for PXDDigits not contained in ROI", 100, 0, 1);
201  m_h2sigmaUphi_out4 = new TH2F("hsigmaUvsPhi_out4", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
202  m_h2sigmaVphi_out4 = new TH2F("hsigmaVvsPhi_out4", "sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
203  m_h1SigmaU_out4 = new TH1F("hSigmaU_out4", "sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
204  m_h1SigmaV_out4 = new TH1F("hSigmaV_out4", "sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
205 
206  m_h2Mapglob_out4 = new TH2F("h2Mapglob_out4", "global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
207  m_h2MaplocL1_out4 = new TH2F("h2MaplocL1_out4", "L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
208  m_h2MaplocL2_out4 = new TH2F("h2MaplocL2_out4", "L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
209 
210 
211  m_h1GlobalTime_out5 = new TH1F("hGlobalTime_out5", "global time for PXDDigits not contained in ROI", 100, 0, 1);
212 
213  m_h2Mapglob_out5 = new TH2F("h2Mapglob_out5", "global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
214  m_h2MaplocL1_out5 = new TH2F("h2MaplocL1_out5", "L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
215  m_h2MaplocL2_out5 = new TH2F("h2MaplocL2_out5", "L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
216 
217 
218  m_h1redFactor = new TH1F("hRedFactor", "L1+L2reduction factor", 1000, 0, 1);
219  m_h1redFactor_L1 = new TH1F("hRedFactor_L1", "L1-only reduction factor", 1000, 0, 1);
220  m_h1redFactor_L2 = new TH1F("hRedFactor_L2", "L2-only reduction factor", 1000, 0, 1);
221 
222  m_h1totROIs = new TH1F("h1TotNROIs", "number of all ROIs", 110, 0, 110);
223  m_h1okROIs = new TH1F("h1OkNROIs", "number of all ROIs containing a PXDDigit", 110, 0, 110);
224  m_h1okROIfrac = new TH1F("h1OkNROIfrac", "fraction of ROIs containing a PXDDigit", 100, 0, 1);
225 
226  m_h1totArea = new TH1F("h1TotArea", "Area of all ROIs", 100, 0, 2500000);
227  m_h1okArea = new TH1F("h1OkArea", "Area of ROIs containing a PXDDigit", 100, 0, 75000);
228 
229 
230 
231  m_h1effPerTrack = new TH1F("heffPerTrack", "fraction of digits in ROI per track", 100, -0.02, 1.02);
232 
233 
234 
235  m_h2ROIbottomLeft = new TH2F("h2ROIbottomLeft", "u,v ID of the bottom left pixel", 650, -200, 450, 1300, -300, 1000);
236  m_h2ROItopRight = new TH2F("h2ROItopRight", "u,v ID of the top right pixel", 650, -200, 450, 1300, -300, 1000);
237 
238  m_h2ROIuMinMax = new TH2F("h2ROIuMinMax", "u Min vs Max", 650, -200, 450, 650, -200, 450);
239  m_h2ROIvMinMax = new TH2F("h2ROIvMinMax", "v Min vs Max", 1300, -300, 1000, 1300, -300, 1000);
240 
241 
242  m_h1DigitsPerParticle = new TH1F("h1DigitsPerPart", "Number of PXDDigits per Particle", 50, 0, 50);
243  m_h1RecoTracksPerParticle = new TH1F("h1RecoTracksPerPart", "Number of RecoTracks per Particle", 10, 0, 10);
244 
245 
246  //analysis
247  Double_t lowBin[6 + 1];
248  for (int i = 0; i < 6; i++)
249  lowBin[i] = pt[i] - ptErr[i];
250  lowBin[6] = pt[5] + ptErr[5];
251 
252  m_h1TrackOneDigiIn = new TH1F("hTracksDigiIn", "Tracks with at least one digit contained in a ROI", 6, lowBin);
253  m_h1nnotINtrack2 = new TH1F("h1outROITrack", "Tracks with ROI with correct VxdID but no digits inside ROI", 6, lowBin);
254  m_h1nnotINtrack3 = new TH1F("h1noROITrack", "Tracks with ROI with wrong VxdID but no digits inside ROI", 6, lowBin);
255  m_h1nnotINtrack4 = new TH1F("h1wrongVxdIDTrack", "Tracks with no ROI, Intercept with correct VxdID", 6, lowBin);
256  m_h1nnotINtrack5 = new TH1F("h1noInterTrack", "Tracks with no Intercept matching a VxdID of digits", 6, lowBin);
257 
258  m_h1notINtrack5 = new TH1F("hNoInterTrack", "track with no intercepts", 20, 0, 20);
259  m_h1notINtrack5_pt = new TH1F("hNoInterTrack_pT", "track with no intercepts", 100, 0, 6);
260  m_h1notINtrack5_phi = new TH1F("h1NoInterTrack_phi", "hNoInterTrack_phi", 100, -180, 180);
261  m_h1notINtrack5_lambda = new TH1F("h1NoInterTrack_lambda", "hNoInterTrack_lambda", 100, -180, 180);
262  m_h1notINtrack5_cosTheta = new TH1F("h1NoInterTrack_cosTheta", "hNoInterTrack_cosTheta", 100, -1, 1);
263  m_h1notINtrack5_pVal = new TH1F("hNoInterTrack_pVal", "track with no intercepts", 100, 0, 1);
264  m_h1notINtrack5_nSVDhits = new TH1F("hNoInterTrack_nSVDhits", "track with no intercepts", 50, 0, 50);
265  m_h1notINtrack5_nCDChits = new TH1F("hNoInterTrack_nCDChits", "track with no intercepts", 100, 0, 100);
266 
267  m_h1INtrack1 = new TH1F("hINTrack", "track with at least one digit inside ROI", 20, 0, 20);
268  m_h1INtrack1_pt = new TH1F("hINTrack_pT", "track with at least one digit inside ROI", 100, 0, 6);
269  m_h1INtrack1_phi = new TH1F("h1INTrack_phi", "hINTrack_phi", 100, -180, 180);
270  m_h1INtrack1_lambda = new TH1F("h1INTrack_lambda", "hINTrack_lambda", 100, -180, 180);
271  m_h1INtrack1_cosTheta = new TH1F("h1INTrack_cosTheta", "hINTrack_cosTheta", 100, -1, 1);
272  m_h1INtrack1_pVal = new TH1F("h1INTrack_pVal", "track with no intercepts", 100, 0, 1);
273  m_h1INtrack1_nSVDhits = new TH1F("h1INTrack_nSVDhits", "track with no intercepts", 50, 0, 50);
274  m_h1INtrack1_nCDChits = new TH1F("h1INTrack_nCDChits", "track with no intercepts", 100, 0, 100);
275 
276  m_h1Track = new TH1F("hTrack", "all tracks", 20, 0, 20);
277  m_h1Track_pt = new TH1F("hTrack_pT", "all tracks with digits", 100, 0, 6);
278  m_h1Track_lambda = new TH1F("h1Track_lambda", "hTrack_lambda", 100, -180, 180);
279  m_h1Track_phi = new TH1F("h1Track_phi", "hTrack_phi", 100, -180, 180);
280  m_h1Track_cosTheta = new TH1F("h1Track_cosTheta", "hTrack_cos theta", 100, -1, 1);
281  m_h1Track_pVal = new TH1F("h1Track_pVal", "track with no intercepts", 100, 0, 1);
282  m_h1Track_nSVDhits = new TH1F("h1Track_nSVDhits", "track with no intercepts", 50, 0, 50);
283  m_h1Track_nCDChits = new TH1F("h1Track_nCDChits", "track with no intercepts", 100, 0, 100);
284 
285  m_h1digiIn = new TH1F("hdigiIn", "digits inside ROI", 6, lowBin);
286  m_h1digiOut2 = new TH1F("hdigiOut2", "ROI exists with with correct VxdID but no digits inside ROI", 6, lowBin);
287  m_h1digiOut3 = new TH1F("hdigiOut3", "ROI exists with with wrong VxdID", 6, lowBin);
288  m_h1digiOut4 = new TH1F("hdigiOut4", "ROI does not exist, but intercept has correct VxdID", 6, lowBin);
289  m_h1digiOut5 = new TH1F("hdigiOut5", "no ROI, no Intercpets with correct VXDid", 6, lowBin);
290 
291  // m_h2_VXDhitsPR_xy = new TH2F("hNoInteTrack_SVDhitsXY", "SVD Hits Missed by the VXDTF", 200, -15, 15, 200, -15, 15);
292 
293  // m_h2_VXDhitsPR_rz = new TH2F("hNoInteTrack_SVDhitsRZ", "SVD Hits Missed by the VXDTF, r_{T} z", 200, -30, 40, 200, 0, 15);
294 
295 
296 }
297 
299 {
300  m_rootEvent = 0;
301 
303 
304  std::set<Belle2::VxdID> pxdLayers = aGeometry.getLayers(VXD::SensorInfoBase::PXD);
305  std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
306 
307  while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
308 
309  std::set<Belle2::VxdID> pxdLadders = aGeometry.getLadders(*itPxdLayers);
310  std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
311 
312  while (itPxdLadders != pxdLadders.end()) {
313 
314  std::set<Belle2::VxdID> pxdSensors = aGeometry.getSensors(*itPxdLadders);
315  std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
316 
317  while (itPxdSensors != pxdSensors.end()) {
318 
319  if (itPxdLadders->getLayerNumber() == 1)
320  m_nSensorsL1++;
321  if (itPxdLadders->getLayerNumber() == 2)
322  m_nSensorsL2++;
323 
324  ++itPxdSensors;
325  }
326  ++itPxdLadders;
327  }
328  ++itPxdLayers;
329  }
330 
331 
332 }
333 
334 
336 {
337 
338  typedef RelationIndex < RecoTrack, PXDIntercept>::range_from PXDInterceptsFromRecoTracks;
339  typedef RelationIndex < RecoTrack, PXDIntercept>::iterator_from PXDInterceptIteratorType;
340  typedef RelationIndex < PXDDigit, PXDTrueHit>::range_from PXDTrueHitFromPXDDigit;
341  typedef RelationIndex < PXDDigit, PXDTrueHit>::iterator_from PXDTrueHitIteratorType;
343  relDigitTrueHit(DataStore::relationName(DataStore::arrayName<PXDDigit>(""),
344  DataStore::arrayName<PXDTrueHit>("")));
347 
348  double tmpGlobalTime;
349  int tmpNGlobalTime;
350 
351  NtrackHit = 0;
352  Ntrack = 0;
353 
354  B2DEBUG(1, " ++++++++++++++ PXDROIFinderAnalysisModule");
355 
356  int nROIs = 0;
357  int okArea_L1 = 0;
358  int okArea_L2 = 0;
359  int totArea_L1 = 0;
360  int totArea_L2 = 0;
361 
362  //MCParticles
363  StoreArray<MCParticle> mcParticles;
364 
365 
366  //ROIs general
367  for (int i = 0; i < (int)m_ROIs.getEntries(); i++) { //loop on ROIlist
368 
369  m_h2ROIbottomLeft->Fill(m_ROIs[i]->getMinUid(), m_ROIs[i]->getMinVid());
370  m_h2ROItopRight->Fill(m_ROIs[i]->getMaxUid(), m_ROIs[i]->getMaxVid());
371  m_h2ROIuMinMax->Fill(m_ROIs[i]->getMinUid(), m_ROIs[i]->getMaxUid());
372  m_h2ROIvMinMax->Fill(m_ROIs[i]->getMinVid(), m_ROIs[i]->getMaxVid());
373  int tmpArea = (m_ROIs[i]->getMaxUid() - m_ROIs[i]->getMinUid()) * (m_ROIs[i]->getMaxVid() - m_ROIs[i]->getMinVid());
374  if ((m_ROIs[i]->getSensorID()).getLayerNumber() == 1)
375  totArea_L1 += tmpArea;
376  else
377  totArea_L2 += tmpArea;
378 
379  bool isOK = false;
380 
381  for (int j = 0; j < (int)mcParticles.getEntries(); j++) {
382  MCParticle* aMcParticle = mcParticles[j];
383 
384  // continue only if MCParticle has a related PXDDigit and RecoTrack
385  RelationVector<PXDDigit> pxdDigits_MCParticle = aMcParticle->getRelationsFrom<PXDDigit>();
386 
387  if (!isOK)
388  //loop on PXDDigits
389  for (unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.size(); iPXDDigit++)
390  if (m_ROIs[i]->Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
391  nROIs++;
392  isOK = true;
393  break;
394  }
395  }
396  }
397 
398  m_h1totArea->Fill(totArea_L1 + totArea_L2);
399  double redFactor_L1 = totArea_L1 / 768. / 250. / m_nSensorsL1; //16
400  double redFactor_L2 = totArea_L2 / 768. / 250. / m_nSensorsL2; //24
401  m_h1redFactor->Fill((double)(totArea_L1 + totArea_L2) / 768. / 250. / (m_nSensorsL1 + m_nSensorsL2));
402  m_h1redFactor_L1->Fill((double) redFactor_L1);
403  m_h1redFactor_L2->Fill((double) redFactor_L2);
404 
405  m_h1totROIs->Fill(m_ROIs.getEntries());
406  n_rois += m_ROIs.getEntries();
407 
408  //RecoTrack general
410 
411  //PXDIntercepts general
412  n_intercepts += m_PXDIntercepts.getEntries();
413 
414  Int_t n_NoInterceptTracks = 0;
415 
416  // bool hasDigits = false;
417  // bool hasRecoTrack = false;
418 
419  //loop on MCParticles
420  for (int j = 0; j < (int)mcParticles.getEntries(); j++) {
421 
422  MCParticle* aMcParticle = mcParticles[j];
423 
424  // continue only if MCParticle has a related PXDDigit and RecoTrack
425  RelationVector<PXDDigit> pxdDigits_MCParticle = aMcParticle->getRelationsFrom<PXDDigit>();
426  RelationVector<RecoTrack> recoTracks_MCParticle = aMcParticle->getRelationsWith<RecoTrack>();
427 
428  m_h1DigitsPerParticle->Fill(pxdDigits_MCParticle.size());
429  if (pxdDigits_MCParticle.size() == 0)
430  continue;
431 
432  // hasDigits = true;
433 
434  m_h1RecoTracksPerParticle->Fill(recoTracks_MCParticle.size());
435  if (recoTracks_MCParticle.size() == 0)
436  continue;
437 
438  // hasRecoTrack = true;
439 
440  Ntrack++;
441 
442  B2DEBUG(1, "Number of RecoTracks = " << recoTracks_MCParticle.size() << " and PXDDigits = " << pxdDigits_MCParticle.size() <<
443  " related to this MCParticle");
444 
445  //retrieve general informations of MCParticle
446  m_momXmc = (aMcParticle->getMomentum()).X();
447  m_momYmc = (aMcParticle->getMomentum()).Y();
448  m_momZmc = (aMcParticle->getMomentum()).Z();
449  m_phimc = (aMcParticle->getMomentum()).Phi() * TMath::RadToDeg();
450  m_thetamc = (aMcParticle->getMomentum()).Theta() * TMath::RadToDeg();
451  m_costhetamc = cos((aMcParticle->getMomentum()).Theta());
452  m_lambdamc = 90 - m_thetamc;
453  m_pTmc = (aMcParticle->getMomentum()).Rho();
454 
455  //SVDhits
456  RelationVector<SVDCluster> svdRelations = aMcParticle->getRelationsFrom<SVDCluster>();
457 
458  /* Int_t nMCPartSVDhits = 0;
459  Int_t nSVDhitLadder[4] = {0};
460  if((int)svdRelations.size() > 0){
461  nMCPartSVDhits = svdRelations.size();
462  for(int s=0; s<(int)svdRelations.size();s++)
463  nSVDhitLadder[ (svdRelations[s]->getSensorID()).getLayerNumber()-3 ]++;
464  }
465  */
466 
467  bool part_outsideROI = false;
468  bool part_noROI = false;
469  bool part_wrongVxdID = false;
470  bool part_noInter = false;
471  bool hasOneDigitInROI = false;
472 
473  double tmpArea = 0;
474 
475  Int_t nDigitsInRoiPerTrack = 0;
476  Int_t nDigitsPerTrack = 0;
477 
478  //loop on PXDDigits
479  for (unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.size(); iPXDDigit++) {
480 
481  bool hasIntercept = false;
482  bool hasROI = false;
483  bool interceptRightVxdID = false;
484  bool MissingHit = true;
485 
486  n_pxdDigit ++ ;
487  nDigitsPerTrack++;
488 
489  PXDTrueHitFromPXDDigit PXDTrueHits = relDigitTrueHit.getElementsFrom(*pxdDigits_MCParticle[iPXDDigit]);
490  PXDTrueHitIteratorType thePXDTrueHitIterator = PXDTrueHits.begin();
491  PXDTrueHitIteratorType thePXDTrueHitIteratorEnd = PXDTrueHits.end();
492  tmpGlobalTime = 0;
493  tmpNGlobalTime = 0;
494 
495  for (; thePXDTrueHitIterator != thePXDTrueHitIteratorEnd; thePXDTrueHitIterator++) {
496  tmpGlobalTime = tmpGlobalTime + thePXDTrueHitIterator->to->getGlobalTime();
497  tmpNGlobalTime++;
498  }
499  m_globalTime = tmpGlobalTime / tmpNGlobalTime;
500 
501 
502  m_Uidmc = pxdDigits_MCParticle[iPXDDigit]->getUCellID();
503  m_Vidmc = pxdDigits_MCParticle[iPXDDigit]->getVCellID();
504  m_vxdIDmc = pxdDigits_MCParticle[iPXDDigit]->getSensorID();
505 
506  int u2 = -999;
507  int v2 = -999;
508  if (VxdID(m_vxdIDmc).getSensorNumber() == 2) { //BKW
509  u2 = m_Uidmc;
510  v2 = -(767 - m_Vidmc);
511  } else if (VxdID(m_vxdIDmc).getSensorNumber() == 1) { //FWD
512  u2 = m_Uidmc;
513  v2 = m_Vidmc;
514  }
515 
517  const VXD::SensorInfoBase& aSensorInfo = aGeometry.getSensorInfo(m_vxdIDmc);
518 
519  m_coorUmc = aSensorInfo.getUCellPosition(m_Uidmc); //pxdDigits_MCParticle[iPXDDigit]->getUCellPosition();
520  m_coorVmc = aSensorInfo.getVCellPosition(m_Vidmc); //pxdDigits_MCParticle[iPXDDigit]->getVCellPosition();
521 
522  ROOT::Math::XYZVector local(m_coorUmc, m_coorVmc, 0);
523  ROOT::Math::XYZVector globalSensorPos = aSensorInfo.pointToGlobal(local, true);
524 
525 
526  if (m_pTmc > 1) npxdDigit[5]++;
527  if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigit[4]++;
528  if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigit[3]++;
529  if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigit[2]++;
530  if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigit[1]++;
531  if (m_pTmc <= 0.1) npxdDigit[0]++;
532 
533 
534  for (int i = 0; i < (int)recoTracks_MCParticle.size(); i++) { //loop on input RecoTracks
535 
536  PXDInterceptsFromRecoTracks PXDIntercepts = recoTrackToPXDIntercept.getElementsFrom(recoTracks_MCParticle[i]);
537 
538  PXDInterceptIteratorType thePXDInterceptIterator = PXDIntercepts.begin();
539  PXDInterceptIteratorType thePXDInterceptIteratorEnd = PXDIntercepts.end();
540 
541 
542  for (; thePXDInterceptIterator != thePXDInterceptIteratorEnd; thePXDInterceptIterator++) {
543 
544  const PXDIntercept* theIntercept = thePXDInterceptIterator->to;
545 
546  if (theIntercept) {
547 
548  hasIntercept = true;
549 
550  m_coorU = theIntercept->getCoorU();
551  m_coorV = theIntercept->getCoorV();
552  m_sigmaU = theIntercept->getSigmaU();
553  m_sigmaV = theIntercept->getSigmaV();
554  m_vxdID = theIntercept->getSensorID();
555 
556  if (m_vxdID == m_vxdIDmc)
557  interceptRightVxdID = true;
558  else
559  continue;
560 
561  const ROIid* theROIid = theIntercept->getRelatedTo<ROIid>(m_ROIListName);
562 
563  if (theROIid) {
564 
565  hasROI = true;
566 
567  tmpArea = (theROIid->getMaxUid() - theROIid->getMinUid()) * (theROIid->getMaxVid() - theROIid->getMinVid());
568 
569  if (theROIid->Contains(*(pxdDigits_MCParticle[iPXDDigit]))) { //CASO1
570 
571  if (MissingHit) {
572  nDigitsInRoiPerTrack++;
573 
575  m_h1PullU->Fill((m_coorU - m_coorUmc) / m_sigmaU);
576  m_h1PullV->Fill((m_coorV - m_coorVmc) / m_sigmaV);
577  m_h1ResidU->Fill(m_coorU - m_coorUmc);
578  m_h1ResidV->Fill(m_coorV - m_coorVmc);
582  m_h1SigmaU->Fill(m_sigmaU);
583  m_h1SigmaV->Fill(m_sigmaV);
584  m_h2Mapglob->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
585 
586 
587  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
588  m_h2MaplocL1->Fill(v2, u2);
589  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
590  m_h2MaplocL2->Fill(v2, u2);
591 
592 
593  m_h1okArea->Fill(tmpArea);
594  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
595  okArea_L1 = okArea_L1 + tmpArea;
596  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
597  okArea_L2 = okArea_L2 + tmpArea;
598 
599 
600  hasOneDigitInROI = true;
601  n_pxdDigitInROI++;
602 
603  if (m_pTmc > 1) npxdDigitInROI[5]++;
604  if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigitInROI[4]++;
605  if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigitInROI[3]++;
606  if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigitInROI[2]++;
607  if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigitInROI[1]++;
608  if (m_pTmc <= 0.1) npxdDigitInROI[0]++;
609 
610  MissingHit = false;
611  }
612 
613 
614  break; // To avoid double counting (intercepts)
615  } //if theROIid contains
616  } //if (theROIid)
617  } //if (theintercept)
618  } //(end loop on intercept list)
619 
620  if (!MissingHit)
621  break;// To avoid double counting (recoTracks)
622 
623  } //(end loop on recoTracks)
624 
625 
626  if (MissingHit) {
627 
628  if (hasROI && hasIntercept && interceptRightVxdID) {
629  part_outsideROI = true;
630 
631  n_notINdigit2 ++;
632 
639  m_h1SigmaU_out2->Fill(m_sigmaU);
640  m_h1SigmaV_out2->Fill(m_sigmaV);
641  m_h2Mapglob_out2->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
642  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
643  m_h2MaplocL1_out2->Fill(v2, u2);
644  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
645  m_h2MaplocL2_out2->Fill(v2, u2);
646 
647  if (m_pTmc > 1) nnotINdigit2[5]++;
648  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit2[4]++;
649  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit2[3]++;
650  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit2[2]++;
651  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit2[1]++;
652  if (m_pTmc <= 0.1) nnotINdigit2[0]++;
653 
654  } else if (!hasROI && hasIntercept && interceptRightVxdID) {
655  part_noROI = true;
656 
657  n_notINdigit3 ++;
658 
665  m_h1SigmaU_out3->Fill(m_sigmaU);
666  m_h1SigmaV_out3->Fill(m_sigmaV);
667  m_h2Mapglob_out3->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
668  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
669  m_h2MaplocL1_out3->Fill(v2, u2);
670 
671  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
672  m_h2MaplocL2_out3->Fill(v2, u2);
673 
674 
675  if (m_pTmc > 1) nnotINdigit3[5]++;
676  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit3[4]++;
677  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit3[3]++;
678  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit3[2]++;
679  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit3[1]++;
680  if (m_pTmc <= 0.1) nnotINdigit3[0]++;
681 
682  } else if (hasIntercept && !interceptRightVxdID) {
683  part_wrongVxdID = true;
684 
685  n_notINdigit4 ++;
686 
690  m_h1SigmaU_out4->Fill(m_sigmaU);
691  m_h1SigmaV_out4->Fill(m_sigmaV);
692  m_h2Mapglob_out4->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
693  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
694  m_h2MaplocL1_out4->Fill(v2, u2);
695  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
696  m_h2MaplocL2_out4->Fill(v2, u2);
697 
698  if (m_pTmc > 1) nnotINdigit4[5]++;
699  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit4[4]++;
700  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit4[3]++;
701  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit4[2]++;
702  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit4[1]++;
703  if (m_pTmc <= 0.1) nnotINdigit4[0]++;
704 
705  } else if (!hasIntercept) {
706  part_noInter = true;
707 
708  n_notINdigit5 ++;
709 
711  m_h2Mapglob_out5->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
712  if (VxdID(m_vxdIDmc).getLayerNumber() == 1) //L1
713  m_h2MaplocL1_out5->Fill(v2, u2);
714  if (VxdID(m_vxdIDmc).getLayerNumber() == 2) //L2
715  m_h2MaplocL2_out5->Fill(v2, u2);
716 
717  if (m_pTmc > 1) nnotINdigit5[5]++;
718  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit5[4]++;
719  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit5[3]++;
720  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit5[2]++;
721  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit5[1]++;
722  if (m_pTmc <= 0.1) nnotINdigit5[0]++;
723  }
724  }
725  } //end loop on digits
726 
727  m_h1effPerTrack->Fill((float) nDigitsInRoiPerTrack / nDigitsPerTrack);
728  m_h1Track_pt->Fill(m_pTmc);
729  m_h1Track_phi->Fill(m_phimc);
732 
733  if (hasOneDigitInROI) {
734  NtrackHit++;
735  if (m_pTmc > 1) TrackOneDigiIn[5]++;
736  if (m_pTmc <= 1 && m_pTmc > 0.5) TrackOneDigiIn[4]++;
737  if (m_pTmc <= 0.5 && m_pTmc > 0.3) TrackOneDigiIn[3]++;
738  if (m_pTmc <= 0.3 && m_pTmc > 0.2) TrackOneDigiIn[2]++;
739  if (m_pTmc <= 0.2 && m_pTmc > 0.1) TrackOneDigiIn[1]++;
740  if (m_pTmc <= 0.1) TrackOneDigiIn[0]++;
741 
742  m_h1INtrack1_pt->Fill(m_pTmc);
743  m_h1INtrack1_phi->Fill(m_phimc);
746  } else if (part_outsideROI) { //CASO2
747  n_notINtrack2++;
748  if (m_pTmc > 1) nnotINtrack2[5]++;
749  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack2[4]++;
750  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack2[3]++;
751  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack2[2]++;
752  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack2[1]++;
753  if (m_pTmc <= 0.1) nnotINtrack2[0]++;
754  } else if (part_noROI) { //CASO3
755  n_notINtrack3++;
756  if (m_pTmc > 1) nnotINtrack3[5]++;
757  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack3[4]++;
758  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack3[3]++;
759  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack3[2]++;
760  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack3[1]++;
761  if (m_pTmc <= 0.1) nnotINtrack3[0]++;
762  } else if (part_wrongVxdID) { //CASO4
763  n_notINtrack4++;
764  if (m_pTmc > 1) nnotINtrack4[5]++;
765  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack4[4]++;
766  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack4[3]++;
767  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack4[2]++;
768  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack4[1]++;
769  if (m_pTmc <= 0.1) nnotINtrack4[0]++;
770  } else if (part_noInter) { //CASO5
771  n_notINtrack5++;
772  if (m_pTmc > 1) nnotINtrack5[5]++;
773  if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack5[4]++;
774  if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack5[3]++;
775  if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack5[2]++;
776  if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack5[1]++;
777  if (m_pTmc <= 0.1) nnotINtrack5[0]++;
778 
779  n_NoInterceptTracks++;
783  m_h1notINtrack5_pt->Fill(m_pTmc);
784  }
785 
786  } // close loop on MCParticlet
787 
788 
789  m_h1notINtrack5->Fill(n_NoInterceptTracks);
790  m_h1Track->Fill(Ntrack);
791  m_h1INtrack1->Fill(NtrackHit);
792 
795 
796  m_rootEvent++;
797  B2INFO(" o PXDROIFinder ANALYSIS: tot ROIs = " << m_ROIs.getEntries() << ", ok ROIs = " << nROIs);
798  B2INFO(" o : NtrackHit/Ntrack = " << NtrackHit << "/ " << Ntrack << " = " <<
799  (double)NtrackHit / Ntrack);
800  if (nROIs > m_ROIs.getEntries()) B2INFO(" HOUSTON WE HAVE A PROBLEM!");
801 
802  m_h1okROIs->Fill(nROIs);
803  m_h1okROIfrac->Fill(1.*nROIs / m_ROIs.getEntries());
804  std::cout << "" << std::endl;
805 
806 
807 }
808 
809 
811 {
812 
813  Double_t epsilon[6];
814  Double_t epsilonErr[6];
815  double epsilonTot = (double)n_pxdDigitInROI / (double) n_pxdDigit;
816  Double_t epsilon2[6];
817  Double_t epsilon2Err[6];
818  double epsilon2Tot = (double)n_tracksWithDigitsInROI / (double) n_tracksWithDigits;
819 
820  for (int i = 0; i < 6; i++) {
821  m_h1digiOut2->SetBinContent(i + 1, nnotINdigit2[i]);
822  m_h1digiOut3->SetBinContent(i + 1, nnotINdigit3[i]);
823  m_h1digiOut4->SetBinContent(i + 1, nnotINdigit4[i]);
824  m_h1digiOut5->SetBinContent(i + 1, nnotINdigit5[i]);
825  m_h1digiIn->SetBinContent(i + 1, npxdDigitInROI[i]);
826  }
827 
828  for (int i = 0; i < 6; i++) {
829  m_h1nnotINtrack2->SetBinContent(i + 1, nnotINtrack2[i]);
830  m_h1nnotINtrack3->SetBinContent(i + 1, nnotINtrack3[i]);
831  m_h1nnotINtrack4->SetBinContent(i + 1, nnotINtrack4[i]);
832  m_h1nnotINtrack5->SetBinContent(i + 1, nnotINtrack5[i]);
833  m_h1TrackOneDigiIn->SetBinContent(i + 1, TrackOneDigiIn[i]);
834  }
835 
836  B2INFO(" ROI Analysis Summary ");
837  B2INFO("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
838  B2INFO("");
839  B2INFO(" number of tracks = " << n_tracks);
840  B2INFO(" number of Intercepts = " << n_intercepts);
841  B2INFO(" number of ROIs = " << n_rois);
842  B2INFO("");
843  B2INFO(" average number of ROIs = " << m_h1totROIs->GetMean() << ", average area " << m_h1totArea->GetMean() <<
844  " (not excluding overlaps!)");
845  B2INFO(" average number of ROIs w digits = " << m_h1okROIs->GetMean() << ", average tot area " << m_h1okArea->GetMean());
846  B2INFO("");
847  B2INFO(" red Factor = " << m_h1redFactor->GetMean() << ", RMS = " << m_h1redFactor->GetRMS());
848  B2INFO("");
849  B2INFO("tracks w digits: " << n_tracksWithDigits);
850  B2INFO("tracks w digits in ROI: " << n_tracksWithDigitsInROI);
851  B2INFO("efficiency PTD : " << epsilon2Tot << " +/- " << sqrt(epsilon2Tot * (1 - epsilon2Tot) / n_tracksWithDigits));
852 
853  Int_t totTrackOneDigiIn = 0; //not used for the moment, added to double check
854  Int_t totnnotINtrack2 = 0;
855  Int_t totnnotINtrack3 = 0;
856  Int_t totnnotINtrack4 = 0;
857  Int_t totnnotINtrack5 = 0;
858 
859  Int_t totTrack[6];
860 
861  for (int j = 0; j < m_h1TrackOneDigiIn->GetNbinsX(); j++) {
862  totTrackOneDigiIn = totTrackOneDigiIn + m_h1TrackOneDigiIn->GetBinContent(j + 1);
863  totnnotINtrack2 = totnnotINtrack2 + m_h1nnotINtrack2->GetBinContent(j + 1);
864  totnnotINtrack3 = totnnotINtrack3 + m_h1nnotINtrack3->GetBinContent(j + 1);
865  totnnotINtrack4 = totnnotINtrack4 + m_h1nnotINtrack4->GetBinContent(j + 1);
866  totnnotINtrack5 = totnnotINtrack5 + m_h1nnotINtrack5->GetBinContent(j + 1);
867 
868  totTrack[j] = m_h1nnotINtrack5->GetBinContent(j + 1) + m_h1nnotINtrack4->GetBinContent(j + 1) + m_h1nnotINtrack3->GetBinContent(
869  j + 1) + m_h1nnotINtrack2->GetBinContent(j + 1) + m_h1TrackOneDigiIn->GetBinContent(j + 1);
870  }
871 
872  B2INFO(" out ROI = " << totnnotINtrack2);
873  B2INFO(" no ROI = " << totnnotINtrack3);
874  B2INFO(" wrongVxdID = " << totnnotINtrack4);
875  B2INFO(" no Inter = " << totnnotINtrack5);
876  B2INFO("");
877 
878  B2INFO(" pxdDigit : " << n_pxdDigit);
879  B2INFO(" pxdDigitIn : " << n_pxdDigitInROI);
880 
881  B2INFO(" eff DGT: " << epsilonTot << " +/- " << sqrt(epsilonTot * (1 - epsilonTot) / n_pxdDigit));
882  B2INFO(" inefficiency (PXDDigits): ");
883  B2INFO(" out ROI: " << n_notINdigit2);
884  B2INFO(" no ROI: " << n_notINdigit3);
885  B2INFO(" wrongVxdID: " << n_notINdigit4);
886  B2INFO(" noInter: " << n_notINdigit5);
887  B2INFO("");
888 
889 
890  B2INFO(" pT > 1 : " << pt[5]);
891  B2INFO(" out ROI: " << nnotINdigit2[5]);
892  B2INFO(" no ROI: " << nnotINdigit3[5]);
893  B2INFO(" wrongVxdID: " << nnotINdigit4[5]);
894  B2INFO(" noInter: " << nnotINdigit5[5]);
895  B2INFO(" pxdDigit : " << npxdDigit[5]);
896  B2INFO(" pxdDigitIn : " << npxdDigitInROI[5]);
897  if ((npxdDigit[5] - npxdDigitInROI[5]) != (nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] + nnotINdigit5[5]))
898  B2INFO(" pxdDigitOut : " << npxdDigit[5] - npxdDigitInROI[5] << " != " << nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] +
899  nnotINdigit5[5]);
900  epsilon[5] = (double)npxdDigitInROI[5] / (double) npxdDigit[5];
901  epsilonErr[5] = sqrt(epsilon[5] * (1 - epsilon[5]) / npxdDigit[5]);
902  B2INFO(" efficiency : " << epsilon[5] << " +/- " << epsilonErr[5]);
903  epsilon2[5] = (double)TrackOneDigiIn[5] / (double) totTrack[5] ;
904  epsilon2Err[5] = sqrt(epsilon2[5] * (1 - epsilon2[5]) / totTrack[5]);
905  B2INFO(" efficiency2 : " << epsilon2[5] << " +/- " << epsilon2Err[5]);
906  B2INFO("");
907 
908  B2INFO(" 0.5 < pT < 1 : " << pt[4]);
909  B2INFO(" out ROI: " << nnotINdigit2[4]);
910  B2INFO(" no ROI: " << nnotINdigit3[4]);
911  B2INFO(" wrongVxdID: " << nnotINdigit4[4]);
912  B2INFO(" noInter: " << nnotINdigit5[4]);
913  B2INFO(" pxdDigit : " << npxdDigit[4]);
914  B2INFO(" pxdDigitIn : " << npxdDigitInROI[4]);
915  if ((npxdDigit[4] - npxdDigitInROI[4]) != (nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] + nnotINdigit5[4]))
916  B2INFO(" pxdDigitOut : " << npxdDigit[4] - npxdDigitInROI[4] << " != " << nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] +
917  nnotINdigit5[4]);
918  epsilon[4] = (double)npxdDigitInROI[4] / (double) npxdDigit[4];
919  epsilonErr[4] = sqrt(epsilon[4] * (1 - epsilon[4]) / npxdDigit[4]);
920  B2INFO(" efficiency : " << epsilon[4] << " +/- " << epsilonErr[4]);
921  epsilon2[4] = (double)TrackOneDigiIn[4] / (double) totTrack[4] ;
922  epsilon2Err[4] = sqrt(epsilon2[4] * (1 - epsilon2[4]) / totTrack[4]);
923  B2INFO(" efficiency2 : " << epsilon2[4] << " +/- " << epsilon2Err[4]);
924 
925  B2INFO("");
926  B2INFO(" 0.3 < pT < 0.5 : " << pt[3]);
927  B2INFO(" out ROI: " << nnotINdigit2[3]);
928  B2INFO(" no ROI: " << nnotINdigit3[3]);
929  B2INFO(" wrongVxdID: " << nnotINdigit4[3]);
930  B2INFO(" noInter: " << nnotINdigit5[3]);
931  B2INFO(" pxdDigit : " << npxdDigit[3]);
932  B2INFO(" pxdDigitIn : " << npxdDigitInROI[3]);
933  if ((npxdDigit[3] - npxdDigitInROI[3]) != (nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] + nnotINdigit5[3]))
934  B2INFO(" pxdDigitOut : " << npxdDigit[3] - npxdDigitInROI[3] << " != " << nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] +
935  nnotINdigit5[3]);
936  epsilon[3] = (double)npxdDigitInROI[3] / (double) npxdDigit[3];
937  epsilonErr[3] = sqrt(epsilon[3] * (1 - epsilon[3]) / npxdDigit[3]);
938  B2INFO(" efficiency : " << epsilon[3] << " +/- " << epsilonErr[3]);
939  epsilon2[3] = (double)TrackOneDigiIn[3] / (double) totTrack[3];
940  epsilon2Err[3] = sqrt(epsilon2[3] * (1 - epsilon2[3]) / totTrack[3]);
941  B2INFO(" efficiency2 : " << epsilon2[3] << " +/- " << epsilon2Err[3]);
942 
943  B2INFO("");
944  B2INFO(" 0.2 < pT < 0.3 : " << pt[2]);
945  B2INFO(" out ROI: " << nnotINdigit2[2]);
946  B2INFO(" no ROI: " << nnotINdigit3[2]);
947  B2INFO(" wrongVxdID: " << nnotINdigit4[2]);
948  B2INFO(" noInter: " << nnotINdigit5[2]);
949  B2INFO(" pxdDigit : " << npxdDigit[2]);
950  B2INFO(" pxdDigitIn : " << npxdDigitInROI[2]);
951  if ((npxdDigit[2] - npxdDigitInROI[2]) != (nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] + nnotINdigit5[2]))
952  B2INFO(" pxdDigitOut : " << npxdDigit[2] - npxdDigitInROI[2] << " != " << nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] +
953  nnotINdigit5[2]);
954  epsilon[2] = (double)npxdDigitInROI[2] / (double) npxdDigit[2];
955  epsilonErr[2] = sqrt(epsilon[2] * (1 - epsilon[2]) / npxdDigit[2]);
956  B2INFO(" efficiency : " << epsilon[2] << " +/- " << epsilonErr[2]);
957  epsilon2[2] = (double)TrackOneDigiIn[2] / (double) totTrack[2] ;
958  epsilon2Err[2] = sqrt(epsilon2[2] * (1 - epsilon2[2]) / totTrack[2]);
959  B2INFO(" efficiency2 : " << epsilon2[2] << " +/- " << epsilon2Err[2]);
960 
961  B2INFO("");
962  B2INFO(" 0.1 < pT < 0.2 : " << pt[1]);
963  B2INFO(" out ROI: " << nnotINdigit2[1]);
964  B2INFO(" no ROI: " << nnotINdigit3[1]);
965  B2INFO(" wrongVxdID: " << nnotINdigit4[1]);
966  B2INFO(" noInter: " << nnotINdigit5[1]);
967  B2INFO(" pxdDigit : " << npxdDigit[1]);
968  B2INFO(" pxdDigitIn : " << npxdDigitInROI[1]);
969  if ((npxdDigit[1] - npxdDigitInROI[1]) != (nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] + nnotINdigit5[1]))
970  B2INFO(" pxdDigitOut : " << npxdDigit[1] - npxdDigitInROI[1] << " ?=? " << nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] +
971  nnotINdigit5[1]);
972  epsilon[1] = (double)npxdDigitInROI[1] / (double) npxdDigit[1];
973  epsilonErr[1] = sqrt(epsilon[1] * (1 - epsilon[1]) / npxdDigit[1]);
974  B2INFO(" efficiency : " << epsilon[1] << " +/- " << epsilonErr[1]);
975  epsilon2[1] = (double)TrackOneDigiIn[1] / (double) totTrack[1] ;
976  epsilon2Err[1] = sqrt(epsilon2[1] * (1 - epsilon2[1]) / totTrack[1]);
977  B2INFO(" efficiency2 : " << epsilon2[1] << " +/- " << epsilon2Err[1]);
978 
979  B2INFO("");
980  B2INFO(" pT < 0.1 : " << pt[0]);
981  B2INFO(" out ROI: " << nnotINdigit2[0]);
982  B2INFO(" no ROI: " << nnotINdigit3[0]);
983  B2INFO(" wrongVxdID: " << nnotINdigit4[0]);
984  B2INFO(" noInter: " << nnotINdigit5[0]);
985  B2INFO(" pxdDigit : " << npxdDigit[0]);
986  B2INFO(" pxdDigitIn : " << npxdDigitInROI[0]);
987  if ((npxdDigit[0] - npxdDigitInROI[0]) != (nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] + nnotINdigit5[0]))
988  B2INFO(" pxdDigitOut : " << npxdDigit[0] - npxdDigitInROI[0] << " ?=? " << nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] +
989  nnotINdigit5[0]);
990  epsilon[0] = (double)npxdDigitInROI[0] / (double) npxdDigit[0];
991  epsilonErr[0] = sqrt(epsilon[0] * (1 - epsilon[0]) / npxdDigit[0]);
992  B2INFO(" efficiency : " << epsilon[0] << " +/- " << epsilonErr[0]);
993  epsilon2[0] = (double)TrackOneDigiIn[0] / (double) totTrack[0] ;
994  epsilon2Err[0] = sqrt(epsilon2[0] * (1 - epsilon2[0]) / totTrack[0]);
995  B2INFO(" efficiency2 : " << epsilon2[0] << " +/- " << epsilon2Err[0]);
996 
997  B2INFO("legend:");
998  B2INFO(" CASO2: if (ROI exists but no PXDDigit inside)");
999  B2INFO(" CASO3: if (ROI does not exist, intercept with correct VxdID)");
1000  B2INFO(" CASO4: if (intercept with wrong VxdID)");
1001  B2INFO(" CASO5: if (intercept does not exist)");
1002 
1003 
1004  m_gEff2 = new TGraphErrors(6, pt, epsilon2, ptErr, epsilon2Err);
1005  m_gEff2->SetName("g_eff2");
1006  m_gEff2->SetTitle("Normalized to MCParticles with digits and related track");
1007  m_gEff = new TGraphErrors(6, pt, epsilon, ptErr, epsilonErr);
1008  m_gEff->SetName("g_eff");
1009  m_gEff->SetTitle("Normalized to digits of MCParticles with digits and related track");
1010 
1011 
1012 
1013  if (m_rootFilePtr != nullptr) {
1014  m_rootFilePtr->cd(); //important! without this the famework root I/O (SimpleOutput etc) could mix with the root I/O of this module
1015 
1016  TDirectory* oldDir = gDirectory;
1017  TDirectory* m_digiDir = oldDir->mkdir("digits");
1018  TDirectory* m_tracksDir = oldDir->mkdir("tracks");
1019  TDirectory* m_notINtrack5 = oldDir->mkdir("notINtrack5");
1020  TDirectory* m_INtrack1 = oldDir->mkdir("INtrack1");
1021  TDirectory* m_alltracks = oldDir->mkdir("alltracks");
1022  TDirectory* m_in = oldDir->mkdir("digi_in");
1023  TDirectory* m_out2 = oldDir->mkdir("digi_out2");
1024  TDirectory* m_out3 = oldDir->mkdir("digi_out3");
1025  TDirectory* m_out4 = oldDir->mkdir("digi_out4");
1026  TDirectory* m_out5 = oldDir->mkdir("digi_out5");
1027  TDirectory* m_ROIDir = oldDir->mkdir("roi");
1028 
1029  m_h1DigitsPerParticle->Write();
1030  m_h1RecoTracksPerParticle->Write();
1031 
1032  m_gEff->Write();
1033  m_gEff2->Write();
1034  m_h1effPerTrack->Write();
1035 
1036 
1037  m_digiDir->cd();
1038  m_h1digiIn->Write();
1039  m_h1digiOut2->Write();
1040  m_h1digiOut3->Write();
1041  m_h1digiOut4->Write();
1042  m_h1digiOut5->Write();
1043 
1044  m_tracksDir->cd();
1045  m_h1TrackOneDigiIn->Write();
1046  m_h1nnotINtrack2->Write();
1047  m_h1nnotINtrack3->Write();
1048  m_h1nnotINtrack4->Write();
1049  m_h1nnotINtrack5->Write();
1050 
1051  m_notINtrack5->cd();
1052  m_h1notINtrack5->Write();
1053  m_h1notINtrack5_pt->Write();
1054  m_h1notINtrack5_phi->Write();
1055  m_h1notINtrack5_lambda->Write();
1056  m_h1notINtrack5_cosTheta->Write();
1057 
1058  m_INtrack1->cd();
1059  m_h1INtrack1->Write();
1060  m_h1INtrack1_pt->Write();
1061  m_h1INtrack1_phi->Write();
1062  m_h1INtrack1_lambda->Write();
1063  m_h1INtrack1_cosTheta->Write();
1064 
1065  m_alltracks->cd();
1066  m_h1Track->Write();
1067  m_h1Track_pt->Write();
1068  m_h1Track_phi->Write();
1069  m_h1Track_lambda->Write();
1070  m_h1Track_cosTheta->Write();
1071 
1072  m_in->cd();
1073  m_h1GlobalTime->Write();
1074  m_h1PullU->Write();
1075  m_h1PullV->Write();
1076  m_h1ResidU->Write();
1077  m_h1ResidV->Write();
1078  m_h2ResidUV->Write();
1079  m_h1SigmaU->Write();
1080  m_h1SigmaV->Write();
1081  m_h2sigmaUphi->Write();
1082  m_h2sigmaVphi->Write();
1083  m_h2Mapglob->Write();
1084  m_h2MaplocL1->Write();
1085  m_h2MaplocL2->Write();
1086 
1087  m_out2->cd();
1088  m_h1GlobalTime_out2->Write();
1089  m_h1ResidU_out2->Write();
1090  m_h1ResidV_out2->Write();
1091  m_h2ResidUV_out2->Write();
1092  m_h1SigmaU_out2->Write();
1093  m_h1SigmaV_out2->Write();
1094  m_h2sigmaUphi_out2->Write();
1095  m_h2sigmaVphi_out2->Write();
1096  m_h2Mapglob_out2->Write();
1097  m_h2MaplocL1_out2->Write();
1098  m_h2MaplocL2_out2->Write();
1099 
1100  m_out3->cd();
1101  m_h1GlobalTime_out3->Write();
1102  m_h1ResidU_out3->Write();
1103  m_h1ResidV_out3->Write();
1104  m_h2ResidUV_out3->Write();
1105  m_h1SigmaU_out3->Write();
1106  m_h1SigmaV_out3->Write();
1107  m_h2sigmaUphi_out3->Write();
1108  m_h2sigmaVphi_out3->Write();
1109  m_h2Mapglob_out3->Write();
1110  m_h2MaplocL1_out3->Write();
1111  m_h2MaplocL2_out3->Write();
1112 
1113  m_out4->cd();
1114  m_h1GlobalTime_out4->Write();
1115  m_h1SigmaU_out4->Write();
1116  m_h1SigmaV_out4->Write();
1117  m_h2sigmaUphi_out4->Write();
1118  m_h2sigmaVphi_out4->Write();
1119  m_h2Mapglob_out4->Write();
1120  m_h2MaplocL1_out4->Write();
1121  m_h2MaplocL2_out4->Write();
1122 
1123  m_out5->cd();
1124  m_h1GlobalTime_out5->Write();
1125  m_h2Mapglob_out5->Write();
1126  m_h2MaplocL1_out5->Write();
1127  m_h2MaplocL2_out5->Write();
1128 
1129  m_ROIDir->cd();
1130  m_h1totArea->Write();
1131  m_h1okArea->Write();
1132  m_h1okROIs->Write();
1133  m_h1okROIfrac->Write();
1134  m_h1totROIs->Write();
1135  m_h1redFactor->Write();
1136  m_h1redFactor_L1->Write();
1137  m_h1redFactor_L2->Write();
1138 
1139 
1140  m_h2ROIbottomLeft->Write();
1141  m_h2ROItopRight->Write();
1142  m_h2ROIuMinMax->Write();
1143  m_h2ROIvMinMax->Write();
1144  m_rootFilePtr->Close();
1145 
1146  }
1147 
1148 }
1149 
static std::string relationName(const std::string &fromName, const std::string &toName, std::string const &namedRelation="")
Return storage name for a relation between two arrays of the given names.
Definition: DataStore.h:180
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:32
ROOT::Math::XYZVector getMomentum() const
Return momentum.
Definition: MCParticle.h:198
Base class for Modules.
Definition: Module.h:72
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:214
The PXD digit class.
Definition: PXDDigit.h:27
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
Definition: PXDIntercept.h:22
unsigned int n_pxdDigit
number of pxd digits
unsigned int nnotINtrack3[6]
number of tracks in bins of pt: no hit, wrong vxdID
TH1F * m_h1SigmaU_out4
distribution of sigmaU for PXDDigits not contained in a ROI
TGraphErrors * m_gEff
efficiency graph
TH1F * m_h1GlobalTime_out3
distribution of global time for PDXDigits not contained in a ROI
TH1F * m_h1GlobalTime_out4
distribution of global time for PDXDigits not contained in a ROI
TH1F * m_h1notINtrack5_nCDChits
denominator track pVal
TH1F * m_h1ResidU_out2
distribution of U resid for PXDDigits not contained in a ROI
void initialize() override final
Initializes the Module.
TH1F * m_h1INtrack1
track with no intercept
Int_t m_nSensorsL2
number of sensors on L2
unsigned int n_pxdDigitInROI
number of pxd digits in ROIs
TH1F * m_h1nnotINtrack2
tracks with lost digit: ROI exist with right vxdID
TH2F * m_h2sigmaVphi_out2
distribution of sigmaV VS phi for PDXDigits not contained in a ROI
TH1F * m_h1SigmaV_out4
distribution of sigmaV for PXDDigits not contained in a ROI
TH1F * m_h1redFactor_L1
distribution of number of ROIsreduction factor
TH2F * m_h2ResidUV_out3
distribution of V resid for PXDDigits not contained in a ROI
TH1F * m_h1ResidV
distribution of V resid for PXDDigits contained in a ROI
TH1F * m_h1nnotINtrack3
lost digit: ROI exist with wrong vxdID
TH1F * m_h1nnotINtrack5
lost digit: ROI does not exist, intercept with wrong vxdID
Int_t m_nSensorsL1
number of sensors on L1
TH1F * m_h1nnotINtrack4
lost digit: ROI does not exist, intercept with right vxdID
unsigned int n_notINdigit2
number of lost digits: no hit, correct vxdID
Double_t ptErr[6]
bin widths (transverse momentum)
unsigned int n_notINtrack4
number of tracks with no ROI (intercept with correct vxdID)
double m_coorUmc
true intercept U coordinate
unsigned int n_intercepts
number of PXDIntercepts
TH1F * m_h1redFactor_L2
distribution of number of ROIsreduction factor
TH1F * m_h1INtrack1_nCDChits
denominator track pVal
std::string m_recoTrackListName
RecoTrack list name.
TH1F * m_h1INtrack1_pt
track with no intercept pT
bool m_writeToRoot
if true, a rootFile named by m_rootFileName will be filled with info
TH1F * m_h1INtrack1_lambda
track with no intercept lambda
TH1F * m_h1SigmaV_out3
distribution of sigmaV for PXDDigits not contained in a ROI
TH1F * m_h1redFactor
distribution of number of ROIsreduction factor
unsigned int nnotINtrack2[6]
number of tracks in bins of pt: no hit, correct vxdID
TH1F * m_h1INtrack1_phi
track with no intercept phi
TH1F * m_h1PullV
distribution of V pulls for PDXDigits contained in a ROI
TH1F * m_h1ResidV_out2
distribution of V resid for PXDDigits not contained in a ROI
TH1F * m_h1Track_pVal
denominator track pVal
TH1F * m_h1PullU
distribution of U pulls for PDXDigits contained in a ROI
TH1F * m_h1okROIs
distribution of number of ROIs containin a PXDDigit
TH1F * m_h1Track_cosTheta
denominator track cosTheta
TH1F * m_h1INtrack1_nSVDhits
denominator track pVal
std::string m_PXDInterceptListName
Intercept list name.
unsigned int nnotINdigit3[6]
number of lost digits in bins of pt: no hit, wrong vxdID
unsigned int nnotINtrack4[6]
number of tracks in bins of pt: no ROI, intercepts with correct vxdID
unsigned int n_notINtrack2
number of tracks with no digits in ROI (correct vxdID)
TH1F * m_h1notINtrack5_phi
track with no intercept phi
unsigned int n_notINdigit3
number of lost digits: no hit, wrong vxdID
TH1F * m_h1Track_nCDChits
denominator track pVal
TH1F * m_h1digiOut5
lost digit: ROI does not exist, intercept with wrong vxdID
TH2F * m_h2ResidUV_out2
distribution of V resid for PXDDigits not contained in a ROI
TH1F * m_h1Track_lambda
denominator track lambda
unsigned int nnotINdigit4[6]
number of lost digits in bins of pt: no ROI, intercepts with correct vxdID
unsigned int nnotINdigit2[6]
number of lost digits in bins of pt: no hit, correct vxdID
TH1F * m_h1notINtrack5_lambda
track with no intercept lambda
unsigned int npxdDigit[6]
number of pxd digits in bins of pt
TGraphErrors * m_gEff2
efficiency graph
TH1F * m_h1totROIs
distribution of number of all ROIs
TH1F * m_h1TrackOneDigiIn
tracks with at least digit contained in ROI
TH2F * m_h2sigmaUphi_out2
distribution of sigmaU VS phi for PDXDigits not contained in a ROI
TH1F * m_h1ResidU_out3
distribution of U resid for PXDDigits not contained in a ROI
TH1F * m_h1okROIfrac
distribution of number of ROIsreduction factor
TH1F * m_h1digiOut4
lost digit: ROI does not exist, intercept with right vxdID
unsigned int nnotINtrack5[6]
number of tracks in bins of pt: no ROI, intercepts with wrong vxdID
unsigned int n_notINdigit5
number of lost digits: no ROI, intercepts with wrong vxdID
TH1F * m_h1GlobalTime
distribution of global time for PDXDigits contained in a ROI
TH2F * m_h2ROItopRight
u,v coordinates of the top right pixel
unsigned int NtrackHit
number of tracks with hits
TH1F * m_h1SigmaU_out2
distribution of sigmaU for PXDDigits not contained in a ROI
TH1F * m_h1notINtrack5_pVal
denominator track pVal
TH1F * m_h1effPerTrack
fraction of digits in ROI per track
void terminate() override final
Termination action.
TH1F * m_h1SigmaV
distribution of sigmaV for PXDDigits contained in a ROI
TH1F * m_h1digiOut2
lost digit: ROI exist with right vxdID
TH1F * m_h1GlobalTime_out2
distribution of global time for PDXDigits not contained in a ROI
TH1F * m_h1INtrack1_cosTheta
track with no intercept costheta
unsigned int n_tracksWithDigitsInROI
number of tracks with digits in ROI
TH2F * m_h2sigmaUphi_out4
distribution of sigmaU VS phi for PDXDigits not contained in a ROI
TH1F * m_h1RecoTracksPerParticle
number of RecoTracks per particle
TH1F * m_h1SigmaU
distribution of sigmaU for PXDDigits contained in a ROI
void event() override final
This method is called for each event.
TH1F * m_h1GlobalTime_out5
distribution of global time for PDXDigits not contained in a ROI
unsigned int Ntrack
number of tracks with pxd digits
unsigned int n_notINtrack5
number of tracks with no ROI (intercept with wrong vxdID)
TH1F * m_h1ResidV_out3
distribution of V resid for PXDDigits not contained in a ROI
unsigned int nnotINdigit5[6]
number of lost digits in bins of pt: no ROI, intercepts with wrong vxdID
unsigned int n_tracksWithDigits
number of tracks with digits
TH1F * m_h1Track_nSVDhits
denominator track pVal
unsigned int n_notINdigit4
number of lost digits: no ROI, intercepts with correct vxdID
TH1F * m_h1ResidU
distribution of U resid for PXDDigits contained in a ROI
TH2F * m_h2ResidUV
distribution of V resid for PXDDigits contained in a ROI
TH1F * m_h1notINtrack5_nSVDhits
denominator track pVal
double m_lambdamc
true lambda = pi/2 - theta
TH1F * m_h1INtrack1_pVal
denominator track pVal
TH2F * m_h2sigmaVphi_out3
distribution of sigmaV VS phi for PDXDigits not contained in a ROI
TH1F * m_h1notINtrack5_pt
track with no intercept pT
TH2F * m_h2sigmaVphi_out4
distribution of sigmaV VS phi for PDXDigits not contained in a ROI
double m_coorVmc
true intercept V coordinate
Double_t pt[6]
bin edges (in pt = transverse momentum)
TH1F * m_h1okArea
distribution of Area of ROIs containing a PXDDigit
unsigned int npxdDigitInROI[6]
number of pxd digits inside ROI in bins of pt
TH1F * m_h1notINtrack5
track with no intercept
StoreArray< PXDIntercept > m_PXDIntercepts
PXDIntercept StoreArray.
TH2F * m_h2sigmaUphi
distribution of sigmaU VS phi for PDXDigits contained in a ROI
TH2F * m_h2ROIbottomLeft
u,v coordinates of the bottom left pixel
TH1F * m_h1digiIn
digits contained in ROI histogram
TH2F * m_h2ROIvMinMax
v-coordinate Min vs Max
TH1F * m_h1SigmaV_out2
distribution of sigmaV for PXDDigits not contained in a ROI
TH1F * m_h1DigitsPerParticle
number of digits per particle
StoreArray< RecoTrack > m_recoTracks
RecoTrack StoreArray.
void beginRun() override final
Called when entering a new run.
TH1F * m_h1totArea
distribution of Area of all ROIs
TH2F * m_h2sigmaVphi
distribution of sigmaV VS phi for PDXDigits contained in a ROI
TH2F * m_h2sigmaUphi_out3
distribution of sigmaU VS phi for PDXDigits not contained in a ROI
TFile * m_rootFilePtr
pointer at root file used for storing infos for debugging and validating purposes
unsigned int TrackOneDigiIn[6]
number of tracks with one digit inside ROI in bins of pt
TH2F * m_h2ROIuMinMax
u-coordinate Min vs Max
StoreArray< MCParticle > m_MCParticles
MCParticle StoreArray.
unsigned int n_notINtrack3
number of tracks with no digits in ROI (wrong vxdID)
PXDROIFinderAnalysisModule()
Constructor of the module.
TH1F * m_h1SigmaU_out3
distribution of sigmaU for PXDDigits not contained in a ROI
TH1F * m_h1digiOut3
lost digit: ROI exist with wrong vxdID
StoreArray< ROIid > m_ROIs
ROIid StoreArray.
TH1F * m_h1notINtrack5_cosTheta
track with no intercept costheta
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
Definition: ROIid.h:25
bool Contains(const Belle2::PXDRawHit &thePXDRawHit) const
true if the ROI contains the thePXDRawHit
Definition: ROIid.cc:25
int getMaxVid() const
return the maximum V id of the ROI
Definition: ROIid.h:47
int getMinVid() const
return the minimum V id of the ROI
Definition: ROIid.h:46
int getMinUid() const
return the minimum U id of the ROI
Definition: ROIid.h:44
int getMaxUid() const
return the maximum U id of the ROI
Definition: ROIid.h:45
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation.
Definition: RelationIndex.h:76
index_from::const_iterator iterator_from
Element iterator of the from side index.
Definition: RelationIndex.h:95
range_from getElementsFrom(const FROM *from) const
Return a range of all elements pointing from the given object.
boost::iterator_range< iterator_from > range_from
Iterator range [first,second) of the from side.
Class for type safe access to objects that are referred to in relations.
size_t size() const
Get number of relations.
RelationVector< FROM > getRelationsFrom(const std::string &name="", const std::string &namedRelation="") const
Get the relations that point from another store array to this object.
RelationVector< T > getRelationsWith(const std::string &name="", const std::string &namedRelation="") const
Get the relations between this object and another store array.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:29
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
int getEntries() const
Get the number of objects in the array.
Definition: StoreArray.h:216
double getSigmaV() const
return the statistical error on the V coordinate of the intercept
Definition: VXDIntercept.h:62
double getCoorV() const
return the V coordinate of the intercept
Definition: VXDIntercept.h:60
double getSigmaU() const
return the statistical error on the U coordinate of the intercept
Definition: VXDIntercept.h:61
VxdID::baseType getSensorID() const
return the sensor ID
Definition: VXDIntercept.h:66
double getCoorU() const
return the U coordinate of the intercept
Definition: VXDIntercept.h:59
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
Definition: GeoCache.h:39
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
Definition: GeoCache.cc:176
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
Definition: GeoCache.cc:67
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
Definition: GeoCache.cc:204
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
Definition: GeoCache.cc:193
Base class to provide Sensor Information for PXD and SVD.
double getVCellPosition(int vID) const
Return the position of a specific strip/pixel in v direction.
double getUCellPosition(int uID, int vID=-1) const
Return the position of a specific strip/pixel in u direction.
ROOT::Math::XYZVector pointToGlobal(const ROOT::Math::XYZVector &local, bool reco=false) const
Convert a point from local to global coordinates.
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:100
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:96
REG_MODULE(arichBtest)
Register the Module.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition: Module.h:560
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.