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  void trackStudyFromTrack(edm::Handle<reco::TrackCollection > trackCollectionHandle, const edm::Event&ev, const edm::EventSetup& es);
95  void trackStudyFromTrajectory(edm::Handle<reco::TrackCollection > trackCollectionHandle, const edm::Event& ev, const edm::EventSetup& es);
96  void trajectoryStudy(const reco::Track& track, const edm::Event& ev, const edm::EventSetup& es, bool track_ok);
97  void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
98  bool trackFilter(const reco::Track& track);
99  // LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
100  void hitStudy(
101  const edm::Event& ev,
102  const edm::EventSetup& es,
103  const ProjectedSiStripRecHit2D* projhit,
104  const SiStripMatchedRecHit2D* matchedhit,
105  const SiStripRecHit2D* hit2D,
106  const SiStripRecHit1D* hit1D,
107  LocalVector localMomentum,
108  const bool track_ok);
109  bool clusterInfos(
110  SiStripClusterInfo* cluster,
111  const uint32_t detid,
112  enum ClusterFlags flags,
113  bool track_ok,
114  LocalVector LV,
115  const Det2MEs& MEs ,
116  const TrackerTopology* tTopo,
117  const SiStripGain* stripGain,
118  const SiStripQuality* stripQuality,
119  const edm::DetSetVector<SiStripDigi>& digilist
120  );
121  template <class T> void RecHitInfo(const T* tkrecHit, LocalVector LV, const edm::Event&, const edm::EventSetup&, bool ok);
122 
123  // fill monitorables
124 // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
125 // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
126 
127  inline void fillME(MonitorElement* ME,float value1){if (ME!=0)ME->Fill(value1);}
128  inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=0)ME->Fill(value1,value2);}
129  inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=0)ME->Fill(value1,value2,value3);}
130  inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=0)ME->Fill(value1,value2,value3,value4);}
131 
132  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
133 
134  // ----------member data ---------------------------
135 private:
140 
142 
143  //******* TkHistoMaps
147  //******** TkHistoMaps
149 
150  struct ModMEs{
161  };
162 
163  struct LayerMEs{
165  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
166  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
167  MonitorElement* ClusterChargeOnTrack = nullptr;
168  MonitorElement* ClusterChargeOffTrack = nullptr;
169  MonitorElement* ClusterChargeRawOnTrack = nullptr;
170  MonitorElement* ClusterChargeRawOffTrack = nullptr;
171  MonitorElement* ClusterNoiseOnTrack = nullptr;
172  MonitorElement* ClusterNoiseOffTrack = nullptr;
173  MonitorElement* ClusterWidthOnTrack = nullptr;
174  MonitorElement* ClusterWidthOffTrack = nullptr;
175  MonitorElement* ClusterPosOnTrack = nullptr;
176  MonitorElement* ClusterPosOffTrack = nullptr;
178  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
179  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
180  };
181  struct RingMEs{
183  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
184  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
185  MonitorElement* ClusterChargeOnTrack = nullptr;
186  MonitorElement* ClusterChargeOffTrack = nullptr;
187  MonitorElement* ClusterChargeRawOnTrack = nullptr;
188  MonitorElement* ClusterChargeRawOffTrack = nullptr;
189  MonitorElement* ClusterNoiseOnTrack = nullptr;
190  MonitorElement* ClusterNoiseOffTrack = nullptr;
191  MonitorElement* ClusterWidthOnTrack = nullptr;
192  MonitorElement* ClusterWidthOffTrack = nullptr;
193  MonitorElement* ClusterPosOnTrack = nullptr;
194  MonitorElement* ClusterPosOffTrack = nullptr;
196  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
197  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
198  };
199  struct SubDetMEs{
200  int totNClustersOnTrack = 0;
201  int totNClustersOffTrack = 0;
202  MonitorElement* nClustersOnTrack = nullptr;
203  MonitorElement* nClustersTrendOnTrack = nullptr;
204  MonitorElement* nClustersOffTrack = nullptr;
205  MonitorElement* nClustersTrendOffTrack = nullptr;
207  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
208  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
209  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
210  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
211  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
212  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
213  MonitorElement* ClusterChargeOnTrack = nullptr;
214  MonitorElement* ClusterChargeOffTrack = nullptr;
215  MonitorElement* ClusterChargeRawOnTrack = nullptr;
216  MonitorElement* ClusterChargeRawOffTrack = nullptr;
217  MonitorElement* ClusterStoNOffTrack = nullptr;
219  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
220  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
221  };
222  std::map<std::string, ModMEs> ModMEsMap;
223  std::map<std::string, LayerMEs> LayerMEsMap;
224  std::map<std::string, RingMEs> RingMEsMap;
225  std::map<std::string, SubDetMEs> SubDetMEsMap;
226 
227  struct Det2MEs {
228  struct LayerMEs *iLayer;
229  struct RingMEs *iRing;
231  };
232 
235 
238 
242 
243  bool Mod_On_;
244  bool Trend_On_;
247  bool ring_flag;
250  bool Digi_On_;
251 
254 
255  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
260 
266 
270 };
271 #endif
Det2MEs findMEs(const TrackerTopology *tTopo, const uint32_t detid)
void trackStudyFromTrack(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::Event &ev, const edm::EventSetup &es)
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
void RecHitInfo(const T *tkrecHit, LocalVector LV, const edm::Event &, const edm::EventSetup &, bool ok)
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 hitStudy(const edm::Event &ev, const edm::EventSetup &es, const ProjectedSiStripRecHit2D *projhit, const SiStripMatchedRecHit2D *matchedhit, const SiStripRecHit2D *hit2D, const SiStripRecHit1D *hit1D, LocalVector localMomentum, const bool track_ok)
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 bookModMEs(DQMStore::IBooker &, const uint32_t)
TkHistoMap * tkhisto_NumberInactiveHits
void trackStudyFromTrajectory(edm::Handle< reco::TrackCollection > trackCollectionHandle, const edm::Event &ev, const edm::EventSetup &es)
TkHistoMap * tkhisto_ClChPerCMfromOrigin
std::map< std::string, ModMEs > ModMEsMap
MonitorElement * bookMETrend(DQMStore::IBooker &, const char *)
TkHistoMap * tkhisto_ClChPerCMfromTrack
TkHistoMap * tkhisto_NumOnTrack
GenericTriggerEventFlag * genTriggerEventFlag_
MonitorElement * handleBookMEs(DQMStore::IBooker &, std::string &, std::string &, std::string &, std::string &)
void trajectoryStudy(const reco::Track &track, const edm::Event &ev, const edm::EventSetup &es, bool track_ok)
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
Definition: Run.h:42
edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusterToken_
std::map< std::string, LayerMEs > LayerMEsMap