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&);
67  void dqmBeginRun(const edm::Run& run, const edm::EventSetup& es) override;
68  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
69  void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
70 
71 private:
72  enum ClusterFlags {
75  };
76 
77  struct Det2MEs;
78 
79  //booking
80  void book(DQMStore::IBooker &, const TrackerTopology* tTopo);
81  void bookModMEs(DQMStore::IBooker &, const uint32_t );
82  void bookLayerMEs(DQMStore::IBooker &, const uint32_t, std::string&);
83  void bookRing(DQMStore::IBooker &, const uint32_t, std::string&);
85  void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string&);
87  MonitorElement * bookME1D(DQMStore::IBooker & , const char*, const char*);
88  MonitorElement * bookME2D(DQMStore::IBooker & , const char*, const char*);
89  MonitorElement * bookME3D(DQMStore::IBooker & , const char*, const char*);
90  MonitorElement * bookMEProfile(DQMStore::IBooker & , const char*, const char*);
91  MonitorElement * bookMETrend(DQMStore::IBooker & , const char*);
92  // internal evaluation of monitorables
93  void AllClusters(const edm::Event& ev, const edm::EventSetup& es);
94 
96  edm::Handle<reco::TrackCollection > trackCollectionHandle,
97  const edm::DetSetVector<SiStripDigi>& digilist,
98  const edm::Event& ev,
99  const edm::EventSetup& es);
101  edm::Handle<reco::TrackCollection > trackCollectionHandle,
102  const edm::DetSetVector<SiStripDigi>& digilist,
103  const edm::Event& ev,
104  const edm::EventSetup& es);
105  void trajectoryStudy(
106  const reco::Track& track,
107  const edm::DetSetVector<SiStripDigi>& digilist,
108  const edm::Event& ev,
109  const edm::EventSetup& es,
110  bool track_ok);
111  void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
112  bool trackFilter(const reco::Track& track);
113  // LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
114  void hitStudy(
115  const edm::Event& ev,
116  const edm::EventSetup& es,
117  const edm::DetSetVector<SiStripDigi>& digilist,
118  const ProjectedSiStripRecHit2D* projhit,
119  const SiStripMatchedRecHit2D* matchedhit,
120  const SiStripRecHit2D* hit2D,
121  const SiStripRecHit1D* hit1D,
122  LocalVector localMomentum,
123  const bool track_ok);
124  bool clusterInfos(
125  SiStripClusterInfo* cluster,
126  const uint32_t detid,
127  enum ClusterFlags flags,
128  bool track_ok,
129  LocalVector LV,
130  const Det2MEs& MEs ,
131  const TrackerTopology* tTopo,
132  const SiStripGain* stripGain,
133  const SiStripQuality* stripQuality,
134  const edm::DetSetVector<SiStripDigi>& digilist
135  );
136  template <class T> void RecHitInfo(
137  const T* tkrecHit,
138  LocalVector LV,
139  const edm::DetSetVector<SiStripDigi>& digilist,
140  const edm::Event& ev,
141  const edm::EventSetup& es,
142  bool ok
143  );
144 
145  bool fillControlViewHistos(const edm::Event& ev, const edm::EventSetup& es);
146  void return2DME(MonitorElement* input, int binx, int biny, double value);
147 
148  // fill monitorables
149 // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
150 // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
151 
152  inline void fillME(MonitorElement* ME,float value1){if (ME!=0)ME->Fill(value1);}
153  inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=0)ME->Fill(value1,value2);}
154  inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=0)ME->Fill(value1,value2,value3);}
155  inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);}
156 
157  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
158 
159  // ----------member data ---------------------------
160 private:
165 
167 
168  //******* TkHistoMaps
172  //******** TkHistoMaps
174 
175  struct ModMEs{
186  };
187 
188  struct LayerMEs{
190  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
191  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
192  MonitorElement* ClusterChargeOnTrack = nullptr;
193  MonitorElement* ClusterChargeOffTrack = nullptr;
194  MonitorElement* ClusterChargeRawOnTrack = nullptr;
195  MonitorElement* ClusterChargeRawOffTrack = nullptr;
196  MonitorElement* ClusterNoiseOnTrack = nullptr;
197  MonitorElement* ClusterNoiseOffTrack = nullptr;
198  MonitorElement* ClusterWidthOnTrack = nullptr;
199  MonitorElement* ClusterWidthOffTrack = nullptr;
200  MonitorElement* ClusterPosOnTrack = nullptr;
201  MonitorElement* ClusterPosOffTrack = nullptr;
203  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
204  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
205  };
206  struct RingMEs{
208  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
209  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
210  MonitorElement* ClusterChargeOnTrack = nullptr;
211  MonitorElement* ClusterChargeOffTrack = nullptr;
212  MonitorElement* ClusterChargeRawOnTrack = nullptr;
213  MonitorElement* ClusterChargeRawOffTrack = nullptr;
214  MonitorElement* ClusterNoiseOnTrack = nullptr;
215  MonitorElement* ClusterNoiseOffTrack = nullptr;
216  MonitorElement* ClusterWidthOnTrack = nullptr;
217  MonitorElement* ClusterWidthOffTrack = nullptr;
218  MonitorElement* ClusterPosOnTrack = nullptr;
219  MonitorElement* ClusterPosOffTrack = nullptr;
221  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
222  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
223  };
224  struct SubDetMEs{
225  int totNClustersOnTrack = 0;
226  int totNClustersOffTrack = 0;
227  MonitorElement* nClustersOnTrack = nullptr;
228  MonitorElement* nClustersTrendOnTrack = nullptr;
229  MonitorElement* nClustersOffTrack = nullptr;
230  MonitorElement* nClustersTrendOffTrack = nullptr;
232  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
233  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
234  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
235  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
236  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
237  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
238  MonitorElement* ClusterChargeOnTrack = nullptr;
239  MonitorElement* ClusterChargeOffTrack = nullptr;
240  MonitorElement* ClusterChargeRawOnTrack = nullptr;
241  MonitorElement* ClusterChargeRawOffTrack = nullptr;
242  MonitorElement* ClusterStoNOffTrack = nullptr;
244  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
245  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
246  };
247  std::map<std::string, ModMEs> ModMEsMap;
248  std::map<std::string, LayerMEs> LayerMEsMap;
249  std::map<std::string, RingMEs> RingMEsMap;
250  std::map<std::string, SubDetMEs> SubDetMEsMap;
251 
252  struct Det2MEs {
253  struct LayerMEs *iLayer;
254  struct RingMEs *iRing;
256  };
257 
260 
263 
267 
268  bool Mod_On_;
269  bool Trend_On_;
272  bool ring_flag;
275 
278 
279  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
284 
290 
294 
295 
296  // control view plots
306 
307 
308 };
309 #endif
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TIBTID
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
MonitorElement * ClusterStoNCorr_OnTrack_TECP
void return2DME(MonitorElement *input, int binx, int biny, double value)
MonitorElement * ClusterChargePerCMfromTrack
void fillME(MonitorElement *ME, float value1, float value2, float value3)
TkHistoMap * tkhisto_NumOffTrack
SiStripMonitorTrack(const edm::ParameterSet &)
void trackStudy(const edm::Event &ev, const edm::EventSetup &es)
edm::EDGetTokenT< reco::TrackCollection > trackToken_
void fillME(MonitorElement *ME, float value1)
SiStripDCSStatus * dcsStatus_
void book(DQMStore::IBooker &, const TrackerTopology *tTopo)
void AllClusters(const edm::Event &ev, const edm::EventSetup &es)
math::XYZTLorentzVectorD LV
std::map< std::string, RingMEs > RingMEsMap
edm::ParameterSet conf_
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)
static std::string const input
Definition: EdmProvDump.cc:44
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)
void Fill(long long x)
edm::ESHandle< TrackerGeometry > tkgeom_
Definition: ME.h:11
void fillME(MonitorElement *ME, float value1, float value2, float value3, float value4)
MonitorElement * ClusterStoNCorr_OnTrack_TOB
edm::EventNumber_t eventNb
TkHistoMap * tkhisto_NumMissingHits
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 *)
void bookSubDetMEs(DQMStore::IBooker &, std::string &name)
MonitorElement * bookME3D(DQMStore::IBooker &, const char *, const char *)
void dqmBeginRun(const edm::Run &run, const edm::EventSetup &es) override
Definition: value.py:1
MonitorElement * ClusterChargePerCMfromOrigin
SiStripFolderOrganizer folderOrganizer_
edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > digiToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
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)
TkHistoMap * tkhisto_NumberInactiveHits
TkHistoMap * tkhisto_ClChPerCMfromOrigin
MonitorElement * ClusterStoNCorr_OnTrack_FECCratevsFECSlot
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TECP
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)
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::DetSetVector< SiStripDigi > &digilist, const edm::Event &ev, const edm::EventSetup &es, bool 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)
TkHistoMap * tkhisto_ClChPerCMfromTrack
MonitorElement * ClusterStoNCorr_OnTrack_FECSlotVsFECRing_TOB
TkHistoMap * tkhisto_NumOnTrack
MonitorElement * ClusterStoNCorr_OnTrack_TIBTID
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
MonitorElement * bookMEProfile(DQMStore::IBooker &, const char *, const char *)
TkHistoMap * tkhisto_StoNCorrOnTrack
edm::ParameterSet Parameters
long double T
void bookRingMEs(DQMStore::IBooker &, const uint32_t, std::string &)
TkHistoMap * tkhisto_NumberValidHits
virtual 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)
Definition: Run.h:42
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