CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ShortenedTrackValidation::trackingMon Class Reference

Public Member Functions

void book (const TFileDirectory &fs)
 
unsigned int count2DHits (const reco::Track &track)
 
void fill (const reco::Track &track, const reco::BeamSpot &beamSpot, const reco::Vertex &pvtx)
 
 trackingMon ()
 
int trackQual (const reco::Track &track)
 
 ~trackingMon ()=default
 

Static Public Member Functions

static bool isHit2D (const TrackingRecHit &hit)
 

Private Attributes

TH1D * h_Charge
 
TH1D * h_chi2ndof
 
TH1D * h_d0
 
TH1D * h_d0BS
 
TH1D * h_d0PV
 
TH1D * h_dxy
 
TH1D * h_dxyBS
 
TH1D * h_dxyPV
 
TH1D * h_dz
 
TH1D * h_dzBS
 
TH1D * h_dzPV
 
TH1D * h_Eta
 
TH1D * h_nHit
 
TH1D * h_nHit2D
 
TH1D * h_nhpxb
 
TH1D * h_nhpxe
 
TH1D * h_nhTEC
 
TH1D * h_nhTIB
 
TH1D * h_nhTID
 
TH1D * h_nhTOB
 
TH1D * h_P
 
TH1D * h_Phi
 
TH1D * h_Pt
 
TH1D * h_QoverP
 
TH1D * h_QoverPZoom
 
TH1D * h_trkAlgo
 
TH1D * h_trkOriAlgo
 
TH1D * h_trkQuality
 
TH1D * h_vx
 
TH1D * h_vy
 
TH1D * h_vz
 

Detailed Description

Definition at line 58 of file ShortenedTrackValidation.cc.

Constructor & Destructor Documentation

◆ trackingMon()

ShortenedTrackValidation::trackingMon::trackingMon ( )
inline

Definition at line 60 of file ShortenedTrackValidation.cc.

60 {}

◆ ~trackingMon()

ShortenedTrackValidation::trackingMon::~trackingMon ( )
default

Member Function Documentation

◆ book()

void ShortenedTrackValidation::trackingMon::book ( const TFileDirectory fs)
inline

Definition at line 63 of file ShortenedTrackValidation.cc.

References reco::TrackBase::algoSize, CREATE_HIST_1D, compareTotals::fs, h_Charge, h_chi2ndof, h_d0, h_d0BS, h_d0PV, h_dxy, h_dxyBS, h_dxyPV, h_dz, h_dzBS, h_dzPV, h_Eta, h_nHit, h_nHit2D, h_nhpxb, h_nhpxe, h_nhTEC, h_nhTIB, h_nhTID, h_nhTOB, h_P, h_Phi, h_Pt, h_QoverP, h_QoverPZoom, h_trkAlgo, h_trkOriAlgo, h_trkQuality, h_vx, h_vy, h_vz, and M_PI.

Referenced by ShortenedTrackValidation::beginJob().

