11 #include <tracking/modules/pxdDataReduction/PXDROIFinderAnalysisModule.h>
12 #include <framework/datastore/StoreArray.h>
13 #include <framework/datastore/RelationArray.h>
14 #include <framework/datastore/RelationIndex.h>
16 #include <mdst/dataobjects/MCParticle.h>
17 #include <svd/dataobjects/SVDCluster.h>
18 #include <pxd/dataobjects/PXDDigit.h>
19 #include <pxd/dataobjects/PXDTrueHit.h>
20 #include <tracking/dataobjects/RecoTrack.h>
21 #include <tracking/dataobjects/ROIid.h>
22 #include <tracking/dataobjects/PXDIntercept.h>
25 #include <vxd/geometry/GeoCache.h>
41 , m_writeToRoot(false)
79 , n_tracksWithDigits(0)
80 , n_tracksWithDigitsInROI(0)
105 setDescription(
"This module performs the analysis of the PXDROIFinder module output");
107 addParam(
"writeToRoot", m_writeToRoot,
108 "set true if you want to save the informations in a root file named by parameter 'rootFileName'",
bool(
true));
110 addParam(
"rootFileName", m_rootFileName,
111 "fileName used for . Will be ignored if parameter 'writeToRoot' is false (standard)",
112 string(
"pxdDataRedAnalysis"));
114 addParam(
"recoTrackListName", m_recoTrackListName,
115 "name of the input collection of RecoTracks", std::string(
""));
117 addParam(
"PXDInterceptListName", m_PXDInterceptListName,
118 "name of the list of interceptions", std::string(
""));
120 addParam(
"ROIListName", m_ROIListName,
121 "name of the list of ROIs", std::string(
""));
127 void PXDROIFinderAnalysisModule::initialize()
131 recoTracks.isRequired(m_recoTrackListName);
134 roiIDs.isRequired(m_ROIListName);
137 pxdIntercepts.isRequired(m_PXDInterceptListName);
140 mcParticles.isRequired();
148 n_tracksWithDigits = 0;
149 n_tracksWithDigitsInROI = 0;
156 for (
int i = 0; i < 6; i++) {
158 npxdDigitInROI[i] = 0;
161 if (m_writeToRoot ==
true) {
162 m_rootFileName +=
".root";
163 m_rootFilePtr =
new TFile(m_rootFileName.c_str(),
"RECREATE");
165 m_rootFilePtr = NULL;
168 m_h1GlobalTime =
new TH1F(
"hGlobalTime",
"global time for PXDDigits contained in ROI", 100, 0, 1);
169 m_h1PullU =
new TH1F(
"hPullU",
"U pulls for PXDDigits contained in ROI", 100, -6, 6);
170 m_h1PullV =
new TH1F(
"hPullV",
"V pulls for PXDDigits contained in ROI", 100, -6, 6);
171 m_h2sigmaUphi =
new TH2F(
"hsigmaUvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.35);
172 m_h2sigmaVphi =
new TH2F(
"hsigmaVvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.4);
173 m_h1ResidU =
new TH1F(
"hResidU",
"U resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
174 m_h1ResidV =
new TH1F(
"hResidV",
"V resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
175 m_h2ResidUV =
new TH2F(
"hResidUV",
"U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
176 m_h1SigmaU =
new TH1F(
"hSigmaU",
"sigmaU for PXDDigits contained in ROI", 100, 0, 0.35);
177 m_h1SigmaV =
new TH1F(
"hSigmaV",
"sigmaV for PXDDigits contained in ROI", 100, 0, 0.35);
178 m_h2Mapglob =
new TH2F(
"h2Mapglob",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
179 m_h2MaplocL1 =
new TH2F(
"h2MaplocL1",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
180 m_h2MaplocL2 =
new TH2F(
"h2MaplocL2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
181 m_h2MaplocL1->GetXaxis()->SetTitle(
"v ID");
182 m_h2MaplocL1->GetYaxis()->SetTitle(
"u ID");
183 m_h2MaplocL2->GetXaxis()->SetTitle(
"v ID");
184 m_h2MaplocL2->GetYaxis()->SetTitle(
"u ID");
187 m_h1GlobalTime_out2 =
new TH1F(
"hGlobalTime_out2",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
188 m_h2sigmaUphi_out2 =
new TH2F(
"hsigmaUvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
189 m_h2sigmaVphi_out2 =
new TH2F(
"hsigmaVvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
190 m_h1ResidU_out2 =
new TH1F(
"hResidU_out2",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
191 m_h1ResidV_out2 =
new TH1F(
"hResidV_out2",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
192 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);
193 m_h1SigmaU_out2 =
new TH1F(
"hSigmaU_out2",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
194 m_h1SigmaV_out2 =
new TH1F(
"hSigmaV_out2",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
195 m_h2Mapglob_out2 =
new TH2F(
"h2Mapglob_out2",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
196 m_h2MaplocL1_out2 =
new TH2F(
"h2MaplocL1_out2",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
197 m_h2MaplocL2_out2 =
new TH2F(
"h2MaplocL2_out2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
200 m_h1GlobalTime_out3 =
new TH1F(
"hGlobalTime_out3",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
201 m_h2sigmaUphi_out3 =
new TH2F(
"hsigmaUvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
202 m_h2sigmaVphi_out3 =
new TH2F(
"hsigmaVvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
203 m_h1ResidU_out3 =
new TH1F(
"hResidU_out3",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
204 m_h1ResidV_out3 =
new TH1F(
"hResidV_out3",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
205 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);
206 m_h1SigmaU_out3 =
new TH1F(
"hSigmaU_out3",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
207 m_h1SigmaV_out3 =
new TH1F(
"hSigmaV_out3",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
209 m_h2Mapglob_out3 =
new TH2F(
"h2Mapglob_out3",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
210 m_h2MaplocL1_out3 =
new TH2F(
"h2MaplocL1_out3",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
211 m_h2MaplocL2_out3 =
new TH2F(
"h2MaplocL2_out3",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
214 m_h1GlobalTime_out4 =
new TH1F(
"hGlobalTime_out4",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
215 m_h2sigmaUphi_out4 =
new TH2F(
"hsigmaUvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
216 m_h2sigmaVphi_out4 =
new TH2F(
"hsigmaVvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
217 m_h1SigmaU_out4 =
new TH1F(
"hSigmaU_out4",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
218 m_h1SigmaV_out4 =
new TH1F(
"hSigmaV_out4",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
220 m_h2Mapglob_out4 =
new TH2F(
"h2Mapglob_out4",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
221 m_h2MaplocL1_out4 =
new TH2F(
"h2MaplocL1_out4",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
222 m_h2MaplocL2_out4 =
new TH2F(
"h2MaplocL2_out4",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
225 m_h1GlobalTime_out5 =
new TH1F(
"hGlobalTime_out5",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
227 m_h2Mapglob_out5 =
new TH2F(
"h2Mapglob_out5",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
228 m_h2MaplocL1_out5 =
new TH2F(
"h2MaplocL1_out5",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
229 m_h2MaplocL2_out5 =
new TH2F(
"h2MaplocL2_out5",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
232 m_h1redFactor =
new TH1F(
"hRedFactor",
"L1+L2reduction factor", 1000, 0, 1);
233 m_h1redFactor_L1 =
new TH1F(
"hRedFactor_L1",
"L1-only reduction factor", 1000, 0, 1);
234 m_h1redFactor_L2 =
new TH1F(
"hRedFactor_L2",
"L2-only reduction factor", 1000, 0, 1);
236 m_h1totROIs =
new TH1F(
"h1TotNROIs",
"number of all ROIs", 110, 0, 110);
237 m_h1okROIs =
new TH1F(
"h1OkNROIs",
"number of all ROIs containing a PXDDigit", 110, 0, 110);
238 m_h1okROIfrac =
new TH1F(
"h1OkNROIfrac",
"fraction of ROIs containing a PXDDigit", 100, 0, 1);
240 m_h1totArea =
new TH1F(
"h1TotArea",
"Area of all ROIs", 100, 0, 2500000);
241 m_h1okArea =
new TH1F(
"h1OkArea",
"Area of ROIs containing a PXDDigit", 100, 0, 75000);
245 m_h1effPerTrack =
new TH1F(
"heffPerTrack",
"fraction of digits in ROI per track", 100, -0.02, 1.02);
249 m_h2ROIbottomLeft =
new TH2F(
"h2ROIbottomLeft",
"u,v ID of the bottom left pixel", 650, -200, 450, 1300, -300, 1000);
250 m_h2ROItopRight =
new TH2F(
"h2ROItopRight",
"u,v ID of the top right pixel", 650, -200, 450, 1300, -300, 1000);
252 m_h2ROIuMinMax =
new TH2F(
"h2ROIuMinMax",
"u Min vs Max", 650, -200, 450, 650, -200, 450);
253 m_h2ROIvMinMax =
new TH2F(
"h2ROIvMinMax",
"v Min vs Max", 1300, -300, 1000, 1300, -300, 1000);
256 m_h1DigitsPerParticle =
new TH1F(
"h1DigitsPerPart",
"Number of PXDDigits per Particle", 50, 0, 50);
257 m_h1RecoTracksPerParticle =
new TH1F(
"h1RecoTracksPerPart",
"Number of RecoTracks per Particle", 10, 0, 10);
261 Double_t lowBin[6 + 1];
262 for (
int i = 0; i < 6; i++)
263 lowBin[i] = pt[i] - ptErr[i];
264 lowBin[6] = pt[5] + ptErr[5];
266 m_h1TrackOneDigiIn =
new TH1F(
"hTracksDigiIn",
"Tracks with at least one digit contained in a ROI", 6, lowBin);
267 m_h1nnotINtrack2 =
new TH1F(
"h1outROITrack",
"Tracks with ROI with correct VxdID but no digits inside ROI", 6, lowBin);
268 m_h1nnotINtrack3 =
new TH1F(
"h1noROITrack",
"Tracks with ROI with wrong VxdID but no digits inside ROI", 6, lowBin);
269 m_h1nnotINtrack4 =
new TH1F(
"h1wrongVxdIDTrack",
"Tracks with no ROI, Intercept with correct VxdID", 6, lowBin);
270 m_h1nnotINtrack5 =
new TH1F(
"h1noInterTrack",
"Tracks with no Intercept matching a VxdID of digits", 6, lowBin);
272 m_h1notINtrack5 =
new TH1F(
"hNoInterTrack",
"track with no intercepts", 20, 0, 20);
273 m_h1notINtrack5_pt =
new TH1F(
"hNoInterTrack_pT",
"track with no intercepts", 100, 0, 6);
274 m_h1notINtrack5_phi =
new TH1F(
"h1NoInterTrack_phi",
"hNoInterTrack_phi", 100, -180, 180);
275 m_h1notINtrack5_lambda =
new TH1F(
"h1NoInterTrack_lambda",
"hNoInterTrack_lambda", 100, -180, 180);
276 m_h1notINtrack5_cosTheta =
new TH1F(
"h1NoInterTrack_cosTheta",
"hNoInterTrack_cosTheta", 100, -1, 1);
277 m_h1notINtrack5_pVal =
new TH1F(
"hNoInterTrack_pVal",
"track with no intercepts", 100, 0, 1);
278 m_h1notINtrack5_nSVDhits =
new TH1F(
"hNoInterTrack_nSVDhits",
"track with no intercepts", 50, 0, 50);
279 m_h1notINtrack5_nCDChits =
new TH1F(
"hNoInterTrack_nCDChits",
"track with no intercepts", 100, 0, 100);
281 m_h1INtrack1 =
new TH1F(
"hINTrack",
"track with at least one digit inside ROI", 20, 0, 20);
282 m_h1INtrack1_pt =
new TH1F(
"hINTrack_pT",
"track with at least one digit inside ROI", 100, 0, 6);
283 m_h1INtrack1_phi =
new TH1F(
"h1INTrack_phi",
"hINTrack_phi", 100, -180, 180);
284 m_h1INtrack1_lambda =
new TH1F(
"h1INTrack_lambda",
"hINTrack_lambda", 100, -180, 180);
285 m_h1INtrack1_cosTheta =
new TH1F(
"h1INTrack_cosTheta",
"hINTrack_cosTheta", 100, -1, 1);
286 m_h1INtrack1_pVal =
new TH1F(
"h1INTrack_pVal",
"track with no intercepts", 100, 0, 1);
287 m_h1INtrack1_nSVDhits =
new TH1F(
"h1INTrack_nSVDhits",
"track with no intercepts", 50, 0, 50);
288 m_h1INtrack1_nCDChits =
new TH1F(
"h1INTrack_nCDChits",
"track with no intercepts", 100, 0, 100);
290 m_h1Track =
new TH1F(
"hTrack",
"all tracks", 20, 0, 20);
291 m_h1Track_pt =
new TH1F(
"hTrack_pT",
"all tracks with digits", 100, 0, 6);
292 m_h1Track_lambda =
new TH1F(
"h1Track_lambda",
"hTrack_lambda", 100, -180, 180);
293 m_h1Track_phi =
new TH1F(
"h1Track_phi",
"hTrack_phi", 100, -180, 180);
294 m_h1Track_cosTheta =
new TH1F(
"h1Track_cosTheta",
"hTrack_cos theta", 100, -1, 1);
295 m_h1Track_pVal =
new TH1F(
"h1Track_pVal",
"track with no intercepts", 100, 0, 1);
296 m_h1Track_nSVDhits =
new TH1F(
"h1Track_nSVDhits",
"track with no intercepts", 50, 0, 50);
297 m_h1Track_nCDChits =
new TH1F(
"h1Track_nCDChits",
"track with no intercepts", 100, 0, 100);
299 m_h1digiIn =
new TH1F(
"hdigiIn",
"digits inside ROI", 6, lowBin);
300 m_h1digiOut2 =
new TH1F(
"hdigiOut2",
"ROI exists with with correct VxdID but no digits inside ROI", 6, lowBin);
301 m_h1digiOut3 =
new TH1F(
"hdigiOut3",
"ROI exists with with wrong VxdID", 6, lowBin);
302 m_h1digiOut4 =
new TH1F(
"hdigiOut4",
"ROI does not exist, but intercept has correct VxdID", 6, lowBin);
303 m_h1digiOut5 =
new TH1F(
"hdigiOut5",
"no ROI, no Intercpets with correct VXDid", 6, lowBin);
312 void PXDROIFinderAnalysisModule::beginRun()
318 std::set<Belle2::VxdID> pxdLayers = aGeometry.
getLayers(VXD::SensorInfoBase::PXD);
319 std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
321 while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
323 std::set<Belle2::VxdID> pxdLadders = aGeometry.
getLadders(*itPxdLayers);
324 std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
326 while (itPxdLadders != pxdLadders.end()) {
328 std::set<Belle2::VxdID> pxdSensors = aGeometry.
getSensors(*itPxdLadders);
329 std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
331 while (itPxdSensors != pxdSensors.end()) {
333 if (itPxdLadders->getLayerNumber() == 1)
335 if (itPxdLadders->getLayerNumber() == 2)
349 void PXDROIFinderAnalysisModule::event()
357 relDigitTrueHit(DataStore::relationName(DataStore::arrayName<PXDDigit>(
""),
358 DataStore::arrayName<PXDTrueHit>(
"")));
360 recoTrackToPXDIntercept(DataStore::relationName(m_recoTrackListName, m_PXDInterceptListName));
362 double tmpGlobalTime;
368 B2DEBUG(1,
" ++++++++++++++ PXDROIFinderAnalysisModule");
382 for (
int i = 0; i < (int)ROIList.
getEntries(); i++) {
384 m_h2ROIbottomLeft->Fill(ROIList[i]->getMinUid(), ROIList[i]->getMinVid());
385 m_h2ROItopRight->Fill(ROIList[i]->getMaxUid(), ROIList[i]->getMaxVid());
386 m_h2ROIuMinMax->Fill(ROIList[i]->getMinUid(), ROIList[i]->getMaxUid());
387 m_h2ROIvMinMax->Fill(ROIList[i]->getMinVid(), ROIList[i]->getMaxVid());
388 int tmpArea = (ROIList[i]->getMaxUid() - ROIList[i]->getMinUid()) * (ROIList[i]->getMaxVid() - ROIList[i]->getMinVid());
389 if ((ROIList[i]->getSensorID()).getLayerNumber() == 1)
390 totArea_L1 += tmpArea;
392 totArea_L2 += tmpArea;
396 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
404 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++)
405 if (ROIList[i]->Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
413 m_h1totArea->Fill(totArea_L1 + totArea_L2);
414 double redFactor_L1 = totArea_L1 / 768. / 250. / m_nSensorsL1;
415 double redFactor_L2 = totArea_L2 / 768. / 250. / m_nSensorsL2;
416 m_h1redFactor->Fill((
double)(totArea_L1 + totArea_L2) / 768. / 250. / (m_nSensorsL1 + m_nSensorsL2));
417 m_h1redFactor_L1->Fill((
double) redFactor_L1);
418 m_h1redFactor_L2->Fill((
double) redFactor_L2);
429 n_intercepts += PXDInterceptList.
getEntries();
431 Int_t n_NoInterceptTracks = 0;
437 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
445 m_h1DigitsPerParticle->Fill(pxdDigits_MCParticle.
size());
446 if (pxdDigits_MCParticle.
size() == 0)
451 m_h1RecoTracksPerParticle->Fill(recoTracks_MCParticle.size());
452 if (recoTracks_MCParticle.size() == 0)
459 B2DEBUG(1,
"Number of RecoTracks = " << recoTracks_MCParticle.size() <<
" and PXDDigits = " << pxdDigits_MCParticle.
size() <<
460 " related to this MCParticle");
466 m_phimc = (aMcParticle->
getMomentum()).Phi() * 180 / 3.1415;
467 m_thetamc = (aMcParticle->
getMomentum()).Theta() * 180 / 3.1415;
468 m_costhetamc = (aMcParticle->
getMomentum()).CosTheta();
469 m_lambdamc = 90 - m_thetamc;
484 bool part_outsideROI =
false;
485 bool part_noROI =
false;
486 bool part_wrongVxdID =
false;
487 bool part_noInter =
false;
488 bool hasOneDigitInROI =
false;
492 Int_t nDigitsInRoiPerTrack = 0;
493 Int_t nDigitsPerTrack = 0;
496 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++) {
498 bool hasIntercept =
false;
500 bool interceptRightVxdID =
false;
501 bool MissingHit =
true;
506 PXDTrueHitFromPXDDigit PXDTrueHits = relDigitTrueHit.
getElementsFrom(*pxdDigits_MCParticle[iPXDDigit]);
507 PXDTrueHitIteratorType thePXDTrueHitIterator = PXDTrueHits.begin();
508 PXDTrueHitIteratorType thePXDTrueHitIteratorEnd = PXDTrueHits.end();
512 for (; thePXDTrueHitIterator != thePXDTrueHitIteratorEnd; thePXDTrueHitIterator++) {
513 tmpGlobalTime = tmpGlobalTime + thePXDTrueHitIterator->to->getGlobalTime();
516 m_globalTime = tmpGlobalTime / tmpNGlobalTime;
519 m_Uidmc = pxdDigits_MCParticle[iPXDDigit]->getUCellID();
520 m_Vidmc = pxdDigits_MCParticle[iPXDDigit]->getVCellID();
521 m_vxdIDmc = pxdDigits_MCParticle[iPXDDigit]->getSensorID();
527 v2 = -(767 - m_Vidmc);
539 TVector3 local(m_coorUmc, m_coorVmc, 0);
540 TVector3 globalSensorPos = aSensorInfo.
pointToGlobal(local,
true);
543 if (m_pTmc > 1) npxdDigit[5]++;
544 if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigit[4]++;
545 if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigit[3]++;
546 if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigit[2]++;
547 if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigit[1]++;
548 if (m_pTmc <= 0.1) npxdDigit[0]++;
551 for (
int i = 0; i < (int)recoTracks_MCParticle.size(); i++) {
553 PXDInterceptsFromRecoTracks PXDIntercepts = recoTrackToPXDIntercept.
getElementsFrom(recoTracks_MCParticle[i]);
555 PXDInterceptIteratorType thePXDInterceptIterator = PXDIntercepts.begin();
556 PXDInterceptIteratorType thePXDInterceptIteratorEnd = PXDIntercepts.end();
559 for (; thePXDInterceptIterator != thePXDInterceptIteratorEnd; thePXDInterceptIterator++) {
561 const PXDIntercept* theIntercept = thePXDInterceptIterator->to;
567 m_coorU = theIntercept->getCoorU();
568 m_coorV = theIntercept->getCoorV();
569 m_sigmaU = theIntercept->getSigmaU();
570 m_sigmaV = theIntercept->getSigmaV();
571 m_vxdID = theIntercept->getSensorID();
573 if (m_vxdID == m_vxdIDmc)
574 interceptRightVxdID =
true;
584 tmpArea = (theROIid->getMaxUid() - theROIid->getMinUid()) * (theROIid->getMaxVid() - theROIid->getMinVid());
586 if (theROIid->
Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
589 nDigitsInRoiPerTrack++;
591 m_h1GlobalTime->Fill(m_globalTime);
592 m_h1PullU->Fill((m_coorU - m_coorUmc) / m_sigmaU);
593 m_h1PullV->Fill((m_coorV - m_coorVmc) / m_sigmaV);
594 m_h1ResidU->Fill(m_coorU - m_coorUmc);
595 m_h1ResidV->Fill(m_coorV - m_coorVmc);
596 m_h2ResidUV->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
597 m_h2sigmaUphi->Fill(m_phimc, m_sigmaU);
598 m_h2sigmaVphi->Fill(m_phimc, m_sigmaV);
599 m_h1SigmaU->Fill(m_sigmaU);
600 m_h1SigmaV->Fill(m_sigmaV);
601 m_h2Mapglob->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
605 m_h2MaplocL1->Fill(v2, u2);
607 m_h2MaplocL2->Fill(v2, u2);
610 m_h1okArea->Fill(tmpArea);
612 okArea_L1 = okArea_L1 + tmpArea;
614 okArea_L2 = okArea_L2 + tmpArea;
617 hasOneDigitInROI =
true;
620 if (m_pTmc > 1) npxdDigitInROI[5]++;
621 if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigitInROI[4]++;
622 if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigitInROI[3]++;
623 if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigitInROI[2]++;
624 if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigitInROI[1]++;
625 if (m_pTmc <= 0.1) npxdDigitInROI[0]++;
645 if (hasROI && hasIntercept && interceptRightVxdID) {
646 part_outsideROI =
true;
650 m_h1GlobalTime_out2->Fill(m_globalTime);
651 m_h1ResidU_out2->Fill(m_coorU - m_coorUmc);
652 m_h1ResidV_out2->Fill(m_coorV - m_coorVmc);
653 m_h2ResidUV_out2->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
654 m_h2sigmaUphi_out2->Fill(m_phimc, m_sigmaU);
655 m_h2sigmaVphi_out2->Fill(m_phimc, m_sigmaV);
656 m_h1SigmaU_out2->Fill(m_sigmaU);
657 m_h1SigmaV_out2->Fill(m_sigmaV);
658 m_h2Mapglob_out2->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
660 m_h2MaplocL1_out2->Fill(v2, u2);
662 m_h2MaplocL2_out2->Fill(v2, u2);
664 if (m_pTmc > 1) nnotINdigit2[5]++;
665 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit2[4]++;
666 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit2[3]++;
667 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit2[2]++;
668 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit2[1]++;
669 if (m_pTmc <= 0.1) nnotINdigit2[0]++;
671 }
else if (!hasROI && hasIntercept && interceptRightVxdID) {
676 m_h1GlobalTime_out3->Fill(m_globalTime);
677 m_h1ResidU_out3->Fill(m_coorU - m_coorUmc);
678 m_h1ResidV_out3->Fill(m_coorV - m_coorVmc);
679 m_h2ResidUV_out3->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
680 m_h2sigmaUphi_out3->Fill(m_phimc, m_sigmaU);
681 m_h2sigmaVphi_out3->Fill(m_phimc, m_sigmaV);
682 m_h1SigmaU_out3->Fill(m_sigmaU);
683 m_h1SigmaV_out3->Fill(m_sigmaV);
684 m_h2Mapglob_out3->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
686 m_h2MaplocL1_out3->Fill(v2, u2);
689 m_h2MaplocL2_out3->Fill(v2, u2);
692 if (m_pTmc > 1) nnotINdigit3[5]++;
693 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit3[4]++;
694 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit3[3]++;
695 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit3[2]++;
696 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit3[1]++;
697 if (m_pTmc <= 0.1) nnotINdigit3[0]++;
699 }
else if (hasIntercept && !interceptRightVxdID) {
700 part_wrongVxdID =
true;
704 m_h1GlobalTime_out4->Fill(m_globalTime);
705 m_h2sigmaUphi_out4->Fill(m_phimc, m_sigmaU);
706 m_h2sigmaVphi_out4->Fill(m_phimc, m_sigmaV);
707 m_h1SigmaU_out4->Fill(m_sigmaU);
708 m_h1SigmaV_out4->Fill(m_sigmaV);
709 m_h2Mapglob_out4->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
711 m_h2MaplocL1_out4->Fill(v2, u2);
713 m_h2MaplocL2_out4->Fill(v2, u2);
715 if (m_pTmc > 1) nnotINdigit4[5]++;
716 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit4[4]++;
717 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit4[3]++;
718 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit4[2]++;
719 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit4[1]++;
720 if (m_pTmc <= 0.1) nnotINdigit4[0]++;
722 }
else if (!hasIntercept) {
727 m_h1GlobalTime_out5->Fill(m_globalTime);
728 m_h2Mapglob_out5->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
730 m_h2MaplocL1_out5->Fill(v2, u2);
732 m_h2MaplocL2_out5->Fill(v2, u2);
734 if (m_pTmc > 1) nnotINdigit5[5]++;
735 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit5[4]++;
736 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit5[3]++;
737 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit5[2]++;
738 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit5[1]++;
739 if (m_pTmc <= 0.1) nnotINdigit5[0]++;
744 m_h1effPerTrack->Fill((
float) nDigitsInRoiPerTrack / nDigitsPerTrack);
745 m_h1Track_pt->Fill(m_pTmc);
746 m_h1Track_phi->Fill(m_phimc);
747 m_h1Track_lambda->Fill(m_lambdamc);
748 m_h1Track_cosTheta->Fill(m_costhetamc);
750 if (hasOneDigitInROI) {
752 if (m_pTmc > 1) TrackOneDigiIn[5]++;
753 if (m_pTmc <= 1 && m_pTmc > 0.5) TrackOneDigiIn[4]++;
754 if (m_pTmc <= 0.5 && m_pTmc > 0.3) TrackOneDigiIn[3]++;
755 if (m_pTmc <= 0.3 && m_pTmc > 0.2) TrackOneDigiIn[2]++;
756 if (m_pTmc <= 0.2 && m_pTmc > 0.1) TrackOneDigiIn[1]++;
757 if (m_pTmc <= 0.1) TrackOneDigiIn[0]++;
759 m_h1INtrack1_pt->Fill(m_pTmc);
760 m_h1INtrack1_phi->Fill(m_phimc);
761 m_h1INtrack1_lambda->Fill(m_lambdamc);
762 m_h1INtrack1_cosTheta->Fill(m_costhetamc);
763 }
else if (part_outsideROI) {
765 if (m_pTmc > 1) nnotINtrack2[5]++;
766 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack2[4]++;
767 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack2[3]++;
768 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack2[2]++;
769 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack2[1]++;
770 if (m_pTmc <= 0.1) nnotINtrack2[0]++;
771 }
else if (part_noROI) {
773 if (m_pTmc > 1) nnotINtrack3[5]++;
774 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack3[4]++;
775 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack3[3]++;
776 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack3[2]++;
777 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack3[1]++;
778 if (m_pTmc <= 0.1) nnotINtrack3[0]++;
779 }
else if (part_wrongVxdID) {
781 if (m_pTmc > 1) nnotINtrack4[5]++;
782 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack4[4]++;
783 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack4[3]++;
784 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack4[2]++;
785 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack4[1]++;
786 if (m_pTmc <= 0.1) nnotINtrack4[0]++;
787 }
else if (part_noInter) {
789 if (m_pTmc > 1) nnotINtrack5[5]++;
790 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack5[4]++;
791 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack5[3]++;
792 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack5[2]++;
793 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack5[1]++;
794 if (m_pTmc <= 0.1) nnotINtrack5[0]++;
796 n_NoInterceptTracks++;
797 m_h1notINtrack5_phi->Fill(m_phimc);
798 m_h1notINtrack5_lambda->Fill(m_lambdamc);
799 m_h1notINtrack5_cosTheta->Fill(m_costhetamc);
800 m_h1notINtrack5_pt->Fill(m_pTmc);
806 m_h1notINtrack5->Fill(n_NoInterceptTracks);
807 m_h1Track->Fill(Ntrack);
808 m_h1INtrack1->Fill(NtrackHit);
810 n_tracksWithDigits += Ntrack;
811 n_tracksWithDigitsInROI += NtrackHit;
814 B2RESULT(
" o PXDROIFinder ANALYSIS: tot ROIs = " << ROIList.
getEntries() <<
", ok ROIs = " << nROIs);
815 B2RESULT(
" o : NtrackHit/Ntrack = " << NtrackHit <<
"/ " << Ntrack <<
" = " <<
816 (
double)NtrackHit / Ntrack);
817 if (nROIs > ROIList.
getEntries()) B2RESULT(
" HOUSTON WE HAVE A PROBLEM!");
819 m_h1okROIs->Fill(nROIs);
820 m_h1okROIfrac->Fill(1.*nROIs / ROIList.
getEntries());
827 void PXDROIFinderAnalysisModule::terminate()
831 Double_t epsilonErr[6];
832 double epsilonTot = (double)n_pxdDigitInROI / (
double) n_pxdDigit;
833 Double_t epsilon2[6];
834 Double_t epsilon2Err[6];
835 double epsilon2Tot = (double)n_tracksWithDigitsInROI / (
double) n_tracksWithDigits;
837 for (
int i = 0; i < 6; i++) {
838 m_h1digiOut2->SetBinContent(i + 1, nnotINdigit2[i]);
839 m_h1digiOut3->SetBinContent(i + 1, nnotINdigit3[i]);
840 m_h1digiOut4->SetBinContent(i + 1, nnotINdigit4[i]);
841 m_h1digiOut5->SetBinContent(i + 1, nnotINdigit5[i]);
842 m_h1digiIn->SetBinContent(i + 1, npxdDigitInROI[i]);
845 for (
int i = 0; i < 6; i++) {
846 m_h1nnotINtrack2->SetBinContent(i + 1, nnotINtrack2[i]);
847 m_h1nnotINtrack3->SetBinContent(i + 1, nnotINtrack3[i]);
848 m_h1nnotINtrack4->SetBinContent(i + 1, nnotINtrack4[i]);
849 m_h1nnotINtrack5->SetBinContent(i + 1, nnotINtrack5[i]);
850 m_h1TrackOneDigiIn->SetBinContent(i + 1, TrackOneDigiIn[i]);
853 B2RESULT(
" ROI Analysis Summary ");
854 B2RESULT(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
856 B2RESULT(
" number of tracks = " << n_tracks);
857 B2RESULT(
" number of Intercepts = " << n_intercepts);
858 B2RESULT(
" number of ROIs = " << n_rois);
860 B2RESULT(
" average number of ROIs = " << m_h1totROIs->GetMean() <<
", average area " << m_h1totArea->GetMean() <<
861 " (not excluding overlaps!)");
862 B2RESULT(
" average number of ROIs w digits = " << m_h1okROIs->GetMean() <<
", average tot area " << m_h1okArea->GetMean());
864 B2RESULT(
" red Factor = " << m_h1redFactor->GetMean() <<
", RMS = " << m_h1redFactor->GetRMS());
866 B2RESULT(
"tracks w digits: " << n_tracksWithDigits);
867 B2RESULT(
"tracks w digits in ROI: " << n_tracksWithDigitsInROI);
868 B2RESULT(
"efficiency PTD : " << epsilon2Tot <<
" +/- " << sqrt(epsilon2Tot * (1 - epsilon2Tot) / n_tracksWithDigits));
870 Int_t totTrackOneDigiIn = 0;
871 Int_t totnnotINtrack2 = 0;
872 Int_t totnnotINtrack3 = 0;
873 Int_t totnnotINtrack4 = 0;
874 Int_t totnnotINtrack5 = 0;
878 for (
int j = 0; j < m_h1TrackOneDigiIn->GetNbinsX(); j++) {
879 totTrackOneDigiIn = totTrackOneDigiIn + m_h1TrackOneDigiIn->GetBinContent(j + 1);
880 totnnotINtrack2 = totnnotINtrack2 + m_h1nnotINtrack2->GetBinContent(j + 1);
881 totnnotINtrack3 = totnnotINtrack3 + m_h1nnotINtrack3->GetBinContent(j + 1);
882 totnnotINtrack4 = totnnotINtrack4 + m_h1nnotINtrack4->GetBinContent(j + 1);
883 totnnotINtrack5 = totnnotINtrack5 + m_h1nnotINtrack5->GetBinContent(j + 1);
885 totTrack[j] = m_h1nnotINtrack5->GetBinContent(j + 1) + m_h1nnotINtrack4->GetBinContent(j + 1) + m_h1nnotINtrack3->GetBinContent(
886 j + 1) + m_h1nnotINtrack2->GetBinContent(j + 1) + m_h1TrackOneDigiIn->GetBinContent(j + 1);
889 B2RESULT(
" out ROI = " << totnnotINtrack2);
890 B2RESULT(
" no ROI = " << totnnotINtrack3);
891 B2RESULT(
" wrongVxdID = " << totnnotINtrack4);
892 B2RESULT(
" no Inter = " << totnnotINtrack5);
895 B2RESULT(
" pxdDigit : " << n_pxdDigit);
896 B2RESULT(
" pxdDigitIn : " << n_pxdDigitInROI);
898 B2RESULT(
" eff DGT: " << epsilonTot <<
" +/- " << sqrt(epsilonTot * (1 - epsilonTot) / n_pxdDigit));
899 B2RESULT(
" inefficiency (PXDDigits): ");
900 B2RESULT(
" out ROI: " << n_notINdigit2);
901 B2RESULT(
" no ROI: " << n_notINdigit3);
902 B2RESULT(
" wrongVxdID: " << n_notINdigit4);
903 B2RESULT(
" noInter: " << n_notINdigit5);
907 B2RESULT(
" pT > 1 : " << pt[5]);
908 B2RESULT(
" out ROI: " << nnotINdigit2[5]);
909 B2RESULT(
" no ROI: " << nnotINdigit3[5]);
910 B2RESULT(
" wrongVxdID: " << nnotINdigit4[5]);
911 B2RESULT(
" noInter: " << nnotINdigit5[5]);
912 B2RESULT(
" pxdDigit : " << npxdDigit[5]);
913 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[5]);
914 if ((npxdDigit[5] - npxdDigitInROI[5]) != (nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] + nnotINdigit5[5]))
915 B2RESULT(
" pxdDigitOut : " << npxdDigit[5] - npxdDigitInROI[5] <<
" != " << nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] +
917 epsilon[5] = (double)npxdDigitInROI[5] / (
double) npxdDigit[5];
918 epsilonErr[5] = sqrt(epsilon[5] * (1 - epsilon[5]) / npxdDigit[5]);
919 B2RESULT(
" efficiency : " << epsilon[5] <<
" +/- " << epsilonErr[5]);
920 epsilon2[5] = (double)TrackOneDigiIn[5] / (
double) totTrack[5] ;
921 epsilon2Err[5] = sqrt(epsilon2[5] * (1 - epsilon2[5]) / totTrack[5]);
922 B2RESULT(
" efficiency2 : " << epsilon2[5] <<
" +/- " << epsilon2Err[5]);
925 B2RESULT(
" 0.5 < pT < 1 : " << pt[4]);
926 B2RESULT(
" out ROI: " << nnotINdigit2[4]);
927 B2RESULT(
" no ROI: " << nnotINdigit3[4]);
928 B2RESULT(
" wrongVxdID: " << nnotINdigit4[4]);
929 B2RESULT(
" noInter: " << nnotINdigit5[4]);
930 B2RESULT(
" pxdDigit : " << npxdDigit[4]);
931 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[4]);
932 if ((npxdDigit[4] - npxdDigitInROI[4]) != (nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] + nnotINdigit5[4]))
933 B2RESULT(
" pxdDigitOut : " << npxdDigit[4] - npxdDigitInROI[4] <<
" != " << nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] +
935 epsilon[4] = (double)npxdDigitInROI[4] / (
double) npxdDigit[4];
936 epsilonErr[4] = sqrt(epsilon[4] * (1 - epsilon[4]) / npxdDigit[4]);
937 B2RESULT(
" efficiency : " << epsilon[4] <<
" +/- " << epsilonErr[4]);
938 epsilon2[4] = (double)TrackOneDigiIn[4] / (
double) totTrack[4] ;
939 epsilon2Err[4] = sqrt(epsilon2[4] * (1 - epsilon2[4]) / totTrack[4]);
940 B2RESULT(
" efficiency2 : " << epsilon2[4] <<
" +/- " << epsilon2Err[4]);
943 B2RESULT(
" 0.3 < pT < 0.5 : " << pt[3]);
944 B2RESULT(
" out ROI: " << nnotINdigit2[3]);
945 B2RESULT(
" no ROI: " << nnotINdigit3[3]);
946 B2RESULT(
" wrongVxdID: " << nnotINdigit4[3]);
947 B2RESULT(
" noInter: " << nnotINdigit5[3]);
948 B2RESULT(
" pxdDigit : " << npxdDigit[3]);
949 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[3]);
950 if ((npxdDigit[3] - npxdDigitInROI[3]) != (nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] + nnotINdigit5[3]))
951 B2RESULT(
" pxdDigitOut : " << npxdDigit[3] - npxdDigitInROI[3] <<
" != " << nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] +
953 epsilon[3] = (double)npxdDigitInROI[3] / (
double) npxdDigit[3];
954 epsilonErr[3] = sqrt(epsilon[3] * (1 - epsilon[3]) / npxdDigit[3]);
955 B2RESULT(
" efficiency : " << epsilon[3] <<
" +/- " << epsilonErr[3]);
956 epsilon2[3] = (double)TrackOneDigiIn[3] / (
double) totTrack[3];
957 epsilon2Err[3] = sqrt(epsilon2[3] * (1 - epsilon2[3]) / totTrack[3]);
958 B2RESULT(
" efficiency2 : " << epsilon2[3] <<
" +/- " << epsilon2Err[3]);
961 B2RESULT(
" 0.2 < pT < 0.3 : " << pt[2]);
962 B2RESULT(
" out ROI: " << nnotINdigit2[2]);
963 B2RESULT(
" no ROI: " << nnotINdigit3[2]);
964 B2RESULT(
" wrongVxdID: " << nnotINdigit4[2]);
965 B2RESULT(
" noInter: " << nnotINdigit5[2]);
966 B2RESULT(
" pxdDigit : " << npxdDigit[2]);
967 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[2]);
968 if ((npxdDigit[2] - npxdDigitInROI[2]) != (nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] + nnotINdigit5[2]))
969 B2RESULT(
" pxdDigitOut : " << npxdDigit[2] - npxdDigitInROI[2] <<
" != " << nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] +
971 epsilon[2] = (double)npxdDigitInROI[2] / (
double) npxdDigit[2];
972 epsilonErr[2] = sqrt(epsilon[2] * (1 - epsilon[2]) / npxdDigit[2]);
973 B2RESULT(
" efficiency : " << epsilon[2] <<
" +/- " << epsilonErr[2]);
974 epsilon2[2] = (double)TrackOneDigiIn[2] / (
double) totTrack[2] ;
975 epsilon2Err[2] = sqrt(epsilon2[2] * (1 - epsilon2[2]) / totTrack[2]);
976 B2RESULT(
" efficiency2 : " << epsilon2[2] <<
" +/- " << epsilon2Err[2]);
979 B2RESULT(
" 0.1 < pT < 0.2 : " << pt[1]);
980 B2RESULT(
" out ROI: " << nnotINdigit2[1]);
981 B2RESULT(
" no ROI: " << nnotINdigit3[1]);
982 B2RESULT(
" wrongVxdID: " << nnotINdigit4[1]);
983 B2RESULT(
" noInter: " << nnotINdigit5[1]);
984 B2RESULT(
" pxdDigit : " << npxdDigit[1]);
985 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[1]);
986 if ((npxdDigit[1] - npxdDigitInROI[1]) != (nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] + nnotINdigit5[1]))
987 B2RESULT(
" pxdDigitOut : " << npxdDigit[1] - npxdDigitInROI[1] <<
" ?=? " << nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] +
989 epsilon[1] = (double)npxdDigitInROI[1] / (
double) npxdDigit[1];
990 epsilonErr[1] = sqrt(epsilon[1] * (1 - epsilon[1]) / npxdDigit[1]);
991 B2RESULT(
" efficiency : " << epsilon[1] <<
" +/- " << epsilonErr[1]);
992 epsilon2[1] = (double)TrackOneDigiIn[1] / (
double) totTrack[1] ;
993 epsilon2Err[1] = sqrt(epsilon2[1] * (1 - epsilon2[1]) / totTrack[1]);
994 B2RESULT(
" efficiency2 : " << epsilon2[1] <<
" +/- " << epsilon2Err[1]);
997 B2RESULT(
" pT < 0.1 : " << pt[0]);
998 B2RESULT(
" out ROI: " << nnotINdigit2[0]);
999 B2RESULT(
" no ROI: " << nnotINdigit3[0]);
1000 B2RESULT(
" wrongVxdID: " << nnotINdigit4[0]);
1001 B2RESULT(
" noInter: " << nnotINdigit5[0]);
1002 B2RESULT(
" pxdDigit : " << npxdDigit[0]);
1003 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[0]);
1004 if ((npxdDigit[0] - npxdDigitInROI[0]) != (nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] + nnotINdigit5[0]))
1005 B2RESULT(
" pxdDigitOut : " << npxdDigit[0] - npxdDigitInROI[0] <<
" ?=? " << nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] +
1007 epsilon[0] = (double)npxdDigitInROI[0] / (
double) npxdDigit[0];
1008 epsilonErr[0] = sqrt(epsilon[0] * (1 - epsilon[0]) / npxdDigit[0]);
1009 B2RESULT(
" efficiency : " << epsilon[0] <<
" +/- " << epsilonErr[0]);
1010 epsilon2[0] = (double)TrackOneDigiIn[0] / (
double) totTrack[0] ;
1011 epsilon2Err[0] = sqrt(epsilon2[0] * (1 - epsilon2[0]) / totTrack[0]);
1012 B2RESULT(
" efficiency2 : " << epsilon2[0] <<
" +/- " << epsilon2Err[0]);
1014 B2RESULT(
"legend:");
1015 B2RESULT(
" CASO2: if (ROI exists but no PXDDigit inside)");
1016 B2RESULT(
" CASO3: if (ROI does not exist, intercept with correct VxdID)");
1017 B2RESULT(
" CASO4: if (intercept with wrong VxdID)");
1018 B2RESULT(
" CASO5: if (intercept does not exist)");
1021 m_gEff2 =
new TGraphErrors(6, pt, epsilon2, ptErr, epsilon2Err);
1022 m_gEff2->SetName(
"g_eff2");
1023 m_gEff2->SetTitle(
"Normalized to MCParticles with digits and related track");
1024 m_gEff =
new TGraphErrors(6, pt, epsilon, ptErr, epsilonErr);
1025 m_gEff->SetName(
"g_eff");
1026 m_gEff->SetTitle(
"Normalized to digits of MCParticles with digits and related track");
1030 if (m_rootFilePtr != NULL) {
1031 m_rootFilePtr->cd();
1033 TDirectory* oldDir = gDirectory;
1034 TDirectory* m_digiDir = oldDir->mkdir(
"digits");
1035 TDirectory* m_tracksDir = oldDir->mkdir(
"tracks");
1036 TDirectory* m_notINtrack5 = oldDir->mkdir(
"notINtrack5");
1037 TDirectory* m_INtrack1 = oldDir->mkdir(
"INtrack1");
1038 TDirectory* m_alltracks = oldDir->mkdir(
"alltracks");
1039 TDirectory* m_in = oldDir->mkdir(
"digi_in");
1040 TDirectory* m_out2 = oldDir->mkdir(
"digi_out2");
1041 TDirectory* m_out3 = oldDir->mkdir(
"digi_out3");
1042 TDirectory* m_out4 = oldDir->mkdir(
"digi_out4");
1043 TDirectory* m_out5 = oldDir->mkdir(
"digi_out5");
1044 TDirectory* m_ROIDir = oldDir->mkdir(
"roi");
1046 m_h1DigitsPerParticle->Write();
1047 m_h1RecoTracksPerParticle->Write();
1051 m_h1effPerTrack->Write();
1055 m_h1digiIn->Write();
1056 m_h1digiOut2->Write();
1057 m_h1digiOut3->Write();
1058 m_h1digiOut4->Write();
1059 m_h1digiOut5->Write();
1062 m_h1TrackOneDigiIn->Write();
1063 m_h1nnotINtrack2->Write();
1064 m_h1nnotINtrack3->Write();
1065 m_h1nnotINtrack4->Write();
1066 m_h1nnotINtrack5->Write();
1068 m_notINtrack5->cd();
1069 m_h1notINtrack5->Write();
1070 m_h1notINtrack5_pt->Write();
1071 m_h1notINtrack5_phi->Write();
1072 m_h1notINtrack5_lambda->Write();
1073 m_h1notINtrack5_cosTheta->Write();
1076 m_h1INtrack1->Write();
1077 m_h1INtrack1_pt->Write();
1078 m_h1INtrack1_phi->Write();
1079 m_h1INtrack1_lambda->Write();
1080 m_h1INtrack1_cosTheta->Write();
1084 m_h1Track_pt->Write();
1085 m_h1Track_phi->Write();
1086 m_h1Track_lambda->Write();
1087 m_h1Track_cosTheta->Write();
1090 m_h1GlobalTime->Write();
1093 m_h1ResidU->Write();
1094 m_h1ResidV->Write();
1095 m_h2ResidUV->Write();
1096 m_h1SigmaU->Write();
1097 m_h1SigmaV->Write();
1098 m_h2sigmaUphi->Write();
1099 m_h2sigmaVphi->Write();
1100 m_h2Mapglob->Write();
1101 m_h2MaplocL1->Write();
1102 m_h2MaplocL2->Write();
1105 m_h1GlobalTime_out2->Write();
1106 m_h1ResidU_out2->Write();
1107 m_h1ResidV_out2->Write();
1108 m_h2ResidUV_out2->Write();
1109 m_h1SigmaU_out2->Write();
1110 m_h1SigmaV_out2->Write();
1111 m_h2sigmaUphi_out2->Write();
1112 m_h2sigmaVphi_out2->Write();
1113 m_h2Mapglob_out2->Write();
1114 m_h2MaplocL1_out2->Write();
1115 m_h2MaplocL2_out2->Write();
1118 m_h1GlobalTime_out3->Write();
1119 m_h1ResidU_out3->Write();
1120 m_h1ResidV_out3->Write();
1121 m_h2ResidUV_out3->Write();
1122 m_h1SigmaU_out3->Write();
1123 m_h1SigmaV_out3->Write();
1124 m_h2sigmaUphi_out3->Write();
1125 m_h2sigmaVphi_out3->Write();
1126 m_h2Mapglob_out3->Write();
1127 m_h2MaplocL1_out3->Write();
1128 m_h2MaplocL2_out3->Write();
1131 m_h1GlobalTime_out4->Write();
1132 m_h1SigmaU_out4->Write();
1133 m_h1SigmaV_out4->Write();
1134 m_h2sigmaUphi_out4->Write();
1135 m_h2sigmaVphi_out4->Write();
1136 m_h2Mapglob_out4->Write();
1137 m_h2MaplocL1_out4->Write();
1138 m_h2MaplocL2_out4->Write();
1141 m_h1GlobalTime_out5->Write();
1142 m_h2Mapglob_out5->Write();
1143 m_h2MaplocL1_out5->Write();
1144 m_h2MaplocL2_out5->Write();
1147 m_h1totArea->Write();
1148 m_h1okArea->Write();
1149 m_h1okROIs->Write();
1150 m_h1okROIfrac->Write();
1151 m_h1totROIs->Write();
1152 m_h1redFactor->Write();
1153 m_h1redFactor_L1->Write();
1154 m_h1redFactor_L2->Write();
1157 m_h2ROIbottomLeft->Write();
1158 m_h2ROItopRight->Write();
1159 m_h2ROIuMinMax->Write();
1160 m_h2ROIvMinMax->Write();
1161 m_rootFilePtr->Close();