CMS 3D CMS Logo

SiStripMonitorTrack.h
Go to the documentation of this file.
1 
2 #ifndef SiStripMonitorTrack_H
3 #define SiStripMonitorTrack_H
4 
5 // system include files
6 #include <memory>
7 #include <fstream>
8 #include <iostream>
9 #include <vector>
10 #include <string>
11 #include <unordered_set>
12 
13 // user include files
23 
27 
35 
40 
43 
45 
50 
51 //******** Single include for the TkMap *************/
53 //***************************************************/
54 
56 
57 class SiStripDCSStatus;
59 class TrackerTopology;
60 
61 //
62 // class declaration
63 //
64 
66 public:
68  enum RecHitType { Single = 0, Matched = 1, Projected = 2, Null = 3 };
69  explicit SiStripMonitorTrack(const edm::ParameterSet&);
70  ~SiStripMonitorTrack() override;
71  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& es) override;
72  void analyze(const edm::Event&, const edm::EventSetup&) override;
73  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
74 
75 private:
77 
78  struct Det2MEs;
79 
80  //booking
81  void book(DQMStore::IBooker&, const TrackerTopology* tTopo, const TkDetMap* tkDetMap);
82  void bookModMEs(DQMStore::IBooker&, const uint32_t);
83  void bookLayerMEs(DQMStore::IBooker&, const uint32_t, std::string&);
84  void bookRing(DQMStore::IBooker&, const uint32_t, std::string&);
86  void bookRingMEs(DQMStore::IBooker&, const uint32_t, std::string&);
88  MonitorElement* bookME1D(DQMStore::IBooker&, const char*, const char*);
89  MonitorElement* bookME2D(DQMStore::IBooker&, const char*, const char*);
90  MonitorElement* bookME3D(DQMStore::IBooker&, const char*, const char*);
91  MonitorElement* bookMEProfile(DQMStore::IBooker&, const char*, const char*);
93  // internal evaluation of monitorables
94  void AllClusters(const edm::Event& ev, const edm::EventSetup& es);
96  const edm::DetSetVector<SiStripDigi>& digilist,
97  const edm::Event& ev,
98  const edm::EventSetup& es);
100  const edm::DetSetVector<SiStripDigi>& digilist,
101  const edm::Event& ev,
102  const edm::EventSetup& es);
103  void trajectoryStudy(const reco::Track& track,
104  const edm::DetSetVector<SiStripDigi>& digilist,
105  const edm::Event& ev,
106  const edm::EventSetup& es,
107  bool track_ok);
108  void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
109  bool trackFilter(const reco::Track& track);
110  // LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
111  void hitStudy(const edm::Event& ev,
112  const edm::EventSetup& es,
113  const edm::DetSetVector<SiStripDigi>& digilist,
114  const ProjectedSiStripRecHit2D* projhit,
115  const SiStripMatchedRecHit2D* matchedhit,
116  const SiStripRecHit2D* hit2D,
117  const SiStripRecHit1D* hit1D,
118  LocalVector localMomentum,
119  const bool track_ok);
120  bool clusterInfos(SiStripClusterInfo* cluster,
121  const uint32_t detid,
122  enum ClusterFlags flags,
123  bool track_ok,
124  LocalVector LV,
125  const Det2MEs& MEs,
126  const TrackerTopology* tTopo,
127  const SiStripGain* stripGain,
128  const SiStripQuality* stripQuality,
129  const edm::DetSetVector<SiStripDigi>& digilist,
130  float clustZ,
131  float clustPhi);
132  template <class T>
133  void RecHitInfo(const T* tkrecHit,
134  LocalVector LV,
135  const edm::DetSetVector<SiStripDigi>& digilist,
136  const edm::Event& ev,
137  const edm::EventSetup& es,
138  bool track_ok);
139 
140  bool fillControlViewHistos(const edm::Event& ev, const edm::EventSetup& es);
141  void return2DME(MonitorElement* input1, MonitorElement* input2, int binx, int biny, double value);
142 
143  // fill monitorables
144  // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
145  // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
146 
147  inline void fillME(MonitorElement* ME, float value1) {
148  if (ME != nullptr)
149  ME->Fill(value1);
150  }
151  inline void fillME(MonitorElement* ME, float value1, float value2) {
152  if (ME != nullptr)
153  ME->Fill(value1, value2);
154  }
155  inline void fillME(MonitorElement* ME, float value1, float value2, float value3) {
156  if (ME != nullptr)
157  ME->Fill(value1, value2, value3);
158  }
159  inline void fillME(MonitorElement* ME, float value1, float value2, float value3, float value4) {
160  if (ME != nullptr)
161  ME->Fill(value1, value2, value3, value4);
162  }
163 
164  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
165 
166  // ----------member data ---------------------------
167 private:
172 
174 
177 
180 
182 
183  //******* TkHistoMaps*/
189  //******** TkHistoMaps*/
191 
192  struct ModMEs {
203  };
204 
205  struct LayerMEs {
207  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
208  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
209  MonitorElement* ClusterChargeOnTrack = nullptr;
210  MonitorElement* ClusterChargeOffTrack = nullptr;
211  MonitorElement* ClusterChargeRawOnTrack = nullptr;
212  MonitorElement* ClusterChargeRawOffTrack = nullptr;
213  MonitorElement* ClusterNoiseOnTrack = nullptr;
214  MonitorElement* ClusterNoiseOffTrack = nullptr;
215  MonitorElement* ClusterWidthOnTrack = nullptr;
216  MonitorElement* ClusterWidthOffTrack = nullptr;
217  MonitorElement* ClusterPosOnTrack = nullptr;
218  MonitorElement* ClusterPosOnTrack2D = nullptr;
219  MonitorElement* ClusterPosOffTrack = nullptr;
221  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
222  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
223  };
224  struct RingMEs {
226  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
227  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
228  MonitorElement* ClusterChargeOnTrack = nullptr;
229  MonitorElement* ClusterChargeOffTrack = nullptr;
230  MonitorElement* ClusterChargeRawOnTrack = nullptr;
231  MonitorElement* ClusterChargeRawOffTrack = nullptr;
232  MonitorElement* ClusterNoiseOnTrack = nullptr;
233  MonitorElement* ClusterNoiseOffTrack = nullptr;
234  MonitorElement* ClusterWidthOnTrack = nullptr;
235  MonitorElement* ClusterWidthOffTrack = nullptr;
236  MonitorElement* ClusterPosOnTrack = nullptr;
237  MonitorElement* ClusterPosOnTrack2D = nullptr;
238  MonitorElement* ClusterPosOffTrack = nullptr;
240  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
241  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
242  };
243  struct SubDetMEs {
244  int totNClustersOnTrack = 0;
245  int totNClustersOffTrack = 0;
246  MonitorElement* nClustersOnTrack = nullptr;
247  MonitorElement* nClustersTrendOnTrack = nullptr;
248  MonitorElement* nClustersOffTrack = nullptr;
249  MonitorElement* nClustersTrendOffTrack = nullptr;
251  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
252  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
253  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
254  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
255  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
256  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
257  MonitorElement* ClusterChargeOnTrack = nullptr;
258  MonitorElement* ClusterChargeOffTrack = nullptr;
259  MonitorElement* ClusterChargeRawOnTrack = nullptr;
260  MonitorElement* ClusterChargeRawOffTrack = nullptr;
261  MonitorElement* ClusterStoNOffTrack = nullptr;
263  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
264  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
265  };
266  std::map<std::string, ModMEs> ModMEsMap;
267  std::map<std::string, LayerMEs> LayerMEsMap;
268  std::map<std::string, RingMEs> RingMEsMap;
269  std::map<std::string, SubDetMEs> SubDetMEsMap;
270 
271  struct Det2MEs {
272  struct LayerMEs* iLayer;
273  struct RingMEs* iRing;
275  };
276 
279 
282 
286 
287  bool Mod_On_;
288  bool Trend_On_;
291  bool ring_flag;
294 
297 
298  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
303 
309 
313 
314  // control view plots
324 
330 };
331 #endif
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID
std::unique_ptr< TkHistoMap > tkhisto_NoiseOffTrack
void return2DME(MonitorElement *input1, MonitorElement *input2, int binx, int biny, double value)
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
MonitorElement * ClusterStoNCorr_OnTrack_TECP
MonitorElement * ClusterChargePerCMfromTrack
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
void fillME(MonitorElement *ME, float value1, float value2, float value3)
SiStripMonitorTrack(const edm::ParameterSet &)
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromOrigin
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void fillME(MonitorElement *ME, float value1)
SiStripDCSStatus * dcsStatus_
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
math::XYZTLorentzVectorD LV
edm::ESWatcher< TrackerTopologyRcd > watchertTopo_
std::map< std::string, RingMEs > RingMEsMap
edm::ParameterSet conf_
bool clusterInfos(SiStripClusterInfo *cluster, const uint32_t detid, enum ClusterFlags flags, bool track_ok, LocalVector LV, const Det2MEs &MEs, const TrackerTopology *tTopo, const SiStripGain *stripGain, const SiStripQuality *stripQuality, const edm::DetSetVector< SiStripDigi > &digilist, float clustZ, float clustPhi)
unsigned long long EventNumber_t
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
bool ev
Provides a code based selection for trigger and DCS information in order to have no failing filters i...
bool trackFilter(const reco::Track &track)
edm::ESHandle< SiStripDetCabling > SiStripDetCabling_
void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string &)
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECM
void fillME(MonitorElement *ME, float value1, float value2)
#define input2
Definition: AMPTWrapper.h:159
void Fill(long long x)
edm::ESHandle< TrackerGeometry > tkgeom_
Definition: ME.h:11
MonitorElement * ClusterCount_OnTrack_FECCratevsFECSlot
void fillME(MonitorElement *ME, float value1, float value2, float value3, float value4)
MonitorElement * ClusterStoNCorr_OnTrack_TOB
edm::EventNumber_t eventNb
TrackingRecHit::ConstRecHitPointer ConstRecHitPointer
std::unordered_set< const SiStripCluster * > vPSiStripCluster
void bookRing(DQMStore::IBooker &, const uint32_t, std::string &)
std::map< std::string, SubDetMEs > SubDetMEsMap
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromTrack
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
const SiStripQuality * stripQuality_
edm::ESWatcher< SiStripGainRcd > watcherStripGain_
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
#define input1
Definition: AMPTWrapper.h:139
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &es) override
void book(DQMStore::IBooker &, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
Definition: value.py:1
std::unique_ptr< TkHistoMap > tkhisto_NumOffTrack
MonitorElement * ClusterChargePerCMfromOrigin
SiStripFolderOrganizer folderOrganizer_
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TOB
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > digiToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECM
void trackStudyFromTrajectory(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es)
void bookModMEs(DQMStore::IBooker &, const uint32_t)
MonitorElement * ClusterStoNCorr_OnTrack_FECCratevsFECSlot
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOffTrack
void hitStudy(const edm::Event &ev, const edm::EventSetup &es, const edm::DetSetVector< SiStripDigi > &digilist, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
const SiStripGain * stripGain_
std::map< std::string, ModMEs > ModMEsMap
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es)
std::unique_ptr< TkHistoMap > tkhisto_StoNCorrOnTrack
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterStoNCorr_OnTrack_TIBTID
GenericTriggerEventFlag * genTriggerEventFlag_
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumMissingHits
std::unique_ptr< TkHistoMap > tkhisto_NoiseOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumberValidHits
std::unique_ptr< TkHistoMap > tkhisto_NumOnTrack
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, const char *)
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID
std::unique_ptr< TkHistoMap > tkhisto_NumberInactiveHits
edm::ParameterSet Parameters
const TrackerTopology * tTopo_
long double T
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
void analyze(const edm::Event &, const edm::EventSetup &) override
void trajectoryStudy(const reco::Track &track, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TECP
Definition: Run.h:45
bool fillControlViewHistos(const edm::Event &ev, const edm::EventSetup &es)
MonitorElement * ClusterStoNCorr_OnTrack_TECM
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap