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:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
 
 ZDCMonitorModule (const edm::ParameterSet &ps)
 
 ~ZDCMonitorModule ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) 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 beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 
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::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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
 
int debug_
 Verbosity switch used for debugging or informational output. More...
 
bool dump2database_
 
edm::InputTag FEDRawDataCollection_
 
bool fedsListed_
 
std::vector< int > fedss
 
edm::EventNumber_t ievent_
 
int ievt_
 
int ievt_digi_
 
int ievt_pre_
 
int ievt_rawdata_
 
int ievt_rechit_
 
unsigned int ilumisec
 
edm::InputTag inputLabelDigi_
 
edm::InputTag inputLabelRecHitZDC_
 
edm::RunNumber_t irun_
 
int itime_
 
std::ofstream m_logFile
 
MonitorElementmeFEDS_
 
MonitorElementmeIEVTALL_
 
MonitorElementmeIEVTDIGI_
 
MonitorElementmeIEVTRAW_
 
MonitorElementmeIEVTRECHIT_
 
MonitorElementmeLatency_
 
MonitorElementmeQuality_
 
MonitorElementmeStatus_
 
MonitorElementmeTrigger_
 
MonitorElementmeZDC_
 
std::string monitorName_
 
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...
 
const edm::ParameterSetps_
 units of "updates", TBD 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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Definition at line 37 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, debug_, dump2database_, fedsListed_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ievent_, ievt_, ievt_digi_, ievt_pre_, ievt_rawdata_, ievt_rechit_, ilumisec, inputLabelDigi_, inputLabelRecHitZDC_, irun_, itime_, meFEDS_, meLatency_, meQuality_, meStatus_, NULL, Online_, prescaleEvt_, prescaleLS_, psTime_, rootFolder_, showTiming_, AlCaHLTBitMon_QueryRunRegistry::string, tok_hcal_, tok_zdc_, tok_zdcrh_, zdcMon_, and ZDCpresent_.

