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() [1/2]

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

Definition at line 45 of file MillePedeMonitor.cc.

References init(), myDeleteDir, myRootDir, and CSCSkim_cfi::rootFileName.

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

◆ MillePedeMonitor() [2/2]

MillePedeMonitor::MillePedeMonitor ( TDirectory *  rootDir,
const TrackerTopology tTopo 
)

Definition at line 54 of file MillePedeMonitor.cc.

References init(), myDeleteDir, and myRootDir.

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

◆ ~MillePedeMonitor()

MillePedeMonitor::~MillePedeMonitor ( )

Definition at line 65 of file MillePedeMonitor.cc.

References myDeleteDir, and myRootDir.

65  {
66  myRootDir->Write();
67  if (myDeleteDir)
68  delete myRootDir; //hists are deleted with their directory
69 }
TDirectory * myRootDir

Member Function Documentation

◆ addToDirectory()

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

Definition at line 154 of file MillePedeMonitor.h.

References DeadROC_duringRun::dir.

Referenced by init().

154  {
155  // OBJECT_TYPE is required to have method SetDirectory(TDirectory *dir)
156  for (typename std::vector<OBJECT_TYPE *>::const_iterator iter = obs.begin(), iterEnd = obs.end(); iter != iterEnd;
157  ++iter) {
158  if (*iter)
159  (*iter)->SetDirectory(dir);
160  }
161 }

◆ cloneHists()

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 133 of file MillePedeMonitor.h.

References mps_fire::result.

Referenced by init().

135  {
136  // OBJECT_TYPE required to have methods Clone(const char*), GetName(), SetTitle(const char*) and GetTitle()
137  std::vector<OBJECT_TYPE *> result;
138  for (typename std::vector<OBJECT_TYPE *>::const_iterator iter = orgs.begin(), iterEnd = orgs.end(); iter != iterEnd;
139  ++iter) {
140  if (!(*iter))
141  continue;
142  result.push_back(static_cast<OBJECT_TYPE *>((*iter)->Clone(namAd + (*iter)->GetName())));
143  if (result.back())
144  result.back()->SetTitle((*iter)->GetTitle() + titAd);
145  else
146  edm::LogError("Alignment") << "@SUB=MillePedeMonitor::cloneHists"
147  << "out of memory?";
148  }
149 
150  return result;
151 }
Log< level::Error, false > LogError

◆ equidistLogBins()

bool MillePedeMonitor::equidistLogBins ( double *  bins,
int  nBins,
double  first,
double  last 
) const
private

Definition at line 551 of file MillePedeMonitor.cc.

References trigObjTnPSource_cfi::bins, dqmdumpme::first, mps_fire::i, dqmdumpme::last, and seedmultiplicitymonitor_newtracking_cfi::nBins.

Referenced by init().

551  {
552  // Filling 'bins' with borders of 'nBins' bins between 'first' and 'last'
553  // that are equidistant when viewed in log scale,
554  // so 'bins' must have length nBins+1;
555  // If 'first', 'last' or 'nBins' are not positive, failure is reported.
556 
557  if (nBins < 1 || first <= 0. || last <= 0.)
558  return false;
559 
560  bins[0] = first;
561  bins[nBins] = last;
562  const double firstLog = TMath::Log10(bins[0]);
563  const double lastLog = TMath::Log10(bins[nBins]);
564  for (int i = 1; i < nBins; ++i) {
565  bins[i] = TMath::Power(10., firstLog + i * (lastLog - firstLog) / (nBins));
566  }
567 
568  return true;
569 }

◆ fillCorrelations2D()

void MillePedeMonitor::fillCorrelations2D ( float  corr,
const TransientTrackingRecHit::ConstRecHitPointer hit 
)

Definition at line 1094 of file MillePedeMonitor.cc.

References alignCSCRings::corr, hcalRecHitTable_cff::detId, AlignableBeamSpot::detId(), myCorrHists, rpcPointValidation_cfi::recHit, and DetId::Tracker.

1094  {
1095  const DetId detId(recHit->det()->geographicalId());
1096  if (detId.det() != DetId::Tracker)
1097  return;
1098 
1099  if ((detId.subdetId() < 1 || detId.subdetId() > 6) && detId != AlignableBeamSpot::detId()) {
1100  edm::LogWarning("Alignment") << "@SUB=MillePedeMonitor::fillCorrelations2D"
1101  << "Expect subdetId from 1 to 6, got " << detId.subdetId();
1102  return;
1103  }
1104 
1105  myCorrHists[detId.subdetId() - 1]->Fill(corr);
1106 }
std::vector< TH1 * > myCorrHists
dictionary corr
Definition: DetId.h:17
static const DetId detId()
Log< level::Warning, false > LogWarning

◆ fillDerivatives()

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 879 of file MillePedeMonitor.cc.

References GetIndex(), mps_fire::i, SummaryClient_cfi::labels, myDerivHists2D, phi, rpcPointValidation_cfi::recHit, and PedeLabelerBase::theMaxNumParam.

884  {
885  const double phi = recHit->det()->position().phi();
886 
887  static const int iLocPar = this->GetIndex(myDerivHists2D, "localDerivsPar");
888  static const int iLocPhi = this->GetIndex(myDerivHists2D, "localDerivsPhi");
889  static const int iLocParLog = this->GetIndex(myDerivHists2D, "localDerivsParLog");
890  static const int iLocPhiLog = this->GetIndex(myDerivHists2D, "localDerivsPhiLog");
891  for (unsigned int i = 0; i < nLocal; ++i) {
892  myDerivHists2D[iLocPar]->Fill(i, localDerivs[i]);
893  myDerivHists2D[iLocPhi]->Fill(phi, localDerivs[i]);
894  if (localDerivs[i]) {
895  myDerivHists2D[iLocParLog]->Fill(i, TMath::Abs(localDerivs[i]));
896  myDerivHists2D[iLocPhiLog]->Fill(phi, TMath::Abs(localDerivs[i]));
897  }
898  }
899 
900  static const int iGlobPar = this->GetIndex(myDerivHists2D, "globalDerivsPar");
901  static const int iGlobPhi = this->GetIndex(myDerivHists2D, "globalDerivsPhi");
902  static const int iGlobParLog = this->GetIndex(myDerivHists2D, "globalDerivsParLog");
903  static const int iGlobPhiLog = this->GetIndex(myDerivHists2D, "globalDerivsPhiLog");
904  // static const int iGlobPhiLog2 = this->GetIndex(myDerivHists2D, "globalDerivsPhiLog2");
905  for (unsigned int i = 0; i < nGlobal; ++i) {
906  const unsigned int parNum = (labels ? (labels[i] % PedeLabelerBase::theMaxNumParam) - 1 : i);
907  myDerivHists2D[iGlobPar]->Fill(parNum, globalDerivs[i]);
908  myDerivHists2D[iGlobPhi]->Fill(phi, globalDerivs[i]);
909  if (globalDerivs[i]) {
910  myDerivHists2D[iGlobParLog]->Fill(parNum, TMath::Abs(globalDerivs[i]));
911  myDerivHists2D[iGlobPhiLog]->Fill(phi, TMath::Abs(globalDerivs[i]));
912  // myDerivHists2D[iGlobPhiLog2]->Fill(phi, TMath::Abs(globalDerivs[i]));
913  }
914  }
915 }
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
static const unsigned int theMaxNumParam
std::vector< TH2 * > myDerivHists2D