63  {
64  h_chi2ndof = CREATE_HIST_1D(h_chi2ndof, 100, 0.0, 10.0, fs);
67  h_trkOriAlgo =
69  h_P = CREATE_HIST_1D(h_P, 100, 0.0, 200.0, fs);
70  h_Pt = CREATE_HIST_1D(h_Pt, 100, 0.0, 100.0, fs);
71  h_nHit = CREATE_HIST_1D(h_nHit, 50, -0.5, 49.5, fs);
72  h_nHit2D = CREATE_HIST_1D(h_nHit2D, 20, -0.5, 19.5, fs);
73  h_Charge = CREATE_HIST_1D(h_Charge, 3, -1.5, 1.5, fs);
74  h_QoverP = CREATE_HIST_1D(h_QoverP, 100, -1.0, 1.0, fs);
75  h_QoverPZoom = CREATE_HIST_1D(h_QoverPZoom, 100, -0.1, 0.1, fs);
76  h_Eta = CREATE_HIST_1D(h_Eta, 100, -3., 3., fs);
77  h_Phi = CREATE_HIST_1D(h_Phi, 100, -M_PI, M_PI, fs);
78  h_vx = CREATE_HIST_1D(h_vx, 100, -0.5, 0.5, fs);
79  h_vy = CREATE_HIST_1D(h_vy, 100, -0.5, 0.5, fs);
80  h_vz = CREATE_HIST_1D(h_vz, 100, -20.0, 20.0, fs);
81  h_d0 = CREATE_HIST_1D(h_d0, 100, -0.5, 0.5, fs);
82  h_dz = CREATE_HIST_1D(h_dz, 100, -20.0, 20.0, fs);
83  h_dxy = CREATE_HIST_1D(h_dxy, 100, -0.5, 0.5, fs);
84  h_nhpxb = CREATE_HIST_1D(h_nhpxb, 10, -0.5, 9.5, fs);
85  h_nhpxe = CREATE_HIST_1D(h_nhpxe, 10, -0.5, 9.5, fs);
86  h_nhTIB = CREATE_HIST_1D(h_nhTIB, 20, -0.5, 19.5, fs);
87  h_nhTID = CREATE_HIST_1D(h_nhTID, 20, -0.5, 19.5, fs);
88  h_nhTOB = CREATE_HIST_1D(h_nhTOB, 20, -0.5, 19.5, fs);
89  h_nhTEC = CREATE_HIST_1D(h_nhTEC, 20, -0.5, 19.5, fs);
90  h_dxyBS = CREATE_HIST_1D(h_dxyBS, 100, -0.05, 0.05, fs);
91  h_d0BS = CREATE_HIST_1D(h_d0BS, 100, -0.05, 0.05, fs);
92  h_dzBS = CREATE_HIST_1D(h_dzBS, 100, -20.0, 20., fs);
93  h_dxyPV = CREATE_HIST_1D(h_dxyPV, 100, -0.05, 0.05, fs);
94  h_d0PV = CREATE_HIST_1D(h_d0PV, 100, -0.05, 0.05, fs);
95  h_dzPV = CREATE_HIST_1D(h_dzPV, 100, -0.05, 0.05, fs);
96 
97  edm::LogInfo("trackingMonitoring") << "done booking";
98  }
#define M_PI
Log< level::Info, false > LogInfo
#define CREATE_HIST_1D(varname, nbins, first, last, fs)

◆ count2DHits()

unsigned int ShortenedTrackValidation::trackingMon::count2DHits ( const reco::Track track)
inline

Definition at line 150 of file ShortenedTrackValidation.cc.

References isHit2D(), and HLT_2024v13_cff::track.

Referenced by fill().

150  {
151  unsigned int nHit2D = 0;
152  for (auto iHit = track.recHitsBegin(); iHit != track.recHitsEnd(); ++iHit) {
153  if (isHit2D(**iHit)) {
154  ++nHit2D;
155  }
156  }
157  return nHit2D;
158  }
static bool isHit2D(const TrackingRecHit &hit)

◆ fill()

void ShortenedTrackValidation::trackingMon::fill ( const reco::Track track,
const reco::BeamSpot beamSpot,
const reco::Vertex pvtx 
)
inline

Definition at line 161 of file ShortenedTrackValidation.cc.

References pwdgSkimBPark_cfi::beamSpot, count2DHits(), h_Charge, h_chi2ndof, h_d0, h_d0BS, h_d0PV, h_dxy, h_dxyBS, h_dxyPV, h_dz, h_dzBS, h_dzPV, h_Eta, h_nHit, h_nHit2D, h_nhpxb, h_nhpxe, h_nhTEC, h_nhTIB, h_nhTID, h_nhTOB, h_P, h_Phi, h_Pt, h_QoverP, h_QoverPZoom, h_trkAlgo, h_trkOriAlgo, h_trkQuality, h_vx, h_vy, h_vz, nanoDQM_cfi::PV, HLT_2024v13_cff::track, trackQual(), reco::Vertex::x(), reco::Vertex::y(), and reco::Vertex::z().

Referenced by ShortenedTrackValidation::analyze().