35  :ps_(ps)
36 {
37 
38  irun_=0; ilumisec=0; ievent_=0; itime_=0;
39 
40  meStatus_=0;
41  meFEDS_=0;
43  fedsListed_ = false;
44  zdcMon_ = 0;
45 
46  // Assumed ZDC is out of the run by default
47  ZDCpresent_=0;
48 
49  inputLabelDigi_ = ps.getParameter<edm::InputTag>("digiLabel");
50  inputLabelRecHitZDC_ = ps.getParameter<edm::InputTag>("zdcRecHitLabel");
51 
52  tok_hcal_ = consumes<HcalUnpackerReport>(inputLabelDigi_);
53  tok_zdc_ = consumes<ZDCDigiCollection>(inputLabelDigi_);
54  tok_zdcrh_ = consumes<ZDCRecHitCollection>(inputLabelRecHitZDC_);
55 
56  showTiming_ = ps.getUntrackedParameter<bool>("showTiming", false); //-- show CPU time
57  dump2database_ = ps.getUntrackedParameter<bool>("dump2database",false); //-- dumps output to database file
58  // Check Online running
59  Online_ = ps.getUntrackedParameter<bool>("Online",false);
60  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  // set parameters
65  prescaleEvt_ = ps.getUntrackedParameter<int>("diagnosticPrescaleEvt", -1);
66  if(debug_>1) std::cout << "===>ZDCMonitor event prescale = " << prescaleEvt_ << " event(s)"<< std::endl;
67 
68  prescaleLS_ = ps.getUntrackedParameter<int>("diagnosticPrescaleLS", -1);
69  if(debug_>1) std::cout << "===>ZDCMonitor lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< std::endl;
70 
71  // Base folder for the contents of this job
72  std::string subsystemname = ps.getUntrackedParameter<std::string>("subSystemFolder", "ZDC") ;
73  if(debug_>0) std::cout << "===>ZDCMonitor name = " << subsystemname << std::endl;
74  rootFolder_ = subsystemname + "/";
75 
76  gettimeofday(&psTime_.updateTV,NULL);
78  psTime_.updateTime = (psTime_.updateTV.tv_sec*1000.0+psTime_.updateTV.tv_usec/1000.0);
79  psTime_.updateTime /= 1000.0;
80  psTime_.elapsedTime=0;
81  psTime_.vetoTime=psTime_.updateTime;
82 
83  // beginJob contents has been moved to the constructor for the MT migration
84  if (checkZDC_) {
85  // should we reset these counters at the start of each run?
86  ievt_ = 0;
87  ievt_pre_=0;
88 
89  // Counters for rawdata, digi, and rechit
90  ievt_rawdata_=0;
91  ievt_digi_=0;
92  ievt_rechit_=0;
93  }
94 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
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.
HcalZDCMonitor * zdcMon_
std::string rootFolder_
struct ZDCMonitorModule::@279 psTime_
edm::EDGetTokenT< ZDCDigiCollection > tok_zdc_
const edm::ParameterSet & ps_
units of &quot;updates&quot;, TBD
unsigned int ilumisec
MonitorElement * meStatus_
edm::RunNumber_t irun_
tuple cout
Definition: gather_cfg.py:121
edm::EventNumber_t ievent_
MonitorElement * meLatency_
MonitorElement * meFEDS_
ZDCMonitorModule::~ZDCMonitorModule ( )

Definition at line 97 of file ZDCMonitorModule.cc.

References checkZDC_, and zdcMon_.

98 {
99  if (!checkZDC_) return;
100 
101 if (zdcMon_!=0)
102  {
103  delete zdcMon_; zdcMon_=0;
104  }
105 }
HcalZDCMonitor * zdcMon_

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::stream::EDAnalyzerBase.

Definition at line 226 of file ZDCMonitorModule.cc.

References checkZDC_, gather_cfg::cout, cpu_timer, edm::CPUTimer::cpuTime(), debug_, edm::EventID::event(), f, HcalMonitorModule_cfi::feds, 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_.

227 {
228  if (!checkZDC_) return;
229  // environment datamembers
230  irun_ = e.id().run();
231  ievent_ = e.id().event();
232  itime_ = e.time().value();
233 
234  if (Online_ && e.luminosityBlock()<ilumisec)
235  return;
236 
237  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;
238 
239  if ( meStatus_ ) meStatus_->Fill(1);
240  meLatency_->Fill(psTime_.elapsedTime);
241 
242 
244  bool rawOK_ = true;
245  bool digiOK_ = true;
246  bool zdchitOK_ = true;
247 
249  e.getByToken(tok_hcal_,report);
250  if (!report.isValid())
251  {
252  rawOK_=false;
253  edm::LogWarning("ZDCMonitorModule")<<" Unpacker Report Digi Collection "<<inputLabelDigi_<<" not available";
254  }
255  if (rawOK_)
256  {
257  if(!fedsListed_){
258  const std::vector<int> feds = (*report).getFedsUnpacked();
259  for(unsigned int f=0; f<feds.size(); f++){
260  meFEDS_->Fill(feds[f]);
261  }
262  fedsListed_ = true;
263  fedss = feds; //Assign to a non-const holder
264  }
265  }
266  if (rawOK_==true) ++ievt_rawdata_;
267 
268  // copy of Bryan Dahmes' calibration filter
269  /*
270  // need to get raw data first before running filter!
271  int calibType=-1;
272  int dccBCN=-1;
273 
274  if (rawOK_==true)
275  {
276  // checking FEDs for calibration information
277  int numEmptyFEDs = 0 ;
278  std::vector<int> calibTypeCounter(8,0) ;
279  for( int i = FEDNumbering::MINHCALFEDID; i <= FEDNumbering::MAXHCALFEDID; i++) {
280  const FEDRawData& fedData = rawraw->FEDData(i) ;
281 
282  if ( fedData.size() < 24 ) numEmptyFEDs++ ;
283  if ( fedData.size() < 24 ) continue;
284  int value = ((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
285  calibTypeCounter.at(value)++ ; // increment the counter for this calib type
286  // Temporary for Pawel -- get BCN #101
287  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(fedData.data());
288  dccBCN = dccHeader->getBunchId();
289  }
290  int maxCount = 0;
291  int numberOfFEDIds = FEDNumbering::MAXHCALFEDID - FEDNumbering::MINHCALFEDID + 1 ;
292  for (unsigned int i=0; i<calibTypeCounter.size(); i++) {
293  if ( calibTypeCounter.at(i) > maxCount )
294  { calibType = i ; maxCount = calibTypeCounter.at(i) ; }
295  if ( maxCount == numberOfFEDIds ) break ;
296  }
297 
298  if ( maxCount != (numberOfFEDIds-numEmptyFEDs) )
299  edm::LogWarning("HcalCalibTypeFilter") << "Conflicting calibration types found. Assigning type "
300  << calibType ;
301  LogDebug("HcalCalibTypeFilter") << "Calibration type is: " << calibType ;
302  } // if (rawOK_==true) // calibration loop
303  */
304 
305  // skip this event if we're prescaling...
306  ++ievt_;
307  if(prescaleEvt_>0 && prescale()) return;
308 
310  // try to get digis
312  e.getByToken(tok_zdc_,zdc_digi);
313  if (!zdc_digi.isValid())
314  {
315  digiOK_=false;
316  if (debug_>1) std::cout <<"<ZDCMonitorModule> COULDN'T GET ZDC DIGI"<<std::endl;
317  //edm::LogWarning("ZDCMonitorModule")<< inputLabelDigi_<<" zdc_digi not available";
318  }
319  if (digiOK_) ++ievt_digi_;
320 
322 
323  // try to get rechits
325  e.getByToken(tok_zdcrh_,zdc_hits);
326  if (!zdc_hits.isValid())
327  {
328  zdchitOK_=false;
329  // ZDC Warnings should be suppressed unless debugging is on (since we don't yet normally run zdcreco)
330  if (debug_>0)
331  edm::LogWarning("ZDCMonitorModule")<< inputLabelRecHitZDC_<<" not available";
332  }
333  if (zdchitOK_) ++ievt_rechit_;
334 
335 
337 
338  // Run the configured tasks, protect against missing products
343 
344  if (ZDCpresent_==0 && (digiOK_ || zdchitOK_))
345  {
346  ZDCpresent_=1;
348  }
349 
350  // Data Format monitor task
351  if (showTiming_)
352  {
354  }
355 
356  if (zdcMon_!=NULL && zdchitOK_ && digiOK_)
357  zdcMon_->processEvent(*zdc_digi,*zdc_hits);
358 
359  if (showTiming_)
360  {
361  cpu_timer.stop();
362  if (zdcMon_ !=NULL) std::cout <<"TIMER:: ZDC MONITOR ->"<<cpu_timer.cpuTime()<<std::endl;
364  }
365 
366  // Empty Event/Unsuppressed monitor plots
367 
368  if(debug_>0 && ievt_%1000 == 0)
369  std::cout << "ZDCMonitorModule: processed " << ievt_ << " events" << std::endl;
370 
371  if(debug_>1)
372  {
373  std::cout << "ZDCMonitorModule: processed " << ievt_ << " events" << std::endl;
374  std::cout << " ZDC RAW Data ==> " << rawOK_<< std::endl;
375  std::cout << " ZDC Digis ==> " << digiOK_<< std::endl;
376  std::cout << " ZDC RecHits ==> " << zdchitOK_<< std::endl;
377  }
378 
379  return;
380 }
RunNumber_t run() const
Definition: EventID.h:39
EventNumber_t event() const
Definition: EventID.h:41
std::vector< int > fedss
edm::EDGetTokenT< HcalUnpackerReport > tok_hcal_
void start()
Definition: CPUTimer.cc:74
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
edm::InputTag inputLabelDigi_
MonitorElement * meIEVTRECHIT_
edm::EDGetTokenT< ZDCRecHitCollection > tok_zdcrh_
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:63
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:75
struct ZDCMonitorModule::@279 psTime_
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:60
MonitorElement * meStatus_
edm::RunNumber_t irun_
tuple cout
Definition: gather_cfg.py:121
edm::EventNumber_t ievent_
MonitorElement * meLatency_
TimeValue_t value() const
Definition: Timestamp.h:56
edm::Timestamp time() const
Definition: EventBase.h:61
MonitorElement * meFEDS_
bool prescale()
Boolean prescale test for this event.
void ZDCMonitorModule::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 167 of file ZDCMonitorModule.cc.

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

169 {
170  /* Don't start a new luminosity block if it is less than the current value
171  when running online. This avoids the problem of getting events
172  from mis-ordered lumi blocks, which screws up our lumi block
173  monitoring.
174  */
175  if (!checkZDC_) return;
176  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
177  return;
178 
179  // Otherwise, run normal startups
180  ilumisec = lumiSeg.luminosityBlock();
182 }
LuminosityBlockNumber_t luminosityBlock() const
HcalZDCMonitor * zdcMon_
void beginLuminosityBlock(int lb)
unsigned int ilumisec
void ZDCMonitorModule::bookHistograms ( DQMStore::IBooker ib,
edm::Run const &  run,
edm::EventSetup const &  c 
)
virtual

Implements DQMEDAnalyzer.

Definition at line 109 of file ZDCMonitorModule.cc.

References HcalBaseMonitor::beginRun(), DQMStore::IBooker::book1D(), DQMStore::IBooker::bookInt(), checkZDC_, conditions_, 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, ps_, reset(), rootFolder_, DQMStore::IBooker::setCurrentFolder(), HcalZDCMonitor::setup(), zdcMon_, and ZDCpresent_.

110 {
111 
112  if (!checkZDC_) return;
113 
114  zdcMon_ = new HcalZDCMonitor();
115  zdcMon_->setup(ps_, ib);
116 
117  fedsListed_ = false;
118  ZDCpresent_ = 0;
119 
120  reset();
121 
122  ib.setCurrentFolder(rootFolder_+"DQM Job Status" );
123 
124  meIEVTALL_ = ib.bookInt("Events Processed");
125  meIEVTRAW_ = ib.bookInt("Events with Raw Data");
126  meIEVTDIGI_= ib.bookInt("Events with Digis");
127  meIEVTRECHIT_ = ib.bookInt("Events with RecHits");
132  meStatus_ = ib.bookInt("STATUS");
133 
135  // process latency was (200,0,1), but that gave overflows
136  meLatency_ = ib.book1D("Process Latency","Process Latency",200,0,10);
137  meQuality_ = ib.book1D("Quality Status","Quality Status",100,0,1);
138  // Store whether or not subdetectors are present
139  meZDC_ = ib.bookInt("ZDCpresent");
140 
141  meStatus_->Fill(0);
142  // Should fill with 0 to start
144 
145  // Create histograms for individual Tasks
146  if (zdcMon_) zdcMon_->beginRun();
147 
149  c.get<HcalDbRecord>().get( pSetup );
150 
151  // Not checking ZDC raw data? In that case, no readoutMap, hcaldetid_, etc. info needed
152 
153 
154  //get conditions
155  c.get<HcalDbRecord>().get(conditions_);
156 
157  // get channel quality -- not yet used for ZDC
158  /*
159  edm::ESHandle<HcalChannelQuality> p;
160  c.get<HcalChannelQualityRcd>().get(p);
161  chanquality_= new HcalChannelQuality(*p.product());
162  */
163  return;
164 }
virtual void beginRun()
MonitorElement * meIEVTRECHIT_
edm::ESHandle< HcalDbService > conditions_
MonitorElement * bookInt(Args &&...args)
Definition: DQMStore.h:103
MonitorElement * meIEVTALL_
void setup(const edm::ParameterSet &ps, DQMStore::IBooker &ib)
void Fill(long long x)
MonitorElement * meQuality_
MonitorElement * meIEVTRAW_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * meZDC_
HcalZDCMonitor * zdcMon_
std::string rootFolder_
const edm::ParameterSet & ps_
units of &quot;updates&quot;, TBD
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * meIEVTDIGI_
MonitorElement * meStatus_
MonitorElement * meLatency_
MonitorElement * meFEDS_
void ZDCMonitorModule::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
)
protectedvirtual

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 186 of file ZDCMonitorModule.cc.

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

188 {
189  if (!checkZDC_) return;
190  // In online running, don't process events that occur before current luminosity block
191  if (Online_ && lumiSeg.luminosityBlock()<ilumisec)
192  return;
193 
194  // Call these every luminosity block
195  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
196  // Call these only if prescale set
197  if (prescaleLS_>-1 && !prescale())
198  {
199  }
200  return;
201 }
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::stream::EDAnalyzerBase.

Definition at line 204 of file ZDCMonitorModule.cc.

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

205 {
206  if (!checkZDC_) return;
207  if (debug_>0)
208  std::cout <<"ZDCMonitorModule::endRun(...) ievt = "<<ievt_<<std::endl;
209 
210  // These should be unnecessary; call them just in case, so that
211  // we're sure we get at least one fill per run
212  if (zdcMon_!=0) { zdcMon_->endLuminosityBlock();}
213 
214  return;
215 }
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 383 of file ZDCMonitorModule.cc.

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

Referenced by analyze(), and endLuminosityBlock().

384 {
385  if (!checkZDC_) return true;
386 
389  if (debug_>1) std::cout <<"ZDCMonitorModule::prescale: ievt = "<<ievt_<<std::endl;
390  // If no prescales are set, return 'false'. (This means that we should process the event.)
391  if(prescaleEvt_<=0 && prescaleLS_<=0) return false;
392 
393  // Now check whether event should be kept. Assume that it should not by default
394  bool keepEvent=false;
395 
396  // Keep event if prescaleLS test is met or if prescaleEvt test is met
397  if(prescaleLS_>0 && (ilumisec%prescaleLS_)==0) keepEvent = true; // check on ls prescale;
398  if (prescaleEvt_>0 && (ievt_%prescaleEvt_)==0) keepEvent = true; //
399 
400  // if any criteria wants to keep the event, do so
401  if (keepEvent) return false; // event should be kept; don't apply prescale
402  return true; // apply prescale by default
403 
404 } // 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 219 of file ZDCMonitorModule.cc.

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