◆ fillFrameToFrame()

void MillePedeMonitor::fillFrameToFrame ( const AlignableDetOrUnitPtr aliDet,
const Alignable ali 
)

Definition at line 1064 of file MillePedeMonitor.cc.

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

1064  {
1065  // get derivative of higher level structure w.r.t. det
1067  const AlgebraicMatrix frameDeriv = ftfd.frameToFrameDerivative(aliDet, ali);
1068  //const AlgebraicMatrix frameDeriv = ftfd.frameToFrameDerivativeAtOrgRot(aliDet, ali);
1069 
1070  static const int iF2f = this->GetIndex(myFrame2FrameHists2D, "frame2frame");
1071  static const int iF2fAbs = this->GetIndex(myFrame2FrameHists2D, "frame2frameAbs");
1072  static const auto iF2fIjPhi = indexArray2D<TH2, 6>(myFrame2FrameHists2D, "frame2framePhi%d%d");
1073  static const auto iF2fIjPhiLog = indexArray2D<TH2, 6>(myFrame2FrameHists2D, "frame2framePhiLog%d%d");
1074  static const auto iF2fIjR = indexArray2D<TH2, 6>(myFrame2FrameHists2D, "frame2frameR%d%d");
1075  static const auto iF2fIjRLog = indexArray2D<TH2, 6>(myFrame2FrameHists2D, "frame2frameRLog%d%d");
1076 
1077  const double phi = aliDet->globalPosition().phi(); // after misalignment...
1078  const double r = aliDet->globalPosition().perp(); // after misalignment...
1079  for (unsigned int i = 0; i < 6; ++i) {
1080  for (unsigned int j = 0; j < 6; ++j) {
1081  myFrame2FrameHists2D[iF2f]->Fill(i, j, frameDeriv[i][j]);
1082  myFrame2FrameHists2D[iF2fIjPhi[i][j]]->Fill(phi, frameDeriv[i][j]);
1083  myFrame2FrameHists2D[iF2fIjR[i][j]]->Fill(r, frameDeriv[i][j]);
1084  if (frameDeriv[i][j]) {
1085  myFrame2FrameHists2D[iF2fAbs]->Fill(i, j, TMath::Abs(frameDeriv[i][j]));
1086  myFrame2FrameHists2D[iF2fIjPhiLog[i][j]]->Fill(phi, TMath::Abs(frameDeriv[i][j]));
1087  myFrame2FrameHists2D[iF2fIjRLog[i][j]]->Fill(r, TMath::Abs(frameDeriv[i][j]));
1088  }
1089  }
1090  }
1091 }
T perp() const
Definition: PV3DBase.h:69
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
CLHEP::HepMatrix AlgebraicMatrix
std::vector< TH2 * > myFrame2FrameHists2D
AlgebraicMatrix frameToFrameDerivative(const Alignable *object, const Alignable *composedObject) const

◆ fillPxbSurveyHistsChi2()

void MillePedeMonitor::fillPxbSurveyHistsChi2 ( const float &  chi2)

Definition at line 1109 of file MillePedeMonitor.cc.

References nano_mu_local_reco_cff::chi2, GetIndex(), and myPxbSurveyHists.

1109  {
1110  static const int iPxbSurvChi2_lo = this->GetIndex(myPxbSurveyHists, "PxbSurvChi2_lo");
1111  myPxbSurveyHists[iPxbSurvChi2_lo]->Fill(chi2);
1112  static const int iPxbSurvChi2_md = this->GetIndex(myPxbSurveyHists, "PxbSurvChi2_md");
1113  myPxbSurveyHists[iPxbSurvChi2_md]->Fill(chi2);
1114  static const int iPxbSurvChi2_hi = this->GetIndex(myPxbSurveyHists, "PxbSurvChi2_hi");
1115  myPxbSurveyHists[iPxbSurvChi2_hi]->Fill(chi2);
1116  static const int iPxbSurvChi2prob = this->GetIndex(myPxbSurveyHists, "PxbSurvChi2prob");
1117  myPxbSurveyHists[iPxbSurvChi2prob]->Fill(TMath::Prob(chi2, 4));
1118 }
std::vector< TH1 * > myPxbSurveyHists
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)

◆ fillPxbSurveyHistsLocalPars()

void MillePedeMonitor::fillPxbSurveyHistsLocalPars ( const float &  a0,
const float &  a1,
const float &  S,
const float &  phi 
)

Definition at line 1121 of file MillePedeMonitor.cc.

References a0, GetIndex(), myPxbSurveyHists, and phi.

1121  {
1122  static const int iPxbSurv_a0 = this->GetIndex(myPxbSurveyHists, "PxbSurv_a0");
1123  myPxbSurveyHists[iPxbSurv_a0]->Fill(a0);
1124  static const int iPxbSurv_a0_abs = this->GetIndex(myPxbSurveyHists, "PxbSurv_a0_abs");
1125  myPxbSurveyHists[iPxbSurv_a0_abs]->Fill(fabs(a0));
1126  static const int iPxbSurv_a1 = this->GetIndex(myPxbSurveyHists, "PxbSurv_a1");
1127  myPxbSurveyHists[iPxbSurv_a1]->Fill(a1);
1128  static const int iPxbSurv_a1_abs = this->GetIndex(myPxbSurveyHists, "PxbSurv_a1_abs");
1129  myPxbSurveyHists[iPxbSurv_a1_abs]->Fill(fabs(a1));
1130  static const int iPxbSurv_scale = this->GetIndex(myPxbSurveyHists, "PxbSurv_scale");
1131  myPxbSurveyHists[iPxbSurv_scale]->Fill(S);
1132  static const int iPxbSurv_phi = this->GetIndex(myPxbSurveyHists, "PxbSurv_phi");
1133  myPxbSurveyHists[iPxbSurv_phi]->Fill(phi);
1134 }
std::vector< TH1 * > myPxbSurveyHists
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
static constexpr float a0

