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::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTScalerInfoTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTScalerInfoTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

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:579
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:274
std::map< std::string,DTTimeEvolutionHisto * > trendHistos
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
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().