CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrackAnalyzer.h
Go to the documentation of this file.
1 #ifndef TrackAnalyzer_H
2 #define TrackAnalyzer_H
3 //
7 // Original Author: Suchandra Dutta, Giorgia Mila
8 // Created: Thu 28 22:45:30 CEST 2008
9 
10 #include <memory>
11 #include <fstream>
12 #include <unordered_map>
23 
27 
37 
38 class BeamSpot;
39 namespace tadqm {
40  class TrackAnalyzer {
41  public:
47  void initHisto(DQMStore::IBooker& ibooker, const edm::EventSetup&, const edm::ParameterSet&);
48 
49  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track);
50 
51  // Compute and locally store the number of Good vertices found
52  // in the event. This information is used as X-axis value in
53  // the hit-efficiency plots derived from the hit patter. This
54  // ugly design to avoid comuting this very same quantity for
55  // each and every track while in the analyze method. A
56  // redesign of the class is needed in the future.
58  void setBX(const edm::Event&);
59  void setLumi(const edm::Event&, const edm::EventSetup& iSetup);
60 
61  private:
62  void initHistos();
63  void fillHistosForState(const edm::EventSetup& iSetup, const reco::Track& track, std::string sname);
64  void bookHistosForState(std::string sname, DQMStore::IBooker& ibooker);
70  const edm::EventSetup& iSetup,
71  const std::string suffix,
72  bool useInac);
73  void fillHistosForHitProperties(const edm::EventSetup& iSetup, const reco::Track& track, std::string sname);
77  const std::string suffix,
78  const float monitoring,
79  bool useInac);
80 
81  // ----------member data ---------------------------
83 
92 
94 
96 
98 
109  // ADD by Mia
116  // ADD by Mia in order to clean the tracking MEs
117  // do not plot *Theta* and TrackPx* and TrackPy*
120  // ADD by Mia in order to not plot DistanceOfClosestApproach w.r.t. (0,0,0)
121  // the DistanceOfClosestApproach w.r.t. the beam-spot is already shown in DistanceOfClosestApproachToBS
124 
126 
127  // ADD by Mia in order to turnON test MEs
129 
130  //For HI Plots
132 
133  // IP significance plots
135 
136  // Compute the hit-finding efficiency using the HitPattern of
137  // the reconstructed tracks
141  int pvNDOF_;
142  const bool forceSCAL_;
147 
148  struct TkParameterMEs {
150  : TrackP(nullptr),
151  TrackPx(nullptr),
152  TrackPy(nullptr),
153  TrackPz(nullptr),
154  TrackPt(nullptr)
155 
156  ,
157  TrackPxErr(nullptr),
158  TrackPyErr(nullptr),
159  TrackPzErr(nullptr),
160  TrackPtErr(nullptr),
161  TrackPErr(nullptr)
162 
163  ,
164  TrackPtErrVsEta(nullptr)
165 
166  ,
167  TrackQ(nullptr)
168 
169  ,
170  TrackPhi(nullptr),
171  TrackEta(nullptr),
172  TrackTheta(nullptr)
173 
174  ,
175  TrackPhiErr(nullptr),
176  TrackEtaErr(nullptr),
177  TrackThetaErr(nullptr)
178 
179  ,
184 
185  ,
192 
193  ,
200 
201  ,
208 
209  ,
216 
217  ,
221 
222  ,
223  Chi2oNDFVsNHits(nullptr),
224  Chi2oNDFVsPt(nullptr),
225  Chi2oNDFVsEta(nullptr),
226  Chi2oNDFVsPhi(nullptr),
227  Chi2oNDFVsTheta(nullptr)
228 
229  ,
230  Chi2ProbVsEta(nullptr),
231  Chi2ProbVsPhi(nullptr),
232  Chi2ProbVsTheta(nullptr) {}
233 
253 
259 
261 
264 
275 
277 
281 
286 
293 
300 
307 
314 
318 
324 
328  };
329  std::map<std::string, TkParameterMEs> TkParameterMEMap;
330 
336 
341 
348 
355 
362 
369 
372 
373  MonitorElement* NumberOfLayersPerTrack[4] = {nullptr, nullptr, nullptr, nullptr};
374 
378 
379  MonitorElement* NumberOfLayersVsPhiVsEtaPerTrack[5] = {nullptr, nullptr, nullptr, nullptr, nullptr};
380 
384 
390 
394 
431  // TESTING MEs
434 
435  // add by Mia in order to deal w/ LS transitions
438 
439  //new plots for Heavy Ion DQM
449 
450  // IP significance plots
457 
468 
471  };
472  std::map<std::string, TkRecHitsPerSubDetMEs> TkRecHitsPerSubDetMEMap;
473 
474  struct Key {
475  int det;
476  int subdet;
478  explicit Key(int det, int subdet, int monitoring) : det(det), subdet(subdet), monitoring(monitoring){};
479  bool operator==(const Key& other) const {
480  return (det == other.det && subdet == other.subdet && monitoring == other.monitoring);
481  }
482  };
483 
484  struct KeyHasher {
485  std::size_t operator()(const Key& k) const {
486  // 3 bits (0x7) for kind of monitoring (7 kinds at most)
487  // next 8 bits to the subdetector (255 subdetectors at most)
488  // next 8 bits to the detector (255 detectors at most)
489  return (size_t)((k.monitoring & (0x7)) | ((k.subdet & (0xff)) << 3) | ((k.det & (0xff)) << 11));
490  }
491  };
492 
493  std::unordered_map<Key, MonitorElement*, KeyHasher> hits_valid_;
494  std::unordered_map<Key, MonitorElement*, KeyHasher> hits_missing_;
495  std::unordered_map<Key, MonitorElement*, KeyHasher> hits_inactive_;
496  std::unordered_map<Key, MonitorElement*, KeyHasher> hits_bad_;
497  std::unordered_map<Key, MonitorElement*, KeyHasher> hits_total_;
498  unsigned int good_vertices_;
499  unsigned int bx_;
500  float pixel_lumi_;
501  float scal_lumi_;
503  std::string monName[monQuantity::END] = {"", "VsBX", "VsPIXELLUMI", "VsSCALLUMI"};
504 
505  std::string histname; //for naming the histograms according to algorithm used
506  };
507 } // namespace tadqm
508 #endif
MonitorElement * dNdPhi_HighPurity
MonitorElement * NumberOfLostRecHitsPerTrackVsPhi
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
MonitorElement * NumberOfMIRecHitsPerTrackVsTheta
MonitorElement * NumberOfLostRecHitsPerTrackVsEta
std::string monName[monQuantity::END]
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfLayersPerTrack[4]
MonitorElement * ValidFractionVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitsPerTrackVsPt
MonitorElement * NumberOfLostRecHitsPerTrackVsPhi
MonitorElement * LongDCASig
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_total_
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * algorithm
MonitorElement * TrackPt_NegEta_Phi_btw_32_16
MonitorElement * sipDxyToPV
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
MonitorElement * DistanceOfClosestApproach
std::string qualityString_
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: TrackAnalyzer.h:86
MonitorElement * NumberOfMORecHitsPerTrackVsTheta
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * stoppingSource
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
void setBX(const edm::Event &)
MonitorElement * DistanceOfClosestApproachToBSdz
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachError
MonitorElement * Chi2oNDFVsPhi
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * DeltaZToPVZoom
MonitorElement * Chi2oNDFVsNHits
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
MonitorElement * sip2dToPV
dqm::legacy::MonitorElement MonitorElement
Definition: TrackAnalyzer.h:43
MonitorElement * Chi2oNDF
TrackAnalyzer(const edm::ParameterSet &)
MonitorElement * DeltaZToPV
MonitorElement * NumberOfLostRecHitsPerTrack
MonitorElement * NumberOfMIRecHitsPerTrackVsEta
MonitorElement * yPointOfClosestApproach
bool operator==(const Key &other) const
MonitorElement * sipDxyToBS
void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &, const edm::ParameterSet &)
MonitorElement * xPointOfClosestApproach
MonitorElement * DistanceOfClosestApproachErrorVsEta
edm::EDGetTokenT< OnlineLuminosityRecord > metaDataToken_
Definition: TrackAnalyzer.h:88
void fillHistosForLScertification(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * Chi2oNDFVsPt
MonitorElement * TrackPt_NegEta_Phi_btw_16_0
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * TransDCASig
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * DistanceOfClosestApproachVsPhi
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup &iSetup, const std::string suffix, bool useInac)
MonitorElement * Chi2oNDFVsTheta
Key(int det, int subdet, int monitoring)
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachToPVVsPhi
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeometryToken_
Definition: TrackAnalyzer.h:89
int iEvent
Definition: GenABIO.cc:224
MonitorElement * stoppingSourceVSeta
MonitorElement * dNdPt_HighPurity
MonitorElement * NumberOfLayersPerTrackVsTheta
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
Definition: TrackAnalyzer.h:87
MonitorElement * Chi2oNDF_lumiFlag
MonitorElement * stoppingSourceVSphi
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
MonitorElement * NumberOfLayersPerTrackVsTheta
bool doTrackRecHitVsPhiVsEtaPerTrack_
MonitorElement * DistanceOfClosestApproachErrorVsPt
MonitorElement * sip3dToPV
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * xPointOfClosestApproachToPV
MonitorElement * NumberOfMORecHitsPerTrack
MonitorElement * Chi2Prob
MonitorElement * dNhitdPt_HighPurity
unsigned int good_vertices_
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfValidRecHitsPerTrackVsTheta
MonitorElement * NumberOfLostRecHitsPerTrackVsEta
MonitorElement * Chi2ProbVsEta
MonitorElement * TrackPt_PosEta_Phi_btw_16_0
void fillHistosForTrackerSpecific(const reco::Track &track)
std::string stateName_
Definition: TrackAnalyzer.h:97
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
MonitorElement * zPointOfClosestApproachToPV
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_missing_
MonitorElement * NhitVsEta_HighPurity
MonitorElement * DistanceOfClosestApproachVsTheta
MonitorElement * Chi2ProbVsPhi
MonitorElement * NumberOfMIRecHitsPerTrackVsPhi
bool doTrackRecHitVsPtVsEtaPerTrack_
std::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack[5]
MonitorElement * Chi2ProbVsTheta
dqm::legacy::DQMStore DQMStore
Definition: TrackAnalyzer.h:42
MonitorElement * NumberOfMIRecHitsPerTrackVsTheta
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
MonitorElement * zPointOfClosestApproach
edm::ParameterSet const * conf_
Definition: TrackAnalyzer.h:95
MonitorElement * sipDzToPV
MonitorElement * Chi2
MonitorElement * sipDzToBS
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:84
MonitorElement * NumberOfMORecHitsPerTrackVsTheta
edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > transientTrackBuilderToken_
Definition: TrackAnalyzer.h:91
void bookHistosForState(std::string sname, DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachErrorVsPhi
void setLumi(const edm::Event &, const edm::EventSetup &iSetup)
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
MonitorElement * DistanceOfClosestApproachVsEta
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
void setNumberOfGoodVertices(const edm::Event &)
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
MonitorElement * DistanceOfClosestApproachToBS
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_inactive_
std::string TopFolder_
Definition: TrackAnalyzer.h:82
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
MonitorElement * NumberOfMIRecHitsPerTrackVsPhi
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
MonitorElement * NhitVsPhi_HighPurity
MonitorElement * NumberOfRecHitsPerTrack
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:85
MonitorElement * Ptdist_HighPurity
MonitorElement * NumberOfMORecHitsPerTrackVsPhi
MonitorElement * NumberOfMORecHitsPerTrackVsEta
MonitorElement * DistanceOfClosestApproachToPVZoom
MonitorElement * DistanceOfClosestApproachToBSVsEta
MonitorElement * DistanceOfClosestApproachErrorVsDxy
MonitorElement * NumberOfValidRecHitsPerTrack
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_bad_
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
void fillHistosForEfficiencyFromHitPatter(const reco::Track &track, const std::string suffix, const float monitoring, bool useInac)
MonitorElement * AbsDistanceOfClosestApproachToBS
MonitorElement * NumberOfValidRecHitsPerTrackVsTheta
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
MonitorElement * TESTDistanceOfClosestApproachToBS
MonitorElement * yPointOfClosestApproachToPV
void fillHistosForHitProperties(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * oriAlgo
MonitorElement * TrackPt_NegEta_Phi_btw_neg16_neg32
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
MonitorElement * NumberOfMIRecHitsPerTrackVsEta
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * yPointOfClosestApproachVsZ0wrt000
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_valid_
MonitorElement * NumberOfMORecHitsPerTrackVsPt
MonitorElement * dNdEta_HighPurity
bool doTrackLayersVsPhiVsEtaPerTrack_
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
std::size_t operator()(const Key &k) const
MonitorElement * xPointOfClosestApproachVsZ0wrt000
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
MonitorElement * TrackPt_PosEta_Phi_btw_neg16_neg32
MonitorElement * TrackEtaPhiInvertedoutofphase
MonitorElement * NumberOfMIRecHitsPerTrack
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * zPointOfClosestApproachVsPhi
MonitorElement * TrackPt_NegEta_Phi_btw_0_neg16
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachToPV
MonitorElement * NumberOfMORecHitsPerTrackVsEta
MonitorElement * Chi2oNDFVsEta
MonitorElement * NumberOfLostRecHitsPerTrackVsTheta
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * NumberOfMORecHitsPerTrackVsPhi
MonitorElement * DistanceOfClosestApproachToBSVsPhi
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * ValidFractionPerTrack
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopologyToken_
Definition: TrackAnalyzer.h:90
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
MonitorElement * TrackPt_PosEta_Phi_btw_0_neg16
MonitorElement * TrackPt_PosEta_Phi_btw_32_16
MonitorElement * NumberOfLostRecHitsPerTrackVsTheta