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  // fill monitorables
146 // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
147 // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
148 
149  inline void fillME(MonitorElement* ME,float value1){if (ME!=0)ME->Fill(value1);}
150  inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=0)ME->Fill(value1,value2);}
151  inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=0)ME->Fill(value1,value2,value3);}
152  inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);}
153 
154  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
155 
156  // ----------member data ---------------------------
157 private:
162 
164 
165  //******* TkHistoMaps
169  //******** TkHistoMaps
171 
172  struct ModMEs{
183  };
184 
185  struct LayerMEs{
187  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
188  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
189  MonitorElement* ClusterChargeOnTrack = nullptr;
190  MonitorElement* ClusterChargeOffTrack = nullptr;
191  MonitorElement* ClusterChargeRawOnTrack = nullptr;
192  MonitorElement* ClusterChargeRawOffTrack = nullptr;
193  MonitorElement* ClusterNoiseOnTrack = nullptr;
194  MonitorElement* ClusterNoiseOffTrack = nullptr;
195  MonitorElement* ClusterWidthOnTrack = nullptr;
196  MonitorElement* ClusterWidthOffTrack = nullptr;
197  MonitorElement* ClusterPosOnTrack = nullptr;
198  MonitorElement* ClusterPosOffTrack = nullptr;
200  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
201  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
202  };
203  struct RingMEs{
205  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
206  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
207  MonitorElement* ClusterChargeOnTrack = nullptr;
208  MonitorElement* ClusterChargeOffTrack = nullptr;
209  MonitorElement* ClusterChargeRawOnTrack = nullptr;
210  MonitorElement* ClusterChargeRawOffTrack = nullptr;
211  MonitorElement* ClusterNoiseOnTrack = nullptr;
212  MonitorElement* ClusterNoiseOffTrack = nullptr;
213  MonitorElement* ClusterWidthOnTrack = nullptr;
214  MonitorElement* ClusterWidthOffTrack = nullptr;
215  MonitorElement* ClusterPosOnTrack = nullptr;
216  MonitorElement* ClusterPosOffTrack = nullptr;
218  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
219  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
220  };
221  struct SubDetMEs{
222  int totNClustersOnTrack = 0;
223  int totNClustersOffTrack = 0;
224  MonitorElement* nClustersOnTrack = nullptr;
225  MonitorElement* nClustersTrendOnTrack = nullptr;
226  MonitorElement* nClustersOffTrack = nullptr;
227  MonitorElement* nClustersTrendOffTrack = nullptr;
229  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
230  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
231  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
232  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
233  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
234  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
235  MonitorElement* ClusterChargeOnTrack = nullptr;
236  MonitorElement* ClusterChargeOffTrack = nullptr;
237  MonitorElement* ClusterChargeRawOnTrack = nullptr;
238  MonitorElement* ClusterChargeRawOffTrack = nullptr;
239  MonitorElement* ClusterStoNOffTrack = nullptr;
241  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
242  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
243  };
244  std::map<std::string, ModMEs> ModMEsMap;
245  std::map<std::string, LayerMEs> LayerMEsMap;
246  std::map<std::string, RingMEs> RingMEsMap;
247  std::map<std::string, SubDetMEs> SubDetMEsMap;
248 
249  struct Det2MEs {
250  struct LayerMEs *iLayer;
251  struct RingMEs *iRing;
253  };
254 
257 
260 
264 
265  bool Mod_On_;
266  bool Trend_On_;
269  bool ring_flag;
272 
275 
276  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
281 
287 
291 };
292 #endif
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
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)
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 &)
void fillME(MonitorElement *ME, float value1, float value2)
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
math::XYZTLorentzVectorD LV
void fillME(MonitorElement *ME, float value1, float value2, float value3, float value4)
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
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
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
TkHistoMap * tkhisto_NumOnTrack
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
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap