CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CastorMonitorModule.h
Go to the documentation of this file.
1 #ifndef CastorMonitorModule_H
2 #define CastorMonitorModule_H
3 
12 
15 
21 
26 
29 
33 
34 
44 
47 #include "DataFormats/HcalDigi/interface/HcalUnpackerReport.h" //-- no CastorUnpackerReport at the moment !
48 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h" //-- HcalCastorDetId
49 
60 
61 #include "CalibCalorimetry/CastorCalib/interface/CastorDbASCIIIO.h" //-- use to get/dump Calib to DB
62 #include "CondFormats/CastorObjects/interface/CastorChannelQuality.h" //-- use to get/hold channel status
64 
65 
67 
68 #include <memory>
69 #include <iostream>
70 #include <fstream>
71 #include <vector>
72 #include <string>
73 #include <sys/time.h>
74 
75 
76 
77 
79 
80 public:
81 
84 
87 
88  protected:
89 
91  void analyze(const edm::Event& iEvent, const edm::EventSetup& eventSetup);
92 
94  void beginJob();
95 
97  void beginRun(const edm::Run& iRun, const edm::EventSetup& eventSetup);
98 
100  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
101  const edm::EventSetup& eventSetup) ;
102 
104  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
105  const edm::EventSetup& eventSetup);
106 
108  void endJob(void);
109 
111  void endRun(const edm::Run& run, const edm::EventSetup& eventSetup);
112 
114  void reset(void);
115 
117  bool prescale();
118 
120  void CheckCastorStatus (const FEDRawDataCollection& rawraw,
121  const HcalUnpackerReport& report,
122  const CastorElectronicsMap& emap,
123  const CastorDigiCollection& castordigi
124  );
125 
126  private:
127 
135  int prescaleEvt_; //-- units of events
136  int prescaleLS_; //-- units of lumi sections
137  int prescaleTime_; //-- units of minutes
138  int prescaleUpdate_; //-- units of "updates", TBD
139 
142  std::string monitorName_;
143 
146 
148  int nevt_;
150  bool saved_;
151 
153  bool rawOK_ ;
154  bool reportOK_ ;
155  bool digiOK_ ;
156  bool rechitOK_ ;
157  bool towerOK_ ;
158  bool jetOK_ ;
159  bool jetIdOK_ ;
160 
161  int nRaw;
162  int nDigi;
163  int nRechit;
164  int nTower;
165  int nJet;
166  int nJetId;
167 
168 
170  bool showTiming_;
172 
174  struct{
175  timeval startTV,updateTV;
176  double elapsedTime;
177  double vetoTime;
178  double updateTime;
179  } psTime_;
180 
181 
184 
187  bool actonLS_ ;
188  std::string rootFolder_;
189 
190  int ievt_;
191  int ievt_pre_; //-- copy of counter used for prescale purposes
193 
194  //edm::InputTag inputLabelGT_;
205 
206 
207 
209  // typedef std::vector<reco::CastorTower> CastorTowerCollection;
210 
211  //edm::InputTag inputLabelCaloTower_;
212  //edm::InputTag inputLabelLaser_;
213 
215  std::map<uint32_t, std::vector<HcalCastorDetId> > DCCtoCell;
216  std::map<uint32_t, std::vector<HcalCastorDetId> > ::iterator thisDCC;
217  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > HTRtoCell;
218  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > ::iterator thisHTR;
219 
229 
230 
242 
244 
247 
250 
251  // pedestal width averaged over capIDs, calculated in beginRun
252  // aware of the difference between index[0..15][0..13]
253  // and sector/module numeration[1..16][1..14]
254  float fPedestalNSigmaAverage[14][16];
255 
256  std::vector<HcalGenericDetId> listEMap; //electronics Emap
257 
258 
259  ofstream m_logFile;
260 
263 
268 
270  bool EDMonOn_;
271 
274  std::map<HcalCastorDetId, unsigned int> myquality_;
276 };
277 
278 #endif
const CastorElectronicsMap * CastorReadoutMap_
edm::InputTag inputLabelBasicJetCASTOR_
MonitorElement * meCASTOR_
edm::InputTag inputLabelCastorJetIDs_
MonitorElement * meQuality_
void endRun(const edm::Run &run, const edm::EventSetup &eventSetup)
void analyze(const edm::Event &iEvent, const edm::EventSetup &eventSetup)
edm::InputTag inputLabelCastorTowers_
std::map< std::pair< int, int >, std::vector< HcalCastorDetId > > HTRtoCell
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &eventSetup)
edm::ESHandle< CastorDbService > conditions_
CastorLEDMonitor * LedMon_
MonitorElement * meRunType_
void beginRun(const edm::Run &iRun, const edm::EventSetup &eventSetup)
MonitorElement * meLatency_
edm::ESHandle< CastorPedestals > dbPedestals
std::map< uint32_t, std::vector< HcalCastorDetId > > DCCtoCell
edm::InputTag inputLabelRaw_
tuple report
Definition: zeeHLT_cff.py:9
edm::InputTag inputLabelDigi_
int iEvent
Definition: GenABIO.cc:243
CastorTowerJetMonitor * TowerJetMon_
std::vector< HcalGenericDetId > listEMap
struct CastorMonitorModule::@169 psTime_
edm::InputTag inputLabelJetIdCASTOR_
CastorMonitorModule(const edm::ParameterSet &ps)
edm::InputTag inputLabelRecHitCASTOR_
MonitorElement * meTrigger_
CastorEventDisplay * EDMon_
edm::InputTag inputLabelReport_
CastorMonitorSelector * evtSel_
CastorDigiMonitor * DigiMon_
MonitorElement * meFEDS_
MonitorElement * meEvtMask_
std::map< uint32_t, std::vector< HcalCastorDetId > >::iterator thisDCC
void CheckCastorStatus(const FEDRawDataCollection &rawraw, const HcalUnpackerReport &report, const CastorElectronicsMap &emap, const CastorDigiCollection &castordigi)
std::map< std::pair< int, int >, std::vector< HcalCastorDetId > >::iterator thisHTR
MonitorElement * meStatus_
CastorDataIntegrityMonitor * DataIntMon_
edm::InputTag inputLabelTowerCASTOR_
MonitorElement * CastorEventProduct
CastorPSMonitor * PSMon_
CastorChannelQualityMonitor * CQMon_
float fPedestalNSigmaAverage[14][16]
CastorRecHitMonitor * RecHitMon_
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &eventSetup)
CastorHIMonitor * HIMon_
CastorChannelQuality * chanquality_
std::map< HcalCastorDetId, unsigned int > myquality_
edm::InputTag inputLabelCastorBasicJets_
Definition: Run.h:33
MonitorElement * meEVT_