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 Member Functions | Private Attributes | Friends
DTScalerInfoTask Class Reference

#include <DTScalerInfoTask.h>

Inheritance diagram for DTScalerInfoTask:
edm::EDAnalyzer

Public Member Functions

 DTScalerInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTScalerInfoTask ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 To reset the MEs. More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 Beginrun. More...
 
void endJob (void)
 EndJob. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 Perform trend plot operations. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Member Functions

void bookHistos ()
 Book the histograms. More...
 

Private Attributes

MonitorElementnEventMonitor
 
int nEvents
 
int nEventsInLS
 
DQMStoretheDQMStore
 
edm::ParameterSet theParams
 
edm::InputTag theScalerTag
 
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
 

Friends

class DTMonitorModule
 

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 36 of file DTScalerInfoTask.h.

Constructor & Destructor Documentation

DTScalerInfoTask::DTScalerInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 28 of file DTScalerInfoTask.cc.

References edm::ParameterSet::getUntrackedParameter(), LogTrace, cppFunctionSkipper::operator, theDQMStore, theParams, and theScalerTag.

28  :
29  nEvents(0) {
30 
31  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
32  << "[DTScalerInfoTask]: Constructor"<<endl;
33 
34  theScalerTag = ps.getUntrackedParameter<InputTag>("inputTagScaler");
35  theParams = ps;
37 
38 }
T getUntrackedParameter(std::string const &, T const &) const
DQMStore * theDQMStore
#define LogTrace(id)
edm::InputTag theScalerTag
edm::ParameterSet theParams
DTScalerInfoTask::~DTScalerInfoTask ( )
virtual

Destructor.

Definition at line 41 of file DTScalerInfoTask.cc.

References LogTrace, and nEvents.

41  {
42 
43  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
44  << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
45 
46 }
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 101 of file DTScalerInfoTask.cc.

References MonitorElement::Fill(), edm::Event::getByLabel(), nEventMonitor, nEvents, nEventsInLS, theScalerTag, and trendHistos.

101  {
102 
103  nEvents++;
104  nEventsInLS++;
106 
107  //retrieve the luminosity
109  e.getByLabel(theScalerTag, lumiScalers);
110  LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin();
111  trendHistos["AvgLumivsLumiSec"]->accumulateValueTimeSlot(lumiIt->instantLumi());
112 
113 }
MonitorElement * nEventMonitor
void Fill(long long x)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
edm::InputTag theScalerTag
void DTScalerInfoTask::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 49 of file DTScalerInfoTask.cc.

References LogTrace.

49  {
50 
51  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
52  << "[DTScalerInfoTask]: BeginJob" << endl;
53 
54 }
#define LogTrace(id)
void DTScalerInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::EDAnalyzer.

Definition at line 67 of file DTScalerInfoTask.cc.

References LogTrace, and nEventsInLS.

67  {
68 
69  nEventsInLS=0;
70 
71  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
72  << "[DTScalerInfoTask]: Begin of LS transition" << endl;
73 
74  }
#define LogTrace(id)
void DTScalerInfoTask::beginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Beginrun.

Reimplemented from edm::EDAnalyzer.

Definition at line 57 of file DTScalerInfoTask.cc.

References bookHistos(), and LogTrace.

57  {
58 
59  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
60  << "[DTScalerInfoTask]: BeginRun" << endl;
61 
62  bookHistos();
63 
64 }
void bookHistos()
Book the histograms.
#define LogTrace(id)
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().

116  {
117 
118  theDQMStore->setCurrentFolder("DT/EventInfo/Counters");
119  nEventMonitor = theDQMStore->bookFloat("nProcessedEventsScalerInfo");
120 
121  theDQMStore->setCurrentFolder("DT/00-DataIntegrity/ScalerInfo");
122 
123  string histoName = "AvgLumivsLumiSec";
124  string histoTitle = "Average Lumi vs LumiSec";
125  trendHistos[histoName] = new DTTimeEvolutionHisto(theDQMStore,histoName,histoTitle,200,10,true,0);
126 
127 }
MonitorElement * nEventMonitor
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
DQMStore * theDQMStore
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void DTScalerInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file DTScalerInfoTask.cc.

References nEvents.

93  {
94 
95  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
96  << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
97 
98 }
void DTScalerInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

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.

76  {
77 
78  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
79  << "[DTScalerInfoTask]: End of LS transition" << endl;
80 
81 
82  int block = lumiSeg.luminosityBlock();
83 
84  map<string,DTTimeEvolutionHisto* >::const_iterator histoIt = trendHistos.begin();
85  map<string,DTTimeEvolutionHisto* >::const_iterator histoEnd = trendHistos.end();
86  for(;histoIt!=histoEnd;++histoIt) {
87  histoIt->second->updateTimeSlot(block, nEventsInLS);
88  }
89 
90 }
LuminosityBlockNumber_t luminosityBlock() const
block
Formating index page&#39;s pieces.
Definition: Association.py:223
#define LogTrace(id)
std::map< std::string,DTTimeEvolutionHisto * > trendHistos

Friends And Related Function Documentation

friend class DTMonitorModule
friend

Definition at line 38 of file DTScalerInfoTask.h.

Member Data Documentation

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().