CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackAnalyzer.h
Go to the documentation of this file.
1 #ifndef TrackAnalyzer_H
2 #define TrackAnalyzer_H
3 // -*- C++ -*-
4 //
5 //
9 // Original Author: Suchandra Dutta, Giorgia Mila
10 // Created: Thu 28 22:45:30 CEST 2008
11 
12 #include <memory>
13 #include <fstream>
14 #include <unordered_map>
24 
28 
31 
32 class DQMStore;
33 
34 class BeamSpot;
36 {
37  public:
40  virtual ~TrackAnalyzer();
41  virtual void initHisto(DQMStore::IBooker & ibooker, const edm::EventSetup &);
42 
43  virtual void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup, const reco::Track& track);
44 
45  void doSoftReset (DQMStore * dqmStore_);
46  void doReset ();
47  void undoSoftReset(DQMStore * dqmStore_);
48  void setLumiFlag();
49  // Compute and locally store the number of Good vertices found
50  // in the event. This information is used as X-axis value in
51  // the hit-efficiency plots derived from the hit patter. This
52  // ugly design to avoid comuting this very same quantity for
53  // each and every track while in the analyze method. A
54  // redesign of the class is needed in the future.
55  void setNumberOfGoodVertices(const edm::Event &);
56  void setBX(const edm::Event &);
57  void setLumi(const edm::Event &, const edm::EventSetup& iSetup);
58 
59  private:
60  void initHistos();
61  void fillHistosForState(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
62  void bookHistosForState(std::string sname,DQMStore::IBooker & ibooker);
68  void fillHistosForHitProperties(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
69  void fillHistosForLScertification(const edm::EventSetup& iSetup, const reco::Track & track, std::string sname);
70  void fillHistosForTrackerSpecific(const reco::Track & track);
71  void fillHistosForEfficiencyFromHitPatter(const reco::Track & track, const std::string suffix, const float monitoring);
72 
73  // ----------member data ---------------------------
75 
81 
83 
86  bool doBSPlots_;
87  bool doPVPlots_;
94  // ADD by Mia
101  // ADD by Mia in order to clean the tracking MEs
102  // do not plot *Theta* and TrackPx* and TrackPy*
105  // ADD by Mia in order to not plot DistanceOfClosestApproach w.r.t. (0,0,0)
106  // the DistanceOfClosestApproach w.r.t. the beam-spot is already shown in DistanceOfClosestApproachToBS
109 
111 
112  // ADD by Mia in order to turnON test MEs
114 
115  //For HI Plots
117 
118  // IP significance plots
120 
121  // Compute the hit-finding efficiency using the HitPattern of
122  // the reconstructed tracks
126  int pvNDOF_;
131 
132  struct TkParameterMEs {
134  TrackP(NULL)
135  , TrackPx(NULL)
136  , TrackPy(NULL)
137  , TrackPz(NULL)
138  , TrackPt(NULL)
139 
140  , TrackPxErr(NULL)
141  , TrackPyErr(NULL)
142  , TrackPzErr(NULL)
143  , TrackPtErr(NULL)
144  , TrackPErr(NULL)
145 
147 
148  , TrackQ(NULL)
149 
150  , TrackPhi(NULL)
151  , TrackEta(NULL)
152  , TrackTheta(NULL)
153 
154  , TrackPhiErr(NULL)
155  , TrackEtaErr(NULL)
157 
162 
169 
176 
183 
190 
194 
198 
202  {}
203 
209 
215 
217 
219 
225 
227 
231 
236 
243 
250 
257 
264 
268 
272 
276 
277  };
278  std::map<std::string, TkParameterMEs> TkParameterMEMap;
279 
280 
286 
287 
292 
299 
306 
313 
320 
323 
324 
325  MonitorElement* NumberOfLayersPerTrack[4] = {nullptr,nullptr,nullptr,nullptr};
326 
330 
331  MonitorElement* NumberOfLayersVsPhiVsEtaPerTrack[4]= {nullptr,nullptr,nullptr,nullptr};
332 
336 
340 
344 
371  // TESTING MEs
374 
375  // add by Mia in order to deal w/ LS transitions
378 
379  //new plots for Heavy Ion DQM
389 
390  // IP significance plots
397 
405 
408  };
409  std::map<std::string, TkRecHitsPerSubDetMEs> TkRecHitsPerSubDetMEMap;
410 
411  struct Key {
412  int det;
413  int subdet;
415  explicit Key(int det, int subdet,int monitoring):det(det),subdet(subdet),monitoring(monitoring){};
416  bool operator==(const Key & other) const {
417  return (det == other.det && subdet == other.subdet && monitoring == other.monitoring);
418  }
419  };
420 
421  struct KeyHasher {
422  std::size_t operator()(const Key& k) const {
423  // 3 bits (0x7) for kind of monitoring (7 kinds at most)
424  // next 8 bits to the subdetector (255 subdetectors at most)
425  // next 8 bits to the detector (255 detectors at most)
426  return (size_t)(
427  (k.monitoring & (0x7)) |
428  ((k.subdet & (0xff)) << 3) |
429  ((k.det & (0xff)) << 11));
430  }
431  };
432 
433  std::unordered_map<Key, MonitorElement *, KeyHasher> hits_valid_;
434  std::unordered_map<Key, MonitorElement *, KeyHasher> hits_missing_;
435  std::unordered_map<Key, MonitorElement *, KeyHasher> hits_inactive_;
436  std::unordered_map<Key, MonitorElement *, KeyHasher> hits_bad_;
437  std::unordered_map<Key, MonitorElement *, KeyHasher> hits_total_;
438  unsigned int good_vertices_;
439  unsigned int bx_;
440  float pixel_lumi_;
441  float scal_lumi_;
442  enum monQuantity {
448  };
449  std::string monName[monQuantity::END] = { "", "VsBX", "VsPIXELLUMI", "VsSCALLUMI" };
450 
451  std::string histname; //for naming the histograms according to algorithm used
452 };
453 #endif
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * stoppingSourceVSphi
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * Chi2ProbVsPhi
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * NumberOfLostRecHitsPerTrackVsPhi
MonitorElement * DistanceOfClosestApproachToPVVsPhi
MonitorElement * NumberOfLostRecHitsPerTrackVsEta
MonitorElement * NumberOfLostRecHitsPerTrackVsEta
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
bool doTrackerSpecific_
Definition: TrackAnalyzer.h:84
MonitorElement * ValidFractionVsPhiVsEtaPerTrack
MonitorElement * dNhitdPt_HighPurity
void fillHistosForTrackerSpecific(const reco::Track &track)
MonitorElement * NumberOfRecHitsPerTrackVsEta
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_valid_
void bookHistosForLScertification(DQMStore::IBooker &ibooker)
MonitorElement * stoppingSourceVSeta
MonitorElement * NumberOfLostRecHitsPerTrackVsTheta
std::size_t operator()(const Key &k) const
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_bad_
MonitorElement * NumberOfValidRecHitsPerTrack
Key(int det, int subdet, int monitoring)
void fillHistosForHitProperties(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * Chi2oNDF_lumiFlag
MonitorElement * xPointOfClosestApproachToPV
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * sip3dToPV
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfLostRecHitsPerTrack
edm::ParameterSet conf_
Definition: TrackAnalyzer.h:82
MonitorElement * NumberOfMORecHitsPerTrackVsPt
bool doGeneralPropertiesPlots_
Definition: TrackAnalyzer.h:89
void fillHistosForLScertification(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * Chi2oNDFVsPhi
MonitorElement * Chi2ProbVsPhi
MonitorElement * NumberOfMIRecHitsPerTrackVsPhi
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitsPerTrackVsPt
MonitorElement * DistanceOfClosestApproachVsPhi
#define NULL
Definition: scimark2.h:8
bool doEffFromHitPatternVsBX_
MonitorElement * sipDzToBS
std::map< std::string, TkParameterMEs > TkParameterMEMap
MonitorElement * NumberOfLayersPerTrack[4]
MonitorElement * NhitVsPhi_HighPurity
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * algorithm
bool doHitPropertiesPlots_
Definition: TrackAnalyzer.h:91
MonitorElement * DistanceOfClosestApproach
bool doRecHitVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:92
MonitorElement * NumberOfLayersPerTrackVsTheta
bool doRecHitVsPtVsEtaPerTrack_
Definition: TrackAnalyzer.h:93
MonitorElement * NumberOfRecHitsPerTrack_lumiFlag
std::map< std::string, TkRecHitsPerSubDetMEs > TkRecHitsPerSubDetMEMap
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
bool doMeasurementStatePlots_
Definition: TrackAnalyzer.h:90
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
MonitorElement * NumberOfRecHitsPerTrack
MonitorElement * Ptdist_HighPurity
void setLumi(const edm::Event &, const edm::EventSetup &iSetup)
bool doTrackRecHitVsPtVsEtaPerTrack_
Definition: TrackAnalyzer.h:97
MonitorElement * NumberOfLayersVsPhiVsEtaPerTrack[4]
MonitorElement * NumberOfMIRecHitsPerTrackVsEta
MonitorElement * TESTDistanceOfClosestApproachToBSVsPhi
void fillHistosForEfficiencyFromHitPatter(const reco::Track &track, const std::string suffix, const float monitoring)
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_total_
bool doTrack2DChi2Plots_
Definition: TrackAnalyzer.h:99
MonitorElement * Chi2ProbVsTheta
MonitorElement * Chi2oNDFVsEta
MonitorElement * TransDCASig
int iEvent
Definition: GenABIO.cc:230
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * xPointOfClosestApproachVsZ0wrt000
std::string qualityString_
MonitorElement * oriAlgo
bool doDCAwrt000Plots_
bool doEffFromHitPatternVsPU_
MonitorElement * NumberOfRecHitsPerTrackVsTheta
MonitorElement * NumberOfLostRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMIRecHitsPerTrackVsPt
MonitorElement * NumberOfMIRecHitVsPhiVsEtaPerTrack
MonitorElement * xPointOfClosestApproach
MonitorElement * Chi2oNDFVsTheta
MonitorElement * NumberOfMIRecHitsPerTrack
bool doTrackLayersVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:98
MonitorElement * NumberOfValidRecHitsPerTrackVsEta
MonitorElement * NumberOfRecHitsPerTrackVsPhi
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
MonitorElement * dNdPt_HighPurity
void setBX(const edm::Event &)
std::string TopFolder_
Definition: TrackAnalyzer.h:74
MonitorElement * xPointOfClosestApproachVsZ0wrtBS
MonitorElement * NumberOfValidRecHitsPerTrackVsPhi
MonitorElement * dNdPhi_HighPurity
MonitorElement * NumberOfLostRecHitsPerTrackVsTheta
MonitorElement * NumberOfValidRecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMIRecHitsPerTrackVsPhi
MonitorElement * yPointOfClosestApproachToPV
MonitorElement * Chi2ProbVsTheta
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * NumberOfMORecHitsPerTrackVsTheta
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
MonitorElement * sip2dToPV
MonitorElement * NumberOfMORecHitsPerTrackVsEta
MonitorElement * Chi2oNDFVsTheta
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_inactive_
MonitorElement * sipDzToPV
MonitorElement * sipDxyToBS
MonitorElement * TrackThetaErr
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
bool operator==(const Key &other) const
void bookHistosForHitProperties(DQMStore::IBooker &ibooker)
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachVsEta
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
MonitorElement * zPointOfClosestApproachVsPhi
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * dNdEta_HighPurity
MonitorElement * NumberOfLayersPerTrackVsTheta
void bookHistosForTrackerSpecific(DQMStore::IBooker &ibooker)
MonitorElement * stoppingSource
void fillHistosForState(const edm::EventSetup &iSetup, const reco::Track &track, std::string sname)
MonitorElement * Chi2
virtual ~TrackAnalyzer()
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * NumberOfValidRecHitsPerTrackVsTheta
edm::EDGetTokenT< reco::BeamSpot > beamSpotToken_
Definition: TrackAnalyzer.h:76
MonitorElement * sipDxyToPV
virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup, const reco::Track &track)
bool doEffFromHitPatternVsLUMI_
MonitorElement * xPointOfClosestApproachVsZ0wrtPV
MonitorElement * NumberOfMORecHitsPerTrackVsTheta
MonitorElement * yPointOfClosestApproachVsZ0wrtBS
MonitorElement * NumberOfMIRecHitVsPtVsEtaPerTrack
MonitorElement * NumberOfMORecHitsPerTrackVsPhi
std::unordered_map< Key, MonitorElement *, KeyHasher > hits_missing_
int minNumberOfPixelsPerCluster_
MonitorElement * DistanceOfClosestApproachVsTheta
void bookHistosForBeamSpot(DQMStore::IBooker &ibooker)
MonitorElement * NumberOfLayersPerTrackVsEta
MonitorElement * NumberOfMIRecHitsPerTrackVsTheta
MonitorElement * Chi2ProbVsEta
MonitorElement * NumberOfMORecHitVsPtVsEtaPerTrack
MonitorElement * zPointOfClosestApproachToPV
MonitorElement * NumberOfLostRecHitsPerTrackVsPt
edm::EDGetTokenT< edmNew::DetSetVector< SiPixelCluster > > pixelClustersToken_
Definition: TrackAnalyzer.h:78
MonitorElement * DistanceOfClosestApproachToPV
MonitorElement * NumberOfValidRecHitsPerTrackVsPt
bool doTrackPxPyPlots_
MonitorElement * NumberOfRecHitVsPhiVsEtaPerTrack
MonitorElement * DistanceOfClosestApproachToBSVsPhi
bool doLayersVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:95
unsigned int bx_
MonitorElement * ValidFractionPerTrack
MonitorElement * NhitVsEta_HighPurity
void doSoftReset(DQMStore *dqmStore_)
bool doTrackRecHitVsPhiVsEtaPerTrack_
Definition: TrackAnalyzer.h:96
MonitorElement * NumberOfMORecHitsPerTrackVsPhi
MonitorElement * yPointOfClosestApproachVsZ0wrt000
unsigned int good_vertices_
MonitorElement * TrackPtErrVsEta
MonitorElement * TESTDistanceOfClosestApproachToBS
virtual void initHisto(DQMStore::IBooker &ibooker, const edm::EventSetup &)
MonitorElement * NumberOfMIRecHitsPerTrackVsTheta
MonitorElement * NumberOfRecHitsPerTrackVsEta
MonitorElement * NumberOfValidRecHitsPerTrackVsTheta
void bookHistosForState(std::string sname, DQMStore::IBooker &ibooker)
MonitorElement * yPointOfClosestApproach
MonitorElement * NumberOfMIRecHitsPerTrackVsEta
float minPixelClusterCharge_
bool doRecHitsPerTrackProfile_
MonitorElement * Chi2Prob
edm::EDGetTokenT< LumiScalersCollection > lumiscalersToken_
Definition: TrackAnalyzer.h:79
MonitorElement * TrackEtaPhiOuter
MonitorElement * yPointOfClosestApproachVsZ0wrtPV
void setNumberOfGoodVertices(const edm::Event &)
void bookHistosForEfficiencyFromHitPatter(DQMStore::IBooker &ibooker, const edm::EventSetup &iSetup, const std::string suffix)
MonitorElement * AbsDistanceOfClosestApproachToBS
MonitorElement * zPointOfClosestApproach
TrackAnalyzer(const edm::ParameterSet &)
MonitorElement * NumberOfLostRecHitsPerTrackVsPhi
float lumi_factor_per_bx_
Definition: TrackAnalyzer.h:80
MonitorElement * Chi2ProbVsEta
MonitorElement * NumberOfLostRecHitVsPtVsEtaPerTrack
MonitorElement * TrackEtaPhiInner
MonitorElement * NumberOfMORecHitsPerTrackVsEta
MonitorElement * DistanceOfClosestApproachToBS
std::string monName[monQuantity::END]
MonitorElement * Chi2oNDF
std::string histname
MonitorElement * Chi2oNDFVsEta
MonitorElement * NumberOfValidRecHitVsPtVsEtaPerTrack
void undoSoftReset(DQMStore *dqmStore_)
MonitorElement * NumberOfMORecHitVsPhiVsEtaPerTrack
MonitorElement * NumberOfMORecHitsPerTrack
MonitorElement * NumberOfLayersPerTrackVsPhi
MonitorElement * LongDCASig
edm::EDGetTokenT< reco::VertexCollection > pvToken_
Definition: TrackAnalyzer.h:77
MonitorElement * Chi2oNDFVsPhi