161  {
162  h_chi2ndof->Fill(track.normalizedChi2());
163  h_trkQuality->Fill(trackQual(track));
164  h_trkAlgo->Fill(static_cast<float>(track.algo()));
165  h_trkOriAlgo->Fill(static_cast<float>(track.originalAlgo()));
166  h_P->Fill(track.p());
167  h_Pt->Fill(track.pt());
168  h_nHit->Fill(track.numberOfValidHits());
169  h_nHit2D->Fill(count2DHits(track));
170  h_Charge->Fill(track.charge());
171  h_QoverP->Fill(track.qoverp());
172  h_QoverPZoom->Fill(track.qoverp());
173  h_Eta->Fill(track.eta());
174  h_Phi->Fill(track.phi());
175  h_vx->Fill(track.vx());
176  h_vy->Fill(track.vy());
177  h_vz->Fill(track.vz());
178  h_d0->Fill(track.d0());
179  h_dz->Fill(track.dz());
180  h_dxy->Fill(track.dxy());
181  h_nhpxb->Fill(track.hitPattern().numberOfValidPixelBarrelHits());
182  h_nhpxe->Fill(track.hitPattern().numberOfValidPixelEndcapHits());
183  h_nhTIB->Fill(track.hitPattern().numberOfValidStripTIBHits());
184  h_nhTID->Fill(track.hitPattern().numberOfValidStripTIDHits());
185  h_nhTOB->Fill(track.hitPattern().numberOfValidStripTOBHits());
186  h_nhTEC->Fill(track.hitPattern().numberOfValidStripTECHits());
187 
188  math::XYZPoint BS(beamSpot.x0(), beamSpot.y0(), beamSpot.z0());
189  h_dxyBS->Fill(track.dxy(BS));
190  h_d0BS->Fill(-track.dxy(BS));
191  h_dzBS->Fill(track.dz(BS));
192 
193  math::XYZPoint PV(pvtx.x(), pvtx.y(), pvtx.z());
194  h_dxyPV->Fill(track.dxy(PV));
195  h_d0PV->Fill(-track.dxy(PV));
196  h_dzPV->Fill(track.dz(PV));
197  }
double z() const
z coordinate
Definition: Vertex.h:134
double x() const
x coordinate
Definition: Vertex.h:130
double y() const
y coordinate
Definition: Vertex.h:132
unsigned int count2DHits(const reco::Track &track)
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Definition: PV.py:1

◆ isHit2D()

static bool ShortenedTrackValidation::trackingMon::isHit2D ( const TrackingRecHit hit)
inlinestatic

Definition at line 118 of file ShortenedTrackValidation.cc.

References hcalRecHitTable_cff::detId, kBPIX, kFPIX, and DetId::Tracker.

Referenced by count2DHits().

118  {
119  if (hit.dimension() < 2) {
120  return false; // some (muon...) stuff really has RecHit1D
121  } else {
122  const DetId detId(hit.geographicalId());
123  if (detId.det() == DetId::Tracker) {
124  if (detId.subdetId() == kBPIX || detId.subdetId() == kFPIX) {
125  return true; // pixel is always 2D
126  } else { // should be SiStrip now
127  if (dynamic_cast<const SiStripRecHit2D *>(&hit))
128  return false; // normal hit
129  else if (dynamic_cast<const SiStripMatchedRecHit2D *>(&hit))
130  return true; // matched is 2D
131  else if (dynamic_cast<const ProjectedSiStripRecHit2D *>(&hit))
132  return false; // crazy hit...
133  else {
134  edm::LogError("UnknownType") << "@SUB=CalibrationTrackSelector::isHit2D"
135  << "Tracker hit not in pixel and neither SiStripRecHit2D nor "
136  << "SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
137  return false;
138  }
139  }
140  } else { // not tracker??
141  edm::LogWarning("DetectorMismatch") << "@SUB=CalibrationTrackSelector::isHit2D"
142  << "Hit not in tracker with 'official' dimension >=2.";
143  return true; // dimension() >= 2 so accept that...
144  }
145  }
146  // never reached...
147  }
const int kBPIX
Log< level::Error, false > LogError
Definition: DetId.h:17
Log< level::Warning, false > LogWarning
const int kFPIX

◆ trackQual()

int ShortenedTrackValidation::trackingMon::trackQual ( const reco::Track track)
inline

Definition at line 101 of file ShortenedTrackValidation.cc.

References reco::TrackBase::goodIterative, reco::TrackBase::highPurity, reco::TrackBase::loose, reco::TrackBase::tight, HLT_2024v13_cff::track, and reco::TrackBase::undefQuality.

