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 
44 
46 
47 //******** Single include for the TkMap *************/
49 //***************************************************/
50 
52 
53 class SiStripDCSStatus;
55 class TrackerTopology;
56 
57 //
58 // class declaration
59 //
60 
62 public:
64  enum RecHitType { Single = 0, Matched = 1, Projected = 2, Null = 3 };
65  explicit SiStripMonitorTrack(const edm::ParameterSet&);
66  ~SiStripMonitorTrack() override;
67  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& es) override;
68  void analyze(const edm::Event&, const edm::EventSetup&) override;
69  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
70 
71 private:
73 
74  struct Det2MEs;
75 
76  //booking
77  void book(DQMStore::IBooker&, const TrackerTopology* tTopo, const TkDetMap* tkDetMap);
78  void bookModMEs(DQMStore::IBooker&, const uint32_t);
79  void bookLayerMEs(DQMStore::IBooker&, const uint32_t, std::string&);
80  void bookRing(DQMStore::IBooker&, const uint32_t, std::string&);
82  void bookRingMEs(DQMStore::IBooker&, const uint32_t, std::string&);
84  MonitorElement* bookME1D(DQMStore::IBooker&, const char*, const char*);
85  MonitorElement* bookME2D(DQMStore::IBooker&, const char*, const char*);
86  MonitorElement* bookME3D(DQMStore::IBooker&, const char*, const char*);
87  MonitorElement* bookMEProfile(DQMStore::IBooker&, const char*, const char*);
89  // internal evaluation of monitorables
90  void AllClusters(const edm::Event& ev, const edm::EventSetup& es);
92  const edm::DetSetVector<SiStripDigi>& digilist,
93  const edm::Event& ev,
94  const edm::EventSetup& es);
96  const edm::DetSetVector<SiStripDigi>& digilist,
97  const edm::Event& ev,
98  const edm::EventSetup& es);
99  void trajectoryStudy(const reco::Track& track,
100  const edm::DetSetVector<SiStripDigi>& digilist,
101  const edm::Event& ev,
102  const edm::EventSetup& es,
103  bool track_ok);
104  void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
105  bool trackFilter(const reco::Track& track);
106  // LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
107  void hitStudy(const edm::Event& ev,
108  const edm::EventSetup& es,
109  const edm::DetSetVector<SiStripDigi>& digilist,
110  const ProjectedSiStripRecHit2D* projhit,
111  const SiStripMatchedRecHit2D* matchedhit,
112  const SiStripRecHit2D* hit2D,
113  const SiStripRecHit1D* hit1D,
114  LocalVector localMomentum,
115  const bool track_ok);
116  bool clusterInfos(SiStripClusterInfo* cluster,
117  const uint32_t detid,
118  enum ClusterFlags flags,
119  bool track_ok,
120  LocalVector LV,
121  const Det2MEs& MEs,
122  const TrackerTopology* tTopo,
123  const SiStripGain* stripGain,
124  const SiStripQuality* stripQuality,
125  const edm::DetSetVector<SiStripDigi>& digilist,
126  float clustZ,
127  float clustPhi);
128  template <class T>
129  void RecHitInfo(const T* tkrecHit,
130  LocalVector LV,
131  const edm::DetSetVector<SiStripDigi>& digilist,
132  const edm::Event& ev,
133  const edm::EventSetup& es,
134  bool track_ok);
135 
136  bool fillControlViewHistos(const edm::Event& ev, const edm::EventSetup& es);
137  void return2DME(MonitorElement* input1, MonitorElement* input2, int binx, int biny, double value);
138 
139  // fill monitorables
140  // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
141  // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
142 
143  inline void fillME(MonitorElement* ME, float value1) {
144  if (ME != nullptr)
145  ME->Fill(value1);
146  }
147  inline void fillME(MonitorElement* ME, float value1, float value2) {
148  if (ME != nullptr)
149  ME->Fill(value1, value2);
150  }
151  inline void fillME(MonitorElement* ME, float value1, float value2, float value3) {
152  if (ME != nullptr)
153  ME->Fill(value1, value2, value3);
154  }
155  inline void fillME(MonitorElement* ME, float value1, float value2, float value3, float value4) {
156  if (ME != nullptr)
157  ME->Fill(value1, value2, value3, value4);
158  }
159 
160  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
161 
162  // ----------member data ---------------------------
163 private:
168 
170 
171  //******* TkHistoMaps*/
177  //******** TkHistoMaps*/
179 
180  struct ModMEs {
191  };
192 
193  struct LayerMEs {
195  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
196  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
197  MonitorElement* ClusterChargeOnTrack = nullptr;
198  MonitorElement* ClusterChargeOffTrack = nullptr;
199  MonitorElement* ClusterChargeRawOnTrack = nullptr;
200  MonitorElement* ClusterChargeRawOffTrack = nullptr;
201  MonitorElement* ClusterNoiseOnTrack = nullptr;
202  MonitorElement* ClusterNoiseOffTrack = nullptr;
203  MonitorElement* ClusterWidthOnTrack = nullptr;
204  MonitorElement* ClusterWidthOffTrack = nullptr;
205  MonitorElement* ClusterPosOnTrack = nullptr;
206  MonitorElement* ClusterPosOnTrack2D = nullptr;
207  MonitorElement* ClusterPosOffTrack = nullptr;
209  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
210  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
211  };
212  struct RingMEs {
214  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
215  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
216  MonitorElement* ClusterChargeOnTrack = nullptr;
217  MonitorElement* ClusterChargeOffTrack = nullptr;
218  MonitorElement* ClusterChargeRawOnTrack = nullptr;
219  MonitorElement* ClusterChargeRawOffTrack = nullptr;
220  MonitorElement* ClusterNoiseOnTrack = nullptr;
221  MonitorElement* ClusterNoiseOffTrack = nullptr;
222  MonitorElement* ClusterWidthOnTrack = nullptr;
223  MonitorElement* ClusterWidthOffTrack = nullptr;
224  MonitorElement* ClusterPosOnTrack = nullptr;
225  MonitorElement* ClusterPosOnTrack2D = nullptr;
226  MonitorElement* ClusterPosOffTrack = nullptr;
228  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
229  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
230  };
231  struct SubDetMEs {
232  int totNClustersOnTrack = 0;
233  int totNClustersOffTrack = 0;
234  MonitorElement* nClustersOnTrack = nullptr;
235  MonitorElement* nClustersTrendOnTrack = nullptr;
236  MonitorElement* nClustersOffTrack = nullptr;
237  MonitorElement* nClustersTrendOffTrack = nullptr;
239  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
240  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
241  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
242  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
243  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
244  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
245  MonitorElement* ClusterChargeOnTrack = nullptr;
246  MonitorElement* ClusterChargeOffTrack = nullptr;
247  MonitorElement* ClusterChargeRawOnTrack = nullptr;
248  MonitorElement* ClusterChargeRawOffTrack = nullptr;
249  MonitorElement* ClusterStoNOffTrack = nullptr;
251  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
252  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
253  };
254  std::map<std::string, ModMEs> ModMEsMap;
255  std::map<std::string, LayerMEs> LayerMEsMap;
256  std::map<std::string, RingMEs> RingMEsMap;
257  std::map<std::string, SubDetMEs> SubDetMEsMap;
258 
259  struct Det2MEs {
260  struct LayerMEs* iLayer;
261  struct RingMEs* iRing;
263  };
264 
267 
270 
274 
275  bool Mod_On_;
276  bool Trend_On_;
279  bool ring_flag;
282 
285 
286  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
291 
297 
301 
302  // control view plots
312 
318 };
319 #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
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
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
std::vector< Variable::Flags > flags
Definition: MVATrainer.cc:135
MonitorElement * bookME1D(DQMStore::IBooker &, const char *, 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:149
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
MonitorElement * bookME2D(DQMStore::IBooker &, const char *, const char *)
std::unique_ptr< TkHistoMap > tkhisto_ClChPerCMfromTrack
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
#define input1
Definition: AMPTWrapper.h:129
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
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)
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
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 * ClusterStoNCorr_OnTrack_TIBTID
GenericTriggerEventFlag * genTriggerEventFlag_
std::unique_ptr< TkHistoMap > tkhisto_ClusterWidthOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumMissingHits
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
std::unique_ptr< TkHistoMap > tkhisto_NoiseOnTrack
std::unique_ptr< TkHistoMap > tkhisto_NumberValidHits
std::unique_ptr< TkHistoMap > tkhisto_NumOnTrack
MonitorElement * ClusterCount_OnTrack_FECSlotVsFECRing_TIBTID
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
std::unique_ptr< TkHistoMap > tkhisto_NumberInactiveHits
edm::ParameterSet Parameters
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 * 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