CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MillePedeMonitor Class Reference

#include <MillePedeMonitor.h>

Public Member Functions

void fillCorrelations2D (float corr, const TransientTrackingRecHit::ConstRecHitPointer &hit)
 
void fillDerivatives (const TransientTrackingRecHit::ConstRecHitPointer &recHit, const float *localDerivs, unsigned int nLocal, const float *globalDerivs, unsigned int nGlobal, const int *labels)
 
void fillFrameToFrame (const AlignableDetOrUnitPtr &aliDet, const Alignable *ali)
 
void fillPxbSurveyHistsChi2 (const float &chi2)
 
void fillPxbSurveyHistsLocalPars (const float &a0, const float &a1, const float &S, const float &phi)
 
void fillRefTrajectory (const ReferenceTrajectoryBase::ReferenceTrajectoryPtr &refTrajPtr)
 
void fillResiduals (const TransientTrackingRecHit::ConstRecHitPointer &recHit, const TrajectoryStateOnSurface &tsos, unsigned int nHit, float residuum, float sigma, bool isY)
 
void fillTrack (const reco::Track *track)
 
void fillUsedTrack (const reco::Track *track, unsigned int nHitX, unsigned int nHitY)
 
 MillePedeMonitor (const TrackerTopology *tTopo, const char *rootFile="trackMonitor.root")
 
 MillePedeMonitor (TDirectory *rootDir, const TrackerTopology *tTopo)
 
 ~MillePedeMonitor ()
 

Private Member Functions

template<class OBJECT_TYPE >
void addToDirectory (const std::vector< OBJECT_TYPE * > &objs, TDirectory *dir) const
 
template<class OBJECT_TYPE >
std::vector< OBJECT_TYPE * > cloneHists (const std::vector< OBJECT_TYPE * > &orgs, const TString &namAd, const TString &titAd) const
 
bool equidistLogBins (double *bins, int nBins, double first, double last) const
 
void fillResidualHists (const std::vector< TH1 * > &hists, float phiSensToNorm, float residuum, float sigma)
 
void fillResidualHitHists (const std::vector< TH1 * > &hists, float angle, float residuum, float sigma, unsigned int nHit)
 
void fillTrack (const reco::Track *track, std::vector< TH1 * > &trackHists1D, std::vector< TH2 * > &trackHists2D)
 
template<class OBJECT_TYPE >
int GetIndex (const std::vector< OBJECT_TYPE * > &vec, const TString &name)
 
template<typename T , size_t SIZE>
std::array< int, SIZEindexArray1D (const std::vector< T * > &hists, const char *title)
 
template<typename T , size_t SIZE>
std::array< std::array< int, SIZE >, SIZEindexArray2D (const std::vector< T * > &hists, const char *title)
 
bool init (TDirectory *directory)
 

Private Attributes

std::vector< TH1 * > myCorrHists
 
bool myDeleteDir
 
std::vector< TH2 * > myDerivHists2D
 
std::vector< TH2 * > myFrame2FrameHists2D
 
std::vector< TH1 * > myPxbSurveyHists
 
std::vector< TH2 * > myResidHists2D
 
std::vector< std::vector< TH1 * > > myResidHistsVec1DX
 
std::vector< std::vector< TH1 * > > myResidHistsVec1DY
 [0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC More...
 
std::vector< TH1 * > myResidHitHists1DX
 [0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC More...
 
std::vector< TH1 * > myResidHitHists1DY
 
TDirectory * myRootDir
 
std::vector< TH1 * > myTrackHists1D
 
std::vector< TH2 * > myTrackHists2D
 
std::vector< TH1 * > myTrajectoryHists1D
 
std::vector< TH2 * > myTrajectoryHists2D
 
std::vector< TH1 * > myUsedTrackHists1D
 
std::vector< TH2 * > myUsedTrackHists2D
 
const TrackerTopologytrackerTopology
 

Detailed Description

monitoring of MillePedeAlignmentAlgorithm and its input tracks

Author
: Gero Flucke date : October 2006
Revision
1.14
Date
2010/10/26 20:52:23

(last update by

Author
flucke

)

Definition at line 46 of file MillePedeMonitor.h.

Constructor & Destructor Documentation

MillePedeMonitor::MillePedeMonitor ( const TrackerTopology tTopo,
const char *  rootFile = "trackMonitor.root" 
)

Definition at line 45 of file MillePedeMonitor.cc.

References init(), myDeleteDir, and myRootDir.

46  : myRootDir(nullptr), myDeleteDir(false), trackerTopology(tTopo)
47 {
48  myRootDir = TFile::Open(rootFileName, "recreate");
49  myDeleteDir = true;
50 
51  this->init(myRootDir);
52 }
const TrackerTopology * trackerTopology
TDirectory * myRootDir
bool init(TDirectory *directory)
MillePedeMonitor::MillePedeMonitor ( TDirectory *  rootDir,
const TrackerTopology tTopo 
)

Definition at line 55 of file MillePedeMonitor.cc.

References init(), myDeleteDir, and myRootDir.

56  : myRootDir(nullptr), myDeleteDir(false), trackerTopology(tTopo)
57 {
58  // cout << "MillePedeMonitor using input TDirectory" << endl;
59 
60  myRootDir = rootDir;
61  myDeleteDir = false;
62 
63  this->init(myRootDir);
64 }
const TrackerTopology * trackerTopology
TDirectory * myRootDir
bool init(TDirectory *directory)
MillePedeMonitor::~MillePedeMonitor ( )

Definition at line 67 of file MillePedeMonitor.cc.

References myDeleteDir, and myRootDir.

68 {
69 
70  myRootDir->Write();
71  if (myDeleteDir) delete myRootDir; //hists are deleted with their directory
72 }
TDirectory * myRootDir

Member Function Documentation

template<class OBJECT_TYPE >
void MillePedeMonitor::addToDirectory ( const std::vector< OBJECT_TYPE * > &  objs,
TDirectory *  dir 
) const
private

Definition at line 149 of file MillePedeMonitor.h.

Referenced by init().

151 {
152  // OBJECT_TYPE is required to have method SetDirectory(TDirectory *dir)
153  for (typename std::vector<OBJECT_TYPE*>::const_iterator iter = obs.begin(), iterEnd = obs.end();
154  iter != iterEnd; ++iter) {
155  if (*iter) (*iter)->SetDirectory(dir);
156  }
157 }
dbl *** dir
Definition: mlp_gen.cc:35
template<class OBJECT_TYPE >
std::vector< OBJECT_TYPE * > MillePedeMonitor::cloneHists ( const std::vector< OBJECT_TYPE * > &  orgs,
const TString &  namAd,
const TString &  titAd 
) const
private

Definition at line 129 of file MillePedeMonitor.h.

References mps_fire::result.

Referenced by init().

132 {
133  // OBJECT_TYPE required to have methods Clone(const char*), GetName(), SetTitle(const char*) and GetTitle()
134  std::vector<OBJECT_TYPE*> result;
135  for (typename std::vector<OBJECT_TYPE*>::const_iterator iter = orgs.begin(), iterEnd = orgs.end();
136  iter != iterEnd; ++iter) {
137  if (!(*iter)) continue;
138  result.push_back(static_cast<OBJECT_TYPE*>((*iter)->Clone(namAd + (*iter)->GetName())));
139  if (result.back()) result.back()->SetTitle((*iter)->GetTitle() + titAd);
140  else edm::LogError("Alignment") <<"@SUB=MillePedeMonitor::cloneHists"
141  << "out of memory?";
142  }
143 
144  return result;
145 }
bool MillePedeMonitor::equidistLogBins ( double *  bins,
int  nBins,
double  first,
double  last 
) const
private

Definition at line 499 of file MillePedeMonitor.cc.

References plotBeamSpotDB::first, mps_fire::i, and plotBeamSpotDB::last.

Referenced by init().

501 {
502  // Filling 'bins' with borders of 'nBins' bins between 'first' and 'last'
503  // that are equidistant when viewed in log scale,
504  // so 'bins' must have length nBins+1;
505  // If 'first', 'last' or 'nBins' are not positive, failure is reported.
506 
507  if (nBins < 1 || first <= 0. || last <= 0.) return false;
508 
509  bins[0] = first;
510  bins[nBins] = last;
511  const double firstLog = TMath::Log10(bins[0]);
512  const double lastLog = TMath::Log10(bins[nBins]);
513  for (int i = 1; i < nBins; ++i) {
514  bins[i] = TMath::Power(10., firstLog + i*(lastLog-firstLog)/(nBins));
515  }
516 
517  return true;
518 }
void MillePedeMonitor::fillCorrelations2D ( float  corr,
const TransientTrackingRecHit::ConstRecHitPointer hit 
)

Definition at line 1048 of file MillePedeMonitor.cc.

References AlignableBeamSpot::detId(), myCorrHists, and DetId::Tracker.

1049 {
1050  const DetId detId(recHit->det()->geographicalId());
1051  if (detId.det() != DetId::Tracker) return;
1052 
1053  if ((detId.subdetId() < 1 || detId.subdetId() > 6) &&
1054  detId!=AlignableBeamSpot::detId()) {
1055  edm::LogWarning("Alignment") << "@SUB=MillePedeMonitor::fillCorrelations2D"
1056  << "Expect subdetId from 1 to 6, got " << detId.subdetId();
1057  return;
1058  }
1059 
1060  myCorrHists[detId.subdetId()-1]->Fill(corr);
1061 }
std::vector< TH1 * > myCorrHists
JetCorrectorParameters corr
Definition: classes.h:5
Definition: DetId.h:18
static const DetId detId()
void MillePedeMonitor::fillDerivatives ( const TransientTrackingRecHit::ConstRecHitPointer recHit,
const float *  localDerivs,
unsigned int  nLocal,
const float *  globalDerivs,
unsigned int  nGlobal,
const int *  labels 
)

Definition at line 836 of file MillePedeMonitor.cc.

References Abs(), GetIndex(), mps_fire::i, myDerivHists2D, phi, and PedeLabelerBase::theMaxNumParam.

840 {
841  const double phi = recHit->det()->position().phi();
842 
843  static const int iLocPar = this->GetIndex(myDerivHists2D, "localDerivsPar");
844  static const int iLocPhi = this->GetIndex(myDerivHists2D, "localDerivsPhi");
845  static const int iLocParLog = this->GetIndex(myDerivHists2D, "localDerivsParLog");
846  static const int iLocPhiLog = this->GetIndex(myDerivHists2D, "localDerivsPhiLog");
847  for (unsigned int i = 0; i < nLocal; ++i) {
848  myDerivHists2D[iLocPar]->Fill(i, localDerivs[i]);
849  myDerivHists2D[iLocPhi]->Fill(phi, localDerivs[i]);
850  if (localDerivs[i]) {
851  myDerivHists2D[iLocParLog]->Fill(i, TMath::Abs(localDerivs[i]));
852  myDerivHists2D[iLocPhiLog]->Fill(phi, TMath::Abs(localDerivs[i]));
853  }
854  }
855 
856  static const int iGlobPar = this->GetIndex(myDerivHists2D, "globalDerivsPar");
857  static const int iGlobPhi = this->GetIndex(myDerivHists2D, "globalDerivsPhi");
858  static const int iGlobParLog = this->GetIndex(myDerivHists2D, "globalDerivsParLog");
859  static const int iGlobPhiLog = this->GetIndex(myDerivHists2D, "globalDerivsPhiLog");
860 // static const int iGlobPhiLog2 = this->GetIndex(myDerivHists2D, "globalDerivsPhiLog2");
861  for (unsigned int i = 0; i < nGlobal; ++i) {
862  const unsigned int parNum = (labels ? (labels[i]%PedeLabelerBase::theMaxNumParam)-1 : i);
863  myDerivHists2D[iGlobPar]->Fill(parNum, globalDerivs[i]);
864  myDerivHists2D[iGlobPhi]->Fill(phi, globalDerivs[i]);
865  if (globalDerivs[i]) {
866  myDerivHists2D[iGlobParLog]->Fill(parNum, TMath::Abs(globalDerivs[i]));
867  myDerivHists2D[iGlobPhiLog]->Fill(phi, TMath::Abs(globalDerivs[i]));
868 // myDerivHists2D[iGlobPhiLog2]->Fill(phi, TMath::Abs(globalDerivs[i]));
869  }
870  }
871 
872 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< TH2 * > myDerivHists2D
static const unsigned int theMaxNumParam
T Abs(T a)
Definition: MathUtil.h:49
void MillePedeMonitor::fillFrameToFrame ( const AlignableDetOrUnitPtr aliDet,
const Alignable ali 
)

Definition at line 1017 of file MillePedeMonitor.cc.

References Abs(), FrameToFrameDerivative::frameToFrameDerivative(), GetIndex(), Alignable::globalPosition(), mps_fire::i, myFrame2FrameHists2D, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), and alignCSCRings::r.

1018 {
1019  // get derivative of higher level structure w.r.t. det
1021  const AlgebraicMatrix frameDeriv = ftfd.frameToFrameDerivative(aliDet, ali);
1022  //const AlgebraicMatrix frameDeriv = ftfd.frameToFrameDerivativeAtOrgRot(aliDet, ali);
1023 
1024  static const int iF2f = this->GetIndex(myFrame2FrameHists2D, "frame2frame");
1025  static const int iF2fAbs = this->GetIndex(myFrame2FrameHists2D, "frame2frameAbs");
1026  static const auto iF2fIjPhi = indexArray2D<TH2,6>(myFrame2FrameHists2D, "frame2framePhi%d%d");
1027  static const auto iF2fIjPhiLog = indexArray2D<TH2,6>(myFrame2FrameHists2D, "frame2framePhiLog%d%d");
1028  static const auto iF2fIjR = indexArray2D<TH2,6>(myFrame2FrameHists2D, "frame2frameR%d%d");
1029  static const auto iF2fIjRLog = indexArray2D<TH2,6>(myFrame2FrameHists2D, "frame2frameRLog%d%d");
1030 
1031  const double phi = aliDet->globalPosition().phi(); // after misalignment...
1032  const double r = aliDet->globalPosition().perp(); // after misalignment...
1033  for (unsigned int i = 0; i < 6; ++i) {
1034  for (unsigned int j = 0; j < 6; ++j) {
1035  myFrame2FrameHists2D[iF2f]->Fill(i, j, frameDeriv[i][j]);
1036  myFrame2FrameHists2D[iF2fIjPhi[i][j]]->Fill(phi, frameDeriv[i][j]);
1037  myFrame2FrameHists2D[iF2fIjR[i][j]]->Fill(r, frameDeriv[i][j]);
1038  if (frameDeriv[i][j]) {
1039  myFrame2FrameHists2D[iF2fAbs]->Fill(i, j, TMath::Abs(frameDeriv[i][j]));
1040  myFrame2FrameHists2D[iF2fIjPhiLog[i][j]]->Fill(phi, TMath::Abs(frameDeriv[i][j]));
1041  myFrame2FrameHists2D[iF2fIjRLog[i][j]]->Fill(r, TMath::Abs(frameDeriv[i][j]));
1042  }
1043  }
1044  }
1045 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
T perp() const
Definition: PV3DBase.h:72
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
CLHEP::HepMatrix AlgebraicMatrix
T Abs(T a)
Definition: MathUtil.h:49
AlgebraicMatrix frameToFrameDerivative(const Alignable *object, const Alignable *composedObject) const
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
std::vector< TH2 * > myFrame2FrameHists2D
void MillePedeMonitor::fillPxbSurveyHistsChi2 ( const float &  chi2)

Definition at line 1064 of file MillePedeMonitor.cc.

References GetIndex(), and myPxbSurveyHists.

1065 {
1066  static const int iPxbSurvChi2_lo = this->GetIndex(myPxbSurveyHists,"PxbSurvChi2_lo");
1067  myPxbSurveyHists[iPxbSurvChi2_lo]->Fill(chi2);
1068  static const int iPxbSurvChi2_md = this->GetIndex(myPxbSurveyHists,"PxbSurvChi2_md");
1069  myPxbSurveyHists[iPxbSurvChi2_md]->Fill(chi2);
1070  static const int iPxbSurvChi2_hi = this->GetIndex(myPxbSurveyHists,"PxbSurvChi2_hi");
1071  myPxbSurveyHists[iPxbSurvChi2_hi]->Fill(chi2);
1072  static const int iPxbSurvChi2prob = this->GetIndex(myPxbSurveyHists,"PxbSurvChi2prob");
1073  myPxbSurveyHists[iPxbSurvChi2prob]->Fill(TMath::Prob(chi2,4));
1074 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< TH1 * > myPxbSurveyHists
void MillePedeMonitor::fillPxbSurveyHistsLocalPars ( const float &  a0,
const float &  a1,
const float &  S,
const float &  phi 
)

Definition at line 1077 of file MillePedeMonitor.cc.

References GetIndex(), and myPxbSurveyHists.

1078 {
1079  static const int iPxbSurv_a0 = this->GetIndex(myPxbSurveyHists,"PxbSurv_a0");
1080  myPxbSurveyHists[iPxbSurv_a0]->Fill(a0);
1081  static const int iPxbSurv_a0_abs = this->GetIndex(myPxbSurveyHists,"PxbSurv_a0_abs");
1082  myPxbSurveyHists[iPxbSurv_a0_abs]->Fill(fabs(a0));
1083  static const int iPxbSurv_a1 = this->GetIndex(myPxbSurveyHists,"PxbSurv_a1");
1084  myPxbSurveyHists[iPxbSurv_a1]->Fill(a1);
1085  static const int iPxbSurv_a1_abs = this->GetIndex(myPxbSurveyHists,"PxbSurv_a1_abs");
1086  myPxbSurveyHists[iPxbSurv_a1_abs]->Fill(fabs(a1));
1087  static const int iPxbSurv_scale = this->GetIndex(myPxbSurveyHists,"PxbSurv_scale");
1088  myPxbSurveyHists[iPxbSurv_scale]->Fill(S);
1089  static const int iPxbSurv_phi = this->GetIndex(myPxbSurveyHists,"PxbSurv_phi");
1090  myPxbSurveyHists[iPxbSurv_phi]->Fill(phi);
1091 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< TH1 * > myPxbSurveyHists
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
void MillePedeMonitor::fillRefTrajectory ( const ReferenceTrajectoryBase::ReferenceTrajectoryPtr refTrajPtr)

Definition at line 710 of file MillePedeMonitor.cc.

References Abs(), Even, GetIndex(), myTrajectoryHists1D, myTrajectoryHists2D, Odd, phi, position, and rho.

711 {
712 
713  static const int iValid = this->GetIndex(myTrajectoryHists1D, "validRefTraj");
714  if (refTrajPtr->isValid()) {
715  myTrajectoryHists1D[iValid]->Fill(1.);
716  } else {
717  myTrajectoryHists1D[iValid]->Fill(0.);
718  return;
719  }
720 
721  const AlgebraicSymMatrix &covMeasLoc = refTrajPtr->measurementErrors();
722  const AlgebraicVector &measurementsLoc = refTrajPtr->measurements();
723  const AlgebraicVector &trajectoryLoc = refTrajPtr->trajectoryPositions();
724  const TransientTrackingRecHit::ConstRecHitContainer &recHits = refTrajPtr->recHits();
725  const AlgebraicMatrix &derivatives = refTrajPtr->derivatives();
726 
727 // CHK
728  const int nRow = refTrajPtr->numberOfHitMeas();
729 
730  for (int iRow = 0; iRow < nRow; ++iRow) {
731  const double residuum = measurementsLoc[iRow] - trajectoryLoc[iRow];
732  const double covMeasLocRow = covMeasLoc[iRow][iRow];
733  const bool is2DhitRow = (!recHits[iRow/2]->detUnit() // FIXME: as in MillePedeAlignmentAlgorithm::is2D()
734  || recHits[iRow/2]->detUnit()->type().isTrackerPixel());
735  //the GeomDetUnit* is zero for composite hits (matched hits in the tracker,...).
736  if (TMath::Even(iRow)) { // local x
737  static const int iMeasLocX = this->GetIndex(myTrajectoryHists1D, "measLocX");
738  myTrajectoryHists1D[iMeasLocX]->Fill(measurementsLoc[iRow]);
739  static const int iTrajLocX = this->GetIndex(myTrajectoryHists1D, "trajLocX");
740  myTrajectoryHists1D[iTrajLocX]->Fill(trajectoryLoc[iRow]);
741  static const int iResidLocX = this->GetIndex(myTrajectoryHists1D, "residLocX");
742  myTrajectoryHists1D[iResidLocX]->Fill(residuum);
743 
744  static const int iMeasLocXvsHit = this->GetIndex(myTrajectoryHists2D, "measLocXvsHit");
745  myTrajectoryHists2D[iMeasLocXvsHit]->Fill(iRow/2, measurementsLoc[iRow]);
746  static const int iTrajLocXvsHit = this->GetIndex(myTrajectoryHists2D, "trajLocXvsHit");
747  myTrajectoryHists2D[iTrajLocXvsHit]->Fill(iRow/2, trajectoryLoc[iRow]);
748  static const int iResidLocXvsHit = this->GetIndex(myTrajectoryHists2D, "residLocXvsHit");
749  myTrajectoryHists2D[iResidLocXvsHit]->Fill(iRow/2, residuum);
750 
751  if (covMeasLocRow > 0.) {
752  static const int iReduResidLocX = this->GetIndex(myTrajectoryHists1D, "reduResidLocX");
753  myTrajectoryHists1D[iReduResidLocX]->Fill(residuum / TMath::Sqrt(covMeasLocRow));
754  static const int iReduResidLocXvsHit =
755  this->GetIndex(myTrajectoryHists2D, "reduResidLocXvsHit");
756  myTrajectoryHists2D[iReduResidLocXvsHit]->Fill(iRow/2, residuum/TMath::Sqrt(covMeasLocRow));
757  }
758  } else if (is2DhitRow) { // local y, 2D detectors only
759 
760  static const int iMeasLocY = this->GetIndex(myTrajectoryHists1D, "measLocY");
761  myTrajectoryHists1D[iMeasLocY]->Fill(measurementsLoc[iRow]);
762  static const int iTrajLocY = this->GetIndex(myTrajectoryHists1D, "trajLocY");
763  myTrajectoryHists1D[iTrajLocY]->Fill(trajectoryLoc[iRow]);
764  static const int iResidLocY = this->GetIndex(myTrajectoryHists1D, "residLocY");
765  myTrajectoryHists1D[iResidLocY]->Fill(residuum);
766 
767  static const int iMeasLocYvsHit = this->GetIndex(myTrajectoryHists2D, "measLocYvsHit");
768  myTrajectoryHists2D[iMeasLocYvsHit]->Fill(iRow/2, measurementsLoc[iRow]);
769  static const int iTrajLocYvsHit = this->GetIndex(myTrajectoryHists2D, "trajLocYvsHit");
770  myTrajectoryHists2D[iTrajLocYvsHit]->Fill(iRow/2, trajectoryLoc[iRow]);
771  static const int iResidLocYvsHit = this->GetIndex(myTrajectoryHists2D, "residLocYvsHit");
772  myTrajectoryHists2D[iResidLocYvsHit]->Fill(iRow/2, residuum);
773 
774  if (covMeasLocRow > 0.) {
775  static const int iReduResidLocY = this->GetIndex(myTrajectoryHists1D, "reduResidLocY");
776  myTrajectoryHists1D[iReduResidLocY]->Fill(residuum / TMath::Sqrt(covMeasLocRow));
777  static const int iReduResidLocYvsHit = this->GetIndex(myTrajectoryHists2D,
778  "reduResidLocYvsHit");
779  myTrajectoryHists2D[iReduResidLocYvsHit]->Fill(iRow/2, residuum/TMath::Sqrt(covMeasLocRow));
780  }
781  }
782 
783  float nHitRow = iRow/2; // '/2' not '/2.'!
784  if (TMath::Odd(iRow)) nHitRow += 0.5; // y-hit gets 0.5
785  // correlations
786  for (int iCol = iRow+1; iCol < nRow; ++iCol) {
787  double rho = TMath::Sqrt(covMeasLocRow + covMeasLoc[iCol][iCol]);
788  rho = (0. == rho ? -2 : covMeasLoc[iRow][iCol] / rho);
789  float nHitCol = iCol/2; //cf. comment nHitRow
790  if (TMath::Odd(iCol)) nHitCol += 0.5; // dito
791  // myProfileCorr->Fill(nHitRow, nHitCol, TMath::Abs(rho));
792  if (0. == rho) continue;
793  static const int iProfileCorr = this->GetIndex(myTrajectoryHists2D, "profCorr");
794  myTrajectoryHists2D[iProfileCorr]->Fill(nHitRow, nHitCol, TMath::Abs(rho));
795  if (iRow+1 == iCol && TMath::Even(iRow)) { // i.e. if iRow is x and iCol the same hit's y
796 // static const int iProfileCorrXy = this->GetIndex(myTrajectoryHists2D,"profCorrOffXy");
797 // myTrajectoryHists2D[iProfileCorrOffXy]->Fill(iRow/2, rho);
798  static const int iHitCorrXy = this->GetIndex(myTrajectoryHists2D, "hitCorrXy");
799  myTrajectoryHists2D[iHitCorrXy]->Fill(iRow/2, rho);
800  static const int iHitCorrXyLog = this->GetIndex(myTrajectoryHists2D, "hitCorrXyLog");
801  myTrajectoryHists2D[iHitCorrXyLog]->Fill(iRow/2, TMath::Abs(rho));
802  if (is2DhitRow) {
803  static const int iHitCorrXyValid = this->GetIndex(myTrajectoryHists2D, "hitCorrXyValid");
804  myTrajectoryHists2D[iHitCorrXyValid]->Fill(iRow/2, rho); // nhitRow??
805  static const int iHitCorrXyLogValid = this->GetIndex(myTrajectoryHists2D,
806  "hitCorrXyLogValid");
807  myTrajectoryHists2D[iHitCorrXyLogValid]->Fill(iRow/2, TMath::Abs(rho)); // nhitRow??
808  }
809  } else {
810  static const int iProfCorrOffXy = this->GetIndex(myTrajectoryHists2D, "profCorrOffXy");
811  myTrajectoryHists2D[iProfCorrOffXy]->Fill(nHitRow, nHitCol, TMath::Abs(rho));
812  static const int iHitCorrOffBlock = this->GetIndex(myTrajectoryHists2D, "hitCorrOffBlock");
813  myTrajectoryHists2D[iHitCorrOffBlock]->Fill(nHitRow, rho);
814  static const int iHitCorOffBlkLg = this->GetIndex(myTrajectoryHists2D,"hitCorrOffBlockLog");
815  myTrajectoryHists2D[iHitCorOffBlkLg]->Fill(nHitRow, TMath::Abs(rho));
816  }
817  } // end loop on columns of covariance
818 
819  // derivatives
820  for (int iCol = 0; iCol < derivatives.num_col(); ++iCol) {
821  static const int iProfDerivatives = this->GetIndex(myTrajectoryHists2D, "profDerivatives");
822  myTrajectoryHists2D[iProfDerivatives]->Fill(nHitRow, iCol, derivatives[iRow][iCol]);
823  static const int iDerivatives = this->GetIndex(myTrajectoryHists2D, "derivatives");
824  myTrajectoryHists2D[iDerivatives]->Fill(iCol, derivatives[iRow][iCol]);
825  static const int iDerivativesLog = this->GetIndex(myTrajectoryHists2D, "derivativesLog");
826  myTrajectoryHists2D[iDerivativesLog]->Fill(iCol, TMath::Abs(derivatives[iRow][iCol]));
827  static const int iDerivativesPhi = this->GetIndex(myTrajectoryHists2D, "derivativesVsPhi");
828  myTrajectoryHists2D[iDerivativesPhi]->Fill(recHits[iRow/2]->det()->position().phi(),
829  derivatives[iRow][iCol]);
830  }
831  } // end loop on rows of covarianvce
832 
833 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< TH1 * > myTrajectoryHists1D
CLHEP::HepMatrix AlgebraicMatrix
T Abs(T a)
Definition: MathUtil.h:49
std::vector< ConstRecHitPointer > ConstRecHitContainer
std::vector< TH2 * > myTrajectoryHists2D
CLHEP::HepVector AlgebraicVector
static int position[264][3]
Definition: ReadPGInfo.cc:509
CLHEP::HepSymMatrix AlgebraicSymMatrix
void MillePedeMonitor::fillResidualHists ( const std::vector< TH1 * > &  hists,
float  phiSensToNorm,
float  residuum,
float  sigma 
)
private

Definition at line 952 of file MillePedeMonitor.cc.

References GetIndex().

Referenced by fillResiduals().

954 {
955  // Histogram indices are calculated at first call, so make sure the vector of hists at the first
956  // call has the correct names (i.e. without subdet extension) and all later calls have the
957  // same order of hists...
958 
959  static const int iRes = this->GetIndex(hists, "resid");
960  hists[iRes]->Fill(residuum);
961  static const int iSigma = this->GetIndex(hists, "sigma");
962  hists[iSigma]->Fill(sigma);
963  static const int iSigmaVsAngle = this->GetIndex(hists, "sigmaVsAngle");
964  hists[iSigmaVsAngle]->Fill(phiSensToNorm, sigma);
965  static const int iResidVsAngle = this->GetIndex(hists, "residVsAngle");
966  hists[iResidVsAngle]->Fill(phiSensToNorm, residuum);
967  static const int iReduRes = this->GetIndex(hists, "reduResid");
968  static const int iReduResidVsAngle = this->GetIndex(hists, "reduResidVsAngle");
969  if (sigma) {
970  hists[iReduRes]->Fill(residuum/sigma);
971  hists[iReduResidVsAngle]->Fill(phiSensToNorm, residuum/sigma);
972  }
973  static const int iAngle = this->GetIndex(hists, "angle");
974  hists[iAngle]->Fill(phiSensToNorm);
975 
976  if (phiSensToNorm > TMath::DegToRad()*45.) {
977  static const int iResGt45 = this->GetIndex(hists, "residGt45");
978  hists[iResGt45]->Fill(residuum);
979  static const int iSigmaGt45 = this->GetIndex(hists, "sigmaGt45");
980  hists[iSigmaGt45]->Fill(sigma);
981  static const int iReduResGt45 = this->GetIndex(hists, "reduResidGt45");
982  if (sigma) hists[iReduResGt45]->Fill(residuum/sigma);
983  } else {
984  static const int iResLt45 = this->GetIndex(hists, "residLt45");
985  hists[iResLt45]->Fill(residuum);
986  static const int iSigmaLt45 = this->GetIndex(hists, "sigmaLt45");
987  hists[iSigmaLt45]->Fill(sigma);
988  static const int iReduResLt45 = this->GetIndex(hists, "reduResidLt45");
989  if (sigma) hists[iReduResLt45]->Fill(residuum/sigma);
990  }
991 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
void MillePedeMonitor::fillResidualHitHists ( const std::vector< TH1 * > &  hists,
float  angle,
float  residuum,
float  sigma,
unsigned int  nHit 
)
private

Definition at line 994 of file MillePedeMonitor.cc.

References constexpr, and compare::hists.

Referenced by fillResiduals().

996 {
997  // Histogram indices are calculated at first call, so make sure the vector of hists at the first
998  // call has the correct names (i.e. without subdet extension) and all later calls have the
999  // same order of hists...
1000 
1001  static constexpr unsigned int maxNhit = 29; // 0...29 foreseen in initialisation...
1002  static const auto iResHit = indexArray1D<TH1,maxNhit+1>(hists, "resid_%d");
1003  static const auto iSigmaHit = indexArray1D<TH1,maxNhit+1>(hists, "sigma_%d");
1004  static const auto iReduResHit = indexArray1D<TH1,maxNhit+1>(hists, "reduResid_%d");
1005  static const auto iAngleHit = indexArray1D<TH1,maxNhit+1>(hists, "angle_%d");
1006  if (nHit > maxNhit) nHit = maxNhit; // limit of hists
1007 
1008  hists[iResHit[nHit]]->Fill(residuum);
1009  hists[iSigmaHit[nHit]]->Fill(sigma);
1010  if (sigma) {
1011  hists[iReduResHit[nHit]]->Fill(residuum/sigma);
1012  }
1013  hists[iAngleHit[nHit]]->Fill(angle);
1014 }
#define constexpr
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
void MillePedeMonitor::fillResiduals ( const TransientTrackingRecHit::ConstRecHitPointer recHit,
const TrajectoryStateOnSurface tsos,
unsigned int  nHit,
float  residuum,
float  sigma,
bool  isY 
)

Definition at line 876 of file MillePedeMonitor.cc.

References Abs(), AlignableBeamSpot::detId(), fillResidualHists(), fillResidualHitHists(), GetIndex(), TrajectoryStateOnSurface::localDirection(), myResidHists2D, myResidHistsVec1DX, myResidHistsVec1DY, myResidHitHists1DX, myResidHitHists1DY, phi, DetId::subdetId(), and DetId::Tracker.

879 {
880  // isY == false: x-measurements
881  // isY == true: y-measurements
882  const GlobalPoint detPos(recHit->det()->position());
883  const double phi = detPos.phi();
884 // const double rSigned = (detPos.y() > 0. ? detPos.perp() : -detPos.perp());
885 
886  static const int iResPhi = this->GetIndex(myResidHists2D, "residPhi");
887  myResidHists2D[iResPhi]->Fill(phi, residuum);
888  static const int iSigPhi = this->GetIndex(myResidHists2D, "sigmaPhi");
889  myResidHists2D[iSigPhi]->Fill(phi, sigma);
890  if (sigma) {
891  static const int iReduResPhi = this->GetIndex(myResidHists2D, "reduResidPhi");
892  myResidHists2D[iReduResPhi]->Fill(phi, residuum/sigma);
893  }
894 
895 // if (isY) {
896 // static const int iResYXy = this->GetIndex(myResidHists2D, "residYProfXy");
897 // myResidHists2D[iResYXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum));
898 // static const int iResYZr = this->GetIndex(myResidHists2D, "residYProfZr");
899 // myResidHists2D[iResYZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum));
900 // static const int iSigmaYXy = this->GetIndex(myResidHists2D, "sigmaYProfXy");
901 // myResidHists2D[iSigmaYXy]->Fill(detPos.x(), detPos.y(), sigma);
902 // static const int iSigmaYZr = this->GetIndex(myResidHists2D, "sigmaYProfZr");
903 // myResidHists2D[iSigmaYZr]->Fill(detPos.z(), rSigned, sigma);
904 // if (sigma) {
905 // static const int iReduResYXy = this->GetIndex(myResidHists2D, "reduResidYProfXy");
906 // myResidHists2D[iReduResYXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum/sigma));
907 // static const int iReduResYZr = this->GetIndex(myResidHists2D, "reduResidYProfZr");
908 // myResidHists2D[iReduResYZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum/sigma));
909 // }
910 // } else {
911 // static const int iResXXy = this->GetIndex(myResidHists2D, "residXProfXy");
912 // myResidHists2D[iResXXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum));
913 // static const int iResXZr = this->GetIndex(myResidHists2D, "residXProfZr");
914 // myResidHists2D[iResXZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum));
915 // static const int iSigmaXXy = this->GetIndex(myResidHists2D, "sigmaXProfXy");
916 // myResidHists2D[iSigmaXXy]->Fill(detPos.x(), detPos.y(), sigma);
917 // static const int iSigmaXZr = this->GetIndex(myResidHists2D, "sigmaXProfZr");
918 // myResidHists2D[iSigmaXZr]->Fill(detPos.z(), rSigned, sigma);
919 // if (sigma) {
920 // static const int iReduResXXy = this->GetIndex(myResidHists2D, "reduResidXProfXy");
921 // myResidHists2D[iReduResXXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum/sigma));
922 // static const int iReduResXZr = this->GetIndex(myResidHists2D, "reduResidXProfZr");
923 // myResidHists2D[iReduResXZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum/sigma));
924 // }
925 // }
926 
927  const LocalVector mom(tsos.localDirection()); // mom.z()==0. impossible for TSOS:
928  const float phiSensToNorm = TMath::ATan(TMath::Abs((isY ? mom.y() : mom.x())/mom.z()));
929 
930  std::vector<std::vector<TH1*> > &histArrayVec = (isY ? myResidHistsVec1DY : myResidHistsVec1DX);
931  std::vector<TH1*> &hitHists = (isY ? myResidHitHists1DY : myResidHitHists1DX);
932 
933  // call with histArrayVec[0] first: 'static' inside is referring to "subdet-less" names (X/Y irrelevant)
934  this->fillResidualHists(histArrayVec[0], phiSensToNorm, residuum, sigma);
935  this->fillResidualHitHists(hitHists, phiSensToNorm, residuum, sigma, nHit);
936 
937  const DetId detId(recHit->det()->geographicalId());
938  if (detId.det() == DetId::Tracker) {
939  // const GeomDet::SubDetector subDetNum = recHit->det()->subDetector();
940  unsigned int subDetNum = detId.subdetId();
941  if (subDetNum < histArrayVec.size() && subDetNum > 0) {
942  this->fillResidualHists(histArrayVec[subDetNum], phiSensToNorm, residuum, sigma);
943  } else {
944  if (detId!=AlignableBeamSpot::detId())
945  edm::LogWarning("Alignment") << "@SUB=MillePedeMonitor::fillResiduals"
946  << "Expect subDetNum from 1 to 6, got " << subDetNum;
947  }
948  }
949 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< std::vector< TH1 * > > myResidHistsVec1DX
LocalVector localDirection() const
std::vector< TH1 * > myResidHitHists1DY
std::vector< TH2 * > myResidHists2D
T Abs(T a)
Definition: MathUtil.h:49
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
std::vector< std::vector< TH1 * > > myResidHistsVec1DY
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
Definition: DetId.h:18
static const DetId detId()
void fillResidualHists(const std::vector< TH1 * > &hists, float phiSensToNorm, float residuum, float sigma)
std::vector< TH1 * > myResidHitHists1DX
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
void fillResidualHitHists(const std::vector< TH1 * > &hists, float angle, float residuum, float sigma, unsigned int nHit)
void MillePedeMonitor::fillTrack ( const reco::Track track)

Definition at line 521 of file MillePedeMonitor.cc.

References myTrackHists1D, and myTrackHists2D.

Referenced by fillUsedTrack().

522 {
523  this->fillTrack(track, myTrackHists1D, myTrackHists2D);
524 }
std::vector< TH1 * > myTrackHists1D
std::vector< TH2 * > myTrackHists2D
void fillTrack(const reco::Track *track)
void MillePedeMonitor::fillTrack ( const reco::Track track,
std::vector< TH1 * > &  trackHists1D,
std::vector< TH2 * > &  trackHists2D 
)
private

Definition at line 541 of file MillePedeMonitor.cc.

References reco::TrackBase::d0(), reco::TrackBase::d0Error(), reco::TrackBase::dz(), reco::TrackBase::dzError(), GetIndex(), reco::Track::innerOk(), reco::Track::innerPosition(), kBPIX, kFPIX, reco::TrackBase::momentum(), reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfLostHits(), reco::TrackBase::numberOfValidHits(), reco::Track::outerOk(), reco::Track::outerPosition(), AlCaHLTBitMon_ParallelJobs::p, reco::TrackBase::pt(), TrackerTopology::pxfSide(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecIsZMinusSide(), TrackerTopology::tecIsZPlusSide(), SiStripDetId::TIB, SiStripDetId::TID, TrackerTopology::tidIsZMinusSide(), TrackerTopology::tidIsZPlusSide(), SiStripDetId::TOB, DetId::Tracker, and trackerTopology.

543 {
544  if (!track) return;
545 
546  const reco::TrackBase::Vector p(track->momentum());
547 
548  static const int iPtLog = this->GetIndex(trackHists1D, "ptTrackLogBins");
549  trackHists1D[iPtLog]->Fill(track->pt());
550  static const int iPt = this->GetIndex(trackHists1D, "ptTrack");
551  trackHists1D[iPt]->Fill(track->pt());
552  static const int iP = this->GetIndex(trackHists1D, "pTrack");
553  trackHists1D[iP]->Fill(p.R());
554  static const int iEta = this->GetIndex(trackHists1D, "etaTrack");
555  trackHists1D[iEta]->Fill(p.Eta());
556  static const int iTheta = this->GetIndex(trackHists1D, "thetaTrack");
557  trackHists1D[iTheta]->Fill(p.Theta());
558  static const int iPhi = this->GetIndex(trackHists1D, "phiTrack");
559  trackHists1D[iPhi]->Fill(p.Phi());
560 
561  static const int iNhit = this->GetIndex(trackHists1D, "nHitTrack");
562  trackHists1D[iNhit]->Fill(track->numberOfValidHits());
563  static const int iNhitInvalid = this->GetIndex(trackHists1D, "nHitInvalidTrack");
564  trackHists1D[iNhitInvalid]->Fill(track->numberOfLostHits());
565 
566  int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
567  int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL=0;
568  int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
569  int nhitinTIDplus = 0, nhitinTIDminus = 0;
570  int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
571  int nhitinTECplus = 0, nhitinTECminus = 0;
572  unsigned int thishit = 0;
573 
574  for (trackingRecHit_iterator iHit = track->recHitsBegin(); iHit != track->recHitsEnd(); ++iHit) {
575  thishit++;
576  const DetId detId((*iHit)->geographicalId());
577  const int subdetId = detId.subdetId();
578 
579  if (!(*iHit)->isValid()) continue; // only real hits count as in track->numberOfValidHits()
580  if (detId.det() != DetId::Tracker) {
581  edm::LogError("DetectorMismatch") << "@SUB=MillePedeMonitor::fillTrack"
582  << "DetId.det() != DetId::Tracker (=" << DetId::Tracker
583  << "), but " << detId.det() << ".";
584  }
585 
586  if (SiStripDetId::TIB == subdetId) ++nhitinTIB;
587  else if (SiStripDetId::TOB == subdetId) ++nhitinTOB;
588  else if (SiStripDetId::TID == subdetId) {
589  ++nhitinTID;
590  ++nhitinENDCAP;
591 
592  if (trackerTopology->tidIsZMinusSide(detId)) {
593  ++nhitinTIDminus;
594  ++nhitinENDCAPminus;
595  }
596  else if (trackerTopology->tidIsZPlusSide(detId)) {
597  ++nhitinTIDplus;
598  ++nhitinENDCAPplus;
599  }
600  }
601  else if (SiStripDetId::TEC == subdetId) {
602  ++nhitinTEC;
603  ++nhitinENDCAP;
604 
605  if (trackerTopology->tecIsZMinusSide(detId)) {
606  ++nhitinTECminus;
607  ++nhitinENDCAPminus;
608  }
609  else if (trackerTopology->tecIsZPlusSide(detId)) {
610  ++nhitinTECplus;
611  ++nhitinENDCAPplus;
612  }
613  }
614  else if ( kBPIX == subdetId) {++nhitinBPIX;++nhitinPIXEL;}
615  else if ( kFPIX == subdetId) {
616  ++nhitinFPIX;
617  ++nhitinPIXEL;
618 
619  if (trackerTopology->pxfSide(detId)==1) ++nhitinFPIXminus;
620  else if (trackerTopology->pxfSide(detId)==2) ++nhitinFPIXplus;
621  }
622 
623  } // end loop on hits
624 
625  static const int iNhit01 = this->GetIndex(trackHists1D, "nHitBPIXTrack");
626  trackHists1D[iNhit01]->Fill(nhitinBPIX);
627  static const int iNhit02 = this->GetIndex(trackHists1D, "nHitFPIXplusTrack");
628  trackHists1D[iNhit02]->Fill(nhitinFPIXplus);
629  static const int iNhit03 = this->GetIndex(trackHists1D, "nHitFPIXminusTrack");
630  trackHists1D[iNhit03]->Fill(nhitinFPIXminus);
631  static const int iNhit04 = this->GetIndex(trackHists1D, "nHitFPIXTrack");
632  trackHists1D[iNhit04]->Fill(nhitinFPIX);
633  static const int iNhit05 = this->GetIndex(trackHists1D, "nHitPIXELTrack");
634  trackHists1D[iNhit05]->Fill(nhitinPIXEL);
635  static const int iNhit06 = this->GetIndex(trackHists1D, "nHitTIBTrack");
636  trackHists1D[iNhit06]->Fill(nhitinTIB);
637  static const int iNhit07 = this->GetIndex(trackHists1D, "nHitTOBTrack");
638  trackHists1D[iNhit07]->Fill(nhitinTOB);
639  static const int iNhit08 = this->GetIndex(trackHists1D, "nHitTIDplusTrack");
640  trackHists1D[iNhit08]->Fill(nhitinTIDplus);
641  static const int iNhit09 = this->GetIndex(trackHists1D, "nHitTIDminusTrack");
642  trackHists1D[iNhit09]->Fill(nhitinTIDminus);
643  static const int iNhit10 = this->GetIndex(trackHists1D, "nHitTIDTrack");
644  trackHists1D[iNhit10]->Fill(nhitinTID);
645  static const int iNhit11 = this->GetIndex(trackHists1D, "nHitTECplusTrack");
646  trackHists1D[iNhit11]->Fill(nhitinTECplus);
647  static const int iNhit12 = this->GetIndex(trackHists1D, "nHitTECminusTrack");
648  trackHists1D[iNhit12]->Fill(nhitinTECminus);
649  static const int iNhit13 = this->GetIndex(trackHists1D, "nHitTECTrack");
650  trackHists1D[iNhit13]->Fill(nhitinTEC);
651  static const int iNhit14 = this->GetIndex(trackHists1D, "nHitENDCAPplusTrack");
652  trackHists1D[iNhit14]->Fill(nhitinENDCAPplus);
653  static const int iNhit15 = this->GetIndex(trackHists1D, "nHitENDCAPminusTrack");
654  trackHists1D[iNhit15]->Fill(nhitinENDCAPminus);
655  static const int iNhit16 = this->GetIndex(trackHists1D, "nHitENDCAPTrack");
656  trackHists1D[iNhit16]->Fill(nhitinENDCAP);
657  static const int iNhit17 = this->GetIndex(trackHists2D, "nHitENDCAPTrackMinusVsPlus");
658  trackHists2D[iNhit17]->Fill(nhitinENDCAPplus,nhitinENDCAPminus);
659 
660  if (track->innerOk()) {
661  const reco::TrackBase::Point& firstPoint(track->innerPosition());
662  static const int iR1 = this->GetIndex(trackHists1D, "r1Track");
663  trackHists1D[iR1]->Fill(firstPoint.Rho());
664  const double rSigned1 = (firstPoint.y() > 0 ? firstPoint.Rho() : -firstPoint.Rho());
665  static const int iR1Signed = this->GetIndex(trackHists1D, "r1TrackSigned");
666  trackHists1D[iR1Signed]->Fill(rSigned1);
667  static const int iZ1 = this->GetIndex(trackHists1D, "z1Track");
668  trackHists1D[iZ1]->Fill(firstPoint.Z());
669  static const int iZ1Full = this->GetIndex(trackHists1D, "z1TrackFull");
670  trackHists1D[iZ1Full]->Fill(firstPoint.Z());
671  static const int iY1 = this->GetIndex(trackHists1D, "y1Track");
672  trackHists1D[iY1]->Fill(firstPoint.Y());
673  static const int iPhi1 = this->GetIndex(trackHists1D, "phi1Track");
674  trackHists1D[iPhi1]->Fill(firstPoint.phi());
675  static const int iRz1Full = this->GetIndex(trackHists2D, "rz1TrackFull");
676  trackHists2D[iRz1Full]->Fill(firstPoint.Z(), rSigned1);
677  static const int iXy1 = this->GetIndex(trackHists2D, "xy1Track");
678  trackHists2D[iXy1]->Fill(firstPoint.X(), firstPoint.Y());
679  }
680 
681  if (track->outerOk()) {
682  const reco::TrackBase::Point& lastPoint(track->outerPosition());
683  static const int iRlast = this->GetIndex(trackHists1D, "rLastTrack");
684  trackHists1D[iRlast]->Fill(lastPoint.Rho());
685  static const int iZlast = this->GetIndex(trackHists1D, "zLastTrack");
686  trackHists1D[iZlast]->Fill(lastPoint.Z());
687  static const int iYlast = this->GetIndex(trackHists1D, "yLastTrack");
688  trackHists1D[iYlast]->Fill(lastPoint.Y());
689  static const int iPhiLast = this->GetIndex(trackHists1D, "phiLastTrack");
690  trackHists1D[iPhiLast]->Fill(lastPoint.phi());
691  }
692 
693  static const int iChi2Ndf = this->GetIndex(trackHists1D, "chi2PerNdf");
694  trackHists1D[iChi2Ndf]->Fill(track->normalizedChi2());
695 
696  static const int iImpZ = this->GetIndex(trackHists1D, "impParZ");
697  trackHists1D[iImpZ]->Fill(track->dz());
698  static const int iImpZerr = this->GetIndex(trackHists1D, "impParErrZ");
699  trackHists1D[iImpZerr]->Fill(track->dzError());
700 
701 
702  static const int iImpRphi = this->GetIndex(trackHists1D, "impParRphi");
703  trackHists1D[iImpRphi]->Fill(track->d0());
704  static const int iImpRphiErr = this->GetIndex(trackHists1D, "impParErrRphi");
705  trackHists1D[iImpRphiErr]->Fill(track->d0Error());
706 
707 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
double d0Error() const
error on d0
Definition: TrackBase.h:802
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
Definition: TrackBase.h:597
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
bool innerOk() const
return true if the innermost hit is valid
Definition: Track.h:50
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:826
const int kBPIX
const TrackerTopology * trackerTopology
const Vector & momentum() const
track momentum vector
Definition: TrackBase.h:675
const math::XYZPoint & outerPosition() const
position of the outermost hit
Definition: Track.h:65
bool tecIsZMinusSide(const DetId &id) const
bool tidIsZMinusSide(const DetId &id) const
const math::XYZPoint & innerPosition() const
position of the innermost hit
Definition: Track.h:55
double pt() const
track transverse momentum
Definition: TrackBase.h:621
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
math::XYZPoint Point
point in the space
Definition: TrackBase.h:83
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
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...
Definition: TrackBase.h:609
double dzError() const
error on dz
Definition: TrackBase.h:814
Definition: DetId.h:18
bool tidIsZPlusSide(const DetId &id) const
bool outerOk() const
return true if the outermost hit is valid
Definition: Track.h:45
const int kFPIX
bool tecIsZPlusSide(const DetId &id) const
unsigned int pxfSide(const DetId &id) const
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:80
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
void MillePedeMonitor::fillUsedTrack ( const reco::Track track,
unsigned int  nHitX,
unsigned int  nHitY 
)

Definition at line 527 of file MillePedeMonitor.cc.

References fillTrack(), GetIndex(), myUsedTrackHists1D, and myUsedTrackHists2D.

529 {
530  // these hist exist only for 'used track' hists:
531  static const int iUsedX = this->GetIndex(myUsedTrackHists1D, "usedHitsX");
532  myUsedTrackHists1D[iUsedX]->Fill(nHitX);
533  static const int iUsedY = this->GetIndex(myUsedTrackHists1D, "usedHitsY");
534  myUsedTrackHists1D[iUsedY]->Fill(nHitY);
535 
536  if (!track) return;
538 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
std::vector< TH1 * > myUsedTrackHists1D
void fillTrack(const reco::Track *track)
std::vector< TH2 * > myUsedTrackHists2D
template<class OBJECT_TYPE >
int MillePedeMonitor::GetIndex ( const std::vector< OBJECT_TYPE * > &  vec,
const TString &  name 
)
private

Definition at line 117 of file MillePedeMonitor.h.

References dataset::name, and mps_fire::result.

Referenced by fillDerivatives(), fillFrameToFrame(), fillPxbSurveyHistsChi2(), fillPxbSurveyHistsLocalPars(), fillRefTrajectory(), fillResidualHists(), fillResiduals(), fillTrack(), and fillUsedTrack().

118 {
119  int result = 0;
120  for (typename std::vector<OBJECT_TYPE*>::const_iterator iter = vec.begin(), iterEnd = vec.end();
121  iter != iterEnd; ++iter, ++result) {
122  if (*iter && (*iter)->GetName() == name) return result;
123  }
124  edm::LogError("Alignment") << "@SUB=MillePedeMonitor::GetIndex" << " could not find " << name;
125  return -1;
126 }
template<typename T , size_t SIZE>
std::array< int, SIZE > MillePedeMonitor::indexArray1D ( const std::vector< T * > &  hists,
const char *  title 
)
private

Definition at line 161 of file MillePedeMonitor.h.

References mps_fire::i, and mps_fire::result.

161  {
162  std::array<int,SIZE> result{};
163  for (size_t i = 0; i < SIZE; ++i) {
164  result[i] = this->GetIndex(hists, Form(title, i));
165  }
166  return result;
167 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
template<typename T , size_t SIZE>
std::array< std::array< int, SIZE >, SIZE > MillePedeMonitor::indexArray2D ( const std::vector< T * > &  hists,
const char *  title 
)
private

Definition at line 171 of file MillePedeMonitor.h.

References mps_fire::i, and mps_fire::result.

171  {
172  std::array<std::array<int,SIZE>,SIZE> result{};
173  for (size_t i = 0; i < SIZE; ++i) {
174  for (size_t j = 0; j < SIZE; ++j) {
175  result[i][j] = this->GetIndex(hists, Form(title, i, j));
176  }
177  }
178  return result;
179 }
int GetIndex(const std::vector< OBJECT_TYPE * > &vec, const TString &name)
bool MillePedeMonitor::init ( TDirectory *  directory)
private

Definition at line 75 of file MillePedeMonitor.cc.

References addToDirectory(), cloneHists(), createBeamHaloJobs::directory, equidistLogBins(), mps_fire::i, eostools::mkdir(), myCorrHists, myDerivHists2D, myFrame2FrameHists2D, myPxbSurveyHists, myResidHists2D, myResidHistsVec1DX, myResidHistsVec1DY, myResidHitHists1DX, myResidHitHists1DY, myTrackHists1D, myTrackHists2D, myTrajectoryHists1D, myTrajectoryHists2D, myUsedTrackHists1D, myUsedTrackHists2D, Pi, and PedeLabelerBase::theMaxNumParam.

Referenced by MillePedeMonitor().

76 {
77  if (!directory) return false;
78  TDirectory *oldDir = gDirectory;
79 
80  const int kNumBins = 20;
81  double binsPt[kNumBins+1] = {0.}; // fully initialised with 0.
82  if (!this->equidistLogBins(binsPt, kNumBins, 0.8, 100.)) {
83 // cerr << "MillePedeMonitor::init: problem with log bins" << endl;
84  }
85  const int nHits = 35;
86 
87  myTrackHists1D.push_back(new TH1F("ptTrackLogBins", "p_{t}(track);p_{t} [GeV]",
88  kNumBins, binsPt));
89 
90  myTrackHists1D.push_back(new TH1F("ptTrack", "p_{t}(track);p_{t} [GeV]",
91  kNumBins, binsPt[0], binsPt[kNumBins]));
92  myTrackHists1D.push_back(new TH1F("pTrack", "p(track);p [GeV]",
93  kNumBins, binsPt[0], 1.3*binsPt[kNumBins]));
94  myTrackHists1D.push_back(new TH1F("etaTrack", "#eta(track);#eta", 26, -2.6, 2.6));
95  myTrackHists1D.push_back(new TH1F("thetaTrack", "#theta(track);#theta", 100, 0., TMath::Pi()));
96  myTrackHists1D.push_back(new TH1F("phiTrack", "#phi(track);#phi", 15, -TMath::Pi(), TMath::Pi()));
97 
98  myTrackHists1D.push_back(new TH1F("nHitTrack", "N_{hit}(track);N_{hit}", 40, 5., 45.));
99  myTrackHists1D.push_back(new TH1F("nHitBPIXTrack", "N_{hit, BPIX}(track);N_{hit}", 45, 0., 45.));
100  myTrackHists1D.push_back(new TH1F("nHitFPIXTrack", "N_{hit, FPIX}(track);N_{hit}", 45, 0., 45.));
101  myTrackHists1D.push_back(new TH1F("nHitFPIXplusTrack", "N_{hit, BPIXplus}(track);N_{hit}", 45, 0., 45.));
102  myTrackHists1D.push_back(new TH1F("nHitFPIXminusTrack", "N_{hit, BPIXminus}(track);N_{hit}", 45, 0., 45.));
103  myTrackHists1D.push_back(new TH1F("nHitPIXELTrack", "N_{hit, PIXEL}(track);N_{hit}", 45, 0., 45.));
104  myTrackHists1D.push_back(new TH1F("nHitTIBTrack", "N_{hit, TIB}(track);N_{hit}", 45, 0., 45.));
105  myTrackHists1D.push_back(new TH1F("nHitTOBTrack", "N_{hit, TOB}(track);N_{hit}", 45, 0., 45.));
106  myTrackHists1D.push_back(new TH1F("nHitTIDplusTrack", "N_{hit, TIDplus}(track);N_{hit}", 45, 0., 45.));
107  myTrackHists1D.push_back(new TH1F("nHitTIDminusTrack", "N_{hit, TIDminus}(track);N_{hit}", 45, 0., 45.));
108  myTrackHists1D.push_back(new TH1F("nHitTIDTrack", "N_{hit, TID}(track);N_{hit}", 45, 0., 45.));
109  myTrackHists1D.push_back(new TH1F("nHitTECplusTrack", "N_{hit, TECplus}(track);N_{hit}", 45, 0., 45.));
110  myTrackHists1D.push_back(new TH1F("nHitTECminusTrack", "N_{hit, TECminus}(track);N_{hit}", 45, 0., 45.));
111  myTrackHists1D.push_back(new TH1F("nHitTECTrack", "N_{hit, TEC}(track);N_{hit}", 45, 0., 45.));
112  myTrackHists1D.push_back(new TH1F("nHitENDCAPplusTrack", "N_{hit, ENDCAPplus}(track);N_{hit}", 45, 0., 45.));
113  myTrackHists1D.push_back(new TH1F("nHitENDCAPminusTrack", "N_{hit, ENDCAPminus}(track);N_{hit}", 45, 0., 45.));
114  myTrackHists1D.push_back(new TH1F("nHitENDCAPTrack", "N_{hit, ENDCAP}(track);N_{hit}", 45, 0., 45.));
115  myTrackHists2D.push_back(new TH2F("nHitENDCAPTrackMinusVsPlus", "N_{hit, ENDCAP}(track);N_{hit, plus};N_{hit, minus}",
116  45, 0., 45.,45, 0., 45.));
117  myTrackHists1D.push_back(new TH1F("nHitInvalidTrack", "N_{hit, invalid}(track)", 5, 0., 5.));
118  myTrackHists1D.push_back(new TH1F("r1Track", "r(1st hit);r [cm]", 20, 0., 20.));
119  myTrackHists1D.push_back(new TH1F("phi1Track", "#phi(1st hit);#phi",
120  30, -TMath::Pi(), TMath::Pi()));
121  myTrackHists1D.push_back(new TH1F("y1Track", "y(1st hit);y [cm]", 40, -120., +120.));
122  myTrackHists1D.push_back(new TH1F("z1Track", "z(1st hit);z [cm]", 20, -50, +50));
123  myTrackHists1D.push_back(new TH1F("r1TrackSigned", "r(1st hit);r_{#pm} [cm]",
124  40, -120., 120.));
125  myTrackHists1D.push_back(new TH1F("z1TrackFull", "z(1st hit);z [cm]", 20, -300., +300.));
126  myTrackHists1D.push_back(new TH1F("rLastTrack", "r(last hit);r [cm]", 20, 20., 120.));
127  myTrackHists1D.push_back(new TH1F("phiLastTrack", "#phi(last hit);#phi",
128  30, -TMath::Pi(), TMath::Pi()));
129  myTrackHists1D.push_back(new TH1F("yLastTrack", "y(last hit);y [cm]", 40, -120., +120.));
130  myTrackHists1D.push_back(new TH1F("zLastTrack", "z(last hit);z [cm]", 30, -300., +300.));
131  myTrackHists1D.push_back(new TH1F("chi2PerNdf", "#chi^{2}/ndf;#chi^{2}/ndf", 500, 0., 50.));
132  myTrackHists1D.push_back(new TH1F("impParZ", "impact parameter in z", 20, -20., 20.));
133  myTrackHists1D.push_back(new TH1F("impParErrZ", "error of impact parameter in z",
134  40, 0., 0.06));
135  myTrackHists1D.push_back(new TH1F("impParRphi", "impact parameter in r#phi", 51, -0.05, .05));
136  myTrackHists1D.push_back(new TH1F("impParErrRphi", "error of impact parameter in r#phi",
137  50, 0., 0.01));
138 
139  myTrackHists2D.push_back(new TH2F("rz1TrackFull", "rz(1st hit);z [cm]; r_{#pm} [cm]",
140  40, -282., +282., 40, -115., +115.));
141  myTrackHists2D.push_back(new TH2F("xy1Track", "xy(1st hit);x [cm]; y [cm]",
142  40, -115., +115., 40, -115., +115.));
143 
144  TDirectory *dirTracks = directory->mkdir("trackHists", "input tracks");
145  this->addToDirectory(myTrackHists1D, dirTracks);
146  this->addToDirectory(myTrackHists2D, dirTracks);
147 
148 // used track
149  myUsedTrackHists1D = this->cloneHists(myTrackHists1D, "used", " (used tracks)");
150  myUsedTrackHists2D = this->cloneHists(myTrackHists2D, "used", " (used tracks)");
151  // must be after clone: index in vector!
152  myUsedTrackHists1D.push_back(new TH1F("usedHitsX", "n(x-hits) transferred to pede;n(x-hits)", nHits, 0., nHits));
153  myUsedTrackHists1D.push_back(new TH1F("usedHitsY", "n(y-hits) transferred to pede;n(y-hits)", 10, 0., 10));
154 
155  TDirectory *dirUsedTracks = directory->mkdir("usedTrackHists", "used tracks");
156  this->addToDirectory(myUsedTrackHists1D, dirUsedTracks);
157  this->addToDirectory(myUsedTrackHists2D, dirUsedTracks);
158 
159 // ReferenceTrajectory
160  myTrajectoryHists1D.push_back(new TH1F("validRefTraj", "validity of ReferenceTrajectory",
161  2, 0., 2.));
162 
163  myTrajectoryHists2D.push_back(new TProfile2D("profCorr",
164  "mean of |#rho|, #rho#neq0;hit x/y;hit x/y;",
165  2*nHits, 0., nHits, 2*nHits, 0., nHits));
166  myTrajectoryHists2D.push_back
167  (new TProfile2D("profCorrOffXy", "mean of |#rho|, #rho#neq0, no xy_{hit};hit x/y;hit x/y;",
168  2*nHits, 0., nHits, 2*nHits, 0., nHits));
169 
170  myTrajectoryHists2D.push_back(new TH2F("hitCorrOffBlock",
171  "hit correlations: off-block-diagonals;N(hit);#rho",
172  2*nHits, 0., nHits, 81, -.06, .06));
173  TArrayD logBins(102);
174  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-11, .1);
175  myTrajectoryHists2D.push_back(new TH2F("hitCorrOffBlockLog",
176  "hit correlations: off-block-diagonals;N(hit);|#rho|",
177  2*nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
178 
179  myTrajectoryHists2D.push_back(new TH2F("hitCorrXy", "hit correlations: xy;N(hit);#rho",
180  nHits, 0., nHits, 81, -.5, .5));
181  myTrajectoryHists2D.push_back
182  (new TH2F("hitCorrXyValid", "hit correlations: xy, 2D-det.;N(hit);#rho",
183  nHits, 0., nHits, 81, -.02, .02));
184  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-10, .5);
185  myTrajectoryHists2D.push_back(new TH2F("hitCorrXyLog", "hit correlations: xy;N(hit);|#rho|",
186  nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
187  myTrajectoryHists2D.push_back
188  (new TH2F("hitCorrXyLogValid", "hit correlations: xy, 2D-det.;N(hit);|#rho|",
189  nHits, 0., nHits, logBins.GetSize()-1, logBins.GetArray()));
190 
191 
192  myTrajectoryHists1D.push_back(new TH1F("measLocX", "local x measurements;x", 101, -6., 6.));
193  myTrajectoryHists1D.push_back(new TH1F("measLocY", "local y measurements, 2D-det.;y",
194  101, -10., 10.));
195  myTrajectoryHists1D.push_back(new TH1F("trajLocX", "local x trajectory;x", 101, -6., 6.));
196  myTrajectoryHists1D.push_back(new TH1F("trajLocY", "local y trajectory, 2D-det.;y",
197  101, -10., 10.));
198 
199  myTrajectoryHists1D.push_back(new TH1F("residLocX", "local x residual;#Deltax", 101, -.75, .75));
200  myTrajectoryHists1D.push_back(new TH1F("residLocY", "local y residual, 2D-det.;#Deltay",
201  101, -2., 2.));
202  myTrajectoryHists1D.push_back(new TH1F("reduResidLocX", "local x reduced residual;#Deltax/#sigma",
203  101, -20., 20.));
204  myTrajectoryHists1D.push_back
205  (new TH1F("reduResidLocY", "local y reduced residual, 2D-det.;#Deltay/#sigma", 101, -20., 20.));
206 
207  // 2D vs. hit
208  myTrajectoryHists2D.push_back(new TH2F("measLocXvsHit", "local x measurements;hit;x",
209  nHits, 0., nHits, 101, -6., 6.));
210  myTrajectoryHists2D.push_back(new TH2F("measLocYvsHit", "local y measurements, 2D-det.;hit;y",
211  nHits, 0., nHits, 101, -10., 10.));
212  myTrajectoryHists2D.push_back(new TH2F("trajLocXvsHit", "local x trajectory;hit;x",
213  nHits, 0., nHits, 101, -6., 6.));
214  myTrajectoryHists2D.push_back(new TH2F("trajLocYvsHit", "local y trajectory, 2D-det.;hit;y",
215  nHits, 0., nHits, 101, -10., 10.));
216 
217  myTrajectoryHists2D.push_back(new TH2F("residLocXvsHit", "local x residual;hit;#Deltax",
218  nHits, 0., nHits, 101, -.75, .75));
219  myTrajectoryHists2D.push_back(new TH2F("residLocYvsHit", "local y residual, 2D-det.;hit;#Deltay",
220  nHits, 0., nHits, 101, -1., 1.));
221  myTrajectoryHists2D.push_back
222  (new TH2F("reduResidLocXvsHit", "local x reduced residual;hit;#Deltax/#sigma",
223  nHits, 0., nHits, 101, -20., 20.));
224  myTrajectoryHists2D.push_back
225  (new TH2F("reduResidLocYvsHit", "local y reduced residual, 2D-det.;hit;#Deltay/#sigma",
226  nHits, 0., nHits, 101, -20., 20.));
227 
228 
229  myTrajectoryHists2D.push_back(new TProfile2D("profDerivatives",
230  "mean derivatives;hit x/y;parameter;",
231  2*nHits, 0., nHits, 10, 0., 10.));
232 
233  myTrajectoryHists2D.push_back
234  (new TH2F("derivatives", "derivative;parameter;#partial(x/y)_{local}/#partial(param)",
235  10, 0., 10., 101, -20., 20.));
236  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-12, 100.);
237  myTrajectoryHists2D.push_back
238  (new TH2F("derivativesLog", "|derivative|;parameter;|#partial(x/y)_{local}/#partial(param)|",
239  10, 0., 10., logBins.GetSize()-1, logBins.GetArray()));
240  myTrajectoryHists2D.push_back
241  (new TH2F("derivativesVsPhi",
242  "derivatives vs. #phi;#phi(geomDet);#partial(x/y)_{local}/#partial(param)",
243  50, -TMath::Pi(), TMath::Pi(), 101, -300., 300.));
244  // myTrajectoryHists2D.back()->SetCanExtend(TH1::kAllAxes);
245 
246  TDirectory *dirTraject = directory->mkdir("refTrajectoryHists", "ReferenceTrajectory's");
247  this->addToDirectory(myTrajectoryHists2D, dirTraject);
248  this->addToDirectory(myTrajectoryHists1D, dirTraject);
249 
250 // derivatives hists
251  myDerivHists2D.push_back
252  (new TH2F("localDerivsPar","local derivatives vs. paramater;parameter;#partial/#partial(param)",
253  6, 0., 6., 101, -200., 200.));
254  myDerivHists2D.push_back
255  (new TH2F("localDerivsPhi","local derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
256  51, -TMath::Pi(), TMath::Pi(), 101, -150., 150.));
257  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-13, 150.);
258  myDerivHists2D.push_back
259  (new TH2F("localDerivsParLog",
260  "local derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
261  6, 0., 6., logBins.GetSize()-1, logBins.GetArray()));
262  myDerivHists2D.push_back
263  (new TH2F("localDerivsPhiLog",
264  "local derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
265  51, -TMath::Pi(), TMath::Pi(), logBins.GetSize()-1, logBins.GetArray()));
266  const unsigned int maxParNum = PedeLabelerBase::theMaxNumParam;
267  myDerivHists2D.push_back
268  (new TH2F("globalDerivsPar",
269  "global derivatives vs. paramater;parameter;#partial/#partial(param)",
270  maxParNum, 0., maxParNum, 100, -200, 200));
271  myDerivHists2D.push_back
272  (new TH2F("globalDerivsPhi",
273  "global derivatives vs. #phi(det);#phi(det);#partial/#partial(param)",
274  51, -TMath::Pi(), TMath::Pi(), 102, -1.02, 1.02));
275  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-7, 5.e2);
276  myDerivHists2D.push_back
277  (new TH2F("globalDerivsParLog",
278  "global derivatives (#neq 0) vs. parameter;parameter;|#partial/#partial(param)|",
279  maxParNum, 0., maxParNum, logBins.GetSize()-1, logBins.GetArray()));
280  myDerivHists2D.push_back
281  (new TH2F("globalDerivsPhiLog",
282  "global derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
283  51, -TMath::Pi(), TMath::Pi(), logBins.GetSize()-1, logBins.GetArray()));
284 // this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.e-40, 1.E-35);
285 // myDerivHists2D.push_back
286 // (new TH2F("globalDerivsPhiLog2",
287 // "global derivatives (#neq 0) vs. #phi(det);#phi(det);|#partial/#partial(param)|",
288 // 51, -TMath::Pi(), TMath::Pi(), logBins.GetSize()-1, logBins.GetArray()));
289 
290  TDirectory *dirDerivs = directory->mkdir("derivatives", "derivatives etc.");
291  this->addToDirectory(myDerivHists2D, dirDerivs);
292 
293 // residual hists
294  myResidHists2D.push_back(new TH2F("residPhi","residuum vs. #phi(det);#phi(det);residuum[cm]",
295  51, -TMath::Pi(), TMath::Pi(), 101, -.5, .5));
296  myResidHists2D.push_back(new TH2F("sigmaPhi","#sigma vs. #phi(det);#phi(det);#sigma[cm]",
297  51, -TMath::Pi(), TMath::Pi(), 101, .0, .1));
298  myResidHists2D.push_back(new TH2F("reduResidPhi",
299  "residuum/#sigma vs. #phi(det);#phi(det);residuum/#sigma",
300  51, -TMath::Pi(), TMath::Pi(), 101, -14., 14.));
301 
302 // myResidHists2D.push_back(new TProfile2D("residXProfXy",
303 // "mean |residuum| (u);x [cm];y [cm];#LT|residuum|#GT",
304 // 25, -110., 110., 25, -110., 110.));
305 // myResidHists2D.push_back(new TProfile2D("residXProfZr",
306 // "mean |residuum| (u);z [cm];r_{#pm} [cm];#LT|residuum|#GT",
307 // 25, -275., 275., 25, -110., 110.));
308 // myResidHists2D.push_back(new TProfile2D("residYProfXy",
309 // "mean |residuum| (v);x [cm];y [cm];#LT|residuum|#GT",
310 // 25, -110., 110., 25, -110., 110.));
311 // myResidHists2D.push_back(new TProfile2D("residYProfZr",
312 // "mean |residuum| (v);z [cm];r_{#pm} [cm];#LT|residuum|#GT",
313 // 25, -275., 275., 25, -110., 110.));
314 // myResidHists2D.push_back(new TProfile2D("reduResidXProfXy",
315 // "mean |residuum/#sigma| (u);x [cm];y [cm];#LT|res./#sigma|#GT",
316 // 25, -110., 110., 25, -110., 110.));
317 // myResidHists2D.push_back(new TProfile2D("reduResidXProfZr",
318 // "mean |residuum/#sigma| (u);z [cm];r_{#pm} [cm];#LT|res./#sigma|#GT",
319 // 25, -275., 275., 25, -110., 110.));
320 // myResidHists2D.push_back(new TProfile2D("reduResidYProfXy",
321 // "mean |residuum/#sigma| (v);x [cm];y [cm];#LT|res./#sigma|#GT",
322 // 25, -110., 110., 25, -110., 110.));
323 // myResidHists2D.push_back(new TProfile2D("reduResidYProfZr",
324 // "mean |residuum/#sigma| (v);z [cm];r_{#pm} [cm];#LT|res./#sigma|#GT",
325 // 25, -275., 275., 25, -110., 110.));
326 // myResidHists2D.push_back(new TProfile2D("sigmaXProfXy",
327 // "mean sigma (u);x [cm];y [cm];#LT#sigma#GT",
328 // 25, -110., 110., 25, -110., 110.));
329 // myResidHists2D.push_back(new TProfile2D("sigmaXProfZr",
330 // "mean sigma (u);z [cm];r_{#pm} [cm];#LT#sigma#GT",
331 // 25, -275., 275., 25, -110., 110.));
332 // myResidHists2D.push_back(new TProfile2D("sigmaYProfXy",
333 // "mean sigma (v);x [cm];y [cm];#LT#sigma#GT",
334 // 25, -110., 110., 25, -110., 110.));
335 // myResidHists2D.push_back(new TProfile2D("sigmaYProfZr",
336 // "mean sigma (v);z [cm];r_{#pm} [cm];#LT#sigma#GT",
337 // 25, -275., 275., 25, -110., 110.));
338 
339  TDirectory *dirResid = directory->mkdir("residuals", "hit residuals, sigma,...");
340  this->addToDirectory(myResidHists2D, dirResid);
341 
342 // Residuum, hit sigma and res./sigma for all sensor/track angles and separated for large and
343 // small angles with respect to the sensor normal in sensitive direction.
344  // Here for x-measurements:
345  std::vector<TH1*> allResidHistsX;
346  allResidHistsX.push_back(new TH1F("resid", "hit residuals;residuum [cm]", 101,-.5,.5));//51,-.05, .05));
347  //allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
348  allResidHistsX.push_back(new TH1F("sigma", "hit uncertainties;#sigma [cm]", 100,0.,1.));//50, 0., .02));
349  //allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
350  allResidHistsX.push_back(new TH1F("reduResid", "reduced hit residuals;res./#sigma",
351  101, -10., 10.));//51, -3., 3.));
352  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
353  allResidHistsX.push_back(new TH1F("angle", "#phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens}",
354  50, 0., TMath::PiOver2()));
355  allResidHistsX.push_back(new TH2F("residVsAngle",
356  "residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};residuum [cm]",
357  50, 0., TMath::PiOver2(), 51, -1., 1.));
358  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-6, 100.);
359  allResidHistsX.push_back(new TH2F("sigmaVsAngle",
360  "#sigma vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};#sigma [cm]",
361  50, 0., TMath::PiOver2(), logBins.GetSize()-1, logBins.GetArray()));
362  allResidHistsX.push_back(new TH2F("reduResidVsAngle",
363  "reduced residuum vs. #phi_{tr} wrt normal (sens. plane);#phi_{n}^{sens};res./#sigma",
364  50, 0., TMath::PiOver2(), 51, -15., 15.));
365 
366  allResidHistsX.push_back(new TH1F("residGt45",
367  "hit residuals (#phi_{n}^{sens}>45#circ);residuum [cm]",
368  101, -.5, .5));//51, -.05, .05));
369  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
370  allResidHistsX.push_back(new TH1F("sigmaGt45",
371  "hit uncertainties(#phi_{n}^{sens}>45#circ);#sigma [cm]",
372  100, 0., 1.));//50, 0., .02));
373  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
374  allResidHistsX.push_back(new TH1F("reduResidGt45",
375  "reduced hit residuals(#phi_{n}^{sens}>45#circ);res./#sigma",
376  101, -10., 10.));//51,-3.,3.));
377  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
378  allResidHistsX.push_back(new TH1F("residLt45",
379  "hit residuals (#phi_{n}^{sens}<45#circ);residuum [cm]",
380  101, -.5, .5));//51, -.15, .15));
381  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
382  allResidHistsX.push_back(new TH1F("sigmaLt45",
383  "hit uncertainties(#phi_{n}^{sens}<45#circ);#sigma [cm]",
384  100, 0., 1.));//50, 0., .01));
385  // allResidHistsX.back()->SetCanExtend(TH1::kAllAxes);
386  allResidHistsX.push_back(new TH1F("reduResidLt45",
387  "reduced hit residuals(#phi_{n}^{sens}<45#circ);res./#sigma",
388  101, -10., 10.));//51,-3.,3.));
389  myResidHistsVec1DX.push_back(allResidHistsX); // at [0] for all subdets together...
390  // ... then separately - indices/order like DetId.subdetId() in tracker:
391  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TPB", " x-coord. in pixel barrel"));
392  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TPE", " x-coord. in pixel discs"));
393  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TIB", " x-coord. in TIB"));
394  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TID", " x-coord. in TID"));
395  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TOB", " x-coord. in TOB"));
396  myResidHistsVec1DX.push_back(this->cloneHists(allResidHistsX, "TEC", " x-coord. in TEC"));
397  // finally, differential in hit number (but subdet independent)
398  for (unsigned int iHit = 0; iHit < 30; ++iHit) { // 4: for each hit fill only angle independent plots
399  for (unsigned int iHist = 0; iHist < 4 && iHist < allResidHistsX.size(); ++iHist) {
400  TH1 *h = allResidHistsX[iHist];
401  myResidHitHists1DX.push_back(static_cast<TH1*>(h->Clone(Form("%s_%d", h->GetName(), iHit))));
402  myResidHitHists1DX.back()->SetTitle(Form("%s, hit %d", h->GetTitle(), iHit));
403  }
404  }
405 
406  TDirectory *dirResidX =
407  (dirResid ? dirResid : directory)->mkdir("X", "hit residuals etc. for x measurements");
408  this->addToDirectory(myResidHitHists1DX, dirResidX);
409  for (std::vector<std::vector<TH1*> >::iterator vecIter = myResidHistsVec1DX.begin(),
410  vecIterEnd = myResidHistsVec1DX.end(); vecIter != vecIterEnd; ++vecIter) {
411  this->addToDirectory(*vecIter, dirResidX);
412  }
413 
414  // Now clone the same as above for y-ccordinate:
415  myResidHistsVec1DY.push_back(this->cloneHists(allResidHistsX, "", " y-coord."));// all subdets
416  std::vector<TH1*> &yHists1D = allResidHistsX;//myResidHistsVec1DY.back(); crashes? ROOT?
417  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TPB", " y-coord. in pixel barrel"));
418  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TPE", " y-coord. in pixel discs"));
419  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TIB", " y-coord. in TIB"));
420  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TID", " y-coord. in TID"));
421  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TOB", " y-coord. in TOB"));
422  myResidHistsVec1DY.push_back(this->cloneHists(yHists1D, "TEC", " y-coord. in TEC"));
423  myResidHitHists1DY = this->cloneHists(myResidHitHists1DX, "", " y-coord.");// diff. in nHit
424 
425  TDirectory *dirResidY =
426  (dirResid ? dirResid : directory)->mkdir("Y", "hit residuals etc. for y measurements");
427  this->addToDirectory(myResidHitHists1DY, dirResidY);
428  for (std::vector<std::vector<TH1*> >::iterator vecIter = myResidHistsVec1DY.begin(),
429  vecIterEnd = myResidHistsVec1DY.end(); vecIter != vecIterEnd; ++vecIter) {
430  this->addToDirectory(*vecIter, dirResidY);
431  }
432 
433  // farme-to-frame derivatives
434  myFrame2FrameHists2D.push_back(new TProfile2D("frame2frame",
435  "mean frame to frame derivatives;col;row",
436  6, 0., 6., 6, 0., 6.));
437  myFrame2FrameHists2D.push_back(new TProfile2D("frame2frameAbs",
438  "mean |frame to frame derivatives|, #neq0;col;row",
439  6, 0., 6., 6, 0., 6.));
440 
441  this->equidistLogBins(logBins.GetArray(), logBins.GetSize()-1, 1.E-36, 100.);
442  for (unsigned int i = 0; i < 6; ++i) {
443  for (unsigned int j = 0; j < 6; ++j) {
444  myFrame2FrameHists2D.push_back
445  (new TH2F(Form("frame2framePhi%d%d", i, j),
446  Form("frame to frame derivatives, %d%d;#phi(aliDet);deriv",i,j),
447  51, -TMath::Pi(), TMath::Pi(), 10, 0., 1.));
448  myFrame2FrameHists2D.back()->SetCanExtend(TH1::kAllAxes);
449  myFrame2FrameHists2D.push_back
450  (new TH2F(Form("frame2frameR%d%d", i, j),
451  Form("frame to frame derivatives, %d%d;r(aliDet);deriv",i,j),
452  51, 0., 110., 10, 0., 1.));
453  myFrame2FrameHists2D.back()->SetCanExtend(TH1::kAllAxes);
454 
455  myFrame2FrameHists2D.push_back
456  (new TH2F(Form("frame2framePhiLog%d%d", i, j),
457  Form("frame to frame |derivatives|, %d%d, #neq0;#phi(aliDet);deriv",i,j),
458  51, -TMath::Pi(), TMath::Pi(), logBins.GetSize()-1, logBins.GetArray()));
459  myFrame2FrameHists2D.push_back
460  (new TH2F(Form("frame2frameRLog%d%d", i, j),
461  Form("frame to frame |derivatives|, %d%d, #neq0;r(aliDet);deriv",i,j),
462  51, 0., 110., logBins.GetSize()-1, logBins.GetArray()));
463  }
464  }
465 
466  TDirectory *dirF2f = directory->mkdir("frame2FrameHists", "derivatives etc.");
467  this->addToDirectory(myFrame2FrameHists2D, dirF2f);
468 
469 
470  myCorrHists.push_back(new TH1F("xyCorrTPB", "#rho_{xy} in pixel barrel", 50, -.5, .5));
471  myCorrHists.push_back(new TH1F("xyCorrTPE", "#rho_{xy} in forward pixel", 50, -.5, .5));
472  myCorrHists.push_back(new TH1F("xyCorrTIB", "#rho_{xy} in TIB", 50, -.5, .5));
473  myCorrHists.push_back(new TH1F("xyCorrTID", "#rho_{xy} in TID", 50, -1., 1.));
474  myCorrHists.push_back(new TH1F("xyCorrTOB", "#rho_{xy} in TOB", 50, -.5, .5));
475  myCorrHists.push_back(new TH1F("xyCorrTEC", "#rho_{xy} in TEC", 50, -1., 1.));
476  TDirectory *dirCorr = directory->mkdir("hitCorrelationHists", "correlations");
477  this->addToDirectory( myCorrHists, dirCorr);
478 
479  // PXB Survey
480  myPxbSurveyHists.push_back(new TH1F("PxbSurvChi2_lo", "#chi^{2} from PXB survey", 25, 0, 25));
481  myPxbSurveyHists.push_back(new TH1F("PxbSurvChi2_md", "#chi^{2} from PXB survey", 25, 0, 500));
482  myPxbSurveyHists.push_back(new TH1F("PxbSurvChi2_hi", "#chi^{2} from PXB survey", 25, 0, 50000));
483  myPxbSurveyHists.push_back(new TH1F("PxbSurvChi2prob", "Math::Prob(#chi^{2},4) from PXB survey", 25, 0, 1));
484  myPxbSurveyHists.push_back(new TH1F("PxbSurv_a0", "a_{0} from PXB survey", 100, -3000, 3000));
485  myPxbSurveyHists.push_back(new TH1F("PxbSurv_a0_abs", "fabs(a_{0}) from PXB survey", 100, 0, 3000));
486  myPxbSurveyHists.push_back(new TH1F("PxbSurv_a1", "a_{1} from PXB survey", 100, -6000, 6000));
487  myPxbSurveyHists.push_back(new TH1F("PxbSurv_a1_abs", "fabs(a_{1}) from PXB survey", 100, 0, 6000));
488  myPxbSurveyHists.push_back(new TH1F("PxbSurv_scale", "scale (#sqrt{a_{2}^{2}+a_{3}^{2}}) from PXB survey", 100, 0, 1500));
489  myPxbSurveyHists.push_back(new TH1F("PxbSurv_phi", "angle(#atan{a_{3}/a_{4}}) from PXB survey", 100, -.05, .05));
490  TDirectory *dirPxbSurvey = directory->mkdir("PxbSurveyHists", "PxbSurvey");
491  this->addToDirectory( myPxbSurveyHists, dirPxbSurvey);
492 
493  oldDir->cd();
494  return true;
495 }
const double Pi
std::vector< TH1 * > myTrackHists1D
std::vector< TH2 * > myDerivHists2D
std::vector< std::vector< TH1 * > > myResidHistsVec1DX
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
static const unsigned int theMaxNumParam
void addToDirectory(const std::vector< OBJECT_TYPE * > &objs, TDirectory *dir) const
std::vector< TH2 * > myTrackHists2D
std::vector< TH2 * > myResidHists2D
std::vector< TH1 * > myCorrHists
std::vector< TH1 * > myPxbSurveyHists
std::vector< TH1 * > myUsedTrackHists1D
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 equidistLogBins(double *bins, int nBins, double first, double last) const
std::vector< TH1 * > myResidHitHists1DX
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
def mkdir(path)
Definition: eostools.py:250
std::vector< TH2 * > myUsedTrackHists2D
std::vector< TH2 * > myFrame2FrameHists2D

Member Data Documentation

std::vector<TH1*> MillePedeMonitor::myCorrHists
private

Definition at line 110 of file MillePedeMonitor.h.

Referenced by fillCorrelations2D(), and init().

bool MillePedeMonitor::myDeleteDir
private

Definition at line 95 of file MillePedeMonitor.h.

Referenced by MillePedeMonitor(), and ~MillePedeMonitor().

std::vector<TH2*> MillePedeMonitor::myDerivHists2D
private

Definition at line 103 of file MillePedeMonitor.h.

Referenced by fillDerivatives(), and init().

std::vector<TH2*> MillePedeMonitor::myFrame2FrameHists2D
private

Definition at line 109 of file MillePedeMonitor.h.

Referenced by fillFrameToFrame(), and init().

std::vector<TH1*> MillePedeMonitor::myPxbSurveyHists
private

Definition at line 111 of file MillePedeMonitor.h.

Referenced by fillPxbSurveyHistsChi2(), fillPxbSurveyHistsLocalPars(), and init().

std::vector<TH2*> MillePedeMonitor::myResidHists2D
private

Definition at line 104 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

std::vector<std::vector<TH1*> > MillePedeMonitor::myResidHistsVec1DX
private

Definition at line 105 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

std::vector<std::vector<TH1*> > MillePedeMonitor::myResidHistsVec1DY
private

[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC

Definition at line 106 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

std::vector<TH1*> MillePedeMonitor::myResidHitHists1DX
private

[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC

Definition at line 107 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

std::vector<TH1*> MillePedeMonitor::myResidHitHists1DY
private

Definition at line 108 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

TDirectory* MillePedeMonitor::myRootDir
private

Definition at line 94 of file MillePedeMonitor.h.

Referenced by MillePedeMonitor(), and ~MillePedeMonitor().

std::vector<TH1*> MillePedeMonitor::myTrackHists1D
private

Definition at line 97 of file MillePedeMonitor.h.

Referenced by fillTrack(), and init().

std::vector<TH2*> MillePedeMonitor::myTrackHists2D
private

Definition at line 98 of file MillePedeMonitor.h.

Referenced by fillTrack(), and init().

std::vector<TH1*> MillePedeMonitor::myTrajectoryHists1D
private

Definition at line 101 of file MillePedeMonitor.h.

Referenced by fillRefTrajectory(), and init().

std::vector<TH2*> MillePedeMonitor::myTrajectoryHists2D
private

Definition at line 102 of file MillePedeMonitor.h.

Referenced by fillRefTrajectory(), and init().

std::vector<TH1*> MillePedeMonitor::myUsedTrackHists1D
private

Definition at line 99 of file MillePedeMonitor.h.

Referenced by fillUsedTrack(), and init().

std::vector<TH2*> MillePedeMonitor::myUsedTrackHists2D
private

Definition at line 100 of file MillePedeMonitor.h.

Referenced by fillUsedTrack(), and init().

const TrackerTopology* MillePedeMonitor::trackerTopology
private

Definition at line 113 of file MillePedeMonitor.h.

Referenced by fillTrack().