Referenced by bookHistograms().

219  {
220  if (!checkZDC_) return;
221  if (zdcMon_!=NULL) zdcMon_->reset();
222 
223 }
#define NULL
Definition: scimark2.h:8
HcalZDCMonitor * zdcMon_

Member Data Documentation

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

Definition at line 161 of file ZDCMonitorModule.h.

Referenced by bookHistograms().

edm::CPUTimer ZDCMonitorModule::cpu_timer
private

Definition at line 109 of file ZDCMonitorModule.h.

Referenced by analyze().

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 171 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 139 of file ZDCMonitorModule.h.

bool ZDCMonitorModule::fedsListed_
private

Definition at line 134 of file ZDCMonitorModule.h.

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

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

Definition at line 79 of file ZDCMonitorModule.h.

Referenced by analyze().

edm::EventNumber_t ZDCMonitorModule::ievent_
private

Definition at line 123 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::ievt_
private

Definition at line 129 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_digi_
private

Definition at line 131 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_pre_
private

Definition at line 133 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::ievt_rawdata_
private

Definition at line 130 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::ievt_rechit_
private

Definition at line 132 of file ZDCMonitorModule.h.

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

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

Definition at line 136 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::InputTag ZDCMonitorModule::inputLabelRecHitZDC_
private

Definition at line 137 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