Referenced by fill().

101  {
102  int myquality = -99;
104  myquality = -1;
105  if (track.quality(reco::TrackBase::loose))
106  myquality = 0;
107  if (track.quality(reco::TrackBase::tight))
108  myquality = 1;
109  if (track.quality(reco::TrackBase::highPurity))
110  myquality = 2;
112  myquality = 3;
113 
114  return myquality;
115  }

Member Data Documentation

◆ h_Charge

TH1D* ShortenedTrackValidation::trackingMon::h_Charge
private

Definition at line 208 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_chi2ndof

TH1D* ShortenedTrackValidation::trackingMon::h_chi2ndof
private

Definition at line 200 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_d0

TH1D* ShortenedTrackValidation::trackingMon::h_d0
private

Definition at line 216 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_d0BS

TH1D* ShortenedTrackValidation::trackingMon::h_d0BS
private

Definition at line 226 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_d0PV

TH1D* ShortenedTrackValidation::trackingMon::h_d0PV
private

Definition at line 229 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dxy

TH1D* ShortenedTrackValidation::trackingMon::h_dxy
private

Definition at line 218 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dxyBS

TH1D* ShortenedTrackValidation::trackingMon::h_dxyBS
private

Definition at line 225 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dxyPV

TH1D* ShortenedTrackValidation::trackingMon::h_dxyPV
private

Definition at line 228 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dz

TH1D* ShortenedTrackValidation::trackingMon::h_dz
private

Definition at line 217 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dzBS

TH1D* ShortenedTrackValidation::trackingMon::h_dzBS
private

Definition at line 227 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_dzPV

TH1D* ShortenedTrackValidation::trackingMon::h_dzPV
private

Definition at line 230 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_Eta

TH1D* ShortenedTrackValidation::trackingMon::h_Eta
private

Definition at line 211 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nHit

TH1D* ShortenedTrackValidation::trackingMon::h_nHit
private

Definition at line 206 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nHit2D

TH1D* ShortenedTrackValidation::trackingMon::h_nHit2D
private

Definition at line 207 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhpxb

TH1D* ShortenedTrackValidation::trackingMon::h_nhpxb
private

Definition at line 219 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhpxe

TH1D* ShortenedTrackValidation::trackingMon::h_nhpxe
private

Definition at line 220 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhTEC

TH1D* ShortenedTrackValidation::trackingMon::h_nhTEC
private

Definition at line 224 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhTIB

TH1D* ShortenedTrackValidation::trackingMon::h_nhTIB
private

Definition at line 221 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhTID

TH1D* ShortenedTrackValidation::trackingMon::h_nhTID
private

Definition at line 222 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_nhTOB

TH1D* ShortenedTrackValidation::trackingMon::h_nhTOB
private

Definition at line 223 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_P

TH1D* ShortenedTrackValidation::trackingMon::h_P
private

Definition at line 204 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_Phi

TH1D* ShortenedTrackValidation::trackingMon::h_Phi
private

Definition at line 212 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_Pt

TH1D* ShortenedTrackValidation::trackingMon::h_Pt
private

Definition at line 205 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_QoverP

TH1D* ShortenedTrackValidation::trackingMon::h_QoverP
private

Definition at line 209 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_QoverPZoom

TH1D* ShortenedTrackValidation::trackingMon::h_QoverPZoom
private

Definition at line 210 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_trkAlgo

TH1D* ShortenedTrackValidation::trackingMon::h_trkAlgo
private

Definition at line 202 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_trkOriAlgo

TH1D* ShortenedTrackValidation::trackingMon::h_trkOriAlgo
private

Definition at line 203 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_trkQuality

TH1D* ShortenedTrackValidation::trackingMon::h_trkQuality
private

Definition at line 201 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_vx

TH1D* ShortenedTrackValidation::trackingMon::h_vx
private

Definition at line 213 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_vy

TH1D* ShortenedTrackValidation::trackingMon::h_vy
private

Definition at line 214 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().

◆ h_vz

TH1D* ShortenedTrackValidation::trackingMon::h_vz
private

Definition at line 215 of file ShortenedTrackValidation.cc.

Referenced by book(), and fill().