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 
59 
60 #include "CalibCalorimetry/CastorCalib/interface/CastorDbASCIIIO.h" //-- use to get/dump Calib to DB
61 #include "CondFormats/CastorObjects/interface/CastorChannelQuality.h" //-- use to get/hold channel status
63 
64 
66 
67 #include <memory>
68 #include <iostream>
69 #include <fstream>
70 #include <vector>
71 #include <string>
72 #include <sys/time.h>
73 
74 
75 
77 
78 public:
79 
82 
85 
86  protected:
87 
89  void analyze(const edm::Event& iEvent, const edm::EventSetup& eventSetup);
90 
92  void beginJob();
93 
95  void beginRun(const edm::Run& iRun, const edm::EventSetup& eventSetup);
96 
98  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
99  const edm::EventSetup& eventSetup) ;
100 
102  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,
103  const edm::EventSetup& eventSetup);
104 
106  void endJob(void);
107 
109  void endRun(const edm::Run& run, const edm::EventSetup& eventSetup);
110 
112  void reset(void);
113 
115  bool prescale();
116 
118  void CheckCastorStatus (const FEDRawDataCollection& rawraw,
119  const HcalUnpackerReport& report,
120  const CastorElectronicsMap& emap,
121  const CastorDigiCollection& castordigi
122  );
123 
124  private:
125 
133  int prescaleEvt_; //-- units of events
134  int prescaleLS_; //-- units of lumi sections
135  int prescaleTime_; //-- units of minutes
136  int prescaleUpdate_; //-- units of "updates", TBD
137 
141 
144 
146  int nevt_;
148  bool saved_;
149 
151  bool rawOK_ ;
152  bool reportOK_ ;
153  bool digiOK_ ;
154  bool rechitOK_ ;
155  bool towerOK_ ;
156  bool jetOK_ ;
157  bool jetIdOK_ ;
158 
159  int nRaw;
160  int nDigi;
161  int nRechit;
162  int nTower;
163  int nJet;
164  int nJetId;
165 
166 
168  bool showTiming_;
170 
172  struct{
173  timeval startTV,updateTV;
174  double elapsedTime;
175  double vetoTime;
176  double updateTime;
177  } psTime_;
178 
179 
182 
185  bool actonLS_ ;
187 
188  int ievt_;
189  int ievt_pre_; //-- copy of counter used for prescale purposes
191 
202 
204  // typedef std::vector<reco::CastorTower> CastorTowerCollection;
205  // edm::InputTag inputLabelCaloTower_;
206  // edm::InputTag inputLabelLaser_;
207 
209  std::map<uint32_t, std::vector<HcalCastorDetId> > DCCtoCell;
210  std::map<uint32_t, std::vector<HcalCastorDetId> > ::iterator thisDCC;
211  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > HTRtoCell;
212  std::map<std::pair <int,int> , std::vector<HcalCastorDetId> > ::iterator thisHTR;
213 
223 
224 
235 
237 
240 
243 
244  // pedestal width averaged over capIDs, calculated in beginRun
245  // aware of the difference between index[0..15][0..13]
246  // and sector/module numeration[1..16][1..14]
247  float fPedestalNSigmaAverage[14][16];
248 
249  std::vector<HcalGenericDetId> listEMap; //electronics Emap
250 
251 
252  std::ofstream m_logFile;
253 
256 
261 
263  bool EDMonOn_;
264 
267  std::map<HcalCastorDetId, unsigned int> myquality_;
269 
270  //define tokens
275 };
276 
277 #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::EDGetTokenT< CastorRecHitCollection > inputLabelRecHitCASTORToken_
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
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_
struct CastorMonitorModule::@255 psTime_
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::EDGetTokenT< FEDRawDataCollection > inputLabelRawToken_
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:41
MonitorElement * meEVT_
edm::EDGetTokenT< HcalUnpackerReport > inputLabelReportToken_