CMS 3D CMS Logo

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...
 
 ~DTScalerInfoTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
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
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 Analyze. More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 To reset the MEs. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 Beginrun. More...
 
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context) override
 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< LumiScalersCollectionscalerToken_
 
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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (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 ( )
override

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 
)
overrideprotected

Analyze.

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:508
void Fill(long long x)
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
void DTScalerInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

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:277
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 
)
overrideprotected

Beginrun.

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 
)
overrideprotected

Perform trend plot operations.

Definition at line 59 of file DTScalerInfoTask.cc.

References groupFilesInBlocks::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().