◆ fillRefTrajectory()

void MillePedeMonitor::fillRefTrajectory ( const ReferenceTrajectoryBase::ReferenceTrajectoryPtr refTrajPtr)

Definition at line 757 of file MillePedeMonitor.cc.

References GetIndex(), myTrajectoryHists1D, myTrajectoryHists2D, phi, position, FastTrackerRecHitMaskProducer_cfi::recHits, and rho.

757  {
758  static const int iValid = this->GetIndex(myTrajectoryHists1D, "validRefTraj");
759  if (refTrajPtr->isValid()) {
760  myTrajectoryHists1D[iValid]->Fill(1.);
761  } else {
762  myTrajectoryHists1D[iValid]->Fill(0.);
763  return;
764  }
765 
766  const AlgebraicSymMatrix &covMeasLoc = refTrajPtr->measurementErrors();
767  const AlgebraicVector &measurementsLoc = refTrajPtr->measurements();
768  const AlgebraicVector &trajectoryLoc = refTrajPtr->trajectoryPositions();
769  const TransientTrackingRecHit::ConstRecHitContainer &recHits = refTrajPtr->recHits();
770  const AlgebraicMatrix &derivatives = refTrajPtr->derivatives();
771 
772  // CHK
773  const int nRow = refTrajPtr->numberOfHitMeas();
774 
775  for (int iRow = 0; iRow < nRow; ++iRow) {
776  const double residuum = measurementsLoc[iRow] - trajectoryLoc[iRow];
777  const double covMeasLocRow = covMeasLoc[iRow][iRow];
778  const bool is2DhitRow = (!recHits[iRow / 2]->detUnit() // FIXME: as in MillePedeAlignmentAlgorithm::is2D()
779  || recHits[iRow / 2]->detUnit()->type().isTrackerPixel());
780  //the GeomDetUnit* is zero for composite hits (matched hits in the tracker,...).
781  if (TMath::Even(iRow)) { // local x
782  static const int iMeasLocX = this->GetIndex(myTrajectoryHists1D, "measLocX");
783  myTrajectoryHists1D[iMeasLocX]->Fill(measurementsLoc[iRow]);
784  static const int iTrajLocX = this->GetIndex(myTrajectoryHists1D, "trajLocX");
785  myTrajectoryHists1D[iTrajLocX]->Fill(trajectoryLoc[iRow]);
786  static const int iResidLocX = this->GetIndex(myTrajectoryHists1D, "residLocX");
787  myTrajectoryHists1D[iResidLocX]->Fill(residuum);
788 
789  static const int iMeasLocXvsHit = this->GetIndex(myTrajectoryHists2D, "measLocXvsHit");
790  myTrajectoryHists2D[iMeasLocXvsHit]->Fill(iRow / 2, measurementsLoc[iRow]);
791  static const int iTrajLocXvsHit = this->GetIndex(myTrajectoryHists2D, "trajLocXvsHit");
792  myTrajectoryHists2D[iTrajLocXvsHit]->Fill(iRow / 2, trajectoryLoc[iRow]);
793  static const int iResidLocXvsHit = this->GetIndex(myTrajectoryHists2D, "residLocXvsHit");
794  myTrajectoryHists2D[iResidLocXvsHit]->Fill(iRow / 2, residuum);
795 
796  if (covMeasLocRow > 0.) {
797  static const int iReduResidLocX = this->GetIndex(myTrajectoryHists1D, "reduResidLocX");
798  myTrajectoryHists1D[iReduResidLocX]->Fill(residuum / TMath::Sqrt(covMeasLocRow));
799  static const int iReduResidLocXvsHit = this->GetIndex(myTrajectoryHists2D, "reduResidLocXvsHit");
800  myTrajectoryHists2D[iReduResidLocXvsHit]->Fill(iRow / 2, residuum / TMath::Sqrt(covMeasLocRow));
801  }
802  } else if (is2DhitRow) { // local y, 2D detectors only
803 
804  static const int iMeasLocY = this->GetIndex(myTrajectoryHists1D, "measLocY");
805  myTrajectoryHists1D[iMeasLocY]->Fill(measurementsLoc[iRow]);
806  static const int iTrajLocY = this->GetIndex(myTrajectoryHists1D, "trajLocY");
807  myTrajectoryHists1D[iTrajLocY]->Fill(trajectoryLoc[iRow]);
808  static const int iResidLocY = this->GetIndex(myTrajectoryHists1D, "residLocY");
809  myTrajectoryHists1D[iResidLocY]->Fill(residuum);
810 
811  static const int iMeasLocYvsHit = this->GetIndex(myTrajectoryHists2D, "measLocYvsHit");
812  myTrajectoryHists2D[iMeasLocYvsHit]->Fill(iRow / 2, measurementsLoc[iRow]);
813  static const int iTrajLocYvsHit = this->GetIndex(myTrajectoryHists2D, "trajLocYvsHit");
814  myTrajectoryHists2D[iTrajLocYvsHit]->Fill(iRow / 2, trajectoryLoc[iRow]);
815  static const int iResidLocYvsHit = this->GetIndex(myTrajectoryHists2D, "residLocYvsHit");
816  myTrajectoryHists2D[iResidLocYvsHit]->Fill(iRow / 2, residuum);
817 
818  if (covMeasLocRow > 0.) {
819  static const int iReduResidLocY = this->GetIndex(myTrajectoryHists1D, "reduResidLocY");
820  myTrajectoryHists1D[iReduResidLocY]->Fill(residuum / TMath::Sqrt(covMeasLocRow));
821  static const int iReduResidLocYvsHit = this->GetIndex(myTrajectoryHists2D, "reduResidLocYvsHit");
822  myTrajectoryHists2D[iReduResidLocYvsHit]->Fill(iRow / 2, residuum / TMath::Sqrt(covMeasLocRow));
823  }
824  }
825 
826  float nHitRow = iRow / 2; // '/2' not '/2.'!
827  if (TMath::Odd(iRow))
828  nHitRow += 0.5; // y-hit gets 0.5
829  // correlations
830  for (int iCol = iRow + 1; iCol < nRow; ++iCol) {
831  double rho = TMath::Sqrt(covMeasLocRow + covMeasLoc[iCol][iCol]);
832  rho = (0. == rho ? -2 : covMeasLoc[iRow][iCol] / rho);
833  float nHitCol = iCol / 2; //cf. comment nHitRow
834  if (TMath::Odd(iCol))
835  nHitCol += 0.5; // dito
836  // myProfileCorr->Fill(nHitRow, nHitCol, TMath::Abs(rho));
837  if (0. == rho)
838  continue;
839  static const int iProfileCorr = this->GetIndex(myTrajectoryHists2D, "profCorr");
840  myTrajectoryHists2D[iProfileCorr]->Fill(nHitRow, nHitCol, TMath::Abs(rho));
841  if (iRow + 1 == iCol && TMath::Even(iRow)) { // i.e. if iRow is x and iCol the same hit's y
842  // static const int iProfileCorrXy = this->GetIndex(myTrajectoryHists2D,"profCorrOffXy");
843  // myTrajectoryHists2D[iProfileCorrOffXy]->Fill(iRow/2, rho);
844  static const int iHitCorrXy = this->GetIndex(myTrajectoryHists2D, "hitCorrXy");
845  myTrajectoryHists2D[iHitCorrXy]->Fill(iRow / 2, rho);
846  static const int iHitCorrXyLog = this->GetIndex(myTrajectoryHists2D, "hitCorrXyLog");
847  myTrajectoryHists2D[iHitCorrXyLog]->Fill(iRow / 2, TMath::Abs(rho));
848  if (is2DhitRow) {
849  static const int iHitCorrXyValid = this->GetIndex(myTrajectoryHists2D, "hitCorrXyValid");
850  myTrajectoryHists2D[iHitCorrXyValid]->Fill(iRow / 2, rho); // nhitRow??
851  static const int iHitCorrXyLogValid = this->GetIndex(myTrajectoryHists2D, "hitCorrXyLogValid");
852  myTrajectoryHists2D[iHitCorrXyLogValid]->Fill(iRow / 2, TMath::Abs(rho)); // nhitRow??
853  }
854  } else {
855  static const int iProfCorrOffXy = this->GetIndex(myTrajectoryHists2D, "profCorrOffXy");
856  myTrajectoryHists2D[iProfCorrOffXy]->Fill(nHitRow, nHitCol, TMath::Abs(rho));
857  static const int iHitCorrOffBlock = this->GetIndex(myTrajectoryHists2D, "hitCorrOffBlock");
858  myTrajectoryHists2D[iHitCorrOffBlock]->Fill(nHitRow, rho);
859  static const int iHitCorOffBlkLg = this->GetIndex(myTrajectoryHists2D, "hitCorrOffBlockLog");
860  myTrajectoryHists2D[iHitCorOffBlkLg]->Fill(nHitRow, TMath::Abs(rho));
861  }
862  } // end loop on columns of covariance
863 
864  // derivatives
865  for (int iCol = 0; iCol < derivatives.num_col(); ++iCol) {
866  static const int iProfDerivatives = this->GetIndex(myTrajectoryHists2D, "profDerivatives");
867  myTrajectoryHists2D[iProfDerivatives]->Fill(nHitRow, iCol, derivatives[iRow][iCol]);
868  static const int iDerivatives = this->GetIndex(myTrajectoryHists2D, "derivatives");
869  myTrajectoryHists2D[iDerivatives]->Fill(iCol, derivatives[iRow][iCol]);
870  static const int iDerivativesLog = this->GetIndex(myTrajectoryHists2D, "derivativesLog");
871  myTrajectoryHists2D[iDerivativesLog]->Fill(iCol, TMath::Abs(derivatives[iRow][iCol]));
872  static const int iDerivativesPhi = this->GetIndex(myTrajectoryHists2D, "derivativesVsPhi");
873  myTrajectoryHists2D[iDerivativesPhi]->Fill(recHits[iRow / 2]->det()->position().phi(), derivatives[iRow][iCol]);
874  }
875  } // end loop on rows of covarianvce
876 }
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
CLHEP::HepMatrix AlgebraicMatrix
std::vector< TH1 * > myTrajectoryHists1D
std::vector< TH2 * > myTrajectoryHists2D
std::vector< ConstRecHitPointer > ConstRecHitContainer
CLHEP::HepVector AlgebraicVector
static int position[264][3]
Definition: ReadPGInfo.cc:289
CLHEP::HepSymMatrix AlgebraicSymMatrix