edm::RunNumber_t ZDCMonitorModule::irun_
private

Definition at line 122 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

int ZDCMonitorModule::itime_
private

Definition at line 124 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

std::ofstream ZDCMonitorModule::m_logFile
private

Definition at line 164 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meFEDS_
private

Definition at line 150 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meIEVTALL_
private

Definition at line 145 of file ZDCMonitorModule.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ZDCMonitorModule::meIEVTDIGI_
private

Definition at line 147 of file ZDCMonitorModule.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ZDCMonitorModule::meIEVTRAW_
private

Definition at line 146 of file ZDCMonitorModule.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ZDCMonitorModule::meIEVTRECHIT_
private

Definition at line 148 of file ZDCMonitorModule.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ZDCMonitorModule::meLatency_
private

Definition at line 153 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meQuality_
private

Definition at line 154 of file ZDCMonitorModule.h.

Referenced by bookHistograms(), and ZDCMonitorModule().

MonitorElement* ZDCMonitorModule::meStatus_
private

Definition at line 151 of file ZDCMonitorModule.h.

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

MonitorElement* ZDCMonitorModule::meTrigger_
private

Definition at line 152 of file ZDCMonitorModule.h.

MonitorElement* ZDCMonitorModule::meZDC_
private

Definition at line 168 of file ZDCMonitorModule.h.

Referenced by analyze(), and bookHistograms().

std::string ZDCMonitorModule::monitorName_
private

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 88 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::prescaleLS_
private

units of events

Definition at line 89 of file ZDCMonitorModule.h.

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

int ZDCMonitorModule::prescaleTime_
private

units of lumi sections

Definition at line 90 of file ZDCMonitorModule.h.

int ZDCMonitorModule::prescaleUpdate_
private

units of minutes

Definition at line 91 of file ZDCMonitorModule.h.

const edm::ParameterSet& ZDCMonitorModule::ps_
private

units of "updates", TBD

keep a reference to the paramter set. This is needed to pass the

Definition at line 98 of file ZDCMonitorModule.h.

Referenced by bookHistograms().

struct { ... } ZDCMonitorModule::psTime_

Referenced by analyze(), and ZDCMonitorModule().

const HcalElectronicsMap* ZDCMonitorModule::readoutMap_
private

Definition at line 162 of file ZDCMonitorModule.h.

std::string ZDCMonitorModule::rootFolder_
private

Definition at line 127 of file ZDCMonitorModule.h.

Referenced by bookHistograms(), 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.

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

Definition at line 141 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

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

Definition at line 142 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

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

Definition at line 143 of file ZDCMonitorModule.h.

Referenced by analyze(), and ZDCMonitorModule().

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 167 of file ZDCMonitorModule.h.

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