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);
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* input1,MonitorElement* input2, 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!=nullptr)ME->Fill(value1);}
153  inline void fillME(MonitorElement* ME,float value1,float value2){if (ME!=nullptr)ME->Fill(value1,value2);}
154  inline void fillME(MonitorElement* ME,float value1,float value2,float value3){if (ME!=nullptr)ME->Fill(value1,value2,value3);}
155  inline void fillME(MonitorElement* ME,float value1,float value2,float value3,float value4){if (ME!=nullptr)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
173  //******** TkHistoMaps
175 
176  struct ModMEs{
187  };
188 
189  struct LayerMEs{
191  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
192  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
193  MonitorElement* ClusterChargeOnTrack = nullptr;
194  MonitorElement* ClusterChargeOffTrack = nullptr;
195  MonitorElement* ClusterChargeRawOnTrack = nullptr;
196  MonitorElement* ClusterChargeRawOffTrack = nullptr;
197  MonitorElement* ClusterNoiseOnTrack = nullptr;
198  MonitorElement* ClusterNoiseOffTrack = nullptr;
199  MonitorElement* ClusterWidthOnTrack = nullptr;
200  MonitorElement* ClusterWidthOffTrack = nullptr;
201  MonitorElement* ClusterPosOnTrack = nullptr;
202  MonitorElement* ClusterPosOffTrack = nullptr;
204  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
205  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
206  };
207  struct RingMEs{
209  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
210  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
211  MonitorElement* ClusterChargeOnTrack = nullptr;
212  MonitorElement* ClusterChargeOffTrack = nullptr;
213  MonitorElement* ClusterChargeRawOnTrack = nullptr;
214  MonitorElement* ClusterChargeRawOffTrack = nullptr;
215  MonitorElement* ClusterNoiseOnTrack = nullptr;
216  MonitorElement* ClusterNoiseOffTrack = nullptr;
217  MonitorElement* ClusterWidthOnTrack = nullptr;
218  MonitorElement* ClusterWidthOffTrack = nullptr;
219  MonitorElement* ClusterPosOnTrack = nullptr;
220  MonitorElement* ClusterPosOffTrack = nullptr;
222  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
223  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
224  };
225  struct SubDetMEs{
226  int totNClustersOnTrack = 0;
227  int totNClustersOffTrack = 0;
228  MonitorElement* nClustersOnTrack = nullptr;
229  MonitorElement* nClustersTrendOnTrack = nullptr;
230  MonitorElement* nClustersOffTrack = nullptr;
231  MonitorElement* nClustersTrendOffTrack = nullptr;
233  MonitorElement* ClusterStoNCorrOnTrack = nullptr;
234  MonitorElement* ClusterStoNCorrThinOnTrack = nullptr;
235  MonitorElement* ClusterStoNCorrThickOnTrack = nullptr;
236  MonitorElement* ClusterChargeCorrOnTrack = nullptr;
237  MonitorElement* ClusterChargeCorrThinOnTrack = nullptr;
238  MonitorElement* ClusterChargeCorrThickOnTrack = nullptr;
239  MonitorElement* ClusterChargeOnTrack = nullptr;
240  MonitorElement* ClusterChargeOffTrack = nullptr;
241  MonitorElement* ClusterChargeRawOnTrack = nullptr;
242  MonitorElement* ClusterChargeRawOffTrack = nullptr;
243  MonitorElement* ClusterStoNOffTrack = nullptr;
245  MonitorElement* ClusterChargePerCMfromOriginOnTrack = nullptr;
246  MonitorElement* ClusterChargePerCMfromOriginOffTrack = nullptr;
247  };
248  std::map<std::string, ModMEs> ModMEsMap;
249  std::map<std::string, LayerMEs> LayerMEsMap;
250  std::map<std::string, RingMEs> RingMEsMap;
251  std::map<std::string, SubDetMEs> SubDetMEsMap;
252 
253  struct Det2MEs {
254  struct LayerMEs *iLayer;
255  struct RingMEs *iRing;
257  };
258 
261 
264 
268 
269  bool Mod_On_;
270  bool Trend_On_;
273  bool ring_flag;
276 
279 
280  std::unordered_set<const SiStripCluster*> vPSiStripCluster;
285 
291 
295 
296 
297  // control view plots
307 
313 
314 
315 
316 
317 
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 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)
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)
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