CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
ZDCMonitorModule Class Reference

#include <ZDCMonitorModule.h>

Inheritance diagram for ZDCMonitorModule:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 ZDCMonitorModule (const edm::ParameterSet &ps)
 
 ~ZDCMonitorModule ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void beginRun (const edm::Run &run, const edm::EventSetup &c)
 
void endJob (void)
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
void endRun (const edm::Run &run, const edm::EventSetup &c)
 
bool prescale ()
 Boolean prescale test for this event. More...
 
void reset (void)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Private Attributes

bool checkZDC_
 
edm::ESHandle< HcalDbServiceconditions_
 
edm::CPUTimer cpu_timer
 
DQMStoredbe_
 Connection to the DQM backend. More...
 
int debug_
 Verbosity switch used for debugging or informational output. More...
 
bool dump2database_
 
edm::InputTag FEDRawDataCollection_
 
bool fedsListed_
 
std::vector< int > fedss
 
int ievent_
 
int ievt_
 
int ievt_digi_
 
int ievt_pre_
 
int ievt_rawdata_
 
int ievt_rechit_
 
unsigned int ilumisec
 
edm::InputTag inputLabelDigi_
 
edm::InputTag inputLabelRecHitZDC_
 
int irun_
 
int itime_
 
std::ofstream m_logFile
 
MonitorElementmeFEDS_
 
MonitorElementmeIEVTALL_
 
MonitorElementmeIEVTDIGI_
 
MonitorElementmeIEVTRAW_
 
MonitorElementmeIEVTRECHIT_
 
MonitorElementmeLatency_
 
MonitorElementmeQuality_
 
MonitorElementmeStatus_
 
MonitorElementmeTrigger_
 
MonitorElementmeZDC_
 
std::string monitorName_
 units of "updates", TBD More...
 
int nevt_
 
bool Online_
 
int prescaleEvt_
 
int prescaleLS_
 units of events More...
 
int prescaleTime_
 units of lumi sections More...
 
int prescaleUpdate_
 units of minutes More...
 
struct {
   double   elapsedTime
 
   timeval   startTV
 
   double   updateTime
 
   timeval   updateTV
 