◆ fillResidualHists()

void MillePedeMonitor::fillResidualHists ( const std::vector< TH1 *> &  hists,
float  phiSensToNorm,
float  residuum,
float  sigma 
)
private

Definition at line 996 of file MillePedeMonitor.cc.

References GetIndex(), and compare::hists.

Referenced by fillResiduals().

999  {
1000  // Histogram indices are calculated at first call, so make sure the vector of hists at the first
1001  // call has the correct names (i.e. without subdet extension) and all later calls have the
1002  // same order of hists...
1003 
1004  static const int iRes = this->GetIndex(hists, "resid");
1005  hists[iRes]->Fill(residuum);
1006  static const int iSigma = this->GetIndex(hists, "sigma");
1007  hists[iSigma]->Fill(sigma);
1008  static const int iSigmaVsAngle = this->GetIndex(hists, "sigmaVsAngle");
1009  hists[iSigmaVsAngle]->Fill(phiSensToNorm, sigma);
1010  static const int iResidVsAngle = this->GetIndex(hists, "residVsAngle");
1011  hists[iResidVsAngle]->Fill(phiSensToNorm, residuum);
1012  static const int iReduRes = this->GetIndex(hists, "reduResid");
1013  static const int iReduResidVsAngle = this->GetIndex(hists, "reduResidVsAngle");
1014  if (sigma) {
1015  hists[iReduRes]->Fill(residuum / sigma);
1016  hists[iReduResidVsAngle]->Fill(phiSensToNorm, residuum / sigma);
1017  }
1018  static const int iAngle = this->GetIndex(hists, "angle");
1019  hists[iAngle]->Fill(phiSensToNorm);
1020 
1021  if (phiSensToNorm > TMath::DegToRad() * 45.) {
1022  static const int iResGt45 = this->GetIndex(hists, "residGt45");
1023  hists[iResGt45]->Fill(residuum);
1024  static const int iSigmaGt45 = this->GetIndex(hists, "sigmaGt45");
1025  hists[iSigmaGt45]->Fill(sigma);
1026  static const int iReduResGt45 = this->GetIndex(hists, "reduResidGt45");
1027  if (sigma)
1028  hists[iReduResGt45]->Fill(residuum / sigma);
1029  } else {
1030  static const int iResLt45 = this->GetIndex(hists, "residLt45");
1031  hists[iResLt45]->Fill(residuum);
1032  static const int iSigmaLt45 = this->GetIndex(hists, "sigmaLt45");
1033  hists[iSigmaLt45]->Fill(sigma);
1034  static const int iReduResLt45 = this->GetIndex(hists, "reduResidLt45");
1035  if (sigma)
1036  hists[iReduResLt45]->Fill(residuum / sigma);
1037  }
1038 }
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)

