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 | Friends
DTScalerInfoTask Class Reference

#include <DTScalerInfoTask.h>

Inheritance diagram for DTScalerInfoTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTScalerInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTScalerInfoTask ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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)
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
 To reset the MEs. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &)
 Beginrun. 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 Attributes

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

Friends

class DTMonitorModule
 

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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 38 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, scalerToken_, 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;
32 }
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
#define LogTrace(id)
edm::ParameterSet theParams
DTScalerInfoTask::~DTScalerInfoTask ( )
virtual

Destructor.

Definition at line 35 of file DTScalerInfoTask.cc.

References LogTrace, and nEvents.

35  {
36 
37  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
38  << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
39 
40 }
#define LogTrace(id)

Member Function Documentation

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

Analyze.

Implements edm::stream::EDAnalyzerBase.

Definition at line 75 of file DTScalerInfoTask.cc.

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

75  {
76 
77  nEvents++;
78  nEventsInLS++;
80 
81  //retrieve the luminosity
83  if (e.getByToken(scalerToken_, lumiScalers)) {
84  if (lumiScalers->begin() != lumiScalers->end()) {
85  LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin();
86  trendHistos["AvgLumivsLumiSec"]->accumulateValueTimeSlot(lumiIt->instantLumi());
87  }
88  else {
89  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
90  << "[DTScalerInfoTask]: LumiScalersCollection size == 0" << endl;
91  }
92  }
93  else {
94  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
95  << "[DTScalerInfoTask]: LumiScalersCollection getByToken call failed" << endl;
96  }
97 
98 }
MonitorElement * nEventMonitor
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void Fill(long long x)
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
void DTScalerInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

To reset the MEs.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 50 of file DTScalerInfoTask.cc.

References LogTrace, and nEventsInLS.

50  {
51 
52  nEventsInLS=0;
53 
54  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
55  << "[DTScalerInfoTask]: Begin of LS transition" << endl;
56 
57  }
#define LogTrace(id)
void DTScalerInfoTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 100 of file DTScalerInfoTask.cc.

References DQMStore::IBooker::bookFloat(), nEventMonitor, DQMStore::IBooker::setCurrentFolder(), and trendHistos.

100  {
101 
102  ibooker.setCurrentFolder("DT/EventInfo/Counters");
103  nEventMonitor = ibooker.bookFloat("nProcessedEventsScalerInfo");
104 
105  ibooker.setCurrentFolder("DT/00-DataIntegrity/ScalerInfo");
106 
107  string histoName = "AvgLumivsLumiSec";
108  string histoTitle = "Average Lumi vs LumiSec";
109  trendHistos[histoName] = new DTTimeEvolutionHisto(ibooker,histoName,histoTitle,200,10,true,0);
110 
111 }
MonitorElement * nEventMonitor
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
void DTScalerInfoTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
protectedvirtual

Beginrun.

Reimplemented from DQMEDAnalyzer.

Definition at line 43 of file DTScalerInfoTask.cc.

References LogTrace.

43  {
44 
45  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
46  << "[DTScalerInfoTask]: BeginRun" << endl;
47 }
#define LogTrace(id)
void DTScalerInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
protectedvirtual

Perform trend plot operations.

Reimplemented from edm::stream::EDAnalyzerBase.

Definition at line 59 of file DTScalerInfoTask.cc.

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

59  {
60 
61  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask")
62  << "[DTScalerInfoTask]: End of LS transition" << endl;
63 
64 
65  int block = lumiSeg.luminosityBlock();
66 
67  map<string,DTTimeEvolutionHisto* >::const_iterator histoIt = trendHistos.begin();
68  map<string,DTTimeEvolutionHisto* >::const_iterator histoEnd = trendHistos.end();
69  for(;histoIt!=histoEnd;++histoIt) {
70  histoIt->second->updateTimeSlot(block, nEventsInLS);
71  }
72 
73 }
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 40 of file DTScalerInfoTask.h.

Member Data Documentation

MonitorElement* DTScalerInfoTask::nEventMonitor
private

Definition at line 77 of file DTScalerInfoTask.h.

Referenced by analyze(), and bookHistograms().

int DTScalerInfoTask::nEvents
private

Definition at line 69 of file DTScalerInfoTask.h.

Referenced by analyze(), looper.Looper::loop(), and ~DTScalerInfoTask().

int DTScalerInfoTask::nEventsInLS
private

Definition at line 70 of file DTScalerInfoTask.h.

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

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

Definition at line 74 of file DTScalerInfoTask.h.

Referenced by analyze(), and DTScalerInfoTask().

edm::ParameterSet DTScalerInfoTask::theParams
private

Definition at line 72 of file DTScalerInfoTask.h.

Referenced by DTScalerInfoTask().

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

Definition at line 76 of file DTScalerInfoTask.h.

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