36 #include <TProfile2D.h>
38 #include <TDirectory.h>
47 : myRootDir(0), myDeleteDir(
false)
49 myRootDir = TFile::Open(rootFileName,
"recreate");
57 : myRootDir(0), myDeleteDir(
false)
78 if (!directory)
return false;
79 TDirectory *oldDir = gDirectory;
81 const int kNumBins = 20;
82 double binsPt[kNumBins+1] = {0.};
88 myTrackHists1D.push_back(
new TH1F(
"ptTrackLogBins",
"p_{t}(track);p_{t} [GeV]",
91 myTrackHists1D.push_back(
new TH1F(
"ptTrack",
"p_{t}(track);p_{t} [GeV]",
92 kNumBins, binsPt[0], binsPt[kNumBins]));
94 kNumBins, binsPt[0], 1.3*binsPt[kNumBins]));
95 myTrackHists1D.push_back(
new TH1F(
"etaTrack",
"#eta(track);#eta", 26, -2.6, 2.6));
99 myTrackHists1D.push_back(
new TH1F(
"nHitTrack",
"N_{hit}(track);N_{hit}", 40, 5., 45.));
100 myTrackHists1D.push_back(
new TH1F(
"nHitBPIXTrack",
"N_{hit, BPIX}(track);N_{hit}", 45, 0., 45.));
101 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXTrack",
"N_{hit, FPIX}(track);N_{hit}", 45, 0., 45.));
102 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXplusTrack",
"N_{hit, BPIXplus}(track);N_{hit}", 45, 0., 45.));
103 myTrackHists1D.push_back(
new TH1F(
"nHitFPIXminusTrack",
"N_{hit, BPIXminus}(track);N_{hit}", 45, 0., 45.));
104 myTrackHists1D.push_back(
new TH1F(
"nHitPIXELTrack",
"N_{hit, PIXEL}(track);N_{hit}", 45, 0., 45.));
105 myTrackHists1D.push_back(
new TH1F(
"nHitTIBTrack",
"N_{hit, TIB}(track);N_{hit}", 45, 0., 45.));
106 myTrackHists1D.push_back(
new TH1F(
"nHitTOBTrack",
"N_{hit, TOB}(track);N_{hit}", 45, 0., 45.));
107 myTrackHists1D.push_back(
new TH1F(
"nHitTIDplusTrack",
"N_{hit, TIDplus}(track);N_{hit}", 45, 0., 45.));
108 myTrackHists1D.push_back(
new TH1F(
"nHitTIDminusTrack",
"N_{hit, TIDminus}(track);N_{hit}", 45, 0., 45.));
109 myTrackHists1D.push_back(
new TH1F(
"nHitTIDTrack",
"N_{hit, TID}(track);N_{hit}", 45, 0., 45.));
110 myTrackHists1D.push_back(
new TH1F(
"nHitTECplusTrack",
"N_{hit, TECplus}(track);N_{hit}", 45, 0., 45.));
111 myTrackHists1D.push_back(
new TH1F(
"nHitTECminusTrack",
"N_{hit, TECminus}(track);N_{hit}", 45, 0., 45.));
112 myTrackHists1D.push_back(
new TH1F(
"nHitTECTrack",
"N_{hit, TEC}(track);N_{hit}", 45, 0., 45.));
113 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPplusTrack",
"N_{hit, ENDCAPplus}(track);N_{hit}", 45, 0., 45.));
114 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPminusTrack",
"N_{hit, ENDCAPminus}(track);N_{hit}", 45, 0., 45.));
115 myTrackHists1D.push_back(
new TH1F(
"nHitENDCAPTrack",
"N_{hit, ENDCAP}(track);N_{hit}", 45, 0., 45.));
116 myTrackHists2D.push_back(
new TH2F(
"nHitENDCAPTrackMinusVsPlus",
"N_{hit, ENDCAP}(track);N_{hit, plus};N_{hit, minus}",
117 45, 0., 45.,45, 0., 45.));
118 myTrackHists1D.push_back(
new TH1F(
"nHitInvalidTrack",
"N_{hit, invalid}(track)", 5, 0., 5.));
119 myTrackHists1D.push_back(
new TH1F(
"r1Track",
"r(1st hit);r [cm]", 20, 0., 20.));
120 myTrackHists1D.push_back(
new TH1F(
"phi1Track",
"#phi(1st hit);#phi",
122 myTrackHists1D.push_back(
new TH1F(
"y1Track",
"y(1st hit);y [cm]", 40, -120., +120.));
123 myTrackHists1D.push_back(
new TH1F(
"z1Track",
"z(1st hit);z [cm]", 20, -50, +50));
124 myTrackHists1D.push_back(
new TH1F(
"r1TrackSigned",
"r(1st hit);r_{#pm} [cm]",
126 myTrackHists1D.push_back(
new TH1F(
"z1TrackFull",
"z(1st hit);z [cm]", 20, -300., +300.));
127 myTrackHists1D.push_back(
new TH1F(
"rLastTrack",
"r(last hit);r [cm]", 20, 20., 120.));
128 myTrackHists1D.push_back(
new TH1F(
"phiLastTrack",
"#phi(last hit);#phi",
130 myTrackHists1D.push_back(
new TH1F(
"yLastTrack",
"y(last hit);y [cm]", 40, -120., +120.));
131 myTrackHists1D.push_back(
new TH1F(
"zLastTrack",
"z(last hit);z [cm]", 30, -300., +300.));
132 myTrackHists1D.push_back(
new TH1F(
"chi2PerNdf",
"#chi^{2}/ndf;#chi^{2}/ndf", 500, 0., 50.));
133 myTrackHists1D.push_back(
new TH1F(
"impParZ",
"impact parameter in z", 20, -20., 20.));
134 myTrackHists1D.push_back(
new TH1F(
"impParErrZ",
"error of impact parameter in z",
136 myTrackHists1D.push_back(
new TH1F(
"impParRphi",
"impact parameter in r#phi", 51, -0.05, .05));
137 myTrackHists1D.push_back(
new TH1F(
"impParErrRphi",
"error of impact parameter in r#phi",
140 myTrackHists2D.push_back(
new TH2F(
"rz1TrackFull",
"rz(1st hit);z [cm]; r_{#pm} [cm]",
141 40, -282., +282., 40, -115., +115.));
142 myTrackHists2D.push_back(
new TH2F(
"xy1Track",
"xy(1st hit);x [cm]; y [cm]",
143 40, -115., +115., 40, -115., +115.));
145 TDirectory *dirTracks = directory->mkdir(
"trackHists",
"input tracks");
153 myUsedTrackHists1D.push_back(
new TH1F(
"usedHitsX",
"n(x-hits) transferred to pede;n(x-hits)", nHits, 0., nHits));
154 myUsedTrackHists1D.push_back(
new TH1F(
"usedHitsY",
"n(y-hits) transferred to pede;n(y-hits)", 10, 0., 10));
156 TDirectory *dirUsedTracks = directory->mkdir(
"usedTrackHists",
"used tracks");
165 "mean of |#rho|, #rho#neq0;hit x/y;hit x/y;",
166 2*nHits, 0., nHits, 2*nHits, 0., nHits));
168 (
new TProfile2D(
"profCorrOffXy",
"mean of |#rho|, #rho#neq0, no xy_{hit};hit x/y;hit x/y;",
169 2*nHits, 0., nHits, 2*nHits, 0., nHits));
172 "hit correlations: off-block-diagonals;N(hit);#rho",
173 2*nHits, 0., nHits, 81, -.06, .06));
174 TArrayD logBins(102);
175 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-11, .1);
177 "hit correlations: off-block-diagonals;N(hit);|#rho|",
178 2*nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
181 nHits, 0., nHits, 81, -.5, .5));
183 (
new TH2F(
"hitCorrXyValid",
"hit correlations: xy, 2D-det.;N(hit);#rho",
184 nHits, 0., nHits, 81, -.02, .02));
185 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-10, .5);
186 myTrajectoryHists2D.push_back(
new TH2F(
"hitCorrXyLog",
"hit correlations: xy;N(hit);|#rho|",
187 nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
189 (
new TH2F(
"hitCorrXyLogValid",
"hit correlations: xy, 2D-det.;N(hit);|#rho|",
190 nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
193 myTrajectoryHists1D.push_back(
new TH1F(
"measLocX",
"local x measurements;x", 101, -6., 6.));
200 myTrajectoryHists1D.push_back(
new TH1F(
"residLocX",
"local x residual;#Deltax", 101, -.75, .75));
203 myTrajectoryHists1D.push_back(
new TH1F(
"reduResidLocX",
"local x reduced residual;#Deltax/#sigma",
206 (
new TH1F(
"reduResidLocY",
"local y reduced residual, 2D-det.;#Deltay/#sigma", 101, -20., 20.));
210 nHits, 0., nHits, 101, -6., 6.));
211 myTrajectoryHists2D.push_back(
new TH2F(
"measLocYvsHit",
"local y measurements, 2D-det.;hit;y",
212 nHits, 0., nHits, 101, -10., 10.));
214 nHits, 0., nHits, 101, -6., 6.));
215 myTrajectoryHists2D.push_back(
new TH2F(
"trajLocYvsHit",
"local y trajectory, 2D-det.;hit;y",
216 nHits, 0., nHits, 101, -10., 10.));
219 nHits, 0., nHits, 101, -.75, .75));
220 myTrajectoryHists2D.push_back(
new TH2F(
"residLocYvsHit",
"local y residual, 2D-det.;hit;#Deltay",
221 nHits, 0., nHits, 101, -1., 1.));
223 (
new TH2F(
"reduResidLocXvsHit",
"local x reduced residual;hit;#Deltax/#sigma",
224 nHits, 0., nHits, 101, -20., 20.));
226 (
new TH2F(
"reduResidLocYvsHit",
"local y reduced residual, 2D-det.;hit;#Deltay/#sigma",
227 nHits, 0., nHits, 101, -20., 20.));
231 "mean derivatives;hit x/y;parameter;",
232 2*nHits, 0., nHits, 10, 0., 10.));
235 (
new TH2F(
"derivatives",
"derivative;parameter;#partial(x/y)_{local}/#partial(param)",
236 10, 0., 10., 101, -20., 20.));
237 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-12, 100.);
239 (
new TH2F(
"derivativesLog",
"|derivative|;parameter;|#partial(x/y)_{local}/#partial(param)|",
240 10, 0., 10., logBins.GetSize()-1, logBins.GetArray()));
242 (
new TH2F(
"derivativesVsPhi",
243 "derivatives vs. #phi;#phi(geomDet);#partial(x/y)_{local}/#partial(param)",
247 TDirectory *dirTraject = directory->mkdir(
"refTrajectoryHists",
"ReferenceTrajectory's");
253 (
new TH2F(
"localDerivsPar",
"local derivatives vs. paramater;parameter;#partial/#partial(param)",
254 6, 0., 6., 101, -200., 200.));
256 (
new TH2F(
"localDerivsPhi",
"local derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
258 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-13, 150.);
260 (
new TH2F(
"localDerivsParLog",
261 "local derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
262 6, 0., 6., logBins.GetSize()-1, logBins.GetArray()));
264 (
new TH2F(
"localDerivsPhiLog",
265 "local derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
269 (
new TH2F(
"globalDerivsPar",
270 "global derivatives vs. paramater;parameter;#partial/#partial(param)",
271 maxParNum, 0., maxParNum, 100, -200, 200));
273 (
new TH2F(
"globalDerivsPhi",
274 "global derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
276 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-7, 5.e2);
278 (
new TH2F(
"globalDerivsParLog",
279 "global derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
280 maxParNum, 0., maxParNum, logBins.GetSize()-1, logBins.GetArray()));
282 (
new TH2F(
"globalDerivsPhiLog",
283 "global derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
291 TDirectory *dirDerivs = directory->mkdir(
"derivatives",
"derivatives etc.");
295 myResidHists2D.push_back(
new TH2F(
"residPhi",
"residuum vs. #phi(det);#phi(det);residuum[cm]",
297 myResidHists2D.push_back(
new TH2F(
"sigmaPhi",
"#sigma vs. #phi(det);#phi(det);#sigma[cm]",
300 "residuum/#sigma vs. #phi(det);#phi(det);residuum/#sigma",
340 TDirectory *dirResid = directory->mkdir(
"residuals",
"hit residuals, sigma,...");
346 std::vector<TH1*> allResidHistsX;
347 allResidHistsX.push_back(
new TH1F(
"resid",
"hit residuals;residuum [cm]", 101,-.5,.5));
349 allResidHistsX.push_back(
new TH1F(
"sigma",
"hit uncertainties;#sigma [cm]", 100,0.,1.));
351 allResidHistsX.push_back(
new TH1F(
"reduResid",
"reduced hit residuals;res./#sigma",
354 allResidHistsX.push_back(
new TH1F(
"angle",
"#phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens}",
355 50, 0., TMath::PiOver2()));
356 allResidHistsX.push_back(
new TH2F(
"residVsAngle",
357 "residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};residuum [cm]",
358 50, 0., TMath::PiOver2(), 51, -1., 1.));
359 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-6, 100.);
360 allResidHistsX.push_back(
new TH2F(
"sigmaVsAngle",
361 "#sigma vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};#sigma [cm]",
362 50, 0., TMath::PiOver2(), logBins.GetSize()-1, logBins.GetArray()));
363 allResidHistsX.push_back(
new TH2F(
"reduResidVsAngle",
364 "reduced residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};res./#sigma",
365 50, 0., TMath::PiOver2(), 51, -15., 15.));
367 allResidHistsX.push_back(
new TH1F(
"residGt45",
368 "hit residuals (#phi_{n}^{sens}>45#circ);residuum [cm]",
371 allResidHistsX.push_back(
new TH1F(
"sigmaGt45",
372 "hit uncertainties(#phi_{n}^{sens}>45#circ);#sigma [cm]",
375 allResidHistsX.push_back(
new TH1F(
"reduResidGt45",
376 "reduced hit residuals(#phi_{n}^{sens}>45#circ);res./#sigma",
379 allResidHistsX.push_back(
new TH1F(
"residLt45",
380 "hit residuals (#phi_{n}^{sens}<45#circ);residuum [cm]",
383 allResidHistsX.push_back(
new TH1F(
"sigmaLt45",
384 "hit uncertainties(#phi_{n}^{sens}<45#circ);#sigma [cm]",
387 allResidHistsX.push_back(
new TH1F(
"reduResidLt45",
388 "reduced hit residuals(#phi_{n}^{sens}<45#circ);res./#sigma",
399 for (
unsigned int iHit = 0; iHit < 30; ++iHit) {
400 for (
unsigned int iHist = 0; iHist < 4 && iHist < allResidHistsX.size(); ++iHist) {
401 TH1 *
h = allResidHistsX[iHist];
402 myResidHitHists1DX.push_back(static_cast<TH1*>(h->Clone(Form(
"%s_%d", h->GetName(), iHit))));
407 TDirectory *dirResidX =
408 (dirResid ? dirResid :
directory)->mkdir(
"X",
"hit residuals etc. for x measurements");
417 std::vector<TH1*> &yHists1D = allResidHistsX;
426 TDirectory *dirResidY =
427 (dirResid ? dirResid :
directory)->mkdir(
"Y",
"hit residuals etc. for y measurements");
436 "mean frame to frame derivatives;col;row",
437 6, 0., 6., 6, 0., 6.));
439 "mean |frame to frame derivatives|, #neq0;col;row",
440 6, 0., 6., 6, 0., 6.));
442 this->
equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-36, 100.);
443 for (
unsigned int i = 0;
i < 6; ++
i) {
444 for (
unsigned int j = 0;
j < 6; ++
j) {
446 (
new TH2F(Form(
"frame2framePhi%d%d",
i,
j),
447 Form(
"frame to frame derivatives, %d%d;#phi(aliDet);deriv",
i,
j),
451 (
new TH2F(Form(
"frame2frameR%d%d",
i,
j),
452 Form(
"frame to frame derivatives, %d%d;r(aliDet);deriv",
i,
j),
453 51, 0., 110., 10, 0., 1.));
457 (
new TH2F(Form(
"frame2framePhiLog%d%d",
i,
j),
458 Form(
"frame to frame |derivatives|, %d%d, #neq0;#phi(aliDet);deriv",
i,
j),
461 (
new TH2F(Form(
"frame2frameRLog%d%d",
i,
j),
462 Form(
"frame to frame |derivatives|, %d%d, #neq0;r(aliDet);deriv",
i,
j),
463 51, 0., 110., logBins.GetSize()-1, logBins.GetArray()));
467 TDirectory *dirF2f = directory->mkdir(
"frame2FrameHists",
"derivatives etc.");
471 myCorrHists.push_back(
new TH1F(
"xyCorrTPB",
"#rho_{xy} in pixel barrel", 50, -.5, .5));
472 myCorrHists.push_back(
new TH1F(
"xyCorrTPE",
"#rho_{xy} in forward pixel", 50, -.5, .5));
473 myCorrHists.push_back(
new TH1F(
"xyCorrTIB",
"#rho_{xy} in TIB", 50, -.5, .5));
474 myCorrHists.push_back(
new TH1F(
"xyCorrTID",
"#rho_{xy} in TID", 50, -1., 1.));
475 myCorrHists.push_back(
new TH1F(
"xyCorrTOB",
"#rho_{xy} in TOB", 50, -.5, .5));
476 myCorrHists.push_back(
new TH1F(
"xyCorrTEC",
"#rho_{xy} in TEC", 50, -1., 1.));
477 TDirectory *dirCorr = directory->mkdir(
"hitCorrelationHists",
"correlations");
481 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_lo",
"#chi^{2} from PXB survey", 25, 0, 25));
482 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_md",
"#chi^{2} from PXB survey", 25, 0, 500));
483 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2_hi",
"#chi^{2} from PXB survey", 25, 0, 50000));
484 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurvChi2prob",
"Math::Prob(#chi^{2},4) from PXB survey", 25, 0, 1));
485 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a0",
"a_{0} from PXB survey", 100, -3000, 3000));
486 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a0_abs",
"fabs(a_{0}) from PXB survey", 100, 0, 3000));
487 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a1",
"a_{1} from PXB survey", 100, -6000, 6000));
488 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_a1_abs",
"fabs(a_{1}) from PXB survey", 100, 0, 6000));
489 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_scale",
"scale (#sqrt{a_{2}^{2}+a_{3}^{2}}) from PXB survey", 100, 0, 1500));
490 myPxbSurveyHists.push_back(
new TH1F(
"PxbSurv_phi",
"angle(#atan{a_{3}/a_{4}}) from PXB survey", 100, -.05, .05));
491 TDirectory *dirPxbSurvey = directory->mkdir(
"PxbSurveyHists",
"PxbSurvey");
508 if (nBins < 1 || first <= 0. || last <= 0.)
return false;
512 const double firstLog = TMath::Log10(bins[0]);
513 const double lastLog = TMath::Log10(bins[nBins]);
514 for (
int i = 1;
i < nBins; ++
i) {
515 bins[
i] = TMath::Power(10., firstLog +
i*(lastLog-firstLog)/(nBins));
543 std::vector<TH2*> &trackHists2D)
549 static const int iPtLog = this->
GetIndex(trackHists1D,
"ptTrackLogBins");
550 trackHists1D[iPtLog]->Fill(track->
pt());
551 static const int iPt = this->
GetIndex(trackHists1D,
"ptTrack");
552 trackHists1D[iPt]->Fill(track->
pt());
553 static const int iP = this->
GetIndex(trackHists1D,
"pTrack");
554 trackHists1D[iP]->Fill(
p.R());
555 static const int iEta = this->
GetIndex(trackHists1D,
"etaTrack");
556 trackHists1D[iEta]->Fill(
p.Eta());
557 static const int iTheta = this->
GetIndex(trackHists1D,
"thetaTrack");
558 trackHists1D[iTheta]->Fill(
p.Theta());
559 static const int iPhi = this->
GetIndex(trackHists1D,
"phiTrack");
560 trackHists1D[iPhi]->Fill(
p.Phi());
562 static const int iNhit = this->
GetIndex(trackHists1D,
"nHitTrack");
564 static const int iNhitInvalid = this->
GetIndex(trackHists1D,
"nHitInvalidTrack");
567 int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
568 int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL=0;
569 int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
570 int nhitinTIDplus = 0, nhitinTIDminus = 0;
571 int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
572 int nhitinTECplus = 0, nhitinTECminus = 0;
573 unsigned int thishit = 0;
577 const DetId detId((*iHit)->geographicalId());
578 const int subdetId = detId.
subdetId();
580 if (!(*iHit)->isValid())
continue;
582 edm::LogError(
"DetectorMismatch") <<
"@SUB=MillePedeMonitor::fillTrack"
584 <<
"), but " << detId.det() <<
".";
615 else if (
kBPIX == subdetId) {++nhitinBPIX;++nhitinPIXEL;}
616 else if (
kFPIX == subdetId) {
620 if (fpixId.
side()==1) ++nhitinFPIXminus;
621 else if (fpixId.
side()==2) ++nhitinFPIXplus;
626 static const int iNhit01 = this->
GetIndex(trackHists1D,
"nHitBPIXTrack");
627 trackHists1D[iNhit01]->Fill(nhitinBPIX);
628 static const int iNhit02 = this->
GetIndex(trackHists1D,
"nHitFPIXplusTrack");
629 trackHists1D[iNhit02]->Fill(nhitinFPIXplus);
630 static const int iNhit03 = this->
GetIndex(trackHists1D,
"nHitFPIXminusTrack");
631 trackHists1D[iNhit03]->Fill(nhitinFPIXminus);
632 static const int iNhit04 = this->
GetIndex(trackHists1D,
"nHitFPIXTrack");
633 trackHists1D[iNhit04]->Fill(nhitinFPIX);
634 static const int iNhit05 = this->
GetIndex(trackHists1D,
"nHitPIXELTrack");
635 trackHists1D[iNhit05]->Fill(nhitinPIXEL);
636 static const int iNhit06 = this->
GetIndex(trackHists1D,
"nHitTIBTrack");
637 trackHists1D[iNhit06]->Fill(nhitinTIB);
638 static const int iNhit07 = this->
GetIndex(trackHists1D,
"nHitTOBTrack");
639 trackHists1D[iNhit07]->Fill(nhitinTOB);
640 static const int iNhit08 = this->
GetIndex(trackHists1D,
"nHitTIDplusTrack");
641 trackHists1D[iNhit08]->Fill(nhitinTIDplus);
642 static const int iNhit09 = this->
GetIndex(trackHists1D,
"nHitTIDminusTrack");
643 trackHists1D[iNhit09]->Fill(nhitinTIDminus);
644 static const int iNhit10 = this->
GetIndex(trackHists1D,
"nHitTIDTrack");
645 trackHists1D[iNhit10]->Fill(nhitinTID);
646 static const int iNhit11 = this->
GetIndex(trackHists1D,
"nHitTECplusTrack");
647 trackHists1D[iNhit11]->Fill(nhitinTECplus);
648 static const int iNhit12 = this->
GetIndex(trackHists1D,
"nHitTECminusTrack");
649 trackHists1D[iNhit12]->Fill(nhitinTECminus);
650 static const int iNhit13 = this->
GetIndex(trackHists1D,
"nHitTECTrack");
651 trackHists1D[iNhit13]->Fill(nhitinTEC);
652 static const int iNhit14 = this->
GetIndex(trackHists1D,
"nHitENDCAPplusTrack");
653 trackHists1D[iNhit14]->Fill(nhitinENDCAPplus);
654 static const int iNhit15 = this->
GetIndex(trackHists1D,
"nHitENDCAPminusTrack");
655 trackHists1D[iNhit15]->Fill(nhitinENDCAPminus);
656 static const int iNhit16 = this->
GetIndex(trackHists1D,
"nHitENDCAPTrack");
657 trackHists1D[iNhit16]->Fill(nhitinENDCAP);
658 static const int iNhit17 = this->
GetIndex(trackHists2D,
"nHitENDCAPTrackMinusVsPlus");
659 trackHists2D[iNhit17]->Fill(nhitinENDCAPplus,nhitinENDCAPminus);
663 static const int iR1 = this->
GetIndex(trackHists1D,
"r1Track");
664 trackHists1D[iR1]->Fill(firstPoint.Rho());
665 const double rSigned1 = (firstPoint.y() > 0 ? firstPoint.Rho() : -firstPoint.Rho());
666 static const int iR1Signed = this->
GetIndex(trackHists1D,
"r1TrackSigned");
667 trackHists1D[iR1Signed]->Fill(rSigned1);
668 static const int iZ1 = this->
GetIndex(trackHists1D,
"z1Track");
669 trackHists1D[iZ1]->Fill(firstPoint.Z());
670 static const int iZ1Full = this->
GetIndex(trackHists1D,
"z1TrackFull");
671 trackHists1D[iZ1Full]->Fill(firstPoint.Z());
672 static const int iY1 = this->
GetIndex(trackHists1D,
"y1Track");
673 trackHists1D[iY1]->Fill(firstPoint.Y());
674 static const int iPhi1 = this->
GetIndex(trackHists1D,
"phi1Track");
675 trackHists1D[iPhi1]->Fill(firstPoint.phi());
676 static const int iRz1Full = this->
GetIndex(trackHists2D,
"rz1TrackFull");
677 trackHists2D[iRz1Full]->Fill(firstPoint.Z(), rSigned1);
678 static const int iXy1 = this->
GetIndex(trackHists2D,
"xy1Track");
679 trackHists2D[iXy1]->Fill(firstPoint.X(), firstPoint.Y());
684 static const int iRlast = this->
GetIndex(trackHists1D,
"rLastTrack");
685 trackHists1D[iRlast]->Fill(lastPoint.Rho());
686 static const int iZlast = this->
GetIndex(trackHists1D,
"zLastTrack");
687 trackHists1D[iZlast]->Fill(lastPoint.Z());
688 static const int iYlast = this->
GetIndex(trackHists1D,
"yLastTrack");
689 trackHists1D[iYlast]->Fill(lastPoint.Y());
690 static const int iPhiLast = this->
GetIndex(trackHists1D,
"phiLastTrack");
691 trackHists1D[iPhiLast]->Fill(lastPoint.phi());
694 static const int iChi2Ndf = this->
GetIndex(trackHists1D,
"chi2PerNdf");
697 static const int iImpZ = this->
GetIndex(trackHists1D,
"impParZ");
698 trackHists1D[iImpZ]->Fill(track->
dz());
699 static const int iImpZerr = this->
GetIndex(trackHists1D,
"impParErrZ");
700 trackHists1D[iImpZerr]->Fill(track->
dzError());
703 static const int iImpRphi = this->
GetIndex(trackHists1D,
"impParRphi");
704 trackHists1D[iImpRphi]->Fill(track->
d0());
705 static const int iImpRphiErr = this->
GetIndex(trackHists1D,
"impParErrRphi");
706 trackHists1D[iImpRphiErr]->Fill(track->
d0Error());
715 if (refTrajPtr->isValid()) {
724 const AlgebraicVector &trajectoryLoc = refTrajPtr->trajectoryPositions();
729 const int nRow = refTrajPtr->numberOfHitMeas();
731 for (
int iRow = 0; iRow < nRow; ++iRow) {
732 const double residuum = measurementsLoc[iRow] - trajectoryLoc[iRow];
733 const double covMeasLocRow = covMeasLoc[iRow][iRow];
734 const bool is2DhitRow = (!recHits[iRow/2]->detUnit()
735 || recHits[iRow/2]->detUnit()->type().isTrackerPixel());
737 if (TMath::Even(iRow)) {
752 if (covMeasLocRow > 0.) {
755 static const int iReduResidLocXvsHit =
757 myTrajectoryHists2D[iReduResidLocXvsHit]->Fill(iRow/2, residuum/TMath::Sqrt(covMeasLocRow));
759 }
else if (is2DhitRow) {
775 if (covMeasLocRow > 0.) {
779 "reduResidLocYvsHit");
780 myTrajectoryHists2D[iReduResidLocYvsHit]->Fill(iRow/2, residuum/TMath::Sqrt(covMeasLocRow));
784 float nHitRow = iRow/2;
785 if (TMath::Odd(iRow)) nHitRow += 0.5;
787 for (
int iCol = iRow+1; iCol < nRow; ++iCol) {
788 double rho = TMath::Sqrt(covMeasLocRow + covMeasLoc[iCol][iCol]);
789 rho = (0. == rho ? -2 : covMeasLoc[iRow][iCol] /
rho);
790 float nHitCol = iCol/2;
791 if (TMath::Odd(iCol)) nHitCol += 0.5;
793 if (0. == rho)
continue;
796 if (iRow+1 == iCol && TMath::Even(iRow)) {
807 "hitCorrXyLogValid");
821 for (
int iCol = 0; iCol < derivatives.num_col(); ++iCol) {
830 derivatives[iRow][iCol]);
838 const float *localDerivs,
unsigned int nLocal,
839 const float *globalDerivs,
unsigned int nGlobal,
842 const double phi = recHit->det()->position().phi();
848 for (
unsigned int i = 0;
i < nLocal; ++
i) {
851 if (localDerivs[i]) {
853 myDerivHists2D[iLocPhiLog]->Fill(phi, TMath::Abs(localDerivs[i]));
862 for (
unsigned int i = 0;
i < nGlobal; ++
i) {
866 if (globalDerivs[i]) {
867 myDerivHists2D[iGlobParLog]->Fill(parNum, TMath::Abs(globalDerivs[i]));
868 myDerivHists2D[iGlobPhiLog]->Fill(phi, TMath::Abs(globalDerivs[i]));
879 unsigned int nHit,
float residuum,
float sigma,
bool isY)
883 const GlobalPoint detPos(recHit->det()->position());
884 const double phi = detPos.phi();
929 const float phiSensToNorm = TMath::ATan(TMath::Abs((isY ? mom.y() : mom.x())/mom.z()));
938 const DetId detId(recHit->det()->geographicalId());
941 unsigned int subDetNum = detId.
subdetId();
942 if (subDetNum < histArrayVec.size() && subDetNum > 0) {
943 this->
fillResidualHists(histArrayVec[subDetNum], phiSensToNorm, residuum, sigma);
947 <<
"Expect subDetNum from 1 to 6, got " << subDetNum;
954 float phiSensToNorm,
float residuum,
float sigma)
960 static const int iRes = this->
GetIndex(hists,
"resid");
961 hists[iRes]->Fill(residuum);
962 static const int iSigma = this->
GetIndex(hists,
"sigma");
963 hists[iSigma]->Fill(sigma);
964 static const int iSigmaVsAngle = this->
GetIndex(hists,
"sigmaVsAngle");
965 hists[iSigmaVsAngle]->Fill(phiSensToNorm, sigma);
966 static const int iResidVsAngle = this->
GetIndex(hists,
"residVsAngle");
967 hists[iResidVsAngle]->Fill(phiSensToNorm, residuum);
968 static const int iReduRes = this->
GetIndex(hists,
"reduResid");
969 static const int iReduResidVsAngle = this->
GetIndex(hists,
"reduResidVsAngle");
971 hists[iReduRes]->Fill(residuum/sigma);
972 hists[iReduResidVsAngle]->Fill(phiSensToNorm, residuum/sigma);
974 static const int iAngle = this->
GetIndex(hists,
"angle");
975 hists[iAngle]->Fill(phiSensToNorm);
977 if (phiSensToNorm > TMath::DegToRad()*45.) {
978 static const int iResGt45 = this->
GetIndex(hists,
"residGt45");
979 hists[iResGt45]->Fill(residuum);
980 static const int iSigmaGt45 = this->
GetIndex(hists,
"sigmaGt45");
981 hists[iSigmaGt45]->Fill(sigma);
982 static const int iReduResGt45 = this->
GetIndex(hists,
"reduResidGt45");
983 if (sigma) hists[iReduResGt45]->Fill(residuum/sigma);
985 static const int iResLt45 = this->
GetIndex(hists,
"residLt45");
986 hists[iResLt45]->Fill(residuum);
987 static const int iSigmaLt45 = this->
GetIndex(hists,
"sigmaLt45");
988 hists[iSigmaLt45]->Fill(sigma);
989 static const int iReduResLt45 = this->
GetIndex(hists,
"reduResidLt45");
990 if (sigma) hists[iReduResLt45]->Fill(residuum/sigma);
996 float residuum,
float sigma,
unsigned int nHit)
1002 static const unsigned int maxNhit = 29;
1003 static int iResHit[maxNhit+1] = {-1};
1004 static int iSigmaHit[maxNhit+1] = {-1};
1005 static int iReduResHit[maxNhit+1] = {-1};
1006 static int iAngleHit[maxNhit+1] = {-1};
1007 if (iResHit[0] == -1) {
1008 for (
unsigned int i = 0;
i <= maxNhit; ++
i) {
1009 iResHit[
i] = this->
GetIndex(hists, Form(
"resid_%d",
i));
1010 iSigmaHit[
i] = this->
GetIndex(hists, Form(
"sigma_%d",
i));
1011 iReduResHit[
i] = this->
GetIndex(hists, Form(
"reduResid_%d",
i));
1012 iAngleHit[
i] = this->
GetIndex(hists, Form(
"angle_%d",
i));
1015 if (nHit > maxNhit) nHit = maxNhit;
1017 hists[iResHit[nHit]]->Fill(residuum);
1018 hists[iSigmaHit[nHit]]->Fill(sigma);
1020 hists[iReduResHit[nHit]]->Fill(residuum/sigma);
1022 hists[iAngleHit[nHit]]->Fill(angle);
1035 static int iF2fIjPhi[6][6], iF2fIjPhiLog[6][6], iF2fIjR[6][6], iF2fIjRLog[6][6];
1036 static bool first =
true;
1038 for (
unsigned int i = 0;
i < 6; ++
i) {
1039 for (
unsigned int j = 0;
j < 6; ++
j) {
1051 for (
unsigned int i = 0;
i < 6; ++
i) {
1052 for (
unsigned int j = 0;
j < 6; ++
j) {
1056 if (frameDeriv[
i][j]) {
1068 const DetId detId(recHit->det()->geographicalId());
1071 if ((detId.subdetId() < 1 || detId.subdetId() > 6) &&
1073 edm::LogWarning(
"Alignment") <<
"@SUB=MillePedeMonitor::fillCorrelations2D"
1074 <<
"Expect subdetId from 1 to 6, got " << detId.subdetId();
std::vector< TH1 * > myTrackHists1D
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
double d0Error() const
error on d0
void fillCorrelations2D(float corr, const TransientTrackingRecHit::ConstRecHitPointer &hit)
const Vector & momentum() const
track momentum vector
std::vector< TH2 * > myDerivHists2D
std::vector< std::vector< TH1 * > > myResidHistsVec1DX
double d0() const
dxy parameter in perigee convention (d0 = - dxy)
void fillFrameToFrame(const AlignableDetOrUnitPtr &aliDet, const Alignable *ali)
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
LocalVector localDirection() const
void fillPxbSurveyHistsLocalPars(const float &a0, const float &a1, const float &S, const float &phi)
Geom::Phi< T > phi() const
bool innerOk() const
return true if the innermost hit is valid
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
std::vector< TH1 * > myTrajectoryHists1D
std::vector< TH1 * > myResidHitHists1DY
std::vector< OBJECT_TYPE * > cloneHists(const std::vector< OBJECT_TYPE * > &orgs, const TString &namAd, const TString &titAd) const
const math::XYZPoint & outerPosition() const
position of the outermost hit
static int position[TOTALCHAMBERS][3]
void fillResiduals(const TransientTrackingRecHit::ConstRecHitPointer &recHit, const TrajectoryStateOnSurface &tsos, unsigned int nHit, float residuum, float sigma, bool isY)
void fillPxbSurveyHistsChi2(const float &chi2)
static const unsigned int theMaxNumParam
const math::XYZPoint & innerPosition() const
position of the innermost hit
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
void addToDirectory(const std::vector< OBJECT_TYPE * > &objs, TDirectory *dir) const
std::vector< TH2 * > myTrackHists2D
bool isZMinusSide() const
MillePedeMonitor(const char *rootFile="trackMonitor.root")
std::vector< TH2 * > myResidHists2D
CLHEP::HepMatrix AlgebraicMatrix
void fillUsedTrack(const reco::Track *track, unsigned int nHitX, unsigned int nHitY)
std::vector< TH1 * > myCorrHists
std::vector< TH1 * > myPxbSurveyHists
double pt() const
track transverse momentum
std::vector< TH1 * > myUsedTrackHists1D
unsigned short numberOfValidHits() const
number of valid hits found
bool init(TDirectory *directory)
math::XYZPoint Point
point in the space
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
AlgebraicMatrix frameToFrameDerivative(const Alignable *object, const Alignable *composedObject) const
Return the derivative DeltaFrame(object)/DeltaFrame(composedobject)
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< TH2 * > myTrajectoryHists2D
std::vector< std::vector< TH1 * > > myResidHistsVec1DY
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
bool isZMinusSide() const
CLHEP::HepVector AlgebraicVector
bool equidistLogBins(double *bins, int nBins, double first, double last) const
static const DetId detId()
bool outerOk() const
return true if the outermost hit is valid
void fillResidualHists(const std::vector< TH1 * > &hists, float phiSensToNorm, float residuum, float sigma)
void fillTrack(const reco::Track *track)
std::vector< TH1 * > myResidHitHists1DX
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
std::vector< TH2 * > myUsedTrackHists2D
void fillRefTrajectory(const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr)
CLHEP::HepSymMatrix AlgebraicSymMatrix
unsigned int side() const
positive or negative id
void fillDerivatives(const TransientTrackingRecHit::ConstRecHitPointer &recHit, const float *localDerivs, unsigned int nLocal, const float *globalDerivs, unsigned int nGlobal, const int *labels)
const PositionType & globalPosition() const
Return the global position of the object.
std::vector< TH2 * > myFrame2FrameHists2D
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
math::XYZVector Vector
spatial vector
void fillResidualHitHists(const std::vector< TH1 * > &hists, float angle, float residuum, float sigma, unsigned int nHit)
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.