#include <DTScalerInfoTask.h>
Public Member Functions | |
DTScalerInfoTask (const edm::ParameterSet &ps) | |
Constructor. | |
virtual | ~DTScalerInfoTask () |
Destructor. | |
Protected Member Functions | |
void | analyze (const edm::Event &e, const edm::EventSetup &c) |
Analyze. | |
void | beginJob () |
void | beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
To reset the MEs. | |
void | beginRun (const edm::Run &, const edm::EventSetup &) |
Beginrun. | |
void | endJob (void) |
EndJob. | |
void | endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) |
Perform trend plot operations. | |
Private Member Functions | |
void | bookHistos () |
Book the histograms. | |
Private Attributes | |
MonitorElement * | nEventMonitor |
int | nEvents |
int | nEventsInLS |
DQMStore * | theDQMStore |
edm::ParameterSet | theParams |
edm::InputTag | theScalerTag |
std::map< std::string,DTTimeEvolutionHisto * > | trendHistos |
Friends | |
class | DTMonitorModule |
Definition at line 36 of file DTScalerInfoTask.h.
DTScalerInfoTask::DTScalerInfoTask | ( | const edm::ParameterSet & | ps | ) |
Constructor.
Definition at line 28 of file DTScalerInfoTask.cc.
References edm::ParameterSet::getUntrackedParameter(), LogTrace, cmsCodeRules::cppFunctionSkipper::operator, theDQMStore, theParams, and theScalerTag.
: nEvents(0) { LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: Constructor"<<endl; theScalerTag = ps.getUntrackedParameter<InputTag>("inputTagScaler"); theParams = ps; theDQMStore = edm::Service<DQMStore>().operator->(); }
DTScalerInfoTask::~DTScalerInfoTask | ( | ) | [virtual] |
void DTScalerInfoTask::analyze | ( | const edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [protected, virtual] |
Analyze.
Implements edm::EDAnalyzer.
Definition at line 101 of file DTScalerInfoTask.cc.
References MonitorElement::Fill(), edm::Event::getByLabel(), nEventMonitor, nEvents, nEventsInLS, theScalerTag, and trendHistos.
{ nEvents++; nEventsInLS++; nEventMonitor->Fill(nEvents); //retrieve the luminosity edm::Handle<LumiScalersCollection> lumiScalers; e.getByLabel(theScalerTag, lumiScalers); LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin(); trendHistos["AvgLumivsLumiSec"]->accumulateValueTimeSlot(lumiIt->instantLumi()); }
void DTScalerInfoTask::beginJob | ( | void | ) | [protected, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 49 of file DTScalerInfoTask.cc.
References LogTrace.
{ LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: BeginJob" << endl; }
void DTScalerInfoTask::beginLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
To reset the MEs.
Reimplemented from edm::EDAnalyzer.
Definition at line 67 of file DTScalerInfoTask.cc.
References LogTrace, and nEventsInLS.
{ nEventsInLS=0; LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: Begin of LS transition" << endl; }
void DTScalerInfoTask::beginRun | ( | const edm::Run & | run, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
Beginrun.
Reimplemented from edm::EDAnalyzer.
Definition at line 57 of file DTScalerInfoTask.cc.
References bookHistos(), and LogTrace.
{ LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: BeginRun" << endl; bookHistos(); }
void DTScalerInfoTask::bookHistos | ( | ) | [private] |
Book the histograms.
Definition at line 116 of file DTScalerInfoTask.cc.
References DQMStore::bookFloat(), nEventMonitor, DQMStore::setCurrentFolder(), theDQMStore, and trendHistos.
Referenced by beginRun().
{ theDQMStore->setCurrentFolder("DT/EventInfo/Counters"); nEventMonitor = theDQMStore->bookFloat("nProcessedEventsScalerInfo"); theDQMStore->setCurrentFolder("DT/00-DataIntegrity/ScalerInfo"); string histoName = "AvgLumivsLumiSec"; string histoTitle = "Average Lumi vs LumiSec"; trendHistos[histoName] = new DTTimeEvolutionHisto(theDQMStore,histoName,histoTitle,200,10,true,0); }
void DTScalerInfoTask::endJob | ( | void | ) | [protected, virtual] |
EndJob.
Reimplemented from edm::EDAnalyzer.
Definition at line 93 of file DTScalerInfoTask.cc.
References nEvents.
{ LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl; }
void DTScalerInfoTask::endLuminosityBlock | ( | const edm::LuminosityBlock & | lumiSeg, |
const edm::EventSetup & | context | ||
) | [protected, virtual] |
Perform trend plot operations.
Reimplemented from edm::EDAnalyzer.
Definition at line 76 of file DTScalerInfoTask.cc.
References Association::block, LogTrace, edm::LuminosityBlockBase::luminosityBlock(), nEventsInLS, and trendHistos.
{ LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: End of LS transition" << endl; int block = lumiSeg.luminosityBlock(); map<string,DTTimeEvolutionHisto* >::const_iterator histoIt = trendHistos.begin(); map<string,DTTimeEvolutionHisto* >::const_iterator histoEnd = trendHistos.end(); for(;histoIt!=histoEnd;++histoIt) { histoIt->second->updateTimeSlot(block, nEventsInLS); } }
friend class DTMonitorModule [friend] |
Definition at line 38 of file DTScalerInfoTask.h.
MonitorElement* DTScalerInfoTask::nEventMonitor [private] |
Definition at line 82 of file DTScalerInfoTask.h.
Referenced by analyze(), and bookHistos().
int DTScalerInfoTask::nEvents [private] |
Definition at line 73 of file DTScalerInfoTask.h.
Referenced by analyze(), endJob(), and ~DTScalerInfoTask().
int DTScalerInfoTask::nEventsInLS [private] |
Definition at line 74 of file DTScalerInfoTask.h.
Referenced by analyze(), beginLuminosityBlock(), and endLuminosityBlock().
DQMStore* DTScalerInfoTask::theDQMStore [private] |
Definition at line 76 of file DTScalerInfoTask.h.
Referenced by bookHistos(), and DTScalerInfoTask().
edm::ParameterSet DTScalerInfoTask::theParams [private] |
Definition at line 77 of file DTScalerInfoTask.h.
Referenced by DTScalerInfoTask().
edm::InputTag DTScalerInfoTask::theScalerTag [private] |
Definition at line 79 of file DTScalerInfoTask.h.
Referenced by analyze(), and DTScalerInfoTask().
std::map<std::string ,DTTimeEvolutionHisto* > DTScalerInfoTask::trendHistos [private] |
Definition at line 81 of file DTScalerInfoTask.h.
Referenced by analyze(), bookHistos(), and endLuminosityBlock().