   double   vetoTime
 
psTime_
 
const HcalElectronicsMapreadoutMap_
 
std::string rootFolder_
 
bool showTiming_
 
edm::EDGetTokenT
< HcalUnpackerReport
tok_hcal_
 
edm::EDGetTokenT
< ZDCDigiCollection
tok_zdc_
 
edm::EDGetTokenT
< ZDCRecHitCollection
tok_zdcrh_
 
HcalZDCMonitorzdcMon_
 
int ZDCpresent_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Detailed Description

Definition at line 36 of file ZDCMonitorModule.h.

Constructor & Destructor Documentation

ZDCMonitorModule::ZDCMonitorModule ( const edm::ParameterSet ps)

get time in milliseconds, convert to minutes

Definition at line 35 of file ZDCMonitorModule.cc.

References checkZDC_, gather_cfg::cout, dbe_, debug_, dump2database_, fedsListed_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ievent_, ilumisec, inputLabelDigi_, inputLabelRecHitZDC_, irun_, itime_, meFEDS_, meLatency_, meQuality_, meStatus_, NULL, Online_, cppFunctionSkipper::operator, prescaleEvt_, prescaleLS_, psTime_, rootFolder_, HcalZDCMonitor::setup(), showTiming_, AlCaHLTBitMon_QueryRunRegistry::string, tok_hcal_, tok_zdc_, tok_zdcrh_, zdcMon_, and ZDCpresent_.

35  {
36 
37  irun_=0; ilumisec=0; ievent_=0; itime_=0;
38 
39  meStatus_=0;
40  meFEDS_=0;
42  fedsListed_ = false;
43  zdcMon_ = 0;
44 
45  // Assumed ZDC is out of the run by default
46  ZDCpresent_=0;
47 
48  inputLabelDigi_ = ps.getParameter<edm::InputTag>("digiLabel");
49  inputLabelRecHitZDC_ = ps.getParameter<edm::InputTag>("zdcRecHitLabel");
50 
51  tok_hcal_ = consumes<HcalUnpackerReport>(inputLabelDigi_);
52  tok_zdc_ = consumes<ZDCDigiCollection>(inputLabelDigi_);
53  tok_zdcrh_ = consumes<ZDCRecHitCollection>(inputLabelRecHitZDC_);
54 
55  showTiming_ = ps.getUntrackedParameter<bool>("showTiming", false); //-- show CPU time
56  dump2database_ = ps.getUntrackedParameter<bool>("dump2database",false); //-- dumps output to database file
57  // Check Online running
58  Online_ = ps.getUntrackedParameter<bool>("Online",false);
59  checkZDC_=ps.getUntrackedParameter<bool>("checkZDC", true);
61  debug_ = ps.getUntrackedParameter<int>("debug", 0);
62  //FEDRawDataCollection_ = ps.getUntrackedParameter<edm::InputTag>("FEDRawDataCollection",edm::InputTag("source",""));
63 
64  if (checkZDC_)
65  {
66  zdcMon_ = new HcalZDCMonitor();
67  zdcMon_->setup(ps, dbe_);
68  }
69 
70  // set parameters
71  prescaleEvt_ = ps.getUntrackedParameter<int>("diagnosticPrescaleEvt", -1);
72  if(debug_>1) std::cout << "===>ZDCMonitor event prescale = " << prescaleEvt_ << " event(s)"<< std::endl;
73 
74  prescaleLS_ = ps.getUntrackedParameter<int>("diagnosticPrescaleLS", -1);
75  if(debug_>1) std::cout << "===>ZDCMonitor lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< std::endl;
76 
77  // Base folder for the contents of this job
78  std::string subsystemname = ps.getUntrackedParameter<std::string>("subSystemFolder", "ZDC") ;
79  if(debug_>0) std::cout << "===>ZDCMonitor name = " << subsystemname << std::endl;
80  rootFolder_ = subsystemname + "/";
81 
82  gettimeofday(&psTime_.updateTV,NULL);
84  psTime_.updateTime = (psTime_.updateTV.tv_sec*1000.0+psTime_.updateTV.tv_usec/1000.0);
85  psTime_.updateTime /= 1000.0;
86  psTime_.elapsedTime=0;
87  psTime_.vetoTime=psTime_.updateTime;
88 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
struct ZDCMonitorModule::@281 psTime_
edm::EDGetTokenT< HcalUnpackerReport > tok_hcal_
edm::InputTag inputLabelDigi_
edm::EDGetTokenT< ZDCRecHitCollection > tok_zdcrh_
#define NULL
Definition: scimark2.h:8
int prescaleLS_
units of events
MonitorElement * meQuality_
edm::InputTag inputLabelRecHitZDC_
int debug_
Verbosity switch used for debugging or informational output.
void setup(const edm::ParameterSet &ps, DQMStore *dbe)
HcalZDCMonitor * zdcMon_
std::string rootFolder_
edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
unsigned int ilumisec
MonitorElement * meStatus_
DQMStore * dbe_
Connection to the DQM backend.
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meLatency_
MonitorElement * meFEDS_
ZDCMonitorModule::~ZDCMonitorModule ( )

Definition at line 91 of file ZDCMonitorModule.cc.

References checkZDC_, HcalBaseMonitor::clearME(), dbe_, DQMStore::removeContents(), rootFolder_, DQMStore::setCurrentFolder(), and zdcMon_.

92 {
93  if (!checkZDC_) return;
94  if (dbe_!=0)
95  {
96  if (zdcMon_!=0) zdcMon_->clearME();
99  }
100 
101 if (zdcMon_!=0)
102  {
103  delete zdcMon_; zdcMon_=0;
104  }
105 }
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3135
virtual void clearME()
HcalZDCMonitor * zdcMon_
std::string rootFolder_
DQMStore * dbe_
Connection to the DQM backend.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667

Member Function Documentation

void ZDCMonitorModule::analyze ( const edm::Event e,
const edm::EventSetup c 
)
protectedvirtual

See if our products are in the event...

Implements edm::EDAnalyzer.

Definition at line 255 of file ZDCMonitorModule.cc.

References checkZDC_, gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), debug_, edm::EventID::event(), f, fedsListed_, fedss, MonitorElement::Fill(), edm::Event::getByToken(), edm::EventBase::id(), ievent_, ievt_, ievt_digi_, ievt_pre_, ievt_rawdata_, ievt_rechit_, ilumisec, inputLabelDigi_, inputLabelRecHitZDC_, irun_, edm::HandleBase::isValid(), itime_, edm::EventBase::luminosityBlock(), meFEDS_, meIEVTALL_, meIEVTDIGI_, meIEVTRAW_, meIEVTRECHIT_, meLatency_, meStatus_, meZDC_, nevt_, NULL, Online_, prescale(), prescaleEvt_, HcalZDCMonitor::processEvent(), psTime_, zeeHLT_cff::report, edm::CPUTimer::reset(), edm::EventID::run(), showTiming_, edm::CPUTimer::start(), edm::CPUTimer::stop(), edm::EventBase::time(), tok_hcal_, tok_zdc_, tok_zdcrh_, edm::Timestamp::value(), zdcMon_, and ZDCpresent_.

256 {
257  if (!checkZDC_) return;
258  // environment datamembers
259  irun_ = e.id().run();
260  ievent_ = e.id().event();
261  itime_ = e.time().value();
262 
263  if (Online_ && e.luminosityBlock()<ilumisec)
264  return;
265 
266  if (debug_>1) std::cout << "ZDCMonitorModule: evts: "<< nevt_ << ", run: " << irun_ << ", LS: " << e.luminosityBlock() << ", evt: " << ievent_ << ", time: " << itime_ << std::endl <<"\t counter = "<<ievt_pre_<<"\t total count = "<<ievt_<<std::endl;
267 
268  if ( meStatus_ ) meStatus_->Fill(1);
269  meLatency_->Fill(psTime_.elapsedTime);
270 
271 
273  bool rawOK_ = true;
274  bool digiOK_ = true;
275  bool zdchitOK_ = true;
276 
278  e.getByToken(tok_hcal_,report);
279  if (!report.isValid())
280  {
281  rawOK_=false;
282  edm::LogWarning("ZDCMonitorModule")<<" Unpacker Report Digi Collection "<<inputLabelDigi_<<" not available";
283  }
284  if (rawOK_)
285  {
286  if(!fedsListed_){
287  const std::vector<int> feds = (*report).getFedsUnpacked();
288  for(unsigned int f=0; f<feds.size(); f++){
289  meFEDS_->Fill(feds[f]);
290  }
291  fedsListed_ = true;
292  fedss = feds; //Assign to a non-const holder
293  }
294  }
295  if (rawOK_==true) ++ievt_rawdata_;
296 
297  // copy of Bryan Dahmes' calibration filter
298  /*
299  // need to get raw data first before running filter!
300  int calibType=-1;
301  int dccBCN=-1;
302 
303  if (rawOK_==true)
304  {
305  // checking FEDs for calibration information
306  int numEmptyFEDs = 0 ;
307  std::vector<int> calibTypeCounter(8,0) ;
308  for( int i = FEDNumbering::MINHCALFEDID; i <= FEDNumbering::MAXHCALFEDID; i++) {
309  const FEDRawData& fedData = rawraw->FEDData(i) ;
310 
311  if ( fedData.size() < 24 ) numEmptyFEDs++ ;
312  if ( fedData.size() < 24 ) continue;
313  int value = ((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
314  calibTypeCounter.at(value)++ ; // increment the counter for this calib type
315  // Temporary for Pawel -- get BCN #101
316  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(fedData.data());
317  dccBCN = dccHeader->getBunchId();
318  }
319  int maxCount = 0;
320  int numberOfFEDIds = FEDNumbering::MAXHCALFEDID - FEDNumbering::MINHCALFEDID + 1 ;
321  for (unsigned int i=0; i<calibTypeCounter.size(); i++) {
322  if ( calibTypeCounter.at(i) > maxCount )
323  { calibType = i ; maxCount = calibTypeCounter.at(i) ; }
324  if ( maxCount == numberOfFEDIds ) break ;
325  }
326 
327  if ( maxCount != (numberOfFEDIds-numEmptyFEDs) )
328  edm::LogWarning("HcalCalibTypeFilter") << "Conflicting calibration types found. Assigning type "
329  << calibType ;
330  LogDebug("HcalCalibTypeFilter") << "Calibration type is: " << calibType ;
331  } // if (rawOK_==true) // calibration loop
332  */
333 
334  // skip this event if we're prescaling...
335  ++ievt_;
336  if(prescaleEvt_>0 && prescale()) return;
337 
339  // try to get digis
341  e.getByToken(tok_zdc_,zdc_digi);
342  if (!zdc_digi.isValid())
343  {
344  digiOK_=false;
345  if (debug_>1) std::cout <<"<ZDCMonitorModule> COULDN'T GET ZDC DIGI"<<std::endl;
346  //edm::LogWarning("ZDCMonitorModule")<< inputLabelDigi_<<" zdc_digi not available";
347  }
348  if (digiOK_) ++ievt_digi_;
349 
351 
352  // try to get rechits
354  e.getByToken(tok_zdcrh_,zdc_hits);
355  if (!zdc_hits.isValid())
356  {
357  zdchitOK_=false;
358  // ZDC Warnings should be suppressed unless debugging is on (since we don't yet normally run zdcreco)
359  if (debug_>0)
360  edm::LogWarning("ZDCMonitorModule")<< inputLabelRecHitZDC_<<" not available";
361  }
362  if (zdchitOK_) ++ievt_rechit_;
363 
364 
366 
367  // Run the configured tasks, protect against missing products
372 
373  if (ZDCpresent_==0 && (digiOK_ || zdchitOK_))
374  {
375  ZDCpresent_=1;
377  }
378 
379  // Data Format monitor task
380  if (showTiming_)
381  {
383  }
384 
385  if (zdcMon_!=NULL && zdchitOK_ && digiOK_)
386  zdcMon_->processEvent(*zdc_digi,*zdc_hits);
387 
388  if (showTiming_)
389  {
390  cpu_timer.stop();
391  if (zdcMon_ !=NULL) std::cout <<"TIMER:: ZDC MONITOR ->"<<cpu_timer.cpuTime()<<std::endl;
393  }
394 
395  // Empty Event/Unsuppressed monitor plots
396 
397  if(debug_>0 && ievt_%1000 == 0)
398  std::cout << "ZDCMonitorModule: processed " << ievt_ << " events" << std::endl;
399 
400  if(debug_>1)
401  {
402  std::cout << "ZDCMonitorModule: processed " << ievt_ << " events" << std::endl;
403  std::cout << " ZDC RAW Data ==> " << rawOK_<< std::endl;
404  std::cout << " ZDC Digis ==> " << digiOK_<< std::endl;
405  std::cout << " ZDC RecHits ==> " << zdchitOK_<< std::endl;
406  }
407 
408  return;
409 }
RunNumber_t run() const
Definition: EventID.h:42
EventNumber_t event() const
Definition: EventID.h:44
std::vector< int > fedss
struct ZDCMonitorModule::@281 psTime_
edm::EDGetTokenT< HcalUnpackerReport > tok_hcal_
void start()
Definition: CPUTimer.cc:74
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::InputTag inputLabelDigi_
MonitorElement * meIEVTRECHIT_
edm::EDGetTokenT< ZDCRecHitCollection > tok_zdcrh_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:59
void reset()
Definition: CPUTimer.cc:107
#define NULL
Definition: scimark2.h:8
edm::CPUTimer cpu_timer
MonitorElement * meIEVTALL_
void Fill(long long x)
tuple report
Definition: zeeHLT_cff.py:9
edm::InputTag inputLabelRecHitZDC_
int debug_
Verbosity switch used for debugging or informational output.
MonitorElement * meIEVTRAW_
MonitorElement * meZDC_
double f[11][100]
HcalZDCMonitor * zdcMon_
Times stop()
Definition: CPUTimer.cc:94
bool isValid() const
Definition: HandleBase.h:76
edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
double cpuTime() const
Definition: CPUTimer.cc:158
unsigned int ilumisec
void processEvent(const ZDCDigiCollection &digi, const ZDCRecHitCollection &rechit)
MonitorElement * meIEVTDIGI_
edm::EventID id() const
Definition: EventBase.h:56
MonitorElement * meStatus_
tuple cout
Definition: gather_cfg.py:121
MonitorElement * meLatency_
TimeValue_t value() const
Definition: Timestamp.h:56
edm::Timestamp time() const
Definition: EventBase.h:57
MonitorElement * meFEDS_
bool prescale()
Boolean prescale test for this event.
void ZDCMonitorModule::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 109 of file ZDCMonitorModule.cc.

References checkZDC_, ievt_, ievt_digi_, ievt_pre_, ievt_rawdata_, and ievt_rechit_.

110 {
111  if (!checkZDC_) return;
112  // should we reset these counters at the start of each run?
113  ievt_ = 0;
114  ievt_pre_=0;
115 
116  // Counters for rawdata, digi, and rechit
117  ievt_rawdata_=0;
118  ievt_digi_=0;
119  ievt_rechit_=0;
120  return;
121 }
void ZDCMonitorModule::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 179 of file ZDCMonitorModule.cc.

References HcalBaseMonitor::beginLuminosityBlock(), checkZDC_, ilumisec, edm::LuminosityBlockBase::luminosityBlock(), Online_, and zdcMon_.

181 {
182  /* Don't start a new luminosity block if it is less than the current value
183  when running online. This avoids the problem of getting events
184  from mis-ordered lumi blocks, which screws up our lumi block
185  monitoring.
186  */
187  if (!checkZDC_) return;
188  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
189  return;
190 
191  // Otherwise, run normal startups
192  ilumisec = lumiSeg.luminosityBlock();
194 }
LuminosityBlockNumber_t luminosityBlock() const
HcalZDCMonitor * zdcMon_
void beginLuminosityBlock(int lb)
unsigned int ilumisec
void ZDCMonitorModule::beginRun ( const edm::Run run,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 124 of file ZDCMonitorModule.cc.

References HcalBaseMonitor::beginRun(), DQMStore::book1D(), DQMStore::bookInt(), checkZDC_, conditions_, dbe_, fedsListed_, MonitorElement::Fill(), edm::EventSetup::get(), ievt_, ievt_digi_, ievt_rawdata_, ievt_rechit_, FEDNumbering::MAXHCALFEDID, meFEDS_, meIEVTALL_, meIEVTDIGI_, meIEVTRAW_, meIEVTRECHIT_, meLatency_, meQuality_, meStatus_, meZDC_, FEDNumbering::MINHCALFEDID, NULL, reset(), rootFolder_, DQMStore::setCurrentFolder(), zdcMon_, and ZDCpresent_.

125 {
126  if (!checkZDC_) return;
127  fedsListed_ = false;
128  ZDCpresent_ = 0;
129 
130  reset();
131 
132  if ( dbe_ != NULL ){
133  dbe_->setCurrentFolder(rootFolder_+"DQM Job Status" );
134 
135  meIEVTALL_ = dbe_->bookInt("Events Processed");
136  meIEVTRAW_ = dbe_->bookInt("Events with Raw Data");
137  meIEVTDIGI_= dbe_->bookInt("Events with Digis");
138  meIEVTRECHIT_ = dbe_->bookInt("Events with RecHits");
143  meStatus_ = dbe_->bookInt("STATUS");
144 
146  // process latency was (200,0,1), but that gave overflows
147  meLatency_ = dbe_->book1D("Process Latency","Process Latency",200,0,10);
148  meQuality_ = dbe_->book1D("Quality Status","Quality Status",100,0,1);
149  // Store whether or not subdetectors are present
150  meZDC_ = dbe_->bookInt("ZDCpresent");
151 
152  meStatus_->Fill(0);
153  // Should fill with 0 to start
155 
156  }
157  // Create histograms for individual Tasks
158  if (zdcMon_) zdcMon_->beginRun();
159 
161  c.get<HcalDbRecord>().get( pSetup );
162 
163  // Not checking ZDC raw data? In that case, no readoutMap, hcaldetid_, etc. info needed
164 
165 
166  //get conditions
167  c.get<HcalDbRecord>().get(conditions_);
168 
169  // get channel quality -- not yet used for ZDC
170  /*
171  edm::ESHandle<HcalChannelQuality> p;
172  c.get<HcalChannelQualityRcd>().get(p);
173  chanquality_= new HcalChannelQuality(*p.product());
174  */
175  return;
176 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
virtual void beginRun()
MonitorElement * meIEVTRECHIT_
edm::ESHandle< HcalDbService > conditions_
#define NULL
Definition: scimark2.h:8
MonitorElement * meIEVTALL_
void Fill(long long x)
MonitorElement * meQuality_
MonitorElement * meIEVTRAW_
MonitorElement * meZDC_
HcalZDCMonitor * zdcMon_
std::string rootFolder_
const T & get() const
Definition: EventSetup.h:55
MonitorElement * meIEVTDIGI_
MonitorElement * meStatus_
DQMStore * dbe_
Connection to the DQM backend.
MonitorElement * meLatency_
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:861
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
MonitorElement * meFEDS_
void ZDCMonitorModule::endJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 231 of file ZDCMonitorModule.cc.

References checkZDC_, dbe_, HcalBaseMonitor::done(), MonitorElement::Fill(), DQMStore::get(), meStatus_, NULL, rootFolder_, and zdcMon_.

232 {
233  if (!checkZDC_) return;
234  if ( dbe_ != NULL ){
235  meStatus_ = dbe_->get(rootFolder_+"DQM Job Status/STATUS");
236  }
237 
238  if ( meStatus_ ) meStatus_->Fill(2);
239 
240  return; // All of the rest of the endjob stuff (filling db, etc.) should be done in the client, right?
241 
242  if (zdcMon_!=NULL) zdcMon_->done();
243 
244  return;
245 }
#define NULL
Definition: scimark2.h:8
void Fill(long long x)
HcalZDCMonitor * zdcMon_
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
std::string rootFolder_
virtual void done()
MonitorElement * meStatus_
DQMStore * dbe_
Connection to the DQM backend.
void ZDCMonitorModule::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 198 of file ZDCMonitorModule.cc.

References checkZDC_, HcalZDCMonitor::endLuminosityBlock(), ilumisec, edm::LuminosityBlockBase::luminosityBlock(), Online_, prescale(), prescaleLS_, and zdcMon_.

200 {
201  if (!checkZDC_) return;
202  // In online running, don't process events that occur before current luminosity block
203  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
204  return;
205 
206  // Call these every luminosity block
207  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
208  // Call these only if prescale set
209  if (prescaleLS_>-1 && !prescale())
210  {
211  }
212  return;
213 }
int prescaleLS_
units of events
LuminosityBlockNumber_t luminosityBlock() const
HcalZDCMonitor * zdcMon_
void endLuminosityBlock(void)
unsigned int ilumisec
bool prescale()
Boolean prescale test for this event.
void ZDCMonitorModule::endRun ( const edm::Run run,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 216 of file ZDCMonitorModule.cc.

References checkZDC_, gather_cfg::cout, debug_, HcalZDCMonitor::endLuminosityBlock(), ievt_, and zdcMon_.

217 {
218  if (!checkZDC_) return;
219  if (debug_>0)
220  std::cout <<"ZDCMonitorModule::endRun(...) ievt = "<<ievt_<<std::endl;
221 
222  // These should be unnecessary; call them just in case, so that
223  // we're sure we get at least one fill per run
224  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
225 
226  return;
227 }
int debug_
Verbosity switch used for debugging or informational output.
HcalZDCMonitor * zdcMon_
void endLuminosityBlock(void)
tuple cout
Definition: gather_cfg.py:121
bool ZDCMonitorModule::prescale ( )
protected

Boolean prescale test for this event.

Return true if this event should be skipped according to the prescale condition... Accommodate a logical "OR" of the possible tests

Definition at line 412 of file ZDCMonitorModule.cc.

References checkZDC_, gather_cfg::cout, debug_, ievt_, ilumisec, prescaleEvt_, and prescaleLS_.

Referenced by analyze(), and endLuminosityBlock().

413 {
414  if (!checkZDC_) return true;
415 
418  if (debug_>1) std::cout <<"ZDCMonitorModule::prescale: ievt = "<<ievt_<<std::endl;
419  // If no prescales are set, return 'false'. (This means that we should process the event.)
420  if(prescaleEvt_<=0 && prescaleLS_<=0) return false;
421 
422  // Now check whether event should be kept. Assume that it should not by default
423  bool keepEvent=false;
424 
425  // Keep event if prescaleLS test is met or if prescaleEvt test is met
426  if(prescaleLS_>0 && (ilumisec%prescaleLS_)==0) keepEvent = true; // check on ls prescale;
427  if (prescaleEvt_>0 && (ievt_%prescaleEvt_)==0) keepEvent = true; //
428 
429  // if any criteria wants to keep the event, do so
430  if (keepEvent) return false; // event should be kept; don't apply prescale
431  return true; // apply prescale by default
432 
433 } // ZDCMonitorModule::prescale(...)
int prescaleLS_
units of events
int debug_
Verbosity switch used for debugging or informational output.
unsigned int ilumisec
tuple cout
Definition: gather_cfg.py:121
void ZDCMonitorModule::reset ( void  )
protected

Definition at line 248 of file ZDCMonitorModule.cc.

References checkZDC_, NULL, HcalZDCMonitor::reset(), and zdcMon_.

Referenced by beginRun().

248  {
249  if (!checkZDC_) return;
250  if (zdcMon_!=NULL) zdcMon_->reset();
251 
252 }
#define NULL
Definition: scimark2.h:8
HcalZDCMonitor * zdcMon_

Member Data Documentation

bool ZDCMonitorModule::checkZDC_
private
edm::ESHandle<HcalDbService> ZDCMonitorModule::conditions_
private

Definition at line 163 of file ZDCMonitorModule.h.

Referenced by beginRun().

edm::CPUTimer ZDCMonitorModule::cpu_timer
private

Definition at line 110 of file ZDCMonitorModule.h.

Referenced by analyze().

DQMStore* ZDCMonitorModule::dbe_
private

Connection to the DQM backend.

Definition at line 123 of file ZDCMonitorModule.h.

Referenced by beginRun(), endJob(), ZDCMonitorModule(), and ~ZDCMonitorModule().

int ZDCMonitorModule::debug_
private

Verbosity switch used for debugging or informational output.

Definition at line 106 of file ZDCMonitorModule.h.

Referenced by analyze(), endRun(), prescale(), and ZDCMonitorModule().

bool ZDCMonitorModule::dump2database_
private

Definition at line 173 of file ZDCMonitorModule.h.

Referenced by ZDCMonitorModule().

double ZDCMonitorModule::elapsedTime

Definition at line 117 of file ZDCMonitorModule.h.

edm::InputTag ZDCMonitorModule::FEDRawDataCollection_
private

Definition at line 141 of file ZDCMonitorModule.h.

bool ZDCMonitorModule::fedsListed_
private

Definition at line 136 of file ZDCMonitorModule.h.

Referenced by analyze(), beginRun(), and ZDCMonitorModule().

std::vector<int> ZDCMonitorModule::fedss
private

Definition at line 85 of file ZDCMonitorModule.h.

Referenced by analyze().

int ZDCMonitorModule::ievent_
private

Definition at line 126 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::ievt_
private

Definition at line 131 of file ZDCMonitorModule.h.

Referenced by analyze(), beginJob(), beginRun(), endRun(), and prescale().

int ZDCMonitorModule::ievt_digi_
private

Definition at line 133 of file ZDCMonitorModule.h.

Referenced by analyze(), beginJob(), and beginRun().

int ZDCMonitorModule::ievt_pre_
private

Definition at line 135 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginJob().

int ZDCMonitorModule::ievt_rawdata_
private

Definition at line 132 of file ZDCMonitorModule.h.

Referenced by analyze(), beginJob(), and beginRun().

int ZDCMonitorModule::ievt_rechit_
private

Definition at line 134 of file ZDCMonitorModule.h.

Referenced by analyze(), beginJob(), and beginRun().

unsigned int ZDCMonitorModule::ilumisec
private
edm::InputTag ZDCMonitorModule::inputLabelDigi_
private

Definition at line 138 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::InputTag ZDCMonitorModule::inputLabelRecHitZDC_
private

Definition at line 139 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::irun_
private

Definition at line 126 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::itime_
private

Definition at line 126 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

std::ofstream ZDCMonitorModule::m_logFile
private

Definition at line 166 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meFEDS_
private

Definition at line 152 of file ZDCMonitorModule.h.

Referenced by analyze(), beginRun(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meIEVTALL_
private

Definition at line 147 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTDIGI_
private

Definition at line 149 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTRAW_
private

Definition at line 148 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTRECHIT_
private

Definition at line 150 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meLatency_
private

Definition at line 155 of file ZDCMonitorModule.h.

Referenced by analyze(), beginRun(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meQuality_
private

Definition at line 156 of file ZDCMonitorModule.h.

Referenced by beginRun(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meStatus_
private

Definition at line 153 of file ZDCMonitorModule.h.

Referenced by analyze(), beginRun(), endJob(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meTrigger_
private

Definition at line 154 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meZDC_
private

Definition at line 170 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

std::string ZDCMonitorModule::monitorName_
private

units of "updates", TBD

The name of the monitoring process which derives from this class, used to standardize filename and file structure

Definition at line 103 of file ZDCMonitorModule.h.

int ZDCMonitorModule::nevt_
private

Definition at line 113 of file ZDCMonitorModule.h.

Referenced by analyze().

bool ZDCMonitorModule::Online_
private
int ZDCMonitorModule::prescaleEvt_
private

Prescale variables for restricting the frequency of analyzer behavior. The base class does not implement prescales. Set to -1 to be ignored.

Definition at line 94 of file ZDCMonitorModule.h.

Referenced by analyze(), prescale(), and ZDCMonitorModule().

int ZDCMonitorModule::prescaleLS_
private

units of events

Definition at line 95 of file ZDCMonitorModule.h.

Referenced by endLuminosityBlock(), prescale(), and ZDCMonitorModule().

int ZDCMonitorModule::prescaleTime_
private

units of lumi sections

Definition at line 96 of file ZDCMonitorModule.h.

int ZDCMonitorModule::prescaleUpdate_
private

units of minutes

Definition at line 97 of file ZDCMonitorModule.h.

struct { ... } ZDCMonitorModule::psTime_

Referenced by analyze(), and ZDCMonitorModule().

const HcalElectronicsMap* ZDCMonitorModule::readoutMap_
private

Definition at line 164 of file ZDCMonitorModule.h.

std::string ZDCMonitorModule::rootFolder_
private

Definition at line 129 of file ZDCMonitorModule.h.

Referenced by beginRun(), endJob(), ZDCMonitorModule(), and ~ZDCMonitorModule().

bool ZDCMonitorModule::showTiming_
private

Definition at line 109 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

timeval ZDCMonitorModule::startTV

Definition at line 116 of file ZDCMonitorModule.h.

edm::EDGetTokenT<HcalUnpackerReport> ZDCMonitorModule::tok_hcal_
private

Definition at line 143 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::EDGetTokenT<ZDCDigiCollection> ZDCMonitorModule::tok_zdc_
private

Definition at line 144 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::EDGetTokenT<ZDCRecHitCollection> ZDCMonitorModule::tok_zdcrh_
private

Definition at line 145 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

double ZDCMonitorModule::updateTime

Definition at line 119 of file ZDCMonitorModule.h.

timeval ZDCMonitorModule::updateTV

Definition at line 116 of file ZDCMonitorModule.h.

double ZDCMonitorModule::vetoTime

Definition at line 118 of file ZDCMonitorModule.h.

HcalZDCMonitor* ZDCMonitorModule::zdcMon_
private
int ZDCMonitorModule::ZDCpresent_
private

Definition at line 169 of file ZDCMonitorModule.h.

Referenced by analyze(), beginRun(), and ZDCMonitorModule().