CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTDCSByLumiTask Class Reference

#include <DTDCSByLumiTask.h>

Inheritance diagram for DTDCSByLumiTask:
DQMOneLumiEDAnalyzer<> DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTDCSByLumiTask (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTDCSByLumiTask () override
 Destructor. More...
 
- Public Member Functions inherited from DQMOneLumiEDAnalyzer<>
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
 DQMOneLumiEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
bool getCanSaveByLumi () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
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
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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
 
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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
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 &) override
 Analyze. More...
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &) override
 By Lumi DCS DB Operation. More...
 
void dqmBeginRun (const edm::Run &, const edm::EventSetup &) override
 Begin Run. More...
 
void dqmEndLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &) override
 By Lumi DCS DB Operation. More...
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)=0
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Private Member Functions

std::string topFolder () const
 

Private Attributes

edm::ESGetToken< DTGeometry, MuonGeometryRecorddtGeometryToken_
 
bool DTHVRecordFound
 
edm::ESGetToken< DTHVStatus, DTHVStatusRcddtHVStatusToken_
 
std::vector< MonitorElement * > hActiveUnits
 
edm::ESHandle< DTGeometrytheDTGeom
 
int theEvents
 
int theLumis
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
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
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 DQMOneLumiEDAnalyzer<>
edm::EDPutTokenT< DQMTokenlumiToken_
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 36 of file DTDCSByLumiTask.h.

Constructor & Destructor Documentation

◆ DTDCSByLumiTask()

DTDCSByLumiTask::DTDCSByLumiTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file DTDCSByLumiTask.cc.

32  : theEvents(0),
33  theLumis(0),
34  dtGeometryToken_(esConsumes<DTGeometry, MuonGeometryRecord, edm::Transition::BeginRun>()),
35  dtHVStatusToken_(esConsumes<DTHVStatus, DTHVStatusRcd, edm::Transition::EndLuminosityBlock>()) {
36  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "[DTDCSByLumiTask]: Constructor" << endl;
37 
38  // If needed put getParameter here
39  // dtDCSByLumiLabel = ps.getParameter<InputTag>("dtDCSByLumiLabel");
40 }

References LogTrace.

◆ ~DTDCSByLumiTask()

DTDCSByLumiTask::~DTDCSByLumiTask ( )
override

Destructor.

Definition at line 42 of file DTDCSByLumiTask.cc.

42  {
43  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
44  << "DTDCSByLumiTask: processed " << theEvents << " events in " << theLumis << " lumi sections" << endl;
45 }

References LogTrace, theEvents, and theLumis.

Member Function Documentation

◆ analyze()

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

◆ bookHistograms()

void DTDCSByLumiTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &   
)
overrideprotected

Definition at line 68 of file DTDCSByLumiTask.cc.

68  {
69  // Book bylumi histo (# of bins as reduced as possible)
70  ibooker.setCurrentFolder(topFolder());
71 
72  for (int wheel = -2; wheel <= 2; wheel++) {
73  stringstream wheel_str;
74  wheel_str << wheel;
75 
76  {
77  // Set Lumi scope in order to save histo every LS
78  auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
80  ibooker.book1D("hActiveUnits" + wheel_str.str(), "Active Untis x LS Wh" + wheel_str.str(), 2, 0.5, 2.5);
81  hActiveUnits.push_back(ME);
82  }
83  }
84 }

References hActiveUnits, topFolder(), and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginLuminosityBlock()

void DTDCSByLumiTask::dqmBeginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &   
)
overrideprotectedvirtual

By Lumi DCS DB Operation.

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 86 of file DTDCSByLumiTask.cc.

86  {
87  theLumis++;
88 
89  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
90  << "[DTDCSByLumiTask]: Begin of processed lumi # " << lumiSeg.id().luminosityBlock() << " " << theLumis
91  << " lumi processed by this job" << endl;
92 
93  for (int wheel = 0; wheel < 5; wheel++) {
94  hActiveUnits[wheel]->Reset(); // Cb by lumi histo need to be resetted in between lumi boundaries
95  }
96 }

References hActiveUnits, edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), theLumis, and makeMuonMisalignmentScenario::wheel.

◆ dqmBeginRun()

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

Begin Run.

Reimplemented from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

Definition at line 47 of file DTDCSByLumiTask.cc.

47  {
48  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "[DTDCSByLumiTask]: begin run" << endl;
49 
51 
52  DTHVRecordFound = true;
53 
55 
56  std::vector<eventsetup::EventSetupRecordKey> recordKeys;
57  context.fillAvailableRecordKeys(recordKeys);
58  vector<eventsetup::EventSetupRecordKey>::iterator it = find(recordKeys.begin(), recordKeys.end(), recordKey);
59 
60  if (it == recordKeys.end()) {
61  //record not found
62  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "Record DTHVStatusRcd does not exist " << std::endl;
63 
64  DTHVRecordFound = false;
65  }
66 }

References dtGeometryToken_, DTHVRecordFound, edm::EventSetup::fillAvailableRecordKeys(), spr::find(), edm::typelookup::findType(), edm::EventSetup::getHandle(), LogTrace, and theDTGeom.

◆ dqmEndLuminosityBlock()

void DTDCSByLumiTask::dqmEndLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
)
overrideprotectedvirtual

By Lumi DCS DB Operation.

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 98 of file DTDCSByLumiTask.cc.

98  {
99  const DTHVStatus* dtHVStatus = nullptr;
100  if (DTHVRecordFound) {
101  dtHVStatus = &context.getData(dtHVStatusToken_);
102  }
103 
104  vector<const DTLayer*>::const_iterator layersIt = theDTGeom->layers().begin();
105  vector<const DTLayer*>::const_iterator layersEnd = theDTGeom->layers().end();
106 
107  for (; layersIt != layersEnd; ++layersIt) {
108  int wheel = (*layersIt)->id().wheel();
109 
110  int nWiresLayer = (*layersIt)->specificTopology().channels();
111  hActiveUnits[wheel + 2]->Fill(1, nWiresLayer); // CB first bin is # of layers
112  int nActiveWires = nWiresLayer;
113 
114  int flagA = -100;
115  int flagC = -100;
116  int flagS = -100;
117  int first = -100;
118  int last = -100;
119 
120  // CB info is not stored if HV is ON -> in this case get returns 1
121  // process all other cases and removed wires with "BAD HV" from active
122  // wires list
123 
124  if (DTHVRecordFound) {
125  if (!dtHVStatus->get((*layersIt)->id(), 0, first, last, flagA, flagC, flagS) && (flagA || flagC || flagS)) {
126  nActiveWires -= (last - first + 1);
127  }
128 
129  if (!dtHVStatus->get((*layersIt)->id(), 1, first, last, flagA, flagC, flagS) && (flagA || flagC || flagS)) {
130  nActiveWires -= (last - first + 1);
131  }
132  } else {
133  nActiveWires = -1.;
134  }
135 
136  hActiveUnits[wheel + 2]->Fill(2, nActiveWires); // CB 2nd bin is the list of wires wit HV ON
137  }
138 }

References DTHVRecordFound, dtHVStatusToken_, dqmdumpme::first, DTHVStatus::get(), edm::EventSetup::getData(), hActiveUnits, dqmdumpme::last, DTGeometry::layers(), theDTGeom, and makeMuonMisalignmentScenario::wheel.

◆ topFolder()

string DTDCSByLumiTask::topFolder ( ) const
private

Definition at line 142 of file DTDCSByLumiTask.cc.

142 { return string("DT/EventInfo/DCSContents"); }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

Member Data Documentation

◆ dtGeometryToken_

edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTDCSByLumiTask::dtGeometryToken_
private

Definition at line 70 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun().

◆ DTHVRecordFound

bool DTDCSByLumiTask::DTHVRecordFound
private

Definition at line 66 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and dqmEndLuminosityBlock().

◆ dtHVStatusToken_

edm::ESGetToken<DTHVStatus, DTHVStatusRcd> DTDCSByLumiTask::dtHVStatusToken_
private

Definition at line 71 of file DTDCSByLumiTask.h.

Referenced by dqmEndLuminosityBlock().

◆ hActiveUnits

std::vector<MonitorElement*> DTDCSByLumiTask::hActiveUnits
private

◆ theDTGeom

edm::ESHandle<DTGeometry> DTDCSByLumiTask::theDTGeom
private

Definition at line 68 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and dqmEndLuminosityBlock().

◆ theEvents

int DTDCSByLumiTask::theEvents
private

Definition at line 63 of file DTDCSByLumiTask.h.

Referenced by analyze(), and ~DTDCSByLumiTask().

◆ theLumis

int DTDCSByLumiTask::theLumis
private

Definition at line 64 of file DTDCSByLumiTask.h.

Referenced by dqmBeginLuminosityBlock(), and ~DTDCSByLumiTask().

edm::typelookup::findType
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:69
DTDCSByLumiTask::DTHVRecordFound
bool DTHVRecordFound
Definition: DTDCSByLumiTask.h:66
edm::EventSetup::fillAvailableRecordKeys
void fillAvailableRecordKeys(std::vector< eventsetup::EventSetupRecordKey > &oToFill) const
clears the oToFill vector and then fills it with the keys for all available records
Definition: EventSetup.h:167
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DTDCSByLumiTask::dtHVStatusToken_
edm::ESGetToken< DTHVStatus, DTHVStatusRcd > dtHVStatusToken_
Definition: DTDCSByLumiTask.h:71
DTDCSByLumiTask::theDTGeom
edm::ESHandle< DTGeometry > theDTGeom
Definition: DTDCSByLumiTask.h:68
DTDCSByLumiTask::topFolder
std::string topFolder() const
Definition: DTDCSByLumiTask.cc:142
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
dqmdumpme.first
first
Definition: dqmdumpme.py:55
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
DTDCSByLumiTask::dtGeometryToken_
edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeometryToken_
Definition: DTDCSByLumiTask.h:70
dqmdumpme.last
last
Definition: dqmdumpme.py:56
DTGeometry::layers
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
DTDCSByLumiTask::theEvents
int theEvents
Definition: DTDCSByLumiTask.h:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DTDCSByLumiTask::theLumis
int theLumis
Definition: DTDCSByLumiTask.h:64
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:141
dqm::implementation::IBooker::UseLumiScope
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:463
DTDCSByLumiTask::hActiveUnits
std::vector< MonitorElement * > hActiveUnits
Definition: DTDCSByLumiTask.h:73
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:113
DTHVStatus
Definition: DTHVStatus.h:70
ME
Definition: ME.h:11
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
DTHVStatus::get
int get(int wheelId, int stationId, int sectorId, int slId, int layerId, int partId, int &fCell, int &lCell, int &flagA, int &flagC, int &flagS) const
get content
Definition: DTHVStatus.cc:56