9#include <tracking/modules/roiFinding/pxd/PXDROIFinderAnalysisModule.h>
10#include <framework/datastore/RelationArray.h>
11#include <framework/datastore/RelationIndex.h>
13#include <mdst/dataobjects/MCParticle.h>
14#include <tracking/dataobjects/RecoTrack.h>
15#include <tracking/dataobjects/ROIid.h>
16#include <tracking/dataobjects/PXDIntercept.h>
18#include <svd/dataobjects/SVDCluster.h>
19#include <pxd/dataobjects/PXDDigit.h>
20#include <pxd/dataobjects/PXDTrueHit.h>
21#include <vxd/geometry/GeoCache.h>
24#include <Math/Vector3D.h>
38 , m_writeToRoot(false)
76 , n_tracksWithDigits(0)
77 , n_tracksWithDigitsInROI(0)
102 setDescription(
"This module performs the analysis of the PXDROIFinder module output");
105 "set true if you want to save the information in a root file named by parameter 'rootFileName'",
bool(
true));
108 "fileName used for . Will be ignored if parameter 'writeToRoot' is false (standard)",
109 std::string(
"pxdDataRedAnalysis"));
112 "name of the input collection of RecoTracks", std::string(
""));
115 "name of the list of interceptions", std::string(
""));
118 "name of the list of ROIs", std::string(
""));
145 for (
int i = 0; i < 6; i++) {
157 m_h1GlobalTime =
new TH1F(
"hGlobalTime",
"global time for PXDDigits contained in ROI", 100, 0, 1);
158 m_h1PullU =
new TH1F(
"hPullU",
"U pulls for PXDDigits contained in ROI", 100, -6, 6);
159 m_h1PullV =
new TH1F(
"hPullV",
"V pulls for PXDDigits contained in ROI", 100, -6, 6);
160 m_h2sigmaUphi =
new TH2F(
"hsigmaUvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.35);
161 m_h2sigmaVphi =
new TH2F(
"hsigmaVvsPhi",
"sigmaU vs phi digits in ROI", 100, -180, 180, 100, 0, 0.4);
162 m_h1ResidU =
new TH1F(
"hResidU",
"U resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
163 m_h1ResidV =
new TH1F(
"hResidV",
"V resid for PXDDigits contained in ROI", 100, -0.5, 0.5);
164 m_h2ResidUV =
new TH2F(
"hResidUV",
"U,V resid for PXDDigits contained in ROI", 100, -0.5, 0.5, 100, -0.5, 0.5);
165 m_h1SigmaU =
new TH1F(
"hSigmaU",
"sigmaU for PXDDigits contained in ROI", 100, 0, 0.35);
166 m_h1SigmaV =
new TH1F(
"hSigmaV",
"sigmaV for PXDDigits contained in ROI", 100, 0, 0.35);
167 m_h2Mapglob =
new TH2F(
"h2Mapglob",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
168 m_h2MaplocL1 =
new TH2F(
"h2MaplocL1",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
169 m_h2MaplocL2 =
new TH2F(
"h2MaplocL2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
176 m_h1GlobalTime_out2 =
new TH1F(
"hGlobalTime_out2",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
177 m_h2sigmaUphi_out2 =
new TH2F(
"hsigmaUvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
178 m_h2sigmaVphi_out2 =
new TH2F(
"hsigmaVvsPhi_out2",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
179 m_h1ResidU_out2 =
new TH1F(
"hResidU_out2",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
180 m_h1ResidV_out2 =
new TH1F(
"hResidV_out2",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
181 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);
182 m_h1SigmaU_out2 =
new TH1F(
"hSigmaU_out2",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
183 m_h1SigmaV_out2 =
new TH1F(
"hSigmaV_out2",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
184 m_h2Mapglob_out2 =
new TH2F(
"h2Mapglob_out2",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
185 m_h2MaplocL1_out2 =
new TH2F(
"h2MaplocL1_out2",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
186 m_h2MaplocL2_out2 =
new TH2F(
"h2MaplocL2_out2",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
189 m_h1GlobalTime_out3 =
new TH1F(
"hGlobalTime_out3",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
190 m_h2sigmaUphi_out3 =
new TH2F(
"hsigmaUvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
191 m_h2sigmaVphi_out3 =
new TH2F(
"hsigmaVvsPhi_out3",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
192 m_h1ResidU_out3 =
new TH1F(
"hResidU_out3",
"U resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
193 m_h1ResidV_out3 =
new TH1F(
"hResidV_out3",
"V resid for PXDDigits not contained in ROI", 100, -2.5, 2.5);
194 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);
195 m_h1SigmaU_out3 =
new TH1F(
"hSigmaU_out3",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
196 m_h1SigmaV_out3 =
new TH1F(
"hSigmaV_out3",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
198 m_h2Mapglob_out3 =
new TH2F(
"h2Mapglob_out3",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
199 m_h2MaplocL1_out3 =
new TH2F(
"h2MaplocL1_out3",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
200 m_h2MaplocL2_out3 =
new TH2F(
"h2MaplocL2_out3",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
203 m_h1GlobalTime_out4 =
new TH1F(
"hGlobalTime_out4",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
204 m_h2sigmaUphi_out4 =
new TH2F(
"hsigmaUvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.35);
205 m_h2sigmaVphi_out4 =
new TH2F(
"hsigmaVvsPhi_out4",
"sigmaU vs phi digits not contained in ROI", 100, -180, 180, 100, 0, 0.4);
206 m_h1SigmaU_out4 =
new TH1F(
"hSigmaU_out4",
"sigmaU for PXDDigits not contained in ROI", 100, 0, 0.35);
207 m_h1SigmaV_out4 =
new TH1F(
"hSigmaV_out4",
"sigmaV for PXDDigits not contained in ROI", 100, 0, 0.35);
209 m_h2Mapglob_out4 =
new TH2F(
"h2Mapglob_out4",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
210 m_h2MaplocL1_out4 =
new TH2F(
"h2MaplocL1_out4",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
211 m_h2MaplocL2_out4 =
new TH2F(
"h2MaplocL2_out4",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
214 m_h1GlobalTime_out5 =
new TH1F(
"hGlobalTime_out5",
"global time for PXDDigits not contained in ROI", 100, 0, 1);
216 m_h2Mapglob_out5 =
new TH2F(
"h2Mapglob_out5",
"global position, perp - phi", 500, 1.2, 2.6, 100, -TMath::Pi(), TMath::Pi());
217 m_h2MaplocL1_out5 =
new TH2F(
"h2MaplocL1_out5",
"L1 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
218 m_h2MaplocL2_out5 =
new TH2F(
"h2MaplocL2_out5",
"L2 local u v ID", 1535, -767.5, 767.5, 250, -0.5, 249.5);
221 m_h1redFactor =
new TH1F(
"hRedFactor",
"L1+L2reduction factor", 1000, 0, 1);
222 m_h1redFactor_L1 =
new TH1F(
"hRedFactor_L1",
"L1-only reduction factor", 1000, 0, 1);
223 m_h1redFactor_L2 =
new TH1F(
"hRedFactor_L2",
"L2-only reduction factor", 1000, 0, 1);
225 m_h1totROIs =
new TH1F(
"h1TotNROIs",
"number of all ROIs", 110, 0, 110);
226 m_h1okROIs =
new TH1F(
"h1OkNROIs",
"number of all ROIs containing a PXDDigit", 110, 0, 110);
227 m_h1okROIfrac =
new TH1F(
"h1OkNROIfrac",
"fraction of ROIs containing a PXDDigit", 100, 0, 1);
229 m_h1totArea =
new TH1F(
"h1TotArea",
"Area of all ROIs", 100, 0, 2500000);
230 m_h1okArea =
new TH1F(
"h1OkArea",
"Area of ROIs containing a PXDDigit", 100, 0, 75000);
234 m_h1effPerTrack =
new TH1F(
"heffPerTrack",
"fraction of digits in ROI per track", 100, -0.02, 1.02);
238 m_h2ROIbottomLeft =
new TH2F(
"h2ROIbottomLeft",
"u,v ID of the bottom left pixel", 650, -200, 450, 1300, -300, 1000);
239 m_h2ROItopRight =
new TH2F(
"h2ROItopRight",
"u,v ID of the top right pixel", 650, -200, 450, 1300, -300, 1000);
241 m_h2ROIuMinMax =
new TH2F(
"h2ROIuMinMax",
"u Min vs Max", 650, -200, 450, 650, -200, 450);
242 m_h2ROIvMinMax =
new TH2F(
"h2ROIvMinMax",
"v Min vs Max", 1300, -300, 1000, 1300, -300, 1000);
250 Double_t lowBin[6 + 1];
251 for (
int i = 0; i < 6; i++)
255 m_h1TrackOneDigiIn =
new TH1F(
"hTracksDigiIn",
"Tracks with at least one digit contained in a ROI", 6, lowBin);
256 m_h1nnotINtrack2 =
new TH1F(
"h1outROITrack",
"Tracks with ROI with correct VxdID but no digits inside ROI", 6, lowBin);
257 m_h1nnotINtrack3 =
new TH1F(
"h1noROITrack",
"Tracks with ROI with wrong VxdID but no digits inside ROI", 6, lowBin);
258 m_h1nnotINtrack4 =
new TH1F(
"h1wrongVxdIDTrack",
"Tracks with no ROI, Intercept with correct VxdID", 6, lowBin);
259 m_h1nnotINtrack5 =
new TH1F(
"h1noInterTrack",
"Tracks with no Intercept matching a VxdID of digits", 6, lowBin);
261 m_h1notINtrack5 =
new TH1F(
"hNoInterTrack",
"track with no intercepts", 20, 0, 20);
262 m_h1notINtrack5_pt =
new TH1F(
"hNoInterTrack_pT",
"track with no intercepts", 100, 0, 6);
270 m_h1INtrack1 =
new TH1F(
"hINTrack",
"track with at least one digit inside ROI", 20, 0, 20);
271 m_h1INtrack1_pt =
new TH1F(
"hINTrack_pT",
"track with at least one digit inside ROI", 100, 0, 6);
272 m_h1INtrack1_phi =
new TH1F(
"h1INTrack_phi",
"hINTrack_phi", 100, -180, 180);
275 m_h1INtrack1_pVal =
new TH1F(
"h1INTrack_pVal",
"track with no intercepts", 100, 0, 1);
279 m_h1Track =
new TH1F(
"hTrack",
"all tracks", 20, 0, 20);
280 m_h1Track_pt =
new TH1F(
"hTrack_pT",
"all tracks with digits", 100, 0, 6);
281 m_h1Track_lambda =
new TH1F(
"h1Track_lambda",
"hTrack_lambda", 100, -180, 180);
282 m_h1Track_phi =
new TH1F(
"h1Track_phi",
"hTrack_phi", 100, -180, 180);
284 m_h1Track_pVal =
new TH1F(
"h1Track_pVal",
"track with no intercepts", 100, 0, 1);
285 m_h1Track_nSVDhits =
new TH1F(
"h1Track_nSVDhits",
"track with no intercepts", 50, 0, 50);
286 m_h1Track_nCDChits =
new TH1F(
"h1Track_nCDChits",
"track with no intercepts", 100, 0, 100);
288 m_h1digiIn =
new TH1F(
"hdigiIn",
"digits inside ROI", 6, lowBin);
289 m_h1digiOut2 =
new TH1F(
"hdigiOut2",
"ROI exists with with correct VxdID but no digits inside ROI", 6, lowBin);
290 m_h1digiOut3 =
new TH1F(
"hdigiOut3",
"ROI exists with with wrong VxdID", 6, lowBin);
291 m_h1digiOut4 =
new TH1F(
"hdigiOut4",
"ROI does not exist, but intercept has correct VxdID", 6, lowBin);
292 m_h1digiOut5 =
new TH1F(
"hdigiOut5",
"no ROI, no Intercpets with correct VXDid", 6, lowBin);
308 std::set<Belle2::VxdID>::iterator itPxdLayers = pxdLayers.begin();
310 while ((itPxdLayers != pxdLayers.end()) && (itPxdLayers->getLayerNumber() != 7)) {
312 std::set<Belle2::VxdID> pxdLadders = aGeometry.
getLadders(*itPxdLayers);
313 std::set<Belle2::VxdID>::iterator itPxdLadders = pxdLadders.begin();
315 while (itPxdLadders != pxdLadders.end()) {
317 std::set<Belle2::VxdID> pxdSensors = aGeometry.
getSensors(*itPxdLadders);
318 std::set<Belle2::VxdID>::iterator itPxdSensors = pxdSensors.begin();
320 while (itPxdSensors != pxdSensors.end()) {
322 if (itPxdLadders->getLayerNumber() == 1)
324 if (itPxdLadders->getLayerNumber() == 2)
345 RelationIndex < PXDDigit, PXDTrueHit >
347 DataStore::arrayName<PXDTrueHit>(
"")));
348 RelationIndex < RecoTrack, PXDIntercept >
351 double tmpGlobalTime;
357 B2DEBUG(1,
" ++++++++++++++ PXDROIFinderAnalysisModule");
370 for (
int i = 0; i < (int)
m_ROIs.getEntries(); i++) {
376 int tmpArea = (
m_ROIs[i]->getMaxUid() -
m_ROIs[i]->getMinUid()) * (
m_ROIs[i]->getMaxVid() -
m_ROIs[i]->getMinVid());
377 if ((
m_ROIs[i]->getSensorID()).getLayerNumber() == 1)
378 totArea_L1 += tmpArea;
380 totArea_L2 += tmpArea;
384 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
392 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++)
393 if (
m_ROIs[i]->Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
402 double redFactor_L1 = totArea_L1 / 768. / 250. /
m_nSensorsL1;
403 double redFactor_L2 = totArea_L2 / 768. / 250. /
m_nSensorsL2;
417 Int_t n_NoInterceptTracks = 0;
423 for (
int j = 0; j < (int)mcParticles.
getEntries(); j++) {
432 if (pxdDigits_MCParticle.
size() == 0)
438 if (recoTracks_MCParticle.size() == 0)
445 B2DEBUG(1,
"Number of RecoTracks = " << recoTracks_MCParticle.size() <<
" and PXDDigits = " << pxdDigits_MCParticle.
size() <<
446 " related to this MCParticle");
470 bool part_outsideROI =
false;
471 bool part_noROI =
false;
472 bool part_wrongVxdID =
false;
473 bool part_noInter =
false;
474 bool hasOneDigitInROI =
false;
478 Int_t nDigitsInRoiPerTrack = 0;
479 Int_t nDigitsPerTrack = 0;
482 for (
unsigned int iPXDDigit = 0; iPXDDigit < pxdDigits_MCParticle.
size(); iPXDDigit++) {
484 bool hasIntercept =
false;
486 bool interceptRightVxdID =
false;
487 bool MissingHit =
true;
492 PXDTrueHitFromPXDDigit PXDTrueHits = relDigitTrueHit.
getElementsFrom(*pxdDigits_MCParticle[iPXDDigit]);
493 PXDTrueHitIteratorType thePXDTrueHitIterator = PXDTrueHits.begin();
494 PXDTrueHitIteratorType thePXDTrueHitIteratorEnd = PXDTrueHits.end();
498 for (; thePXDTrueHitIterator != thePXDTrueHitIteratorEnd; thePXDTrueHitIterator++) {
499 tmpGlobalTime = tmpGlobalTime + thePXDTrueHitIterator->to->getGlobalTime();
505 m_Uidmc = pxdDigits_MCParticle[iPXDDigit]->getUCellID();
506 m_Vidmc = pxdDigits_MCParticle[iPXDDigit]->getVCellID();
507 m_vxdIDmc = pxdDigits_MCParticle[iPXDDigit]->getSensorID();
526 ROOT::Math::XYZVector globalSensorPos = aSensorInfo.
pointToGlobal(local,
true);
530 if (m_pTmc <= 1 && m_pTmc > 0.5)
npxdDigit[4]++;
531 if (m_pTmc <= 0.5 && m_pTmc > 0.3)
npxdDigit[3]++;
532 if (m_pTmc <= 0.3 && m_pTmc > 0.2)
npxdDigit[2]++;
533 if (m_pTmc <= 0.2 && m_pTmc > 0.1)
npxdDigit[1]++;
537 for (
int i = 0; i < (int)recoTracks_MCParticle.size(); i++) {
539 PXDInterceptsFromRecoTracks PXDIntercepts = recoTrackToPXDIntercept.
getElementsFrom(recoTracks_MCParticle[i]);
541 PXDInterceptIteratorType thePXDInterceptIterator = PXDIntercepts.begin();
542 PXDInterceptIteratorType thePXDInterceptIteratorEnd = PXDIntercepts.end();
545 for (; thePXDInterceptIterator != thePXDInterceptIteratorEnd; thePXDInterceptIterator++) {
547 const PXDIntercept* theIntercept = thePXDInterceptIterator->to;
560 interceptRightVxdID =
true;
572 if (theROIid->
Contains(*(pxdDigits_MCParticle[iPXDDigit]))) {
575 nDigitsInRoiPerTrack++;
587 m_h2Mapglob->Fill(globalSensorPos.Rho(), globalSensorPos.Phi());
598 okArea_L1 = okArea_L1 + tmpArea;
600 okArea_L2 = okArea_L2 + tmpArea;
603 hasOneDigitInROI =
true;
631 if (hasROI && hasIntercept && interceptRightVxdID) {
632 part_outsideROI =
true;
657 }
else if (!hasROI && hasIntercept && interceptRightVxdID) {
685 }
else if (hasIntercept && !interceptRightVxdID) {
686 part_wrongVxdID =
true;
708 }
else if (!hasIntercept) {
736 if (hasOneDigitInROI) {
749 }
else if (part_outsideROI) {
757 }
else if (part_noROI) {
765 }
else if (part_wrongVxdID) {
773 }
else if (part_noInter) {
782 n_NoInterceptTracks++;
800 B2INFO(
" o PXDROIFinder ANALYSIS: tot ROIs = " <<
m_ROIs.getEntries() <<
", ok ROIs = " << nROIs);
801 B2INFO(
" o : NtrackHit/Ntrack = " <<
NtrackHit <<
"/ " <<
Ntrack <<
" = " <<
803 if (nROIs >
m_ROIs.getEntries()) B2INFO(
" HOUSTON WE HAVE A PROBLEM!");
815 Double_t epsilonErr[6];
817 Double_t epsilon2[6];
818 Double_t epsilon2Err[6];
821 for (
int i = 0; i < 6; i++) {
829 for (
int i = 0; i < 6; i++) {
837 B2INFO(
" ROI Analysis Summary ");
838 B2INFO(
"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
840 B2INFO(
" number of tracks = " <<
n_tracks);
842 B2INFO(
" number of ROIs = " <<
n_rois);
844 B2INFO(
" average number of ROIs = " <<
m_h1totROIs->GetMean() <<
", average area " <<
m_h1totArea->GetMean() <<
845 " (not excluding overlaps!)");
846 B2INFO(
" average number of ROIs w digits = " <<
m_h1okROIs->GetMean() <<
", average tot area " <<
m_h1okArea->GetMean());
852 B2INFO(
"efficiency PTD : " << epsilon2Tot <<
" +/- " <<
sqrt(epsilon2Tot * (1 - epsilon2Tot) /
n_tracksWithDigits));
854 Int_t totTrackOneDigiIn = 0;
855 Int_t totnnotINtrack2 = 0;
856 Int_t totnnotINtrack3 = 0;
857 Int_t totnnotINtrack4 = 0;
858 Int_t totnnotINtrack5 = 0;
873 B2INFO(
" out ROI = " << totnnotINtrack2);
874 B2INFO(
" no ROI = " << totnnotINtrack3);
875 B2INFO(
" wrongVxdID = " << totnnotINtrack4);
876 B2INFO(
" no Inter = " << totnnotINtrack5);
882 B2INFO(
" eff DGT: " << epsilonTot <<
" +/- " <<
sqrt(epsilonTot * (1 - epsilonTot) /
n_pxdDigit));
883 B2INFO(
" inefficiency (PXDDigits): ");
891 B2INFO(
" pT > 1 : " <<
pt[5]);
902 epsilonErr[5] =
sqrt(epsilon[5] * (1 - epsilon[5]) /
npxdDigit[5]);
903 B2INFO(
" efficiency : " << epsilon[5] <<
" +/- " << epsilonErr[5]);
905 epsilon2Err[5] =
sqrt(epsilon2[5] * (1 - epsilon2[5]) / totTrack[5]);
906 B2INFO(
" efficiency2 : " << epsilon2[5] <<
" +/- " << epsilon2Err[5]);
909 B2INFO(
" 0.5 < pT < 1 : " <<
pt[4]);
920 epsilonErr[4] =
sqrt(epsilon[4] * (1 - epsilon[4]) /
npxdDigit[4]);
921 B2INFO(
" efficiency : " << epsilon[4] <<
" +/- " << epsilonErr[4]);
923 epsilon2Err[4] =
sqrt(epsilon2[4] * (1 - epsilon2[4]) / totTrack[4]);
924 B2INFO(
" efficiency2 : " << epsilon2[4] <<
" +/- " << epsilon2Err[4]);
927 B2INFO(
" 0.3 < pT < 0.5 : " <<
pt[3]);
938 epsilonErr[3] =
sqrt(epsilon[3] * (1 - epsilon[3]) /
npxdDigit[3]);
939 B2INFO(
" efficiency : " << epsilon[3] <<
" +/- " << epsilonErr[3]);
941 epsilon2Err[3] =
sqrt(epsilon2[3] * (1 - epsilon2[3]) / totTrack[3]);
942 B2INFO(
" efficiency2 : " << epsilon2[3] <<
" +/- " << epsilon2Err[3]);
945 B2INFO(
" 0.2 < pT < 0.3 : " <<
pt[2]);
956 epsilonErr[2] =
sqrt(epsilon[2] * (1 - epsilon[2]) /
npxdDigit[2]);
957 B2INFO(
" efficiency : " << epsilon[2] <<
" +/- " << epsilonErr[2]);
959 epsilon2Err[2] =
sqrt(epsilon2[2] * (1 - epsilon2[2]) / totTrack[2]);
960 B2INFO(
" efficiency2 : " << epsilon2[2] <<
" +/- " << epsilon2Err[2]);
963 B2INFO(
" 0.1 < pT < 0.2 : " <<
pt[1]);
974 epsilonErr[1] =
sqrt(epsilon[1] * (1 - epsilon[1]) /
npxdDigit[1]);
975 B2INFO(
" efficiency : " << epsilon[1] <<
" +/- " << epsilonErr[1]);
977 epsilon2Err[1] =
sqrt(epsilon2[1] * (1 - epsilon2[1]) / totTrack[1]);
978 B2INFO(
" efficiency2 : " << epsilon2[1] <<
" +/- " << epsilon2Err[1]);
981 B2INFO(
" pT < 0.1 : " <<
pt[0]);
992 epsilonErr[0] =
sqrt(epsilon[0] * (1 - epsilon[0]) /
npxdDigit[0]);
993 B2INFO(
" efficiency : " << epsilon[0] <<
" +/- " << epsilonErr[0]);
995 epsilon2Err[0] =
sqrt(epsilon2[0] * (1 - epsilon2[0]) / totTrack[0]);
996 B2INFO(
" efficiency2 : " << epsilon2[0] <<
" +/- " << epsilon2Err[0]);
999 B2INFO(
" CASO2: if (ROI exists but no PXDDigit inside)");
1000 B2INFO(
" CASO3: if (ROI does not exist, intercept with correct VxdID)");
1001 B2INFO(
" CASO4: if (intercept with wrong VxdID)");
1002 B2INFO(
" CASO5: if (intercept does not exist)");
1007 m_gEff2->SetTitle(
"Normalized to MCParticles with digits and related track");
1008 m_gEff =
new TGraphErrors(6,
pt, epsilon,
ptErr, epsilonErr);
1009 m_gEff->SetName(
"g_eff");
1010 m_gEff->SetTitle(
"Normalized to digits of MCParticles with digits and related track");
1017 TDirectory* oldDir = gDirectory;
1018 TDirectory* m_digiDir = oldDir->mkdir(
"digits");
1019 TDirectory* m_tracksDir = oldDir->mkdir(
"tracks");
1020 TDirectory* m_notINtrack5 = oldDir->mkdir(
"notINtrack5");
1021 TDirectory* m_INtrack1 = oldDir->mkdir(
"INtrack1");
1022 TDirectory* m_alltracks = oldDir->mkdir(
"alltracks");
1023 TDirectory* m_in = oldDir->mkdir(
"digi_in");
1024 TDirectory* m_out2 = oldDir->mkdir(
"digi_out2");
1025 TDirectory* m_out3 = oldDir->mkdir(
"digi_out3");
1026 TDirectory* m_out4 = oldDir->mkdir(
"digi_out4");
1027 TDirectory* m_out5 = oldDir->mkdir(
"digi_out5");
1028 TDirectory* m_ROIDir = oldDir->mkdir(
"roi");
1052 m_notINtrack5->cd();
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.
A Class to store the Monte Carlo particle information.
ROOT::Math::XYZVector getMomentum() const
Return momentum.
void setDescription(const std::string &description)
Sets the description of the module.
PXDIntercept stores the U,V coordinates and uncertainties of the intersection of a track with an PXD ...
unsigned int n_pxdDigit
number of pxd digits
double m_costhetamc
true cos theta
std::string m_rootFileName
root file name
double m_momYmc
true p along Y
unsigned int nnotINtrack3[6]
number of tracks in bins of pt: no hit, wrong vxdID
double m_momXmc
true p along X
TH1F * m_h1SigmaU_out4
distribution of sigmaU for PXDDigits not contained in a ROI
TH2F * m_h2MaplocL2
L2 ladder u,v.
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
int m_vxdIDmc
true intercept VXD id
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
std::string m_ROIListName
ROI list name.
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.
double m_momZmc
true p along Z
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
unsigned int n_tracks
number of tracks
TH1F * m_h1INtrack1_phi
track with no intercept phi
TH1F * m_h1PullV
distribution of V pulls for PDXDigits contained in a ROI
TH2F * m_h2MaplocL1_out4
L1 ladder u,v.
TH1F * m_h1Track_pt
denominator track pT
TH1F * m_h1ResidV_out2
distribution of V resid for PXDDigits not contained in a ROI
int m_Vidmc
true intercept V id
int m_rootEvent
event number
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 containing a PXDDigit
double m_coorU
intercept U coordinate
TH1F * m_h1Track_cosTheta
denominator track cosTheta
TH1F * m_h1INtrack1_nSVDhits
denominator track pVal
double m_pTmc
transverse momentum
std::string m_PXDInterceptListName
Intercept list name.
unsigned int nnotINdigit3[6]
number of lost digits in bins of pt: no hit, wrong vxdID
double m_sigmaU
intercept U stat error
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
TH2F * m_h2Mapglob_out3
sensor perp,phi
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
double m_globalTime
global hit time
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
TH2F * m_h2Mapglob_out5
sensor perp,phi
TH1F * m_h1notINtrack5_lambda
track with no intercept lambda
TH1F * m_h1Track
denominator track
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
TH2F * m_h2MaplocL1_out3
L1 ladder u,v.
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
double m_coorV
intercept V coordinate
TH2F * m_h2MaplocL2_out2
L2 ladder u,v.
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
double m_thetamc
true theta
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
int m_Uidmc
true intercept U id
TH2F * m_h2Mapglob_out2
sensor perp,phi
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
double m_sigmaV
intercept V stat error
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_h2MaplocL2_out4
L2 ladder u,v.
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)
TH2F * m_h2MaplocL2_out3
L2 ladder u,v.
TH1F * m_h1okArea
distribution of Area of ROIs containing a PXDDigit
unsigned int n_rois
number of ROIs
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.
TH2F * m_h2MaplocL1
L1 ladder u,v.
void beginRun() override final
Called when entering a new run.
TH1F * m_h1totArea
distribution of Area of all ROIs
TH2F * m_h2MaplocL1_out2
L1 ladder u,v.
TH2F * m_h2sigmaVphi
distribution of sigmaV VS phi for PDXDigits contained in a ROI
TH1F * m_h1Track_phi
denominator track phi
TH2F * m_h2sigmaUphi_out3
distribution of sigmaU VS phi for PDXDigits not contained in a ROI
TH2F * m_h2MaplocL2_out5
L2 ladder u,v.
TFile * m_rootFilePtr
pointer at root file used for storing infos for debugging and validating purposes
TH2F * m_h2Mapglob
sensor perp,phi
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.
TH2F * m_h2MaplocL1_out5
L1 ladder u,v.
unsigned int n_notINtrack3
number of tracks with no digits in ROI (wrong vxdID)
PXDROIFinderAnalysisModule()
Constructor of the module.
TH2F * m_h2Mapglob_out4
sensor perp,phi
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.
bool Contains(const 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.
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.
TO * getRelatedTo(const std::string &name="", const std::string &namedRelation="") const
Get the object to which this object has a relation.
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.
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.
static GeoCache & getInstance()
Return a reference to the singleton instance.
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.
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.
baseType getSensorNumber() const
Get the sensor id.
baseType getLayerNumber() const
Get the layer id.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.