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:
DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > 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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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 DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 34 of file DTScalerInfoTask.h.

Constructor & Destructor Documentation

◆ DTScalerInfoTask()

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

Constructor.

Definition at line 23 of file DTScalerInfoTask.cc.

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

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

◆ ~DTScalerInfoTask()

DTScalerInfoTask::~DTScalerInfoTask ( )
override

Destructor.

Definition at line 30 of file DTScalerInfoTask.cc.

References LogTrace, and nEvents.

30  {
31  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: analyzed " << nEvents << " events" << endl;
32 }
#define LogTrace(id)

Member Function Documentation

◆ analyze()

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

Analyze.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 56 of file DTScalerInfoTask.cc.

References MillePedeFileConverter_cfg::e, dqm::impl::MonitorElement::Fill(), V0Monitor_cfi::lumiScalers, nEventMonitor, nEvents, nEventsInLS, scalerToken_, and trendHistos.

56  {
57  nEvents++;
58  nEventsInLS++;
60 
61  //retrieve the luminosity
63  if (e.getByToken(scalerToken_, lumiScalers)) {
64  if (lumiScalers->begin() != lumiScalers->end()) {
65  LumiScalersCollection::const_iterator lumiIt = lumiScalers->begin();
66  trendHistos["AvgLumivsLumiSec"]->accumulateValueTimeSlot(lumiIt->instantLumi());
67  } else {
68  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
69  << "[DTScalerInfoTask]: LumiScalersCollection size == 0" << endl;
70  }
71  } else {
72  LogVerbatim("DTDQM|DTMonitorModule|DTScalerInfoTask")
73  << "[DTScalerInfoTask]: LumiScalersCollection getByToken call failed" << endl;
74  }
75 }
Log< level::Info, true > LogVerbatim
MonitorElement * nEventMonitor
edm::EDGetTokenT< LumiScalersCollection > scalerToken_
void Fill(long long x)
std::map< std::string, DTTimeEvolutionHisto * > trendHistos

◆ beginLuminosityBlock()

void DTScalerInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

To reset the MEs.

Definition at line 38 of file DTScalerInfoTask.cc.

References LogTrace, and nEventsInLS.

38  {
39  nEventsInLS = 0;
40 
41  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: Begin of LS transition" << endl;
42 }
#define LogTrace(id)

◆ bookHistograms()

void DTScalerInfoTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 77 of file DTScalerInfoTask.cc.

References dqm::implementation::IBooker::bookFloat(), HltBtagPostValidation_cff::histoName, nEventMonitor, dqm::implementation::NavigatorBase::setCurrentFolder(), and trendHistos.

79  {
80  ibooker.setCurrentFolder("DT/EventInfo/Counters");
81  nEventMonitor = ibooker.bookFloat("nProcessedEventsScalerInfo");
82 
83  ibooker.setCurrentFolder("DT/00-DataIntegrity/ScalerInfo");
84 
85  string histoName = "AvgLumivsLumiSec";
86  string histoTitle = "Average Lumi vs LumiSec";
87  trendHistos[histoName] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
88 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * nEventMonitor
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, DTTimeEvolutionHisto * > trendHistos

◆ dqmBeginRun()

void DTScalerInfoTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotectedvirtual

Beginrun.

Reimplemented from DQMOneEDAnalyzer< edm::one::WatchLuminosityBlocks >.

Definition at line 34 of file DTScalerInfoTask.cc.

References LogTrace.

34  {
35  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: BeginRun" << endl;
36 }
#define LogTrace(id)

◆ endLuminosityBlock()

void DTScalerInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotected

Perform trend plot operations.

Definition at line 44 of file DTScalerInfoTask.cc.

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

44  {
45  LogTrace("DTDQM|DTMonitorModule|DTScalerInfoTask") << "[DTScalerInfoTask]: End of LS transition" << endl;
46 
47  int block = lumiSeg.luminosityBlock();
48 
49  map<string, DTTimeEvolutionHisto*>::const_iterator histoIt = trendHistos.begin();
50  map<string, DTTimeEvolutionHisto*>::const_iterator histoEnd = trendHistos.end();
51  for (; histoIt != histoEnd; ++histoIt) {
52  histoIt->second->updateTimeSlot(block, nEventsInLS);
53  }
54 }
#define LogTrace(id)
std::map< std::string, DTTimeEvolutionHisto * > trendHistos
LuminosityBlockNumber_t luminosityBlock() const

Friends And Related Function Documentation

◆ DTMonitorModule

friend class DTMonitorModule
friend

Definition at line 35 of file DTScalerInfoTask.h.

Member Data Documentation

◆ nEventMonitor

MonitorElement* DTScalerInfoTask::nEventMonitor
private

Definition at line 69 of file DTScalerInfoTask.h.

Referenced by analyze(), and bookHistograms().

◆ nEvents

int DTScalerInfoTask::nEvents
private

Definition at line 61 of file DTScalerInfoTask.h.

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

◆ nEventsInLS

int DTScalerInfoTask::nEventsInLS
private

Definition at line 62 of file DTScalerInfoTask.h.

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

◆ scalerToken_

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

Definition at line 66 of file DTScalerInfoTask.h.

Referenced by analyze(), and DTScalerInfoTask().

◆ theParams

edm::ParameterSet DTScalerInfoTask::theParams
private

Definition at line 64 of file DTScalerInfoTask.h.

Referenced by DTScalerInfoTask().

◆ trendHistos

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

Definition at line 68 of file DTScalerInfoTask.h.

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