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:
72  enum ClusterFlags {
75  };
76 
77  struct Det2MEs;
78 
79  //booking
80  void book(DQMStore::IBooker &, const TrackerTopology* tTopo, const TkDetMap* tkDetMap);
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);
95  edm::Handle<reco::TrackCollection > trackCollectionHandle,
96  const edm::DetSetVector<SiStripDigi>& digilist,
97  const edm::Event& ev,
98  const edm::EventSetup& es);
100  edm::Handle<reco::TrackCollection > trackCollectionHandle,
101  const edm::DetSetVector<SiStripDigi>& digilist,
102  const edm::Event& ev,
103  const edm::EventSetup& es);
104  void trajectoryStudy(
105  const reco::Track& track,
106  const edm::DetSetVector<SiStripDigi>& digilist,
107  const edm::Event& ev,
108  const edm::EventSetup& es,
109  bool track_ok);
110  void trackStudy(const edm::Event& ev, const edm::EventSetup& es);
111  bool trackFilter(const reco::Track& track);
112  // LocalPoint project(const GeomDet *det,const GeomDet* projdet,LocalPoint position,LocalVector trackdirection)const;
113  void hitStudy(
114  const edm::Event& ev,
115  const edm::EventSetup& es,
116  const edm::DetSetVector<SiStripDigi>& digilist,
117  const ProjectedSiStripRecHit2D* projhit,
118  const SiStripMatchedRecHit2D* matchedhit,
119  const SiStripRecHit2D* hit2D,
120  const SiStripRecHit1D* hit1D,
121  LocalVector localMomentum,
122  const bool track_ok);
123  bool clusterInfos(
124  SiStripClusterInfo* cluster,
125  const uint32_t detid,
126  enum ClusterFlags flags,
127  bool track_ok,
128  LocalVector LV,
129  const Det2MEs& MEs ,
130  const TrackerTopology* tTopo,
131  const SiStripGain* stripGain,
132  const SiStripQuality* stripQuality,
133  const edm::DetSetVector<SiStripDigi>& digilist
134  );
135  template <class T> void RecHitInfo(
136  const T* tkrecHit,
137  LocalVector LV,
138  const edm::DetSetVector<SiStripDigi>& digilist,
139  const edm::Event& ev,
140  const edm::EventSetup& es,
141  bool track_ok
142  );
143 
144  bool fillControlViewHistos(const edm::Event& ev, const edm::EventSetup& es);
145  void return2DME(MonitorElement* input1,MonitorElement* input2, int binx, int biny, double value);
146 
147  // fill monitorables
148 // void fillModMEs(SiStripClusterInfo* cluster,std::string name, float cos, const uint32_t detid, const LocalVector LV);
149 // void fillMEs(SiStripClusterInfo*,const uint32_t detid, float,enum ClusterFlags, const LocalVector LV, const Det2MEs& MEs);
150 
151  inline void fillME(MonitorElement* ME,float value1){if (ME!=nullptr)ME->Fill(value1);}
152  inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=nullptr)ME->Fill(value1,value2);}
153  inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=nullptr)ME->Fill(value1,value2,value3);}
154  inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=nullptr)ME->Fill(value1,value2,value3,value4);}
155 
156  Det2MEs findMEs(const TrackerTopology* tTopo, const uint32_t detid);
157 
158  // ----------member data ---------------------------
159 private:
164 
166 
167  //******* 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  // control view plots
305 
311 
312 };
313 #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_
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
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
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:43
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