◆ fillResidualHitHists()

void MillePedeMonitor::fillResidualHitHists ( const std::vector< TH1 *> &  hists,
float  angle,
float  residuum,
float  sigma,
unsigned int  nHit 
)
private

Definition at line 1041 of file MillePedeMonitor.cc.

References angle(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), and compare::hists.

Referenced by fillResiduals().

1042  {
1043  // Histogram indices are calculated at first call, so make sure the vector of hists at the first
1044  // call has the correct names (i.e. without subdet extension) and all later calls have the
1045  // same order of hists...
1046 
1047  static constexpr unsigned int maxNhit = 29; // 0...29 foreseen in initialisation...
1048  static const auto iResHit = indexArray1D<TH1, maxNhit + 1>(hists, "resid_%d");
1049  static const auto iSigmaHit = indexArray1D<TH1, maxNhit + 1>(hists, "sigma_%d");
1050  static const auto iReduResHit = indexArray1D<TH1, maxNhit + 1>(hists, "reduResid_%d");
1051  static const auto iAngleHit = indexArray1D<TH1, maxNhit + 1>(hists, "angle_%d");
1052  if (nHit > maxNhit)
1053  nHit = maxNhit; // limit of hists
1054 
1055  hists[iResHit[nHit]]->Fill(residuum);
1056  hists[iSigmaHit[nHit]]->Fill(sigma);
1057  if (sigma) {
1058  hists[iReduResHit[nHit]]->Fill(residuum / sigma);
1059  }
1060  hists[iAngleHit[nHit]]->Fill(angle);
1061 }
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11

◆ fillResiduals()

void MillePedeMonitor::fillResiduals ( const TransientTrackingRecHit::ConstRecHitPointer recHit,
const TrajectoryStateOnSurface tsos,
unsigned int  nHit,
float  residuum,
float  sigma,
bool  isY 
)

Definition at line 918 of file MillePedeMonitor.cc.

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

923  {
924  // isY == false: x-measurements
925  // isY == true: y-measurements
926  const GlobalPoint detPos(recHit->det()->position());
927  const double phi = detPos.phi();
928  // const double rSigned = (detPos.y() > 0. ? detPos.perp() : -detPos.perp());
929 
930  static const int iResPhi = this->GetIndex(myResidHists2D, "residPhi");
931  myResidHists2D[iResPhi]->Fill(phi, residuum);
932  static const int iSigPhi = this->GetIndex(myResidHists2D, "sigmaPhi");
933  myResidHists2D[iSigPhi]->Fill(phi, sigma);
934  if (sigma) {
935  static const int iReduResPhi = this->GetIndex(myResidHists2D, "reduResidPhi");
936  myResidHists2D[iReduResPhi]->Fill(phi, residuum / sigma);
937  }
938 
939  // if (isY) {
940  // static const int iResYXy = this->GetIndex(myResidHists2D, "residYProfXy");
941  // myResidHists2D[iResYXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum));
942  // static const int iResYZr = this->GetIndex(myResidHists2D, "residYProfZr");
943  // myResidHists2D[iResYZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum));
944  // static const int iSigmaYXy = this->GetIndex(myResidHists2D, "sigmaYProfXy");
945  // myResidHists2D[iSigmaYXy]->Fill(detPos.x(), detPos.y(), sigma);
946  // static const int iSigmaYZr = this->GetIndex(myResidHists2D, "sigmaYProfZr");
947  // myResidHists2D[iSigmaYZr]->Fill(detPos.z(), rSigned, sigma);
948  // if (sigma) {
949  // static const int iReduResYXy = this->GetIndex(myResidHists2D, "reduResidYProfXy");
950  // myResidHists2D[iReduResYXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum/sigma));
951  // static const int iReduResYZr = this->GetIndex(myResidHists2D, "reduResidYProfZr");
952  // myResidHists2D[iReduResYZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum/sigma));
953  // }
954  // } else {
955  // static const int iResXXy = this->GetIndex(myResidHists2D, "residXProfXy");
956  // myResidHists2D[iResXXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum));
957  // static const int iResXZr = this->GetIndex(myResidHists2D, "residXProfZr");
958  // myResidHists2D[iResXZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum));
959  // static const int iSigmaXXy = this->GetIndex(myResidHists2D, "sigmaXProfXy");
960  // myResidHists2D[iSigmaXXy]->Fill(detPos.x(), detPos.y(), sigma);
961  // static const int iSigmaXZr = this->GetIndex(myResidHists2D, "sigmaXProfZr");
962  // myResidHists2D[iSigmaXZr]->Fill(detPos.z(), rSigned, sigma);
963  // if (sigma) {
964  // static const int iReduResXXy = this->GetIndex(myResidHists2D, "reduResidXProfXy");
965  // myResidHists2D[iReduResXXy]->Fill(detPos.x(), detPos.y(), TMath::Abs(residuum/sigma));
966  // static const int iReduResXZr = this->GetIndex(myResidHists2D, "reduResidXProfZr");
967  // myResidHists2D[iReduResXZr]->Fill(detPos.z(), rSigned, TMath::Abs(residuum/sigma));
968  // }
969  // }
970 
971  const LocalVector mom(tsos.localDirection()); // mom.z()==0. impossible for TSOS:
972  const float phiSensToNorm = TMath::ATan(TMath::Abs((isY ? mom.y() : mom.x()) / mom.z()));
973 
974  std::vector<std::vector<TH1 *> > &histArrayVec = (isY ? myResidHistsVec1DY : myResidHistsVec1DX);
975  std::vector<TH1 *> &hitHists = (isY ? myResidHitHists1DY : myResidHitHists1DX);
976 
977  // call with histArrayVec[0] first: 'static' inside is referring to "subdet-less" names (X/Y irrelevant)
978  this->fillResidualHists(histArrayVec[0], phiSensToNorm, residuum, sigma);
979  this->fillResidualHitHists(hitHists, phiSensToNorm, residuum, sigma, nHit);
980 
981  const DetId detId(recHit->det()->geographicalId());
982  if (detId.det() == DetId::Tracker) {
983  // const GeomDet::SubDetector subDetNum = recHit->det()->subDetector();
984  unsigned int subDetNum = detId.subdetId();
985  if (subDetNum < histArrayVec.size() && subDetNum > 0) {
986  this->fillResidualHists(histArrayVec[subDetNum], phiSensToNorm, residuum, sigma);
987  } else {
989  edm::LogWarning("Alignment") << "@SUB=MillePedeMonitor::fillResiduals"
990  << "Expect subDetNum from 1 to 6, got " << subDetNum;
991  }
992  }
993 }
std::vector< std::vector< TH1 * > > myResidHistsVec1DY
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
std::vector< TH2 * > myResidHists2D
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
std::vector< TH1 * > myResidHitHists1DX
[0]=all [1]=TPB [2]=TPE [3]=TIB [4]=TID [5]=TOB [6]=TEC
LocalVector localDirection() const
void fillResidualHitHists(const std::vector< TH1 *> &hists, float angle, float residuum, float sigma, unsigned int nHit)
Definition: DetId.h:17
static const DetId detId()
std::vector< TH1 * > myResidHitHists1DY
Log< level::Warning, false > LogWarning
void fillResidualHists(const std::vector< TH1 *> &hists, float phiSensToNorm, float residuum, float sigma)
std::vector< std::vector< TH1 * > > myResidHistsVec1DX

◆ fillTrack() [1/2]

void MillePedeMonitor::fillTrack ( const reco::Track track)

Definition at line 572 of file MillePedeMonitor.cc.

References myTrackHists1D, and myTrackHists2D.

Referenced by fillUsedTrack().

572 { this->fillTrack(track, myTrackHists1D, myTrackHists2D); }
std::vector< TH2 * > myTrackHists2D
void fillTrack(const reco::Track *track)
std::vector< TH1 * > myTrackHists1D

◆ fillTrack() [2/2]

void MillePedeMonitor::fillTrack ( const reco::Track track,
std::vector< TH1 *> &  trackHists1D,
std::vector< TH2 *> &  trackHists2D 
)
private

Definition at line 588 of file MillePedeMonitor.cc.

References hcalRecHitTable_cff::detId, GetIndex(), l1tPhase2CaloJetEmulator_cfi::iEta, kBPIX, kFPIX, AlCaHLTBitMon_ParallelJobs::p, TrackerTopology::pxfSide(), SiStripDetId::TEC, TrackerTopology::tecIsZMinusSide(), TrackerTopology::tecIsZPlusSide(), SiStripDetId::TIB, SiStripDetId::TID, TrackerTopology::tidIsZMinusSide(), TrackerTopology::tidIsZPlusSide(), SiStripDetId::TOB, HLT_2024v13_cff::track, DetId::Tracker, and trackerTopology.

590  {
591  if (!track)
592  return;
593 
594  const reco::TrackBase::Vector p(track->momentum());
595 
596  static const int iPtLog = this->GetIndex(trackHists1D, "ptTrackLogBins");
597  trackHists1D[iPtLog]->Fill(track->pt());
598  static const int iPt = this->GetIndex(trackHists1D, "ptTrack");
599  trackHists1D[iPt]->Fill(track->pt());
600  static const int iP = this->GetIndex(trackHists1D, "pTrack");
601  trackHists1D[iP]->Fill(p.R());
602  static const int iEta = this->GetIndex(trackHists1D, "etaTrack");
603  trackHists1D[iEta]->Fill(p.Eta());
604  static const int iTheta = this->GetIndex(trackHists1D, "thetaTrack");
605  trackHists1D[iTheta]->Fill(p.Theta());
606  static const int iPhi = this->GetIndex(trackHists1D, "phiTrack");
607  trackHists1D[iPhi]->Fill(p.Phi());
608 
609  static const int iNhit = this->GetIndex(trackHists1D, "nHitTrack");
610  trackHists1D[iNhit]->Fill(track->numberOfValidHits());
611  static const int iNhitInvalid = this->GetIndex(trackHists1D, "nHitInvalidTrack");
612  trackHists1D[iNhitInvalid]->Fill(track->numberOfLostHits());
613 
614  int nhitinTIB = 0, nhitinTOB = 0, nhitinTID = 0;
615  int nhitinTEC = 0, nhitinBPIX = 0, nhitinFPIX = 0, nhitinPIXEL = 0;
616  int nhitinENDCAP = 0, nhitinENDCAPplus = 0, nhitinENDCAPminus = 0;
617  int nhitinTIDplus = 0, nhitinTIDminus = 0;
618  int nhitinFPIXplus = 0, nhitinFPIXminus = 0;
619  int nhitinTECplus = 0, nhitinTECminus = 0;
620 
621  for (auto const &hit : track->recHits()) {
622  const DetId detId(hit->geographicalId());
623  const int subdetId = detId.subdetId();
624 
625  if (!hit->isValid())
626  continue; // only real hits count as in track->numberOfValidHits()
627  if (detId.det() != DetId::Tracker) {
628  edm::LogError("DetectorMismatch") << "@SUB=MillePedeMonitor::fillTrack"
629  << "DetId.det() != DetId::Tracker (=" << DetId::Tracker << "), but "
630  << detId.det() << ".";
631  }
632 
633  if (SiStripDetId::TIB == subdetId)
634  ++nhitinTIB;
635  else if (SiStripDetId::TOB == subdetId)
636  ++nhitinTOB;
637  else if (SiStripDetId::TID == subdetId) {
638  ++nhitinTID;
639  ++nhitinENDCAP;
640 
642  ++nhitinTIDminus;
643  ++nhitinENDCAPminus;
644  } else if (trackerTopology->tidIsZPlusSide(detId)) {
645  ++nhitinTIDplus;
646  ++nhitinENDCAPplus;
647  }
648  } else if (SiStripDetId::TEC == subdetId) {
649  ++nhitinTEC;
650  ++nhitinENDCAP;
651 
653  ++nhitinTECminus;
654  ++nhitinENDCAPminus;
655  } else if (trackerTopology->tecIsZPlusSide(detId)) {
656  ++nhitinTECplus;
657  ++nhitinENDCAPplus;
658  }
659  } else if (kBPIX == subdetId) {
660  ++nhitinBPIX;
661  ++nhitinPIXEL;
662  } else if (kFPIX == subdetId) {
663  ++nhitinFPIX;
664  ++nhitinPIXEL;
665 
666  if (trackerTopology->pxfSide(detId) == 1)
667  ++nhitinFPIXminus;
668  else if (trackerTopology->pxfSide(detId) == 2)
669  ++nhitinFPIXplus;
670  }
671 
672  } // end loop on hits
673 
674  static const int iNhit01 = this->GetIndex(trackHists1D, "nHitBPIXTrack");
675  trackHists1D[iNhit01]->Fill(nhitinBPIX);
676  static const int iNhit02 = this->GetIndex(trackHists1D, "nHitFPIXplusTrack");
677  trackHists1D[iNhit02]->Fill(nhitinFPIXplus);
678  static const int iNhit03 = this->GetIndex(trackHists1D, "nHitFPIXminusTrack");
679  trackHists1D[iNhit03]->Fill(nhitinFPIXminus);
680  static const int iNhit04 = this->GetIndex(trackHists1D, "nHitFPIXTrack");
681  trackHists1D[iNhit04]->Fill(nhitinFPIX);
682  static const int iNhit05 = this->GetIndex(trackHists1D, "nHitPIXELTrack");
683  trackHists1D[iNhit05]->Fill(nhitinPIXEL);
684  static const int iNhit06 = this->GetIndex(trackHists1D, "nHitTIBTrack");
685  trackHists1D[iNhit06]->Fill(nhitinTIB);
686  static const int iNhit07 = this->GetIndex(trackHists1D, "nHitTOBTrack");
687  trackHists1D[iNhit07]->Fill(nhitinTOB);
688  static const int iNhit08 = this->GetIndex(trackHists1D, "nHitTIDplusTrack");
689  trackHists1D[iNhit08]->Fill(nhitinTIDplus);
690  static const int iNhit09 = this->GetIndex(trackHists1D, "nHitTIDminusTrack");
691  trackHists1D[iNhit09]->Fill(nhitinTIDminus);
692  static const int iNhit10 = this->GetIndex(trackHists1D, "nHitTIDTrack");
693  trackHists1D[iNhit10]->Fill(nhitinTID);
694  static const int iNhit11 = this->GetIndex(trackHists1D, "nHitTECplusTrack");
695  trackHists1D[iNhit11]->Fill(nhitinTECplus);
696  static const int iNhit12 = this->GetIndex(trackHists1D, "nHitTECminusTrack");
697  trackHists1D[iNhit12]->Fill(nhitinTECminus);
698  static const int iNhit13 = this->GetIndex(trackHists1D, "nHitTECTrack");
699  trackHists1D[iNhit13]->Fill(nhitinTEC);
700  static const int iNhit14 = this->GetIndex(trackHists1D, "nHitENDCAPplusTrack");
701  trackHists1D[iNhit14]->Fill(nhitinENDCAPplus);
702  static const int iNhit15 = this->GetIndex(trackHists1D, "nHitENDCAPminusTrack");
703  trackHists1D[iNhit15]->Fill(nhitinENDCAPminus);
704  static const int iNhit16 = this->GetIndex(trackHists1D, "nHitENDCAPTrack");
705  trackHists1D[iNhit16]->Fill(nhitinENDCAP);
706  static const int iNhit17 = this->GetIndex(trackHists2D, "nHitENDCAPTrackMinusVsPlus");
707  trackHists2D[iNhit17]->Fill(nhitinENDCAPplus, nhitinENDCAPminus);
708 
709  if (track->innerOk()) {
710  const reco::TrackBase::Point &firstPoint(track->innerPosition());
711  static const int iR1 = this->GetIndex(trackHists1D, "r1Track");
712  trackHists1D[iR1]->Fill(firstPoint.Rho());
713  const double rSigned1 = (firstPoint.y() > 0 ? firstPoint.Rho() : -firstPoint.Rho());
714  static const int iR1Signed = this->GetIndex(trackHists1D, "r1TrackSigned");
715  trackHists1D[iR1Signed]->Fill(rSigned1);
716  static const int iZ1 = this->GetIndex(trackHists1D, "z1Track");
717  trackHists1D[iZ1]->Fill(firstPoint.Z());
718  static const int iZ1Full = this->GetIndex(trackHists1D, "z1TrackFull");
719  trackHists1D[iZ1Full]->Fill(firstPoint.Z());
720  static const int iY1 = this->GetIndex(trackHists1D, "y1Track");
721  trackHists1D[iY1]->Fill(firstPoint.Y());
722  static const int iPhi1 = this->GetIndex(trackHists1D, "phi1Track");
723  trackHists1D[iPhi1]->Fill(firstPoint.phi());
724  static const int iRz1Full = this->GetIndex(trackHists2D, "rz1TrackFull");
725  trackHists2D[iRz1Full]->Fill(firstPoint.Z(), rSigned1);
726  static const int iXy1 = this->GetIndex(trackHists2D, "xy1Track");
727  trackHists2D[iXy1]->Fill(firstPoint.X(), firstPoint.Y());
728  }
729 
730  if (track->outerOk()) {
731  const reco::TrackBase::Point &lastPoint(track->outerPosition());
732  static const int iRlast = this->GetIndex(trackHists1D, "rLastTrack");
733  trackHists1D[iRlast]->Fill(lastPoint.Rho());
734  static const int iZlast = this->GetIndex(trackHists1D, "zLastTrack");
735  trackHists1D[iZlast]->Fill(lastPoint.Z());
736  static const int iYlast = this->GetIndex(trackHists1D, "yLastTrack");
737  trackHists1D[iYlast]->Fill(lastPoint.Y());
738  static const int iPhiLast = this->GetIndex(trackHists1D, "phiLastTrack");
739  trackHists1D[iPhiLast]->Fill(lastPoint.phi());
740  }
741 
742  static const int iChi2Ndf = this->GetIndex(trackHists1D, "chi2PerNdf");
743  trackHists1D[iChi2Ndf]->Fill(track->normalizedChi2());
744 
745  static const int iImpZ = this->GetIndex(trackHists1D, "impParZ");
746  trackHists1D[iImpZ]->Fill(track->dz());
747  static const int iImpZerr = this->GetIndex(trackHists1D, "impParErrZ");
748  trackHists1D[iImpZerr]->Fill(track->dzError());
749 
750  static const int iImpRphi = this->GetIndex(trackHists1D, "impParRphi");
751  trackHists1D[iImpRphi]->Fill(track->d0());
752  static const int iImpRphiErr = this->GetIndex(trackHists1D, "impParErrRphi");
753  trackHists1D[iImpRphiErr]->Fill(track->d0Error());
754 }
bool tidIsZPlusSide(const DetId &id) const
static constexpr auto TID
Definition: SiStripDetId.h:38
const int kBPIX
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
bool tecIsZMinusSide(const DetId &id) const
const TrackerTopology * trackerTopology
Log< level::Error, false > LogError
bool tidIsZMinusSide(const DetId &id) const
math::XYZPoint Point
point in the space
Definition: TrackBase.h:80
static constexpr auto TOB
Definition: SiStripDetId.h:39
Definition: DetId.h:17
unsigned int pxfSide(const DetId &id) const
bool tecIsZPlusSide(const DetId &id) const
static constexpr auto TIB
Definition: SiStripDetId.h:37
const int kFPIX
math::XYZVector Vector
spatial vector
Definition: TrackBase.h:77
static constexpr auto TEC
Definition: SiStripDetId.h:40

