35 #include <TProfile2D.h> 37 #include <TDirectory.h> 46 : myRootDir(nullptr), myDeleteDir(
false), trackerTopology(tTopo) {
55 : myRootDir(nullptr), myDeleteDir(
false), trackerTopology(tTopo) {
75 TDirectory *oldDir = gDirectory;
77 const int kNumBins = 20;
78 double binsPt[kNumBins + 1] = {0.};
84 myTrackHists1D.push_back(
new TH1F(
"ptTrackLogBins",
"p_{t}(track);p_{t} [GeV]", kNumBins, binsPt));
86 myTrackHists1D.push_back(
new TH1F(
"ptTrack",
"p_{t}(track);p_{t} [GeV]", kNumBins, binsPt[0], binsPt[kNumBins]));
87 myTrackHists1D.push_back(
new TH1F(
"pTrack",
"p(track);p [GeV]", kNumBins, binsPt[0], 1.3 * binsPt[kNumBins]));
88 myTrackHists1D.push_back(
new TH1F(
"etaTrack",
"#eta(track);#eta", 26, -2.6, 2.6));
92 myTrackHists1D.push_back(
new TH1F(
"nHitTrack",
"N_{hit}(track);N_{hit}", 40, 5., 45.));
93 myTrackHists1D.push_back(
new TH1F(
"nHitBPIXTrack",
"N_{hit, BPIX}(track);N_{hit}", 45, 0., 45.));
94 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXTrack",
"N_{hit, FPIX}(track);N_{hit}", 45, 0., 45.));
95 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXplusTrack",
"N_{hit, BPIXplus}(track);N_{hit}", 45, 0., 45.));
96 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXminusTrack",
"N_{hit, BPIXminus}(track);N_{hit}", 45, 0., 45.));
97 myTrackHists1D.push_back(
new TH1F(
"nHitPIXELTrack",
"N_{hit, PIXEL}(track);N_{hit}", 45, 0., 45.));
98 myTrackHists1D.push_back(
new TH1F(
"nHitTIBTrack",
"N_{hit, TIB}(track);N_{hit}", 45, 0., 45.));
99 myTrackHists1D.push_back(
new TH1F(
"nHitTOBTrack",
"N_{hit, TOB}(track);N_{hit}", 45, 0., 45.));
100 myTrackHists1D.push_back(
new TH1F(
"nHitTIDplusTrack",
"N_{hit, TIDplus}(track);N_{hit}", 45, 0., 45.));
101 myTrackHists1D.push_back(
new TH1F(
"nHitTIDminusTrack",
"N_{hit, TIDminus}(track);N_{hit}", 45, 0., 45.));
102 myTrackHists1D.push_back(
new TH1F(
"nHitTIDTrack",
"N_{hit, TID}(track);N_{hit}", 45, 0., 45.));
103 myTrackHists1D.push_back(
new TH1F(
"nHitTECplusTrack",
"N_{hit, TECplus}(track);N_{hit}", 45, 0., 45.));
104 myTrackHists1D.push_back(
new TH1F(
"nHitTECminusTrack",
"N_{hit, TECminus}(track);N_{hit}", 45, 0., 45.));
105 myTrackHists1D.push_back(
new TH1F(
"nHitTECTrack",
"N_{hit, TEC}(track);N_{hit}", 45, 0., 45.));
106 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPplusTrack",
"N_{hit, ENDCAPplus}(track);N_{hit}", 45, 0., 45.));
107 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPminusTrack",
"N_{hit, ENDCAPminus}(track);N_{hit}", 45, 0., 45.));
108 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPTrack",
"N_{hit, ENDCAP}(track);N_{hit}", 45, 0., 45.));
110 "nHitENDCAPTrackMinusVsPlus",
"N_{hit, ENDCAP}(track);N_{hit, plus};N_{hit, minus}", 45, 0., 45., 45, 0., 45.));
111 myTrackHists1D.push_back(
new TH1F(
"nHitInvalidTrack",
"N_{hit, invalid}(track)", 5, 0., 5.));
112 myTrackHists1D.push_back(
new TH1F(
"r1Track",
"r(1st hit);r [cm]", 20, 0., 20.));
114 myTrackHists1D.push_back(
new TH1F(
"y1Track",
"y(1st hit);y [cm]", 40, -120., +120.));
115 myTrackHists1D.push_back(
new TH1F(
"z1Track",
"z(1st hit);z [cm]", 20, -50, +50));
116 myTrackHists1D.push_back(
new TH1F(
"r1TrackSigned",
"r(1st hit);r_{#pm} [cm]", 40, -120., 120.));
117 myTrackHists1D.push_back(
new TH1F(
"z1TrackFull",
"z(1st hit);z [cm]", 20, -300., +300.));
118 myTrackHists1D.push_back(
new TH1F(
"rLastTrack",
"r(last hit);r [cm]", 20, 20., 120.));
120 myTrackHists1D.push_back(
new TH1F(
"yLastTrack",
"y(last hit);y [cm]", 40, -120., +120.));
121 myTrackHists1D.push_back(
new TH1F(
"zLastTrack",
"z(last hit);z [cm]", 30, -300., +300.));
122 myTrackHists1D.push_back(
new TH1F(
"chi2PerNdf",
"#chi^{2}/ndf;#chi^{2}/ndf", 500, 0., 50.));
123 myTrackHists1D.push_back(
new TH1F(
"impParZ",
"impact parameter in z", 20, -20., 20.));
124 myTrackHists1D.push_back(
new TH1F(
"impParErrZ",
"error of impact parameter in z", 40, 0., 0.06));
125 myTrackHists1D.push_back(
new TH1F(
"impParRphi",
"impact parameter in r#phi", 51, -0.05, .05));
126 myTrackHists1D.push_back(
new TH1F(
"impParErrRphi",
"error of impact parameter in r#phi", 50, 0., 0.01));
129 new TH2F(
"rz1TrackFull",
"rz(1st hit);z [cm]; r_{#pm} [cm]", 40, -282., +282., 40, -115., +115.));
130 myTrackHists2D.push_back(
new TH2F(
"xy1Track",
"xy(1st hit);x [cm]; y [cm]", 40, -115., +115., 40, -115., +115.));
132 TDirectory *dirTracks =
directory->mkdir(
"trackHists",
"input tracks");
141 myUsedTrackHists1D.push_back(
new TH1F(
"usedHitsY",
"n(y-hits) transferred to pede;n(y-hits)", 10, 0., 10));
143 TDirectory *dirUsedTracks =
directory->mkdir(
"usedTrackHists",
"used tracks");
148 myTrajectoryHists1D.push_back(
new TH1F(
"validRefTraj",
"validity of ReferenceTrajectory", 2, 0., 2.));
151 "profCorr",
"mean of |#rho|, #rho#neq0;hit x/y;hit x/y;", 2 *
nHits, 0.,
nHits, 2 *
nHits, 0.,
nHits));
153 "mean of |#rho|, #rho#neq0, no xy_{hit};hit x/y;hit x/y;",
162 "hitCorrOffBlock",
"hit correlations: off-block-diagonals;N(hit);#rho", 2 *
nHits, 0.,
nHits, 81, -.06, .06));
163 TArrayD logBins(102);
164 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-11, .1);
166 "hit correlations: off-block-diagonals;N(hit);|#rho|",
170 logBins.GetSize() - 1,
171 logBins.GetArray()));
174 new TH2F(
"hitCorrXy",
"hit correlations: xy;N(hit);#rho",
nHits, 0.,
nHits, 81, -.5, .5));
176 new TH2F(
"hitCorrXyValid",
"hit correlations: xy, 2D-det.;N(hit);#rho",
nHits, 0.,
nHits, 81, -.02, .02));
177 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-10, .5);
179 "hitCorrXyLog",
"hit correlations: xy;N(hit);|#rho|",
nHits, 0.,
nHits, logBins.GetSize() - 1, logBins.GetArray()));
181 "hit correlations: xy, 2D-det.;N(hit);|#rho|",
185 logBins.GetSize() - 1,
186 logBins.GetArray()));
188 myTrajectoryHists1D.push_back(
new TH1F(
"measLocX",
"local x measurements;x", 101, -6., 6.));
189 myTrajectoryHists1D.push_back(
new TH1F(
"measLocY",
"local y measurements, 2D-det.;y", 101, -10., 10.));
191 myTrajectoryHists1D.push_back(
new TH1F(
"trajLocY",
"local y trajectory, 2D-det.;y", 101, -10., 10.));
193 myTrajectoryHists1D.push_back(
new TH1F(
"residLocX",
"local x residual;#Deltax", 101, -.75, .75));
194 myTrajectoryHists1D.push_back(
new TH1F(
"residLocY",
"local y residual, 2D-det.;#Deltay", 101, -2., 2.));
195 myTrajectoryHists1D.push_back(
new TH1F(
"reduResidLocX",
"local x reduced residual;#Deltax/#sigma", 101, -20., 20.));
197 new TH1F(
"reduResidLocY",
"local y reduced residual, 2D-det.;#Deltay/#sigma", 101, -20., 20.));
201 new TH2F(
"measLocXvsHit",
"local x measurements;hit;x",
nHits, 0.,
nHits, 101, -6., 6.));
203 new TH2F(
"measLocYvsHit",
"local y measurements, 2D-det.;hit;y",
nHits, 0.,
nHits, 101, -10., 10.));
206 new TH2F(
"trajLocYvsHit",
"local y trajectory, 2D-det.;hit;y",
nHits, 0.,
nHits, 101, -10., 10.));
209 new TH2F(
"residLocXvsHit",
"local x residual;hit;#Deltax",
nHits, 0.,
nHits, 101, -.75, .75));
211 new TH2F(
"residLocYvsHit",
"local y residual, 2D-det.;hit;#Deltay",
nHits, 0.,
nHits, 101, -1., 1.));
213 new TH2F(
"reduResidLocXvsHit",
"local x reduced residual;hit;#Deltax/#sigma",
nHits, 0.,
nHits, 101, -20., 20.));
215 "reduResidLocYvsHit",
"local y reduced residual, 2D-det.;hit;#Deltay/#sigma",
nHits, 0.,
nHits, 101, -20., 20.));
218 new TProfile2D(
"profDerivatives",
"mean derivatives;hit x/y;parameter;", 2 *
nHits, 0.,
nHits, 10, 0., 10.));
221 "derivatives",
"derivative;parameter;#partial(x/y)_{local}/#partial(param)", 10, 0., 10., 101, -20., 20.));
222 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-12, 100.);
224 "|derivative|;parameter;|#partial(x/y)_{local}/#partial(param)|",
228 logBins.GetSize() - 1,
229 logBins.GetArray()));
231 "derivatives vs. #phi;#phi(geomDet);#partial(x/y)_{local}/#partial(param)",
240 TDirectory *dirTraject =
directory->mkdir(
"refTrajectoryHists",
"ReferenceTrajectory's");
246 "local derivatives vs. paramater;parameter;#partial/#partial(param)",
254 "local derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
261 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-13, 150.);
263 "local derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
267 logBins.GetSize() - 1,
268 logBins.GetArray()));
270 "local derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
274 logBins.GetSize() - 1,
275 logBins.GetArray()));
278 "global derivatives vs. paramater;parameter;#partial/#partial(param)",
286 "global derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
293 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-7, 5.e2);
295 "global derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
299 logBins.GetSize() - 1,
300 logBins.GetArray()));
302 "global derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
306 logBins.GetSize() - 1,
307 logBins.GetArray()));
314 TDirectory *dirDerivs =
directory->mkdir(
"derivatives",
"derivatives etc.");
319 "residPhi",
"residuum vs. #phi(det);#phi(det);residuum[cm]", 51, -
TMath::Pi(),
TMath::Pi(), 101, -.5, .5));
321 new TH2F(
"sigmaPhi",
"#sigma vs. #phi(det);#phi(det);#sigma[cm]", 51, -
TMath::Pi(),
TMath::Pi(), 101, .0, .1));
323 "residuum/#sigma vs. #phi(det);#phi(det);residuum/#sigma",
368 TDirectory *dirResid =
directory->mkdir(
"residuals",
"hit residuals, sigma,...");
374 std::vector<TH1 *> allResidHistsX;
375 allResidHistsX.push_back(
new TH1F(
"resid",
"hit residuals;residuum [cm]", 101, -.5, .5));
377 allResidHistsX.push_back(
new TH1F(
"sigma",
"hit uncertainties;#sigma [cm]", 100, 0., 1.));
379 allResidHistsX.push_back(
380 new TH1F(
"reduResid",
"reduced hit residuals;res./#sigma", 101, -10., 10.));
382 allResidHistsX.push_back(
383 new TH1F(
"angle",
"#phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens}", 50, 0., TMath::PiOver2()));
384 allResidHistsX.push_back(
new TH2F(
"residVsAngle",
385 "residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};residuum [cm]",
392 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-6, 100.);
393 allResidHistsX.push_back(
new TH2F(
"sigmaVsAngle",
394 "#sigma vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};#sigma [cm]",
398 logBins.GetSize() - 1,
399 logBins.GetArray()));
400 allResidHistsX.push_back(
401 new TH2F(
"reduResidVsAngle",
402 "reduced residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};res./#sigma",
410 allResidHistsX.push_back(
411 new TH1F(
"residGt45",
"hit residuals (#phi_{n}^{sens}>45#circ);residuum [cm]", 101, -.5, .5));
413 allResidHistsX.push_back(
414 new TH1F(
"sigmaGt45",
"hit uncertainties(#phi_{n}^{sens}>45#circ);#sigma [cm]", 100, 0., 1.));
416 allResidHistsX.push_back(
new TH1F(
417 "reduResidGt45",
"reduced hit residuals(#phi_{n}^{sens}>45#circ);res./#sigma", 101, -10., 10.));
419 allResidHistsX.push_back(
420 new TH1F(
"residLt45",
"hit residuals (#phi_{n}^{sens}<45#circ);residuum [cm]", 101, -.5, .5));
422 allResidHistsX.push_back(
423 new TH1F(
"sigmaLt45",
"hit uncertainties(#phi_{n}^{sens}<45#circ);#sigma [cm]", 100, 0., 1.));
425 allResidHistsX.push_back(
new TH1F(
426 "reduResidLt45",
"reduced hit residuals(#phi_{n}^{sens}<45#circ);res./#sigma", 101, -10., 10.));
436 for (
unsigned int iHit = 0; iHit < 30; ++iHit) {
437 for (
unsigned int iHist = 0; iHist < 4 && iHist < allResidHistsX.size(); ++iHist) {
438 TH1 *
h = allResidHistsX[iHist];
444 TDirectory *dirResidX = (dirResid ? dirResid :
directory)->
mkdir(
"X",
"hit residuals etc. for x measurements");
448 vecIter != vecIterEnd;
455 std::vector<TH1 *> &yHists1D = allResidHistsX;
464 TDirectory *dirResidY = (dirResid ? dirResid :
directory)->
mkdir(
"Y",
"hit residuals etc. for y measurements");
468 vecIter != vecIterEnd;
475 new TProfile2D(
"frame2frame",
"mean frame to frame derivatives;col;row", 6, 0., 6., 6, 0., 6.));
477 new TProfile2D(
"frame2frameAbs",
"mean |frame to frame derivatives|, #neq0;col;row", 6, 0., 6., 6, 0., 6.));
479 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize() - 1, 1.E-36, 100.);
480 for (
unsigned int i = 0;
i < 6; ++
i) {
481 for (
unsigned int j = 0;
j < 6; ++
j) {
483 Form(
"frame to frame derivatives, %d%d;#phi(aliDet);deriv",
i,
j),
492 Form(
"frame to frame derivatives, %d%d;r(aliDet);deriv",
i,
j),
502 new TH2F(Form(
"frame2framePhiLog%d%d",
i,
j),
503 Form(
"frame to frame |derivatives|, %d%d, #neq0;#phi(aliDet);deriv",
i,
j),
507 logBins.GetSize() - 1,
508 logBins.GetArray()));
510 Form(
"frame to frame |derivatives|, %d%d, #neq0;r(aliDet);deriv",
i,
j),
514 logBins.GetSize() - 1,
515 logBins.GetArray()));
519 TDirectory *dirF2f =
directory->mkdir(
"frame2FrameHists",
"derivatives etc.");
522 myCorrHists.push_back(
new TH1F(
"xyCorrTPB",
"#rho_{xy} in pixel barrel", 50, -.5, .5));
523 myCorrHists.push_back(
new TH1F(
"xyCorrTPE",
"#rho_{xy} in forward pixel", 50, -.5, .5));
524 myCorrHists.push_back(
new TH1F(
"xyCorrTIB",
"#rho_{xy} in TIB", 50, -.5, .5));
525 myCorrHists.push_back(
new TH1F(
"xyCorrTID",
"#rho_{xy} in TID", 50, -1., 1.));
526 myCorrHists.push_back(
new TH1F(
"xyCorrTOB",
"#rho_{xy} in TOB", 50, -.5, .5));
527 myCorrHists.push_back(
new TH1F(
"xyCorrTEC",
"#rho_{xy} in TEC", 50, -1., 1.));
528 TDirectory *dirCorr =
directory->mkdir(
"hitCorrelationHists",
"correlations");
532 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_lo",
"#chi^{2} from PXB survey", 25, 0, 25));
533 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_md",
"#chi^{2} from PXB survey", 25, 0, 500));
534 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_hi",
"#chi^{2} from PXB survey", 25, 0, 50000));
535 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2prob",
"Math::Prob(#chi^{2},4) from PXB survey", 25, 0, 1));
536 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a0",
"a_{0} from PXB survey", 100, -3000, 3000));
537 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a0_abs",
"fabs(a_{0}) from PXB survey", 100, 0, 3000));
538 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a1",
"a_{1} from PXB survey", 100, -6000, 6000));
539 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a1_abs",
"fabs(a_{1}) from PXB survey", 100, 0, 6000));
541 new TH1F(
"PxbSurv_scale",
"scale (#sqrt{a_{2}^{2}+a_{3}^{2}}) from PXB survey", 100, 0, 1500));
542 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_phi",
"angle(#atan{a_{3}/a_{4}}) from PXB survey", 100, -.05, .05));
543 TDirectory *dirPxbSurvey =
directory->mkdir(
"PxbSurveyHists",
"PxbSurvey");
562 const double firstLog = TMath::Log10(
bins[0]);
563 const double lastLog = TMath::Log10(
bins[
nBins]);
565 bins[
i] = TMath::Power(10., firstLog +
i * (lastLog - firstLog) / (
nBins));
589 std::vector<TH1 *> &trackHists1D,
590 std::vector<TH2 *> &trackHists2D) {
596 static const int iPtLog = this->
GetIndex(trackHists1D,
"ptTrackLogBins");
597 trackHists1D[iPtLog]->Fill(
track->pt());
598 static const int iPt = this->
GetIndex(trackHists1D,
"ptTrack");
599 trackHists1D[iPt]->Fill(
track->pt());
600 static const int iP = this->
GetIndex(trackHists1D,
"pTrack");
601 trackHists1D[iP]->Fill(
p.R());
602 static const int iEta = this->
GetIndex(trackHists1D,
"etaTrack");
603 trackHists1D[
iEta]->Fill(
p.Eta());
604 static const int iTheta = this->
GetIndex(trackHists1D,
"thetaTrack");
605 trackHists1D[iTheta]->Fill(
p.Theta());
606 static const int iPhi = this->
GetIndex(trackHists1D,
"phiTrack");
607 trackHists1D[iPhi]->Fill(
p.Phi());
609 static const int iNhit = this->
GetIndex(trackHists1D,
"nHitTrack");
610 trackHists1D[iNhit]->Fill(
track->numberOfValidHits());
611 static const int iNhitInvalid = this->
GetIndex(trackHists1D,
"nHitInvalidTrack");
612 trackHists1D[iNhitInvalid]->Fill(
track->numberOfLostHits());
614 int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
615 int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL = 0;
616 int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
617 int nhitinTIDplus = 0, nhitinTIDminus = 0;
618 int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
619 int nhitinTECplus = 0, nhitinTECminus = 0;
620 unsigned int thishit = 0;
622 for (
auto const &
hit :
track->recHits()) {
624 const DetId detId(
hit->geographicalId());
625 const int subdetId = detId.
subdetId();
630 edm::LogError(
"DetectorMismatch") <<
"@SUB=MillePedeMonitor::fillTrack" 631 <<
"DetId.det() != DetId::Tracker (=" <<
DetId::Tracker <<
"), but " 632 << detId.det() <<
".";
661 }
else if (
kBPIX == subdetId) {
664 }
else if (
kFPIX == subdetId) {
676 static const int iNhit01 = this->
GetIndex(trackHists1D,
"nHitBPIXTrack");
677 trackHists1D[iNhit01]->Fill(nhitinBPIX);
678 static const int iNhit02 = this->
GetIndex(trackHists1D,
"nHitFPIXplusTrack");
679 trackHists1D[iNhit02]->Fill(nhitinFPIXplus);
680 static const int iNhit03 = this->
GetIndex(trackHists1D,
"nHitFPIXminusTrack");
681 trackHists1D[iNhit03]->Fill(nhitinFPIXminus);
682 static const int iNhit04 = this->
GetIndex(trackHists1D,
"nHitFPIXTrack");
683 trackHists1D[iNhit04]->Fill(nhitinFPIX);
684 static const int iNhit05 = this->
GetIndex(trackHists1D,
"nHitPIXELTrack");
685 trackHists1D[iNhit05]->Fill(nhitinPIXEL);
686 static const int iNhit06 = this->
GetIndex(trackHists1D,
"nHitTIBTrack");
687 trackHists1D[iNhit06]->Fill(nhitinTIB);
688 static const int iNhit07 = this->
GetIndex(trackHists1D,
"nHitTOBTrack");
689 trackHists1D[iNhit07]->Fill(nhitinTOB);
690 static const int iNhit08 = this->
GetIndex(trackHists1D,
"nHitTIDplusTrack");
691 trackHists1D[iNhit08]->Fill(nhitinTIDplus);
692 static const int iNhit09 = this->
GetIndex(trackHists1D,
"nHitTIDminusTrack");
693 trackHists1D[iNhit09]->Fill(nhitinTIDminus);
694 static const int iNhit10 = this->
GetIndex(trackHists1D,
"nHitTIDTrack");
695 trackHists1D[iNhit10]->Fill(nhitinTID);
696 static const int iNhit11 = this->
GetIndex(trackHists1D,
"nHitTECplusTrack");
697 trackHists1D[iNhit11]->Fill(nhitinTECplus);
698 static const int iNhit12 = this->
GetIndex(trackHists1D,
"nHitTECminusTrack");
699 trackHists1D[iNhit12]->Fill(nhitinTECminus);
700 static const int iNhit13 = this->
GetIndex(trackHists1D,
"nHitTECTrack");
701 trackHists1D[iNhit13]->Fill(nhitinTEC);
702 static const int iNhit14 = this->
GetIndex(trackHists1D,
"nHitENDCAPplusTrack");
703 trackHists1D[iNhit14]->Fill(nhitinENDCAPplus);
704 static const int iNhit15 = this->
GetIndex(trackHists1D,
"nHitENDCAPminusTrack");
705 trackHists1D[iNhit15]->Fill(nhitinENDCAPminus);
706 static const int iNhit16 = this->
GetIndex(trackHists1D,
"nHitENDCAPTrack");
707 trackHists1D[iNhit16]->Fill(nhitinENDCAP);
708 static const int iNhit17 = this->
GetIndex(trackHists2D,
"nHitENDCAPTrackMinusVsPlus");
709 trackHists2D[iNhit17]->Fill(nhitinENDCAPplus, nhitinENDCAPminus);
711 if (
track->innerOk()) {
713 static const int iR1 = this->
GetIndex(trackHists1D,
"r1Track");
714 trackHists1D[iR1]->Fill(firstPoint.Rho());
715 const double rSigned1 = (firstPoint.y() > 0 ? firstPoint.Rho() : -firstPoint.Rho());
716 static const int iR1Signed = this->
GetIndex(trackHists1D,
"r1TrackSigned");
717 trackHists1D[iR1Signed]->Fill(rSigned1);
718 static const int iZ1 = this->
GetIndex(trackHists1D,
"z1Track");
719 trackHists1D[iZ1]->Fill(firstPoint.Z());
720 static const int iZ1Full = this->
GetIndex(trackHists1D,
"z1TrackFull");
721 trackHists1D[iZ1Full]->Fill(firstPoint.Z());
722 static const int iY1 = this->
GetIndex(trackHists1D,
"y1Track");
723 trackHists1D[iY1]->Fill(firstPoint.Y());
724 static const int iPhi1 = this->
GetIndex(trackHists1D,
"phi1Track");
725 trackHists1D[iPhi1]->Fill(firstPoint.phi());
726 static const int iRz1Full = this->
GetIndex(trackHists2D,
"rz1TrackFull");
727 trackHists2D[iRz1Full]->Fill(firstPoint.Z(), rSigned1);
728 static const int iXy1 = this->
GetIndex(trackHists2D,
"xy1Track");
729 trackHists2D[iXy1]->Fill(firstPoint.X(), firstPoint.Y());
732 if (
track->outerOk()) {
734 static const int iRlast = this->
GetIndex(trackHists1D,
"rLastTrack");
735 trackHists1D[iRlast]->Fill(lastPoint.Rho());
736 static const int iZlast = this->
GetIndex(trackHists1D,
"zLastTrack");
737 trackHists1D[iZlast]->Fill(lastPoint.Z());
738 static const int iYlast = this->
GetIndex(trackHists1D,
"yLastTrack");
739 trackHists1D[iYlast]->Fill(lastPoint.Y());
740 static const int iPhiLast = this->
GetIndex(trackHists1D,
"phiLastTrack");
741 trackHists1D[iPhiLast]->Fill(lastPoint.phi());
744 static const int iChi2Ndf = this->
GetIndex(trackHists1D,
"chi2PerNdf");
745 trackHists1D[iChi2Ndf]->Fill(
track->normalizedChi2());
747 static const int iImpZ = this->
GetIndex(trackHists1D,
"impParZ");
748 trackHists1D[iImpZ]->Fill(
track->dz());
749 static const int iImpZerr = this->
GetIndex(trackHists1D,
"impParErrZ");
750 trackHists1D[iImpZerr]->Fill(
track->dzError());
752 static const int iImpRphi = this->
GetIndex(trackHists1D,
"impParRphi");
753 trackHists1D[iImpRphi]->Fill(
track->d0());
754 static const int iImpRphiErr = this->
GetIndex(trackHists1D,
"impParErrRphi");
755 trackHists1D[iImpRphiErr]->Fill(
track->d0Error());
761 if (refTrajPtr->isValid()) {
770 const AlgebraicVector &trajectoryLoc = refTrajPtr->trajectoryPositions();
775 const int nRow = refTrajPtr->numberOfHitMeas();
777 for (
int iRow = 0; iRow < nRow; ++iRow) {
778 const double residuum = measurementsLoc[iRow] - trajectoryLoc[iRow];
779 const double covMeasLocRow = covMeasLoc[iRow][iRow];
780 const bool is2DhitRow = (!
recHits[iRow / 2]->detUnit()
781 ||
recHits[iRow / 2]->detUnit()->type().isTrackerPixel());
783 if (TMath::Even(iRow)) {
798 if (covMeasLocRow > 0.) {
802 myTrajectoryHists2D[iReduResidLocXvsHit]->Fill(iRow / 2, residuum / TMath::Sqrt(covMeasLocRow));
804 }
else if (is2DhitRow) {
820 if (covMeasLocRow > 0.) {
824 myTrajectoryHists2D[iReduResidLocYvsHit]->Fill(iRow / 2, residuum / TMath::Sqrt(covMeasLocRow));
828 float nHitRow = iRow / 2;
829 if (TMath::Odd(iRow))
832 for (
int iCol = iRow + 1; iCol < nRow; ++iCol) {
833 double rho = TMath::Sqrt(covMeasLocRow + covMeasLoc[iCol][iCol]);
834 rho = (0. ==
rho ? -2 : covMeasLoc[iRow][iCol] /
rho);
835 float nHitCol = iCol / 2;
836 if (TMath::Odd(iCol))
843 if (iRow + 1 == iCol && TMath::Even(iRow)) {
867 for (
int iCol = 0; iCol < derivatives.num_col(); ++iCol) {
882 const float *localDerivs,
884 const float *globalDerivs,
885 unsigned int nGlobal,
887 const double phi =
recHit->det()->position().phi();
893 for (
unsigned int i = 0;
i < nLocal; ++
i) {
896 if (localDerivs[
i]) {
907 for (
unsigned int i = 0;
i < nGlobal; ++
i) {
911 if (globalDerivs[
i]) {
912 myDerivHists2D[iGlobParLog]->Fill(parNum, TMath::Abs(globalDerivs[
i]));
929 const double phi = detPos.phi();
974 const float phiSensToNorm = TMath::ATan(TMath::Abs((isY ? mom.y() : mom.x()) / mom.z()));
983 const DetId detId(
recHit->det()->geographicalId());
986 unsigned int subDetNum = detId.
subdetId();
987 if (subDetNum < histArrayVec.size() && subDetNum > 0) {
988 this->
fillResidualHists(histArrayVec[subDetNum], phiSensToNorm, residuum, sigma);
992 <<
"Expect subDetNum from 1 to 6, got " << subDetNum;
1006 static const int iRes = this->
GetIndex(hists,
"resid");
1007 hists[iRes]->Fill(residuum);
1008 static const int iSigma = this->
GetIndex(hists,
"sigma");
1009 hists[iSigma]->Fill(sigma);
1010 static const int iSigmaVsAngle = this->
GetIndex(hists,
"sigmaVsAngle");
1011 hists[iSigmaVsAngle]->Fill(phiSensToNorm, sigma);
1012 static const int iResidVsAngle = this->
GetIndex(hists,
"residVsAngle");
1013 hists[iResidVsAngle]->Fill(phiSensToNorm, residuum);
1014 static const int iReduRes = this->
GetIndex(hists,
"reduResid");
1015 static const int iReduResidVsAngle = this->
GetIndex(hists,
"reduResidVsAngle");
1017 hists[iReduRes]->Fill(residuum / sigma);
1018 hists[iReduResidVsAngle]->Fill(phiSensToNorm, residuum / sigma);
1020 static const int iAngle = this->
GetIndex(hists,
"angle");
1021 hists[iAngle]->Fill(phiSensToNorm);
1023 if (phiSensToNorm > TMath::DegToRad() * 45.) {
1024 static const int iResGt45 = this->
GetIndex(hists,
"residGt45");
1025 hists[iResGt45]->Fill(residuum);
1026 static const int iSigmaGt45 = this->
GetIndex(hists,
"sigmaGt45");
1027 hists[iSigmaGt45]->Fill(sigma);
1028 static const int iReduResGt45 = this->
GetIndex(hists,
"reduResidGt45");
1030 hists[iReduResGt45]->Fill(residuum / sigma);
1032 static const int iResLt45 = this->
GetIndex(hists,
"residLt45");
1033 hists[iResLt45]->Fill(residuum);
1034 static const int iSigmaLt45 = this->
GetIndex(hists,
"sigmaLt45");
1035 hists[iSigmaLt45]->Fill(sigma);
1036 static const int iReduResLt45 = this->
GetIndex(hists,
"reduResidLt45");
1038 hists[iReduResLt45]->Fill(residuum / sigma);
1044 const std::vector<TH1 *> &
hists,
float angle,
float residuum,
float sigma,
unsigned int nHit) {
1049 static constexpr
unsigned int maxNhit = 29;
1050 static const auto iResHit = indexArray1D<TH1, maxNhit + 1>(
hists,
"resid_%d");
1051 static const auto iSigmaHit = indexArray1D<TH1, maxNhit + 1>(
hists,
"sigma_%d");
1052 static const auto iReduResHit = indexArray1D<TH1, maxNhit + 1>(
hists,
"reduResid_%d");
1053 static const auto iAngleHit = indexArray1D<TH1, maxNhit + 1>(
hists,
"angle_%d");
1057 hists[iResHit[nHit]]->Fill(residuum);
1058 hists[iSigmaHit[nHit]]->Fill(sigma);
1060 hists[iReduResHit[nHit]]->Fill(residuum / sigma);
1074 static const auto iF2fIjPhi = indexArray2D<TH2, 6>(
myFrame2FrameHists2D,
"frame2framePhi%d%d");
1075 static const auto iF2fIjPhiLog = indexArray2D<TH2, 6>(
myFrame2FrameHists2D,
"frame2framePhiLog%d%d");
1077 static const auto iF2fIjRLog = indexArray2D<TH2, 6>(
myFrame2FrameHists2D,
"frame2frameRLog%d%d");
1081 for (
unsigned int i = 0;
i < 6; ++
i) {
1082 for (
unsigned int j = 0;
j < 6; ++
j) {
1086 if (frameDeriv[
i][
j]) {
1097 const DetId detId(
recHit->det()->geographicalId());
1102 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeMonitor::fillCorrelations2D" 1103 <<
"Expect subdetId from 1 to 6, got " << detId.subdetId();
std::vector< std::vector< TH1 * > > myResidHistsVec1DY
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
std::vector< TH2 * > myResidHists2D
void fillCorrelations2D(float corr, const TransientTrackingRecHit::ConstRecHitPointer &hit)
bool tidIsZPlusSide(const DetId &id) const
bool equidistLogBins(double *bins, int nBins, double first, double last) const
std::vector< TH1 * > myUsedTrackHists1D
std::vector< TH1 * > myCorrHists
std::vector< OBJECT_TYPE * > cloneHists(const std::vector< OBJECT_TYPE *> &orgs, const TString &namAd, const TString &titAd) const
void fillFrameToFrame(const AlignableDetOrUnitPtr &aliDet, const Alignable *ali)
std::vector< TH1 * > myPxbSurveyHists
void addToDirectory(const std::vector< OBJECT_TYPE *> &objs, TDirectory *dir) const
static constexpr auto TID
Geom::Phi< T > phi() const
void fillPxbSurveyHistsLocalPars(const float &a0, const float &a1, const float &S, const float &phi)
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
bool tecIsZMinusSide(const DetId &id) const
const TrackerTopology * trackerTopology
Log< level::Error, false > LogError
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::vector< TH1 * > myResidHitHists1DX
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
MillePedeMonitor(const TrackerTopology *tTopo, const char *rootFile="trackMonitor.root")
void fillResiduals(const TransientTrackingRecHit::ConstRecHitPointer &recHit, const TrajectoryStateOnSurface &tsos, unsigned int nHit, float residuum, float sigma, bool isY)
void fillPxbSurveyHistsChi2(const float &chi2)
std::vector< TH2 * > myUsedTrackHists2D
static const unsigned int theMaxNumParam
bool tidIsZMinusSide(const DetId &id) const
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::vector< TH2 * > myTrackHists2D
const PositionType & globalPosition() const
Return the global position of the object.
std::vector< TH2 * > myDerivHists2D
CLHEP::HepMatrix AlgebraicMatrix
void fillUsedTrack(const reco::Track *track, unsigned int nHitX, unsigned int nHitY)
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
std::vector< TH1 * > myTrajectoryHists1D
LocalVector localDirection() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::vector< TH2 * > myTrajectoryHists2D
bool init(TDirectory *directory)
math::XYZPoint Point
point in the space
static constexpr auto TOB
void fillResidualHitHists(const std::vector< TH1 *> &hists, float angle, float residuum, float sigma, unsigned int nHit)
std::vector< ConstRecHitPointer > ConstRecHitContainer
CLHEP::HepVector AlgebraicVector
unsigned int pxfSide(const DetId &id) const
std::vector< TH2 * > myFrame2FrameHists2D
static const DetId detId()
static constexpr float a0
void fillTrack(const reco::Track *track)
bool tecIsZPlusSide(const DetId &id) const
static constexpr auto TIB
std::vector< TH1 * > myTrackHists1D
std::vector< TH1 * > myResidHitHists1DY
static int position[264][3]
void fillRefTrajectory(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr)
CLHEP::HepSymMatrix AlgebraicSymMatrix
void fillDerivatives(const TransientTrackingRecHit::ConstRecHitPointer &recHit, const float *localDerivs, unsigned int nLocal, const float *globalDerivs, unsigned int nGlobal, const int *labels)
Log< level::Warning, false > LogWarning
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
void fillResidualHists(const std::vector< TH1 *> &hists, float phiSensToNorm, float residuum, float sigma)
std::vector< std::vector< TH1 * > > myResidHistsVec1DX
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
math::XYZVector Vector
spatial vector
static constexpr auto TEC
AlgebraicMatrix frameToFrameDerivative(const Alignable *object, const Alignable *composedObject) const
T angle(T x1, T y1, T z1, T x2, T y2, T z2)