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 
30 
34 
35 
45 
48 #include "DataFormats/HcalDigi/interface/HcalUnpackerReport.h" //-- no CastorUnpackerReport at the moment !
49 #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h" //-- HcalCastorDetId
50 
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 
78 
79 public:
80 
83 
86 
87  protected:
88 
90  void analyze(const edm::Event& iEvent, const edm::EventSetup& eventSetup);
91 
93  void beginJob();
94 
96  void beginRun(const edm::Run& iRun, const edm::EventSetup& eventSetup);
97 
99  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
100  const edm::EventSetup& eventSetup) ;
101 
103  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
104  const edm::EventSetup& eventSetup);
105 
107  void endJob(void);
108 
110  void endRun(const edm::Run& run, const edm::EventSetup& eventSetup);
111 
113  void reset(void);
114 
116  bool prescale();
117 
119  void CheckCastorStatus (const FEDRawDataCollection& rawraw,
120  const HcalUnpackerReport& report,
121  const CastorElectronicsMap& emap,
122  const CastorDigiCollection& castordigi
123  );
124 
125  private:
126 
134  int prescaleEvt_; //-- units of events
135  int prescaleLS_; //-- units of lumi sections
136  int prescaleTime_; //-- units of minutes
137  int prescaleUpdate_; //-- units of "updates", TBD
138 
142 
145 
147  int nevt_;
149  bool saved_;
150 
152  bool rawOK_ ;
153  bool reportOK_ ;
154  bool digiOK_ ;
155  bool rechitOK_ ;
156  bool towerOK_ ;
157  bool jetOK_ ;
158  bool jetIdOK_ ;
159 
160  int nRaw;
161  int nDigi;
162  int nRechit;
163  int nTower;
164  int nJet;
165  int nJetId;
166 
167 
169  bool showTiming_;
171 
173  struct{
174  timeval startTV,updateTV;
175  double elapsedTime;
176  double vetoTime;
177  double updateTime;
178  } psTime_;
179 
180 
183 
188  bool actonLS_ ;
190 
191  int ievt_;
192  int ievt_pre_; //-- copy of counter used for prescale purposes
194 
205 
207  // typedef std::vector<reco::CastorTower> CastorTowerCollection;
208  // edm::InputTag inputLabelCaloTower_;
209  // edm::InputTag inputLabelLaser_;
210 
212  std::map<uint32_t, std::vector<HcalCastorDetId> > DCCtoCell;
213  std::map<uint32_t, std::vector<HcalCastorDetId> > ::iterator thisDCC;
214  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > HTRtoCell;
215  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > ::iterator thisHTR;
216 
226 
227 
238 
240 
243 
246 
247  // pedestal width averaged over capIDs, calculated in beginRun
248  // aware of the difference between index[0..15][0..13]
249  // and sector/module numeration[1..16][1..14]
250  float fPedestalNSigmaAverage[14][16];
251 
252  std::vector<HcalGenericDetId> listEMap; //electronics Emap
253 
254 
255  std::ofstream m_logFile;
256 
259 
264 
266  bool EDMonOn_;
267 
270  std::map<HcalCastorDetId, unsigned int> myquality_;
272 
273  //define tokens
278 };
279 
280 #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
edm::RunNumber_t irun_
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &eventSetup)
edm::EDGetTokenT< CastorRecHitCollection > inputLabelRecHitCASTORToken_
edm::ESHandle< CastorDbService > conditions_
unsigned long long EventNumber_t
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:230
CastorTowerJetMonitor * TowerJetMon_
std::vector< HcalGenericDetId > listEMap
edm::InputTag inputLabelJetIdCASTOR_
CastorMonitorModule(const edm::ParameterSet &ps)
edm::InputTag inputLabelRecHitCASTOR_
MonitorElement * meTrigger_
edm::InputTag inputLabelReport_
CastorMonitorSelector * evtSel_
CastorDigiMonitor * DigiMon_
MonitorElement * meFEDS_
edm::EDGetTokenT< CastorDigiCollection > inputLabelDigiToken_
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_
edm::EventNumber_t ievent_
edm::EDGetTokenT< FEDRawDataCollection > inputLabelRawToken_
MonitorElement * CastorEventProduct
CastorPSMonitor * PSMon_
CastorChannelQualityMonitor * CQMon_
float fPedestalNSigmaAverage[14][16]
CastorRecHitMonitor * RecHitMon_
unsigned int RunNumber_t
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &eventSetup)
CastorHIMonitor * HIMon_
struct CastorMonitorModule::@278 psTime_
CastorChannelQuality * chanquality_
std::map< HcalCastorDetId, unsigned int > myquality_
edm::InputTag inputLabelCastorBasicJets_
Definition: Run.h:41
MonitorElement * meEVT_
edm::EDGetTokenT< HcalUnpackerReport > inputLabelReportToken_