◆ fillUsedTrack()

void MillePedeMonitor::fillUsedTrack ( const reco::Track track,
unsigned int  nHitX,
unsigned int  nHitY 
)

Definition at line 575 of file MillePedeMonitor.cc.

References fillTrack(), GetIndex(), myUsedTrackHists1D, myUsedTrackHists2D, and HLT_2024v13_cff::track.

575  {
576  // these hist exist only for 'used track' hists:
577  static const int iUsedX = this->GetIndex(myUsedTrackHists1D, "usedHitsX");
578  myUsedTrackHists1D[iUsedX]->Fill(nHitX);
579  static const int iUsedY = this->GetIndex(myUsedTrackHists1D, "usedHitsY");
580  myUsedTrackHists1D[iUsedY]->Fill(nHitY);
581 
582  if (!track)
583  return;
585 }
std::vector< TH1 * > myUsedTrackHists1D
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)
std::vector< TH2 * > myUsedTrackHists2D
void fillTrack(const reco::Track *track)

◆ GetIndex()

template<class OBJECT_TYPE >
int MillePedeMonitor::GetIndex ( const std::vector< OBJECT_TYPE *> &  vec,
const TString &  name 
)
private

Definition at line 120 of file MillePedeMonitor.h.

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

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

120  {
121  int result = 0;
122  for (typename std::vector<OBJECT_TYPE *>::const_iterator iter = vec.begin(), iterEnd = vec.end(); iter != iterEnd;
123  ++iter, ++result) {
124  if (*iter && (*iter)->GetName() == name)
125  return result;
126  }
127  edm::LogError("Alignment") << "@SUB=MillePedeMonitor::GetIndex"
128  << " could not find " << name;
129  return -1;
130 }
Log< level::Error, false > LogError

◆ indexArray1D()

template<typename T , size_t SIZE>
std::array< int, SIZE > MillePedeMonitor::indexArray1D ( const std::vector< T *> &  hists,
const char *  title 
)
private

Definition at line 164 of file MillePedeMonitor.h.

References GetIndex(), mps_fire::i, mps_fire::result, SIZE, and runGCPTkAlMap::title.

164  {
165  std::array<int, SIZE> result{};
166  for (size_t i = 0; i < SIZE; ++i) {
167  result[i] = this->GetIndex(hists, Form(title, i));
168  }
169  return result;
170 }
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)

◆ indexArray2D()

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 173 of file MillePedeMonitor.h.

References GetIndex(), mps_fire::i, dqmiolumiharvest::j, mps_fire::result, SIZE, and runGCPTkAlMap::title.

174  {
175  std::array<std::array<int, SIZE>, SIZE> result{};
176  for (size_t i = 0; i < SIZE; ++i) {
177  for (size_t j = 0; j < SIZE; ++j) {
178  result[i][j] = this->GetIndex(hists, Form(title, i, j));
179  }
180  }
181  return result;
182 }
int GetIndex(const std::vector< OBJECT_TYPE *> &vec, const TString &name)

◆ init()

bool MillePedeMonitor::init ( TDirectory *  directory)
private

Definition at line 72 of file MillePedeMonitor.cc.

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

Referenced by MillePedeMonitor().

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

Member Data Documentation

◆ myCorrHists

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

Definition at line 113 of file MillePedeMonitor.h.

Referenced by fillCorrelations2D(), and init().

◆ myDeleteDir

bool MillePedeMonitor::myDeleteDir
private

Definition at line 98 of file MillePedeMonitor.h.

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

◆ myDerivHists2D

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

Definition at line 106 of file MillePedeMonitor.h.

Referenced by fillDerivatives(), and init().

◆ myFrame2FrameHists2D

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

Definition at line 112 of file MillePedeMonitor.h.

Referenced by fillFrameToFrame(), and init().

◆ myPxbSurveyHists

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

Definition at line 114 of file MillePedeMonitor.h.

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

◆ myResidHists2D

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

Definition at line 107 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

◆ myResidHistsVec1DX

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

Definition at line 108 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

◆ myResidHistsVec1DY

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 109 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

◆ myResidHitHists1DX

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

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

Definition at line 110 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

◆ myResidHitHists1DY

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

Definition at line 111 of file MillePedeMonitor.h.

Referenced by fillResiduals(), and init().

◆ myRootDir

TDirectory* MillePedeMonitor::myRootDir
private

Definition at line 97 of file MillePedeMonitor.h.

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

◆ myTrackHists1D

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

Definition at line 100 of file MillePedeMonitor.h.

Referenced by fillTrack(), and init().

◆ myTrackHists2D

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

Definition at line 101 of file MillePedeMonitor.h.

Referenced by fillTrack(), and init().

◆ myTrajectoryHists1D

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

Definition at line 104 of file MillePedeMonitor.h.

Referenced by fillRefTrajectory(), and init().

◆ myTrajectoryHists2D

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

Definition at line 105 of file MillePedeMonitor.h.

Referenced by fillRefTrajectory(), and init().

◆ myUsedTrackHists1D

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

Definition at line 102 of file MillePedeMonitor.h.

Referenced by fillUsedTrack(), and init().

◆ myUsedTrackHists2D

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

Definition at line 103 of file MillePedeMonitor.h.

Referenced by fillUsedTrack(), and init().

◆ trackerTopology

const TrackerTopology* MillePedeMonitor::trackerTopology
private

Definition at line 116 of file MillePedeMonitor.h.

Referenced by fillTrack().