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 edm::EDConsumerBase

Public Member Functions

 DTScalerInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTScalerInfoTask ()
 Destructor. More...
 
- 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)
 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::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 Member Functions

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

Private Attributes

MonitorElementnEventMonitor
 
int nEvents
 
int nEventsInLS
 
edm::EDGetTokenT
< LumiScalersCollection
scalerToken_
 
DQMStoretheDQMStore
 
edm::ParameterSet theParams
 
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
 

Friends

class DTMonitorModule
 

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 DTScalerInfoTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 23 of file DTScalerInfoTask.cc.

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

23  :
24  nEvents(0) {
25 
26  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
27  << "[DTScalerInfoTask]: Constructor"<<endl;
28 
29  scalerToken_ = consumes<LumiScalersCollection>(
30  ps.getUntrackedParameter<InputTag>("inputTagScaler"));
31  theParams = ps;
33 
34 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
DQMStore * theDQMStore
#define LogTrace(id)
edm::ParameterSet theParams
DTScalerInfoTask::~DTScalerInfoTask ( )
virtual

Destructor.

Definition at line 37 of file DTScalerInfoTask.cc.

References LogTrace, and nEvents.

37  {
38 
39  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
40  << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
41 
42 }
#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 97 of file DTScalerInfoTask.cc.

References MonitorElement::Fill(), edm::Event::getByToken(), nEventMonitor, nEvents, nEventsInLS, scalerToken_, and trendHistos.

97  {
98 
99  nEvents++;
100  nEventsInLS++;
102 
103  //retrieve the luminosity
105  if (e.getByToken(scalerToken_, lumiScalers)) {
106  if (lumiScalers->begin() != lumiScalers->end()) {
107  LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin();
108  trendHistos["AvgLumivsLumiSec"]->accumulateValueTimeSlot(lumiIt->instantLumi());
109  }
110  else {
111  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
112  << "[DTScalerInfoTask]: LumiScalersCollection size == 0" << endl;
113  }
114  }
115  else {
116  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
117  << "[DTScalerInfoTask]: LumiScalersCollection getByToken call failed" << endl;
118  }
119 
120 }
MonitorElement * nEventMonitor
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
void Fill(long long x)
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
void DTScalerInfoTask::beginJob ( void  )
protectedvirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 45 of file DTScalerInfoTask.cc.

References LogTrace.

45  {
46 
47  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
48  << "[DTScalerInfoTask]: BeginJob" << endl;
49 
50 }
#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 63 of file DTScalerInfoTask.cc.

References LogTrace, and nEventsInLS.

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

Beginrun.

Reimplemented from edm::EDAnalyzer.

Definition at line 53 of file DTScalerInfoTask.cc.

References bookHistos(), and LogTrace.

53  {
54 
55  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
56  << "[DTScalerInfoTask]: BeginRun" << endl;
57 
58  bookHistos();
59 
60 }
void bookHistos()
Book the histograms.
#define LogTrace(id)
void DTScalerInfoTask::bookHistos ( )
private

Book the histograms.

Definition at line 123 of file DTScalerInfoTask.cc.

References hltbtagharvestinganalyzer_cfi::histoName, nEventMonitor, theDQMStore, and trendHistos.

Referenced by beginRun().

123  {
124 
125  theDQMStore->setCurrentFolder("DT/EventInfo/Counters");
126  nEventMonitor = theDQMStore->bookFloat("nProcessedEventsScalerInfo");
127 
128  theDQMStore->setCurrentFolder("DT/00-DataIntegrity/ScalerInfo");
129 
130  string histoName = "AvgLumivsLumiSec";
131  string histoTitle = "Average Lumi vs LumiSec";
132  trendHistos[histoName] = new DTTimeEvolutionHisto(theDQMStore,histoName,histoTitle,200,10,true,0);
133 
134 }
MonitorElement * nEventMonitor
DQMStore * theDQMStore
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
void DTScalerInfoTask::endJob ( void  )
protectedvirtual

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file DTScalerInfoTask.cc.

References nEvents.

89  {
90 
91  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
92  << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
93 
94 }
void DTScalerInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Perform trend plot operations.

Reimplemented from edm::EDAnalyzer.

Definition at line 72 of file DTScalerInfoTask.cc.

References createPayload::block, LogTrace, edm::LuminosityBlockBase::luminosityBlock(), nEventsInLS, and trendHistos.

72  {
73 
74  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
75  << "[DTScalerInfoTask]: End of LS transition" << endl;
76 
77 
78  int block = lumiSeg.luminosityBlock();
79 
80  map<string,DTTimeEvolutionHisto* >::const_iterator histoIt = trendHistos.begin();
81  map<string,DTTimeEvolutionHisto* >::const_iterator histoEnd = trendHistos.end();
82  for(;histoIt!=histoEnd;++histoIt) {
83  histoIt->second->updateTimeSlot(block, nEventsInLS);
84  }
85 
86 }
LuminosityBlockNumber_t luminosityBlock() const
#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(), looper.Looper::loop(), and ~DTScalerInfoTask().

int DTScalerInfoTask::nEventsInLS
private

Definition at line 74 of file DTScalerInfoTask.h.

Referenced by analyze(), beginLuminosityBlock(), and endLuminosityBlock().

edm::EDGetTokenT<LumiScalersCollection> DTScalerInfoTask::scalerToken_
private

Definition at line 79 of file DTScalerInfoTask.h.

Referenced by analyze(), and DTScalerInfoTask().

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

std::map<std::string ,DTTimeEvolutionHisto* > DTScalerInfoTask::trendHistos
private

Definition at line 81 of file DTScalerInfoTask.h.

Referenced by analyze(), bookHistos(), and endLuminosityBlock().