CMS 3D CMS Logo

SiStripMonitorDigi.h
Go to the documentation of this file.
1 #ifndef SiStripMonitorDigi_SiStripMonitorDigi_h
2 #define SiStripMonitorDigi_SiStripMonitorDigi_h
3 // -*- C++ -*-
4 // Package: SiStripMonitorDigi
5 // Class : SiStripMonitorDigi
9 // Original Author: dkcira
10 // Created: Sat Feb 4 20:49:51 CET 2006
11 
12 #include <memory>
13 
27 
28 class SiStripDCSStatus;
29 class SiStripDetCabling;
30 
31 class EventWithHistory;
34 
35 class SiStripMonitorDigi : public DQMOneEDAnalyzer<edm::LuminosityBlockCache<bool>> {
36 public:
37  explicit SiStripMonitorDigi(const edm::ParameterSet&);
38  ~SiStripMonitorDigi() override;
39  void analyze(const edm::Event&, const edm::EventSetup&) override;
40  std::shared_ptr<bool> globalBeginLuminosityBlock(const edm::LuminosityBlock& lumi,
41  const edm::EventSetup& iSetup) const override;
42  void globalEndLuminosityBlock(const edm::LuminosityBlock& lumi, const edm::EventSetup& iSetup) override;
43  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
44  void dqmBeginRun(const edm::Run& r, const edm::EventSetup& c) override;
45 
47 
48  struct ModMEs {
55  };
56 
57  struct LayerMEs {
70  };
71 
72  struct SubDetMEs {
73  int totNDigis;
77 
78  //int totApvShots;
79  std::vector<APVShot> SubDetApvShots;
85  };
86 
87  struct DigiFailureMEs {
90  };
91 
93 
94 private:
95  void createMEs(DQMStore::IBooker& ibooker, const edm::EventSetup& es);
96  void ResetModuleMEs(uint32_t idet);
97  void bookLayer(DQMStore::IBooker& ibooker);
98  MonitorElement* bookMETrend(DQMStore::IBooker& ibooker, const char* ParameterSetLabel, const char* HistoName);
99  MonitorElement* bookME1D(DQMStore::IBooker& ibooker, const char* ParameterSetLabel, const char* HistoName);
100  void bookTrendMEs(DQMStore::IBooker& ibooker, const TString& name, int32_t layer, uint32_t id, std::string flag);
102  void fillTrend(MonitorElement* me, float value, float timeinorbit);
103  inline void fillME(MonitorElement* ME, float value1) {
104  if (ME != nullptr)
105  ME->Fill(value1);
106  }
107  inline void fillME(MonitorElement* ME, float value1, float value2) {
108  if (ME != nullptr)
109  ME->Fill(value1, value2);
110  }
111  inline void fillME(MonitorElement* ME, float value1, float value2, float value3) {
112  if (ME != nullptr)
113  ME->Fill(value1, value2, value3);
114  }
115  inline void fillME(MonitorElement* ME, float value1, float value2, float value3, float value4) {
116  if (ME != nullptr)
117  ME->Fill(value1, value2, value3, value4);
118  }
119  bool AllDigis(const edm::EventSetup& es);
120 
121  void createModuleMEs(DQMStore::IBooker& ibooker, ModMEs& mod_single, uint32_t detid);
122  void createLayerMEs(DQMStore::IBooker& ibooker, std::string label, int ndet);
125  int getDigiSourceIndex(uint32_t id);
126  void AddApvShotsToSubDet(const std::vector<APVShot>&, std::vector<APVShot>&);
127  void FillApvShotsMap(TkHistoMap*, const std::vector<APVShot>&, uint32_t id, int);
128 
129 private:
131  std::vector<edm::EDGetTokenT<edm::DetSetVector<SiStripDigi>>> digiProducerTokenList;
132  std::vector<edm::InputTag> digiProducerList;
133  std::map<uint32_t, ModMEs>
134  DigiMEs; // uint32_t me_type: 1=#digis/module; 2=adcs of hottest strip/module; 3= adcs of coolest strips/module.
137 
138  std::map<std::string, std::vector<uint32_t>> LayerDetMap;
139  std::map<std::string, LayerMEs> LayerMEsMap;
140  std::map<std::string, SubDetMEs> SubDetMEsMap;
141  std::map<std::string, std::string> SubDetPhasePartMap;
143 
144  TString name;
146  std::map<std::pair<std::string, int32_t>, bool> DetectedLayers;
147  std::vector<const edm::DetSetVector<SiStripDigi>*> digi_detset_handles;
148 
149  unsigned long long m_cacheID_;
151  std::vector<uint32_t> ModulesToBeExcluded_;
152 
153  //Global MEs to monitor APV Shots properties
156 
158 
162 
164 
173 
180 
184 
186 
192 
199 
200  // int xLumiProf;
205  int nFedTIB;
206  int nFedTIDp;
207  int nFedTIDm;
208  int nFedTECp;
209  int nFedTECm;
210  int nFedTOB;
211  // int nFEDConnected;
212 
213  bool Mod_On_;
214 
219 
221 
223 
224  std::vector<float> vecSubDetTotDigiProfLS;
227 
236 
238 };
239 #endif
bool AllDigis(const edm::EventSetup &es)
void ResetModuleMEs(uint32_t idet)
std::map< std::string, LayerMEs > LayerMEsMap
void createMEs(DQMStore::IBooker &ibooker, const edm::EventSetup &es)
MonitorElement * LayerNumberOfDigisTrend
std::map< std::pair< std::string, int32_t >, bool > DetectedLayers
MonitorElement * LayerStripOccupancy
MonitorElement * LayerADCsHottestStrip
edm::InputTag historyProducer_
MonitorElement * LayerADCsHottestStripTrend
std::unique_ptr< TkHistoMap > tkmapNstripApvshot
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenRun_
MonitorElement * NApvShotsGlobalProf
std::map< uint32_t, ModMEs > DigiMEs
std::map< std::string, std::string > SubDetPhasePartMap
MonitorElement * MedianChargeApvShotsGlobal
MonitorElement * StripMultiplicityApvShotsGlobal
const SiStripDetCabling * SiStripDetCabling_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoTokenRun_
edm::ESGetToken< TkDetMap, TrackerTopologyRcd > tkDetMapTokenRun_
std::unique_ptr< TkHistoMap > tkmapMedianChargeApvshots
MonitorElement * LayerNumberOfDigisProfile
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
constexpr std::array< uint8_t, layerIndexSize > layer
void dqmBeginRun(const edm::Run &r, const edm::EventSetup &c) override
std::vector< APVShot > SubDetApvShots
unsigned long long m_cacheID_
MonitorElement * SubDetNApvShotsNApvTH1
void createSubDetMEs(DQMStore::IBooker &ibooker, std::string label)
Definition: ME.h:11
void globalEndLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &iSetup) override
char const * label
MonitorElement * NumberOfDigisPerStrip
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
MonitorElement * ADCsCoolestStrip
SiStripDCSStatus * dcsStatus_
MonitorElement * LayerADCsCoolestStripTrend
MonitorElement * SubDetNStripsApvShotsTH1
DigiFailureMEs digiFailureMEs
edm::EDGetTokenT< EventWithHistory > historyProducerToken_
void fillME(MonitorElement *ME, float value1)
MonitorElement * bookME1D(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
void fillME(MonitorElement *ME, float value1, float value2, float value3, float value4)
MonitorElement * NApvApvShotsGlobal
std::vector< float > vecSubDetTotDigiProfLS
std::shared_ptr< bool > globalBeginLuminosityBlock(const edm::LuminosityBlock &lumi, const edm::EventSetup &iSetup) const override
Definition: value.py:1
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > SiStripDetCablingTokenRun_
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * ADCsHottestStrip
void createLayerMEs(DQMStore::IBooker &ibooker, std::string label, int ndet)
void fillTrend(MonitorElement *me, float value, float timeinorbit)
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > gtEvmToken_
MonitorElement * NApvShotsGlobal
std::vector< edm::EDGetTokenT< edm::DetSetVector< SiStripDigi > > > digiProducerTokenList
MonitorElement * LayerDigiADCProfile
std::vector< const edm::DetSetVector< SiStripDigi > * > digi_detset_handles
int getDigiSourceIndex(uint32_t id)
void fillME(MonitorElement *ME, float value1, float value2, float value3)
void analyze(const edm::Event &, const edm::EventSetup &) override
SiStripMonitorDigi(const edm::ParameterSet &)
edm::InputTag apvPhaseProducer_
std::unique_ptr< TkHistoMap > tkmapNApvshots
void fillME(MonitorElement *ME, float value1, float value2)
MonitorElement * SubDetChargeMedianApvShotsTH1
MonitorElement * bookMETrend(DQMStore::IBooker &ibooker, const char *ParameterSetLabel, const char *HistoName)
std::map< std::string, std::vector< uint32_t > > LayerDetMap
std::string topFolderName_
void bookLayer(DQMStore::IBooker &ibooker)
edm::ParameterSet conf_
std::string HistoName
std::unique_ptr< TkHistoMap > tkmapdigi
std::vector< edm::InputTag > digiProducerList
edm::EDGetTokenT< APVCyclePhaseCollection > apvPhaseProducerToken_
MonitorElement * LayerStripOccupancyTrend
MonitorElement * LayerADCsCoolestStrip
std::vector< uint32_t > ModulesToBeExcluded_
void AddApvShotsToSubDet(const std::vector< APVShot > &, std::vector< APVShot > &)
SiStripFolderOrganizer folder_organizer
MonitorElement * ShotsVsTimeApvShotsGlobal
void fillDigiADCsMEs(int value, std::string name)
void FillApvShotsMap(TkHistoMap *, const std::vector< APVShot > &, uint32_t id, int)
MonitorElement * NumberOfFEDDigis
void createSubDetTH2(DQMStore::IBooker &ibooker, std::string label)
void bookTrendMEs(DQMStore::IBooker &ibooker, const TString &name, int32_t layer, uint32_t id, std::string flag)
void createModuleMEs(DQMStore::IBooker &ibooker, ModMEs &mod_single, uint32_t detid)
Definition: Run.h:45