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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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_
 
HcalZDCMonitorzdcMon_
 
int ZDCpresent_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 35 of file ZDCMonitorModule.h.

Constructor & Destructor Documentation

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

get time in milliseconds, convert to minutes

Definition at line 37 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, zdcMon_, and ZDCpresent_.

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

Definition at line 88 of file ZDCMonitorModule.cc.

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

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

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 252 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::getByLabel(), 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(), edm::Timestamp::value(), zdcMon_, and ZDCpresent_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 106 of file ZDCMonitorModule.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 176 of file ZDCMonitorModule.cc.

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

178 {
179  /* Don't start a new luminosity block if it is less than the current value
180  when running online. This avoids the problem of getting events
181  from mis-ordered lumi blocks, which screws up our lumi block
182  monitoring.
183  */
184  if (!checkZDC_) return;
185  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
186  return;
187 
188  // Otherwise, run normal startups
189  ilumisec = lumiSeg.luminosityBlock();
191 }
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 121 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_.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 228 of file ZDCMonitorModule.cc.

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

229 {
230  if (!checkZDC_) return;
231  if ( dbe_ != NULL ){
232  meStatus_ = dbe_->get(rootFolder_+"DQM Job Status/STATUS");
233  }
234 
235  if ( meStatus_ ) meStatus_->Fill(2);
236 
237  return; // All of the rest of the endjob stuff (filling db, etc.) should be done in the client, right?
238 
239  if (zdcMon_!=NULL) zdcMon_->done();
240 
241  return;
242 }
#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:1473
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 195 of file ZDCMonitorModule.cc.

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

197 {
198  if (!checkZDC_) return;
199  // In online running, don't process events that occur before current luminosity block
200  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
201  return;
202 
203  // Call these every luminosity block
204  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
205  // Call these only if prescale set
206  if (prescaleLS_>-1 && !prescale())
207  {
208  }
209  return;
210 }
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 213 of file ZDCMonitorModule.cc.

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

214 {
215  if (!checkZDC_) return;
216  if (debug_>0)
217  std::cout <<"ZDCMonitorModule::endRun(...) ievt = "<<ievt_<<std::endl;
218 
219  // These should be unnecessary; call them just in case, so that
220  // we're sure we get at least one fill per run
221  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
222 
223  return;
224 }
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 409 of file ZDCMonitorModule.cc.

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

Referenced by analyze(), and endLuminosityBlock().

410 {
411  if (!checkZDC_) return true;
412 
415  if (debug_>1) std::cout <<"ZDCMonitorModule::prescale: ievt = "<<ievt_<<std::endl;
416  // If no prescales are set, return 'false'. (This means that we should process the event.)
417  if(prescaleEvt_<=0 && prescaleLS_<=0) return false;
418 
419  // Now check whether event should be kept. Assume that it should not by default
420  bool keepEvent=false;
421 
422  // Keep event if prescaleLS test is met or if prescaleEvt test is met
423  if(prescaleLS_>0 && (ilumisec%prescaleLS_)==0) keepEvent = true; // check on ls prescale;
424  if (prescaleEvt_>0 && (ievt_%prescaleEvt_)==0) keepEvent = true; //
425 
426  // if any criteria wants to keep the event, do so
427  if (keepEvent) return false; // event should be kept; don't apply prescale
428  return true; // apply prescale by default
429 
430 } // 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 245 of file ZDCMonitorModule.cc.

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

Referenced by beginRun().

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

Member Data Documentation

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

Definition at line 158 of file ZDCMonitorModule.h.

Referenced by beginRun().

edm::CPUTimer ZDCMonitorModule::cpu_timer
private

Definition at line 109 of file ZDCMonitorModule.h.

Referenced by analyze().

DQMStore* ZDCMonitorModule::dbe_
private

Connection to the DQM backend.

Definition at line 122 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 105 of file ZDCMonitorModule.h.

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

bool ZDCMonitorModule::dump2database_
private

Definition at line 168 of file ZDCMonitorModule.h.

Referenced by ZDCMonitorModule().

double ZDCMonitorModule::elapsedTime

Definition at line 116 of file ZDCMonitorModule.h.

edm::InputTag ZDCMonitorModule::FEDRawDataCollection_
private

Definition at line 140 of file ZDCMonitorModule.h.

bool ZDCMonitorModule::fedsListed_
private

Definition at line 135 of file ZDCMonitorModule.h.

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

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

Definition at line 84 of file ZDCMonitorModule.h.

Referenced by analyze().

int ZDCMonitorModule::ievent_
private

Definition at line 125 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::ievt_
private

Definition at line 130 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_digi_
private

Definition at line 132 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_pre_
private

Definition at line 134 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginJob().

int ZDCMonitorModule::ievt_rawdata_
private

Definition at line 131 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_rechit_
private

Definition at line 133 of file ZDCMonitorModule.h.

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

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

Definition at line 137 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::InputTag ZDCMonitorModule::inputLabelRecHitZDC_
private

Definition at line 138 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::irun_
private

Definition at line 125 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::itime_
private

Definition at line 125 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

std::ofstream ZDCMonitorModule::m_logFile
private

Definition at line 161 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meFEDS_
private

Definition at line 147 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meIEVTALL_
private

Definition at line 142 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTDIGI_
private

Definition at line 144 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTRAW_
private

Definition at line 143 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meIEVTRECHIT_
private

Definition at line 145 of file ZDCMonitorModule.h.

Referenced by analyze(), and beginRun().

MonitorElement* ZDCMonitorModule::meLatency_
private

Definition at line 150 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meQuality_
private

Definition at line 151 of file ZDCMonitorModule.h.

Referenced by beginRun(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meStatus_
private

Definition at line 148 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meTrigger_
private

Definition at line 149 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meZDC_
private

Definition at line 165 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 102 of file ZDCMonitorModule.h.

int ZDCMonitorModule::nevt_
private

Definition at line 112 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 93 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::prescaleLS_
private

units of events

Definition at line 94 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::prescaleTime_
private

units of lumi sections

Definition at line 95 of file ZDCMonitorModule.h.

int ZDCMonitorModule::prescaleUpdate_
private

units of minutes

Definition at line 96 of file ZDCMonitorModule.h.

struct { ... } ZDCMonitorModule::psTime_

Referenced by analyze(), and ZDCMonitorModule().

const HcalElectronicsMap* ZDCMonitorModule::readoutMap_
private

Definition at line 159 of file ZDCMonitorModule.h.

std::string ZDCMonitorModule::rootFolder_
private

Definition at line 128 of file ZDCMonitorModule.h.

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

bool ZDCMonitorModule::showTiming_
private

Definition at line 108 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

timeval ZDCMonitorModule::startTV

Definition at line 115 of file ZDCMonitorModule.h.

double ZDCMonitorModule::updateTime

Definition at line 118 of file ZDCMonitorModule.h.

timeval ZDCMonitorModule::updateTV

Definition at line 115 of file ZDCMonitorModule.h.

double ZDCMonitorModule::vetoTime

Definition at line 117 of file ZDCMonitorModule.h.

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

Definition at line 164 of file ZDCMonitorModule.h.

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