9 #include <tracking/modules/pxdDataReduction/PXDROIFinderAnalysisModule.h>
10 #include <framework/datastore/StoreArray.h>
11 #include <framework/datastore/RelationArray.h>
12 #include <framework/datastore/RelationIndex.h>
14 #include <mdst/dataobjects/MCParticle.h>
15 #include <svd/dataobjects/SVDCluster.h>
16 #include <pxd/dataobjects/PXDDigit.h>
17 #include <pxd/dataobjects/PXDTrueHit.h>
18 #include <tracking/dataobjects/RecoTrack.h>
19 #include <tracking/dataobjects/ROIid.h>
20 #include <tracking/dataobjects/PXDIntercept.h>
23 #include <vxd/geometry/GeoCache.h>
39 , m_writeToRoot(false)
77 , n_tracksWithDigits(0)
78 , n_tracksWithDigitsInROI(0)
103 setDescription(
"This module performs the analysis of the PXDROIFinder module output");
105 addParam(
"writeToRoot", m_writeToRoot,
106 "set true if you want to save the informations in a root file named by parameter 'rootFileName'",
bool(
true));
108 addParam(
"rootFileName", m_rootFileName,
109 "fileName used for . Will be ignored if parameter 'writeToRoot' is false (standard)",
110 string(
"pxdDataRedAnalysis"));
112 addParam(
"recoTrackListName", m_recoTrackListName,
113 "name of the input collection of RecoTracks", std::string(
""));
115 addParam(
"PXDInterceptListName", m_PXDInterceptListName,
116 "name of the list of interceptions", std::string(
""));
118 addParam(
"ROIListName", m_ROIListName,
119 "name of the list of ROIs", std::string(
""));
125 void PXDROIFinderAnalysisModule::initialize()
135 pxdIntercepts.
isRequired(m_PXDInterceptListName);
146 n_tracksWithDigits = 0;
147 n_tracksWithDigitsInROI = 0;
154 for (
int i = 0; i < 6; i++) {
156 npxdDigitInROI[i] = 0;
159 if (m_writeToRoot ==
true) {
160 m_rootFileName +=
".root";
161 m_rootFilePtr =
new TFile(m_rootFileName.c_str(),
"RECREATE");
163 m_rootFilePtr =
nullptr;
166 m_h1GlobalTime =
new TH1F(
"hGlobalTime",
"global time for PXDDigits contained in ROI", 100, 0, 1);
167 m_h1PullU =
new TH1F(
"hPullU",
"U pulls for PXDDigits contained in ROI", 100, -6, 6);
168 m_h1PullV =
new TH1F(
"hPullV",
"V pulls for PXDDigits contained in ROI", 100, -6, 6);
169 m_h2sigmaUphi =
new TH2F(
"hsigmaUvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.35);
170 m_h2sigmaVphi =
new TH2F(
"hsigmaVvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.4);
171 m_h1ResidU =
new TH1F(
"hResidU",
"U resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
172 m_h1ResidV =
new TH1F(
"hResidV",
"V resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
173 m_h2ResidUV =
new TH2F(
"hResidUV",
"U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
174 m_h1SigmaU =
new TH1F(
"hSigmaU",
"sigmaU for PXDDigits contained in ROI", 100, 0, 0.35);
175 m_h1SigmaV =
new TH1F(
"hSigmaV",
"sigmaV for PXDDigits contained in ROI", 100, 0, 0.35);
176 m_h2Mapglob =
new TH2F(
"h2Mapglob",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
177 m_h2MaplocL1 =
new TH2F(
"h2MaplocL1",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
178 m_h2MaplocL2 =
new TH2F(
"h2MaplocL2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
179 m_h2MaplocL1->GetXaxis()->SetTitle(
"v ID");
180 m_h2MaplocL1->GetYaxis()->SetTitle(
"u ID");
181 m_h2MaplocL2->GetXaxis()->SetTitle(
"v ID");
182 m_h2MaplocL2->GetYaxis()->SetTitle(
"u ID");
185 m_h1GlobalTime_out2 =
new TH1F(
"hGlobalTime_out2",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
186 m_h2sigmaUphi_out2 =
new TH2F(
"hsigmaUvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
187 m_h2sigmaVphi_out2 =
new TH2F(
"hsigmaVvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
188 m_h1ResidU_out2 =
new TH1F(
"hResidU_out2",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
189 m_h1ResidV_out2 =
new TH1F(
"hResidV_out2",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
190 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);
191 m_h1SigmaU_out2 =
new TH1F(
"hSigmaU_out2",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
192 m_h1SigmaV_out2 =
new TH1F(
"hSigmaV_out2",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
193 m_h2Mapglob_out2 =
new TH2F(
"h2Mapglob_out2",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
194 m_h2MaplocL1_out2 =
new TH2F(
"h2MaplocL1_out2",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
195 m_h2MaplocL2_out2 =
new TH2F(
"h2MaplocL2_out2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
198 m_h1GlobalTime_out3 =
new TH1F(
"hGlobalTime_out3",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
199 m_h2sigmaUphi_out3 =
new TH2F(
"hsigmaUvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
200 m_h2sigmaVphi_out3 =
new TH2F(
"hsigmaVvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
201 m_h1ResidU_out3 =
new TH1F(
"hResidU_out3",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
202 m_h1ResidV_out3 =
new TH1F(
"hResidV_out3",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
203 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);
204 m_h1SigmaU_out3 =
new TH1F(
"hSigmaU_out3",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
205 m_h1SigmaV_out3 =
new TH1F(
"hSigmaV_out3",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
207 m_h2Mapglob_out3 =
new TH2F(
"h2Mapglob_out3",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
208 m_h2MaplocL1_out3 =
new TH2F(
"h2MaplocL1_out3",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
209 m_h2MaplocL2_out3 =
new TH2F(
"h2MaplocL2_out3",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
212 m_h1GlobalTime_out4 =
new TH1F(
"hGlobalTime_out4",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
213 m_h2sigmaUphi_out4 =
new TH2F(
"hsigmaUvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
214 m_h2sigmaVphi_out4 =
new TH2F(
"hsigmaVvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
215 m_h1SigmaU_out4 =
new TH1F(
"hSigmaU_out4",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
216 m_h1SigmaV_out4 =
new TH1F(
"hSigmaV_out4",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
218 m_h2Mapglob_out4 =
new TH2F(
"h2Mapglob_out4",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
219 m_h2MaplocL1_out4 =
new TH2F(
"h2MaplocL1_out4",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
220 m_h2MaplocL2_out4 =
new TH2F(
"h2MaplocL2_out4",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
223 m_h1GlobalTime_out5 =
new TH1F(
"hGlobalTime_out5",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
225 m_h2Mapglob_out5 =
new TH2F(
"h2Mapglob_out5",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
226 m_h2MaplocL1_out5 =
new TH2F(
"h2MaplocL1_out5",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
227 m_h2MaplocL2_out5 =
new TH2F(
"h2MaplocL2_out5",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
230 m_h1redFactor =
new TH1F(
"hRedFactor",
"L1+L2reduction factor", 1000, 0, 1);
231 m_h1redFactor_L1 =
new TH1F(
"hRedFactor_L1",
"L1-only reduction factor", 1000, 0, 1);
232 m_h1redFactor_L2 =
new TH1F(
"hRedFactor_L2",
"L2-only reduction factor", 1000, 0, 1);
234 m_h1totROIs =
new TH1F(
"h1TotNROIs",
"number of all ROIs", 110, 0, 110);
235 m_h1okROIs =
new TH1F(
"h1OkNROIs",
"number of all ROIs containing a PXDDigit", 110, 0, 110);
236 m_h1okROIfrac =
new TH1F(
"h1OkNROIfrac",
"fraction of ROIs containing a PXDDigit", 100, 0, 1);
238 m_h1totArea =
new TH1F(
"h1TotArea",
"Area of all ROIs", 100, 0, 2500000);
239 m_h1okArea =
new TH1F(
"h1OkArea",
"Area of ROIs containing a PXDDigit", 100, 0, 75000);
243 m_h1effPerTrack =
new TH1F(
"heffPerTrack",
"fraction of digits in ROI per track", 100, -0.02, 1.02);
247 m_h2ROIbottomLeft =
new TH2F(
"h2ROIbottomLeft",
"u,v ID of the bottom left pixel", 650, -200, 450, 1300, -300, 1000);
248 m_h2ROItopRight =
new TH2F(
"h2ROItopRight",
"u,v ID of the top right pixel", 650, -200, 450, 1300, -300, 1000);
250 m_h2ROIuMinMax =
new TH2F(
"h2ROIuMinMax",
"u Min vs Max", 650, -200, 450, 650, -200, 450);
251 m_h2ROIvMinMax =
new TH2F(
"h2ROIvMinMax",
"v Min vs Max", 1300, -300, 1000, 1300, -300, 1000);
254 m_h1DigitsPerParticle =
new TH1F(
"h1DigitsPerPart",
"Number of PXDDigits per Particle", 50, 0, 50);
255 m_h1RecoTracksPerParticle =
new TH1F(
"h1RecoTracksPerPart",
"Number of RecoTracks per Particle", 10, 0, 10);
259 Double_t lowBin[6 + 1];
260 for (
int i = 0; i < 6; i++)
261 lowBin[i] = pt[i] - ptErr[i];
262 lowBin[6] = pt[5] + ptErr[5];
264 m_h1TrackOneDigiIn =
new TH1F(
"hTracksDigiIn",
"Tracks with at least one digit contained in a ROI", 6, lowBin);
265 m_h1nnotINtrack2 =
new TH1F(
"h1outROITrack",
"Tracks with ROI with correct VxdID but no digits inside ROI", 6, lowBin);
266 m_h1nnotINtrack3 =
new TH1F(
"h1noROITrack",
"Tracks with ROI with wrong VxdID but no digits inside ROI", 6, lowBin);
267 m_h1nnotINtrack4 =
new TH1F(
"h1wrongVxdIDTrack",
"Tracks with no ROI, Intercept with correct VxdID", 6, lowBin);
268 m_h1nnotINtrack5 =
new TH1F(
"h1noInterTrack",
"Tracks with no Intercept matching a VxdID of digits", 6, lowBin);
270 m_h1notINtrack5 =
new TH1F(
"hNoInterTrack",
"track with no intercepts", 20, 0, 20);
271 m_h1notINtrack5_pt =
new TH1F(
"hNoInterTrack_pT",
"track with no intercepts", 100, 0, 6);
272 m_h1notINtrack5_phi =
new TH1F(
"h1NoInterTrack_phi",
"hNoInterTrack_phi", 100, -180, 180);
273 m_h1notINtrack5_lambda =
new TH1F(
"h1NoInterTrack_lambda",
"hNoInterTrack_lambda", 100, -180, 180);
274 m_h1notINtrack5_cosTheta =
new TH1F(
"h1NoInterTrack_cosTheta",
"hNoInterTrack_cosTheta", 100, -1, 1);
275 m_h1notINtrack5_pVal =
new TH1F(
"hNoInterTrack_pVal",
"track with no intercepts", 100, 0, 1);
276 m_h1notINtrack5_nSVDhits =
new TH1F(
"hNoInterTrack_nSVDhits",
"track with no intercepts", 50, 0, 50);
277 m_h1notINtrack5_nCDChits =
new TH1F(
"hNoInterTrack_nCDChits",
"track with no intercepts", 100, 0, 100);
279 m_h1INtrack1 =
new TH1F(
"hINTrack",
"track with at least one digit inside ROI", 20, 0, 20);
280 m_h1INtrack1_pt =
new TH1F(
"hINTrack_pT",
"track with at least one digit inside ROI", 100, 0, 6);
281 m_h1INtrack1_phi =
new TH1F(
"h1INTrack_phi",
"hINTrack_phi", 100, -180, 180);
282 m_h1INtrack1_lambda =
new TH1F(
"h1INTrack_lambda",
"hINTrack_lambda", 100, -180, 180);
283 m_h1INtrack1_cosTheta =
new TH1F(
"h1INTrack_cosTheta",
"hINTrack_cosTheta", 100, -1, 1);
284 m_h1INtrack1_pVal =
new TH1F(
"h1INTrack_pVal",
"track with no intercepts", 100, 0, 1);
285 m_h1INtrack1_nSVDhits =
new TH1F(
"h1INTrack_nSVDhits",
"track with no intercepts", 50, 0, 50);
286 m_h1INtrack1_nCDChits =
new TH1F(
"h1INTrack_nCDChits",
"track with no intercepts", 100, 0, 100);
288 m_h1Track =
new TH1F(
"hTrack",
"all tracks", 20, 0, 20);
289 m_h1Track_pt =
new TH1F(
"hTrack_pT",
"all tracks with digits", 100, 0, 6);
290 m_h1Track_lambda =
new TH1F(
"h1Track_lambda",
"hTrack_lambda", 100, -180, 180);
291 m_h1Track_phi =
new TH1F(
"h1Track_phi",
"hTrack_phi", 100, -180, 180);
292 m_h1Track_cosTheta =
new TH1F(
"h1Track_cosTheta",
"hTrack_cos theta", 100, -1, 1);
293 m_h1Track_pVal =
new TH1F(
"h1Track_pVal",
"track with no intercepts", 100, 0, 1);
294 m_h1Track_nSVDhits =
new TH1F(
"h1Track_nSVDhits",
"track with no intercepts", 50, 0, 50);
295 m_h1Track_nCDChits =
new TH1F(
"h1Track_nCDChits",
"track with no intercepts", 100, 0, 100);
297 m_h1digiIn =
new TH1F(
"hdigiIn",
"digits inside ROI", 6, lowBin);
298 m_h1digiOut2 =
new TH1F(
"hdigiOut2",
"ROI exists with with correct VxdID but no digits inside ROI", 6, lowBin);
299 m_h1digiOut3 =
new TH1F(
"hdigiOut3",
"ROI exists with with wrong VxdID", 6, lowBin);
300 m_h1digiOut4 =
new TH1F(
"hdigiOut4",
"ROI does not exist, but intercept has correct VxdID", 6, lowBin);
301 m_h1digiOut5 =
new TH1F(
"hdigiOut5",
"no ROI, no Intercpets with correct VXDid", 6, lowBin);
310 void PXDROIFinderAnalysisModule::beginRun()
316 std::set<Belle2::VxdID> pxdLayers = aGeometry.
getLayers(VXD::SensorInfoBase::PXD);
317 std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
319 while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
321 std::set<Belle2::VxdID> pxdLadders = aGeometry.
getLadders(*itPxdLayers);
322 std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
324 while (itPxdLadders != pxdLadders.end()) {
326 std::set<Belle2::VxdID> pxdSensors = aGeometry.
getSensors(*itPxdLadders);
327 std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
329 while (itPxdSensors != pxdSensors.end()) {
331 if (itPxdLadders->getLayerNumber() == 1)
333 if (itPxdLadders->getLayerNumber() == 2)
347 void PXDROIFinderAnalysisModule::event()
355 relDigitTrueHit(DataStore::relationName(DataStore::arrayName<PXDDigit>(
""),
356 DataStore::arrayName<PXDTrueHit>(
"")));
358 recoTrackToPXDIntercept(DataStore::relationName(m_recoTrackListName, m_PXDInterceptListName));
360 double tmpGlobalTime;
366 B2DEBUG(1,
" ++++++++++++++ PXDROIFinderAnalysisModule");
380 for (
int i = 0; i < (int)ROIList.
getEntries(); i++) {
382 m_h2ROIbottomLeft->Fill(ROIList[i]->getMinUid(), ROIList[i]->getMinVid());
383 m_h2ROItopRight->Fill(ROIList[i]->getMaxUid(), ROIList[i]->getMaxVid());
384 m_h2ROIuMinMax->Fill(ROIList[i]->getMinUid(), ROIList[i]->getMaxUid());
385 m_h2ROIvMinMax->Fill(ROIList[i]->getMinVid(), ROIList[i]->getMaxVid());
386 int tmpArea = (ROIList[i]->getMaxUid() - ROIList[i]->getMinUid()) * (ROIList[i]->getMaxVid() - ROIList[i]->getMinVid());
387 if ((ROIList[i]->getSensorID()).getLayerNumber() == 1)
388 totArea_L1 += tmpArea;
390 totArea_L2 += tmpArea;
394 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
402 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++)
403 if (ROIList[i]->Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
411 m_h1totArea->Fill(totArea_L1 + totArea_L2);
412 double redFactor_L1 = totArea_L1 / 768. / 250. / m_nSensorsL1;
413 double redFactor_L2 = totArea_L2 / 768. / 250. / m_nSensorsL2;
414 m_h1redFactor->Fill((
double)(totArea_L1 + totArea_L2) / 768. / 250. / (m_nSensorsL1 + m_nSensorsL2));
415 m_h1redFactor_L1->Fill((
double) redFactor_L1);
416 m_h1redFactor_L2->Fill((
double) redFactor_L2);
427 n_intercepts += PXDInterceptList.
getEntries();
429 Int_t n_NoInterceptTracks = 0;
435 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
443 m_h1DigitsPerParticle->Fill(pxdDigits_MCParticle.
size());
444 if (pxdDigits_MCParticle.
size() == 0)
449 m_h1RecoTracksPerParticle->Fill(recoTracks_MCParticle.size());
450 if (recoTracks_MCParticle.size() == 0)
457 B2DEBUG(1,
"Number of RecoTracks = " << recoTracks_MCParticle.size() <<
" and PXDDigits = " << pxdDigits_MCParticle.
size() <<
458 " related to this MCParticle");
464 m_phimc = (aMcParticle->
getMomentum()).Phi() * 180 / 3.1415;
465 m_thetamc = (aMcParticle->
getMomentum()).Theta() * 180 / 3.1415;
466 m_costhetamc = (aMcParticle->
getMomentum()).CosTheta();
467 m_lambdamc = 90 - m_thetamc;
482 bool part_outsideROI =
false;
483 bool part_noROI =
false;
484 bool part_wrongVxdID =
false;
485 bool part_noInter =
false;
486 bool hasOneDigitInROI =
false;
490 Int_t nDigitsInRoiPerTrack = 0;
491 Int_t nDigitsPerTrack = 0;
494 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++) {
496 bool hasIntercept =
false;
498 bool interceptRightVxdID =
false;
499 bool MissingHit =
true;
504 PXDTrueHitFromPXDDigit PXDTrueHits = relDigitTrueHit.
getElementsFrom(*pxdDigits_MCParticle[iPXDDigit]);
505 PXDTrueHitIteratorType thePXDTrueHitIterator = PXDTrueHits.begin();
506 PXDTrueHitIteratorType thePXDTrueHitIteratorEnd = PXDTrueHits.end();
510 for (; thePXDTrueHitIterator != thePXDTrueHitIteratorEnd; thePXDTrueHitIterator++) {
511 tmpGlobalTime = tmpGlobalTime + thePXDTrueHitIterator->to->getGlobalTime();
514 m_globalTime = tmpGlobalTime / tmpNGlobalTime;
517 m_Uidmc = pxdDigits_MCParticle[iPXDDigit]->getUCellID();
518 m_Vidmc = pxdDigits_MCParticle[iPXDDigit]->getVCellID();
519 m_vxdIDmc = pxdDigits_MCParticle[iPXDDigit]->getSensorID();
525 v2 = -(767 - m_Vidmc);
537 TVector3 local(m_coorUmc, m_coorVmc, 0);
538 TVector3 globalSensorPos = aSensorInfo.
pointToGlobal(local,
true);
541 if (m_pTmc > 1) npxdDigit[5]++;
542 if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigit[4]++;
543 if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigit[3]++;
544 if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigit[2]++;
545 if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigit[1]++;
546 if (m_pTmc <= 0.1) npxdDigit[0]++;
549 for (
int i = 0; i < (int)recoTracks_MCParticle.size(); i++) {
551 PXDInterceptsFromRecoTracks PXDIntercepts = recoTrackToPXDIntercept.
getElementsFrom(recoTracks_MCParticle[i]);
553 PXDInterceptIteratorType thePXDInterceptIterator = PXDIntercepts.begin();
554 PXDInterceptIteratorType thePXDInterceptIteratorEnd = PXDIntercepts.end();
557 for (; thePXDInterceptIterator != thePXDInterceptIteratorEnd; thePXDInterceptIterator++) {
559 const PXDIntercept* theIntercept = thePXDInterceptIterator->to;
571 if (m_vxdID == m_vxdIDmc)
572 interceptRightVxdID =
true;
584 if (theROIid->
Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
587 nDigitsInRoiPerTrack++;
589 m_h1GlobalTime->Fill(m_globalTime);
590 m_h1PullU->Fill((m_coorU - m_coorUmc) / m_sigmaU);
591 m_h1PullV->Fill((m_coorV - m_coorVmc) / m_sigmaV);
592 m_h1ResidU->Fill(m_coorU - m_coorUmc);
593 m_h1ResidV->Fill(m_coorV - m_coorVmc);
594 m_h2ResidUV->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
595 m_h2sigmaUphi->Fill(m_phimc, m_sigmaU);
596 m_h2sigmaVphi->Fill(m_phimc, m_sigmaV);
597 m_h1SigmaU->Fill(m_sigmaU);
598 m_h1SigmaV->Fill(m_sigmaV);
599 m_h2Mapglob->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
603 m_h2MaplocL1->Fill(v2, u2);
605 m_h2MaplocL2->Fill(v2, u2);
608 m_h1okArea->Fill(tmpArea);
610 okArea_L1 = okArea_L1 + tmpArea;
612 okArea_L2 = okArea_L2 + tmpArea;
615 hasOneDigitInROI =
true;
618 if (m_pTmc > 1) npxdDigitInROI[5]++;
619 if (m_pTmc <= 1 && m_pTmc > 0.5) npxdDigitInROI[4]++;
620 if (m_pTmc <= 0.5 && m_pTmc > 0.3) npxdDigitInROI[3]++;
621 if (m_pTmc <= 0.3 && m_pTmc > 0.2) npxdDigitInROI[2]++;
622 if (m_pTmc <= 0.2 && m_pTmc > 0.1) npxdDigitInROI[1]++;
623 if (m_pTmc <= 0.1) npxdDigitInROI[0]++;
643 if (hasROI && hasIntercept && interceptRightVxdID) {
644 part_outsideROI =
true;
648 m_h1GlobalTime_out2->Fill(m_globalTime);
649 m_h1ResidU_out2->Fill(m_coorU - m_coorUmc);
650 m_h1ResidV_out2->Fill(m_coorV - m_coorVmc);
651 m_h2ResidUV_out2->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
652 m_h2sigmaUphi_out2->Fill(m_phimc, m_sigmaU);
653 m_h2sigmaVphi_out2->Fill(m_phimc, m_sigmaV);
654 m_h1SigmaU_out2->Fill(m_sigmaU);
655 m_h1SigmaV_out2->Fill(m_sigmaV);
656 m_h2Mapglob_out2->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
658 m_h2MaplocL1_out2->Fill(v2, u2);
660 m_h2MaplocL2_out2->Fill(v2, u2);
662 if (m_pTmc > 1) nnotINdigit2[5]++;
663 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit2[4]++;
664 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit2[3]++;
665 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit2[2]++;
666 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit2[1]++;
667 if (m_pTmc <= 0.1) nnotINdigit2[0]++;
669 }
else if (!hasROI && hasIntercept && interceptRightVxdID) {
674 m_h1GlobalTime_out3->Fill(m_globalTime);
675 m_h1ResidU_out3->Fill(m_coorU - m_coorUmc);
676 m_h1ResidV_out3->Fill(m_coorV - m_coorVmc);
677 m_h2ResidUV_out3->Fill(m_coorU - m_coorUmc, m_coorV - m_coorVmc);
678 m_h2sigmaUphi_out3->Fill(m_phimc, m_sigmaU);
679 m_h2sigmaVphi_out3->Fill(m_phimc, m_sigmaV);
680 m_h1SigmaU_out3->Fill(m_sigmaU);
681 m_h1SigmaV_out3->Fill(m_sigmaV);
682 m_h2Mapglob_out3->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
684 m_h2MaplocL1_out3->Fill(v2, u2);
687 m_h2MaplocL2_out3->Fill(v2, u2);
690 if (m_pTmc > 1) nnotINdigit3[5]++;
691 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit3[4]++;
692 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit3[3]++;
693 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit3[2]++;
694 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit3[1]++;
695 if (m_pTmc <= 0.1) nnotINdigit3[0]++;
697 }
else if (hasIntercept && !interceptRightVxdID) {
698 part_wrongVxdID =
true;
702 m_h1GlobalTime_out4->Fill(m_globalTime);
703 m_h2sigmaUphi_out4->Fill(m_phimc, m_sigmaU);
704 m_h2sigmaVphi_out4->Fill(m_phimc, m_sigmaV);
705 m_h1SigmaU_out4->Fill(m_sigmaU);
706 m_h1SigmaV_out4->Fill(m_sigmaV);
707 m_h2Mapglob_out4->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
709 m_h2MaplocL1_out4->Fill(v2, u2);
711 m_h2MaplocL2_out4->Fill(v2, u2);
713 if (m_pTmc > 1) nnotINdigit4[5]++;
714 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit4[4]++;
715 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit4[3]++;
716 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit4[2]++;
717 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit4[1]++;
718 if (m_pTmc <= 0.1) nnotINdigit4[0]++;
720 }
else if (!hasIntercept) {
725 m_h1GlobalTime_out5->Fill(m_globalTime);
726 m_h2Mapglob_out5->Fill(globalSensorPos.Perp() , globalSensorPos.Phi());
728 m_h2MaplocL1_out5->Fill(v2, u2);
730 m_h2MaplocL2_out5->Fill(v2, u2);
732 if (m_pTmc > 1) nnotINdigit5[5]++;
733 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINdigit5[4]++;
734 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINdigit5[3]++;
735 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINdigit5[2]++;
736 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINdigit5[1]++;
737 if (m_pTmc <= 0.1) nnotINdigit5[0]++;
742 m_h1effPerTrack->Fill((
float) nDigitsInRoiPerTrack / nDigitsPerTrack);
743 m_h1Track_pt->Fill(m_pTmc);
744 m_h1Track_phi->Fill(m_phimc);
745 m_h1Track_lambda->Fill(m_lambdamc);
746 m_h1Track_cosTheta->Fill(m_costhetamc);
748 if (hasOneDigitInROI) {
750 if (m_pTmc > 1) TrackOneDigiIn[5]++;
751 if (m_pTmc <= 1 && m_pTmc > 0.5) TrackOneDigiIn[4]++;
752 if (m_pTmc <= 0.5 && m_pTmc > 0.3) TrackOneDigiIn[3]++;
753 if (m_pTmc <= 0.3 && m_pTmc > 0.2) TrackOneDigiIn[2]++;
754 if (m_pTmc <= 0.2 && m_pTmc > 0.1) TrackOneDigiIn[1]++;
755 if (m_pTmc <= 0.1) TrackOneDigiIn[0]++;
757 m_h1INtrack1_pt->Fill(m_pTmc);
758 m_h1INtrack1_phi->Fill(m_phimc);
759 m_h1INtrack1_lambda->Fill(m_lambdamc);
760 m_h1INtrack1_cosTheta->Fill(m_costhetamc);
761 }
else if (part_outsideROI) {
763 if (m_pTmc > 1) nnotINtrack2[5]++;
764 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack2[4]++;
765 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack2[3]++;
766 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack2[2]++;
767 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack2[1]++;
768 if (m_pTmc <= 0.1) nnotINtrack2[0]++;
769 }
else if (part_noROI) {
771 if (m_pTmc > 1) nnotINtrack3[5]++;
772 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack3[4]++;
773 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack3[3]++;
774 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack3[2]++;
775 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack3[1]++;
776 if (m_pTmc <= 0.1) nnotINtrack3[0]++;
777 }
else if (part_wrongVxdID) {
779 if (m_pTmc > 1) nnotINtrack4[5]++;
780 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack4[4]++;
781 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack4[3]++;
782 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack4[2]++;
783 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack4[1]++;
784 if (m_pTmc <= 0.1) nnotINtrack4[0]++;
785 }
else if (part_noInter) {
787 if (m_pTmc > 1) nnotINtrack5[5]++;
788 if (m_pTmc <= 1 && m_pTmc > 0.5) nnotINtrack5[4]++;
789 if (m_pTmc <= 0.5 && m_pTmc > 0.3) nnotINtrack5[3]++;
790 if (m_pTmc <= 0.3 && m_pTmc > 0.2) nnotINtrack5[2]++;
791 if (m_pTmc <= 0.2 && m_pTmc > 0.1) nnotINtrack5[1]++;
792 if (m_pTmc <= 0.1) nnotINtrack5[0]++;
794 n_NoInterceptTracks++;
795 m_h1notINtrack5_phi->Fill(m_phimc);
796 m_h1notINtrack5_lambda->Fill(m_lambdamc);
797 m_h1notINtrack5_cosTheta->Fill(m_costhetamc);
798 m_h1notINtrack5_pt->Fill(m_pTmc);
804 m_h1notINtrack5->Fill(n_NoInterceptTracks);
805 m_h1Track->Fill(Ntrack);
806 m_h1INtrack1->Fill(NtrackHit);
808 n_tracksWithDigits += Ntrack;
809 n_tracksWithDigitsInROI += NtrackHit;
812 B2RESULT(
" o PXDROIFinder ANALYSIS: tot ROIs = " << ROIList.
getEntries() <<
", ok ROIs = " << nROIs);
813 B2RESULT(
" o : NtrackHit/Ntrack = " << NtrackHit <<
"/ " << Ntrack <<
" = " <<
814 (
double)NtrackHit / Ntrack);
815 if (nROIs > ROIList.
getEntries()) B2RESULT(
" HOUSTON WE HAVE A PROBLEM!");
817 m_h1okROIs->Fill(nROIs);
818 m_h1okROIfrac->Fill(1.*nROIs / ROIList.
getEntries());
825 void PXDROIFinderAnalysisModule::terminate()
829 Double_t epsilonErr[6];
830 double epsilonTot = (double)n_pxdDigitInROI / (
double) n_pxdDigit;
831 Double_t epsilon2[6];
832 Double_t epsilon2Err[6];
833 double epsilon2Tot = (double)n_tracksWithDigitsInROI / (
double) n_tracksWithDigits;
835 for (
int i = 0; i < 6; i++) {
836 m_h1digiOut2->SetBinContent(i + 1, nnotINdigit2[i]);
837 m_h1digiOut3->SetBinContent(i + 1, nnotINdigit3[i]);
838 m_h1digiOut4->SetBinContent(i + 1, nnotINdigit4[i]);
839 m_h1digiOut5->SetBinContent(i + 1, nnotINdigit5[i]);
840 m_h1digiIn->SetBinContent(i + 1, npxdDigitInROI[i]);
843 for (
int i = 0; i < 6; i++) {
844 m_h1nnotINtrack2->SetBinContent(i + 1, nnotINtrack2[i]);
845 m_h1nnotINtrack3->SetBinContent(i + 1, nnotINtrack3[i]);
846 m_h1nnotINtrack4->SetBinContent(i + 1, nnotINtrack4[i]);
847 m_h1nnotINtrack5->SetBinContent(i + 1, nnotINtrack5[i]);
848 m_h1TrackOneDigiIn->SetBinContent(i + 1, TrackOneDigiIn[i]);
851 B2RESULT(
" ROI Analysis Summary ");
852 B2RESULT(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
854 B2RESULT(
" number of tracks = " << n_tracks);
855 B2RESULT(
" number of Intercepts = " << n_intercepts);
856 B2RESULT(
" number of ROIs = " << n_rois);
858 B2RESULT(
" average number of ROIs = " << m_h1totROIs->GetMean() <<
", average area " << m_h1totArea->GetMean() <<
859 " (not excluding overlaps!)");
860 B2RESULT(
" average number of ROIs w digits = " << m_h1okROIs->GetMean() <<
", average tot area " << m_h1okArea->GetMean());
862 B2RESULT(
" red Factor = " << m_h1redFactor->GetMean() <<
", RMS = " << m_h1redFactor->GetRMS());
864 B2RESULT(
"tracks w digits: " << n_tracksWithDigits);
865 B2RESULT(
"tracks w digits in ROI: " << n_tracksWithDigitsInROI);
866 B2RESULT(
"efficiency PTD : " << epsilon2Tot <<
" +/- " << sqrt(epsilon2Tot * (1 - epsilon2Tot) / n_tracksWithDigits));
868 Int_t totTrackOneDigiIn = 0;
869 Int_t totnnotINtrack2 = 0;
870 Int_t totnnotINtrack3 = 0;
871 Int_t totnnotINtrack4 = 0;
872 Int_t totnnotINtrack5 = 0;
876 for (
int j = 0; j < m_h1TrackOneDigiIn->GetNbinsX(); j++) {
877 totTrackOneDigiIn = totTrackOneDigiIn + m_h1TrackOneDigiIn->GetBinContent(j + 1);
878 totnnotINtrack2 = totnnotINtrack2 + m_h1nnotINtrack2->GetBinContent(j + 1);
879 totnnotINtrack3 = totnnotINtrack3 + m_h1nnotINtrack3->GetBinContent(j + 1);
880 totnnotINtrack4 = totnnotINtrack4 + m_h1nnotINtrack4->GetBinContent(j + 1);
881 totnnotINtrack5 = totnnotINtrack5 + m_h1nnotINtrack5->GetBinContent(j + 1);
883 totTrack[j] = m_h1nnotINtrack5->GetBinContent(j + 1) + m_h1nnotINtrack4->GetBinContent(j + 1) + m_h1nnotINtrack3->GetBinContent(
884 j + 1) + m_h1nnotINtrack2->GetBinContent(j + 1) + m_h1TrackOneDigiIn->GetBinContent(j + 1);
887 B2RESULT(
" out ROI = " << totnnotINtrack2);
888 B2RESULT(
" no ROI = " << totnnotINtrack3);
889 B2RESULT(
" wrongVxdID = " << totnnotINtrack4);
890 B2RESULT(
" no Inter = " << totnnotINtrack5);
893 B2RESULT(
" pxdDigit : " << n_pxdDigit);
894 B2RESULT(
" pxdDigitIn : " << n_pxdDigitInROI);
896 B2RESULT(
" eff DGT: " << epsilonTot <<
" +/- " << sqrt(epsilonTot * (1 - epsilonTot) / n_pxdDigit));
897 B2RESULT(
" inefficiency (PXDDigits): ");
898 B2RESULT(
" out ROI: " << n_notINdigit2);
899 B2RESULT(
" no ROI: " << n_notINdigit3);
900 B2RESULT(
" wrongVxdID: " << n_notINdigit4);
901 B2RESULT(
" noInter: " << n_notINdigit5);
905 B2RESULT(
" pT > 1 : " << pt[5]);
906 B2RESULT(
" out ROI: " << nnotINdigit2[5]);
907 B2RESULT(
" no ROI: " << nnotINdigit3[5]);
908 B2RESULT(
" wrongVxdID: " << nnotINdigit4[5]);
909 B2RESULT(
" noInter: " << nnotINdigit5[5]);
910 B2RESULT(
" pxdDigit : " << npxdDigit[5]);
911 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[5]);
912 if ((npxdDigit[5] - npxdDigitInROI[5]) != (nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] + nnotINdigit5[5]))
913 B2RESULT(
" pxdDigitOut : " << npxdDigit[5] - npxdDigitInROI[5] <<
" != " << nnotINdigit2[5] + nnotINdigit3[5] + nnotINdigit4[5] +
915 epsilon[5] = (double)npxdDigitInROI[5] / (
double) npxdDigit[5];
916 epsilonErr[5] = sqrt(epsilon[5] * (1 - epsilon[5]) / npxdDigit[5]);
917 B2RESULT(
" efficiency : " << epsilon[5] <<
" +/- " << epsilonErr[5]);
918 epsilon2[5] = (double)TrackOneDigiIn[5] / (
double) totTrack[5] ;
919 epsilon2Err[5] = sqrt(epsilon2[5] * (1 - epsilon2[5]) / totTrack[5]);
920 B2RESULT(
" efficiency2 : " << epsilon2[5] <<
" +/- " << epsilon2Err[5]);
923 B2RESULT(
" 0.5 < pT < 1 : " << pt[4]);
924 B2RESULT(
" out ROI: " << nnotINdigit2[4]);
925 B2RESULT(
" no ROI: " << nnotINdigit3[4]);
926 B2RESULT(
" wrongVxdID: " << nnotINdigit4[4]);
927 B2RESULT(
" noInter: " << nnotINdigit5[4]);
928 B2RESULT(
" pxdDigit : " << npxdDigit[4]);
929 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[4]);
930 if ((npxdDigit[4] - npxdDigitInROI[4]) != (nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] + nnotINdigit5[4]))
931 B2RESULT(
" pxdDigitOut : " << npxdDigit[4] - npxdDigitInROI[4] <<
" != " << nnotINdigit2[4] + nnotINdigit3[4] + nnotINdigit4[4] +
933 epsilon[4] = (double)npxdDigitInROI[4] / (
double) npxdDigit[4];
934 epsilonErr[4] = sqrt(epsilon[4] * (1 - epsilon[4]) / npxdDigit[4]);
935 B2RESULT(
" efficiency : " << epsilon[4] <<
" +/- " << epsilonErr[4]);
936 epsilon2[4] = (double)TrackOneDigiIn[4] / (
double) totTrack[4] ;
937 epsilon2Err[4] = sqrt(epsilon2[4] * (1 - epsilon2[4]) / totTrack[4]);
938 B2RESULT(
" efficiency2 : " << epsilon2[4] <<
" +/- " << epsilon2Err[4]);
941 B2RESULT(
" 0.3 < pT < 0.5 : " << pt[3]);
942 B2RESULT(
" out ROI: " << nnotINdigit2[3]);
943 B2RESULT(
" no ROI: " << nnotINdigit3[3]);
944 B2RESULT(
" wrongVxdID: " << nnotINdigit4[3]);
945 B2RESULT(
" noInter: " << nnotINdigit5[3]);
946 B2RESULT(
" pxdDigit : " << npxdDigit[3]);
947 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[3]);
948 if ((npxdDigit[3] - npxdDigitInROI[3]) != (nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] + nnotINdigit5[3]))
949 B2RESULT(
" pxdDigitOut : " << npxdDigit[3] - npxdDigitInROI[3] <<
" != " << nnotINdigit2[3] + nnotINdigit3[3] + nnotINdigit4[3] +
951 epsilon[3] = (double)npxdDigitInROI[3] / (
double) npxdDigit[3];
952 epsilonErr[3] = sqrt(epsilon[3] * (1 - epsilon[3]) / npxdDigit[3]);
953 B2RESULT(
" efficiency : " << epsilon[3] <<
" +/- " << epsilonErr[3]);
954 epsilon2[3] = (double)TrackOneDigiIn[3] / (
double) totTrack[3];
955 epsilon2Err[3] = sqrt(epsilon2[3] * (1 - epsilon2[3]) / totTrack[3]);
956 B2RESULT(
" efficiency2 : " << epsilon2[3] <<
" +/- " << epsilon2Err[3]);
959 B2RESULT(
" 0.2 < pT < 0.3 : " << pt[2]);
960 B2RESULT(
" out ROI: " << nnotINdigit2[2]);
961 B2RESULT(
" no ROI: " << nnotINdigit3[2]);
962 B2RESULT(
" wrongVxdID: " << nnotINdigit4[2]);
963 B2RESULT(
" noInter: " << nnotINdigit5[2]);
964 B2RESULT(
" pxdDigit : " << npxdDigit[2]);
965 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[2]);
966 if ((npxdDigit[2] - npxdDigitInROI[2]) != (nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] + nnotINdigit5[2]))
967 B2RESULT(
" pxdDigitOut : " << npxdDigit[2] - npxdDigitInROI[2] <<
" != " << nnotINdigit2[2] + nnotINdigit3[2] + nnotINdigit4[2] +
969 epsilon[2] = (double)npxdDigitInROI[2] / (
double) npxdDigit[2];
970 epsilonErr[2] = sqrt(epsilon[2] * (1 - epsilon[2]) / npxdDigit[2]);
971 B2RESULT(
" efficiency : " << epsilon[2] <<
" +/- " << epsilonErr[2]);
972 epsilon2[2] = (double)TrackOneDigiIn[2] / (
double) totTrack[2] ;
973 epsilon2Err[2] = sqrt(epsilon2[2] * (1 - epsilon2[2]) / totTrack[2]);
974 B2RESULT(
" efficiency2 : " << epsilon2[2] <<
" +/- " << epsilon2Err[2]);
977 B2RESULT(
" 0.1 < pT < 0.2 : " << pt[1]);
978 B2RESULT(
" out ROI: " << nnotINdigit2[1]);
979 B2RESULT(
" no ROI: " << nnotINdigit3[1]);
980 B2RESULT(
" wrongVxdID: " << nnotINdigit4[1]);
981 B2RESULT(
" noInter: " << nnotINdigit5[1]);
982 B2RESULT(
" pxdDigit : " << npxdDigit[1]);
983 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[1]);
984 if ((npxdDigit[1] - npxdDigitInROI[1]) != (nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] + nnotINdigit5[1]))
985 B2RESULT(
" pxdDigitOut : " << npxdDigit[1] - npxdDigitInROI[1] <<
" ?=? " << nnotINdigit2[1] + nnotINdigit3[1] + nnotINdigit4[1] +
987 epsilon[1] = (double)npxdDigitInROI[1] / (
double) npxdDigit[1];
988 epsilonErr[1] = sqrt(epsilon[1] * (1 - epsilon[1]) / npxdDigit[1]);
989 B2RESULT(
" efficiency : " << epsilon[1] <<
" +/- " << epsilonErr[1]);
990 epsilon2[1] = (double)TrackOneDigiIn[1] / (
double) totTrack[1] ;
991 epsilon2Err[1] = sqrt(epsilon2[1] * (1 - epsilon2[1]) / totTrack[1]);
992 B2RESULT(
" efficiency2 : " << epsilon2[1] <<
" +/- " << epsilon2Err[1]);
995 B2RESULT(
" pT < 0.1 : " << pt[0]);
996 B2RESULT(
" out ROI: " << nnotINdigit2[0]);
997 B2RESULT(
" no ROI: " << nnotINdigit3[0]);
998 B2RESULT(
" wrongVxdID: " << nnotINdigit4[0]);
999 B2RESULT(
" noInter: " << nnotINdigit5[0]);
1000 B2RESULT(
" pxdDigit : " << npxdDigit[0]);
1001 B2RESULT(
" pxdDigitIn : " << npxdDigitInROI[0]);
1002 if ((npxdDigit[0] - npxdDigitInROI[0]) != (nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] + nnotINdigit5[0]))
1003 B2RESULT(
" pxdDigitOut : " << npxdDigit[0] - npxdDigitInROI[0] <<
" ?=? " << nnotINdigit2[0] + nnotINdigit3[0] + nnotINdigit4[0] +
1005 epsilon[0] = (double)npxdDigitInROI[0] / (
double) npxdDigit[0];
1006 epsilonErr[0] = sqrt(epsilon[0] * (1 - epsilon[0]) / npxdDigit[0]);
1007 B2RESULT(
" efficiency : " << epsilon[0] <<
" +/- " << epsilonErr[0]);
1008 epsilon2[0] = (double)TrackOneDigiIn[0] / (
double) totTrack[0] ;
1009 epsilon2Err[0] = sqrt(epsilon2[0] * (1 - epsilon2[0]) / totTrack[0]);
1010 B2RESULT(
" efficiency2 : " << epsilon2[0] <<
" +/- " << epsilon2Err[0]);
1012 B2RESULT(
"legend:");
1013 B2RESULT(
" CASO2: if (ROI exists but no PXDDigit inside)");
1014 B2RESULT(
" CASO3: if (ROI does not exist, intercept with correct VxdID)");
1015 B2RESULT(
" CASO4: if (intercept with wrong VxdID)");
1016 B2RESULT(
" CASO5: if (intercept does not exist)");
1019 m_gEff2 =
new TGraphErrors(6, pt, epsilon2, ptErr, epsilon2Err);
1020 m_gEff2->SetName(
"g_eff2");
1021 m_gEff2->SetTitle(
"Normalized to MCParticles with digits and related track");
1022 m_gEff =
new TGraphErrors(6, pt, epsilon, ptErr, epsilonErr);
1023 m_gEff->SetName(
"g_eff");
1024 m_gEff->SetTitle(
"Normalized to digits of MCParticles with digits and related track");
1028 if (m_rootFilePtr !=
nullptr) {
1029 m_rootFilePtr->cd();
1031 TDirectory* oldDir = gDirectory;
1032 TDirectory* m_digiDir = oldDir->mkdir(
"digits");
1033 TDirectory* m_tracksDir = oldDir->mkdir(
"tracks");
1034 TDirectory* m_notINtrack5 = oldDir->mkdir(
"notINtrack5");
1035 TDirectory* m_INtrack1 = oldDir->mkdir(
"INtrack1");
1036 TDirectory* m_alltracks = oldDir->mkdir(
"alltracks");
1037 TDirectory* m_in = oldDir->mkdir(
"digi_in");
1038 TDirectory* m_out2 = oldDir->mkdir(
"digi_out2");
1039 TDirectory* m_out3 = oldDir->mkdir(
"digi_out3");
1040 TDirectory* m_out4 = oldDir->mkdir(
"digi_out4");
1041 TDirectory* m_out5 = oldDir->mkdir(
"digi_out5");
1042 TDirectory* m_ROIDir = oldDir->mkdir(
"roi");
1044 m_h1DigitsPerParticle->Write();
1045 m_h1RecoTracksPerParticle->Write();
1049 m_h1effPerTrack->Write();
1053 m_h1digiIn->Write();
1054 m_h1digiOut2->Write();
1055 m_h1digiOut3->Write();
1056 m_h1digiOut4->Write();
1057 m_h1digiOut5->Write();
1060 m_h1TrackOneDigiIn->Write();
1061 m_h1nnotINtrack2->Write();
1062 m_h1nnotINtrack3->Write();
1063 m_h1nnotINtrack4->Write();
1064 m_h1nnotINtrack5->Write();
1066 m_notINtrack5->cd();
1067 m_h1notINtrack5->Write();
1068 m_h1notINtrack5_pt->Write();
1069 m_h1notINtrack5_phi->Write();
1070 m_h1notINtrack5_lambda->Write();
1071 m_h1notINtrack5_cosTheta->Write();
1074 m_h1INtrack1->Write();
1075 m_h1INtrack1_pt->Write();
1076 m_h1INtrack1_phi->Write();
1077 m_h1INtrack1_lambda->Write();
1078 m_h1INtrack1_cosTheta->Write();
1082 m_h1Track_pt->Write();
1083 m_h1Track_phi->Write();
1084 m_h1Track_lambda->Write();
1085 m_h1Track_cosTheta->Write();
1088 m_h1GlobalTime->Write();
1091 m_h1ResidU->Write();
1092 m_h1ResidV->Write();
1093 m_h2ResidUV->Write();
1094 m_h1SigmaU->Write();
1095 m_h1SigmaV->Write();
1096 m_h2sigmaUphi->Write();
1097 m_h2sigmaVphi->Write();
1098 m_h2Mapglob->Write();
1099 m_h2MaplocL1->Write();
1100 m_h2MaplocL2->Write();
1103 m_h1GlobalTime_out2->Write();
1104 m_h1ResidU_out2->Write();
1105 m_h1ResidV_out2->Write();
1106 m_h2ResidUV_out2->Write();
1107 m_h1SigmaU_out2->Write();
1108 m_h1SigmaV_out2->Write();
1109 m_h2sigmaUphi_out2->Write();
1110 m_h2sigmaVphi_out2->Write();
1111 m_h2Mapglob_out2->Write();
1112 m_h2MaplocL1_out2->Write();
1113 m_h2MaplocL2_out2->Write();
1116 m_h1GlobalTime_out3->Write();
1117 m_h1ResidU_out3->Write();
1118 m_h1ResidV_out3->Write();
1119 m_h2ResidUV_out3->Write();
1120 m_h1SigmaU_out3->Write();
1121 m_h1SigmaV_out3->Write();
1122 m_h2sigmaUphi_out3->Write();
1123 m_h2sigmaVphi_out3->Write();
1124 m_h2Mapglob_out3->Write();
1125 m_h2MaplocL1_out3->Write();
1126 m_h2MaplocL2_out3->Write();
1129 m_h1GlobalTime_out4->Write();
1130 m_h1SigmaU_out4->Write();
1131 m_h1SigmaV_out4->Write();
1132 m_h2sigmaUphi_out4->Write();
1133 m_h2sigmaVphi_out4->Write();
1134 m_h2Mapglob_out4->Write();
1135 m_h2MaplocL1_out4->Write();
1136 m_h2MaplocL2_out4->Write();
1139 m_h1GlobalTime_out5->Write();
1140 m_h2Mapglob_out5->Write();
1141 m_h2MaplocL1_out5->Write();
1142 m_h2MaplocL2_out5->Write();
1145 m_h1totArea->Write();
1146 m_h1okArea->Write();
1147 m_h1okROIs->Write();
1148 m_h1okROIfrac->Write();
1149 m_h1totROIs->Write();
1150 m_h1redFactor->Write();
1151 m_h1redFactor_L1->Write();
1152 m_h1redFactor_L2->Write();
1155 m_h2ROIbottomLeft->Write();
1156 m_h2ROItopRight->Write();
1157 m_h2ROIuMinMax->Write();
1158 m_h2ROIvMinMax->Write();
1159 m_rootFilePtr->Close();
A Class to store the Monte Carlo particle information.
TVector3 getMomentum() const
Return momentum.
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
The PXD Data Reduction Analysis Module.
ROIid stores the U and V ids and the sensor id of the Region Of Interest.
bool Contains(const Belle2::PXDRawHit &thePXDRawHit) const
true if the ROI contains the thePXDRawHit
int getMaxVid() const
return the maximum V id of the ROI
int getMinVid() const
return the minimum V id of the ROI
int getMinUid() const
return the minimum U id of the ROI
int getMaxUid() const
return the maximum U id of the ROI
This is the Reconstruction Event-Data Model Track.
Provides access to fast ( O(log n) ) bi-directional lookups on a specified relation.
index_from::const_iterator iterator_from
Element iterator of the from side index.
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.
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
Accessor to arrays stored in the data store.
int getEntries() const
Get the number of objects in the array.
double getSigmaV() const
return the statistical error on the V coordinate of the intercept
double getCoorV() const
return the V coordinate of the intercept
double getSigmaU() const
return the statistical error on the U coordinate of the intercept
VxdID::baseType getSensorID() const
return the sensor ID
double getCoorU() const
return the U coordinate of the intercept
Class to faciliate easy access to sensor information of the VXD like coordinate transformations or pi...
const std::set< Belle2::VxdID > getLayers(SensorInfoBase::SensorType sensortype=SensorInfoBase::VXD)
Return a set of all known Layers.
const SensorInfoBase & getSensorInfo(Belle2::VxdID id) const
Return a referecne to the SensorInfo of a given SensorID.
const std::set< Belle2::VxdID > & getSensors(Belle2::VxdID ladder) const
Return a set of all sensor IDs belonging to a given ladder.
const std::set< Belle2::VxdID > & getLadders(Belle2::VxdID layer) const
Return a set of all ladder IDs belonging to a given layer.
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.
TVector3 pointToGlobal(const TVector3 &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.
baseType getSensorNumber() const
Get the sensor id.
baseType getLayerNumber() const
Get the layer id.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.