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 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) final
 
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
 
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
 
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
 
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)
 
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 bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context) 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 &setup) override
 By Lumi DCS DB Operation. More...
 
- Protected Member Functions inherited from DQMOneLumiEDAnalyzer<>
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 Member Functions

std::string topFolder () const
 

Private Attributes

bool DTHVRecordFound
 
std::vector< MonitorElement * > hActiveUnits
 
edm::ESHandle< DTHVStatushvStatus
 
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 33 of file DTDCSByLumiTask.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 34 of file DTDCSByLumiTask.cc.

References LogTrace.

34  : theEvents(0), theLumis(0) {
35  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "[DTDCSByLumiTask]: Constructor" << endl;
36 
37  // If needed put getParameter here
38  // dtDCSByLumiLabel = ps.getParameter<InputTag>("dtDCSByLumiLabel");
39 }
#define LogTrace(id)
DTDCSByLumiTask::~DTDCSByLumiTask ( )
override

Destructor.

Definition at line 41 of file DTDCSByLumiTask.cc.

References LogTrace, theEvents, and theLumis.

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

Member Function Documentation

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

Analyze.

Definition at line 136 of file DTDCSByLumiTask.cc.

References theEvents.

136 { theEvents++; }
void DTDCSByLumiTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

Implements DQMOneEDAnalyzer< edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, Args... >.

Definition at line 67 of file DTDCSByLumiTask.cc.

References dqm::dqmstoreimpl::DQMStore::IBooker::book1D(), hActiveUnits, dqm::dqmstoreimpl::DQMStore::IBooker::setCurrentFolder(), dqm::impl::MonitorElement::setLumiFlag(), topFolder(), and makeMuonMisalignmentScenario::wheel.

67  {
68  // Book bylumi histo (# of bins as reduced as possible)
69  ibooker.setCurrentFolder(topFolder());
70 
71  for (int wheel = -2; wheel <= 2; wheel++) {
72  stringstream wheel_str;
73  wheel_str << wheel;
74 
76  ibooker.book1D("hActiveUnits" + wheel_str.str(), "Active Untis x LS Wh" + wheel_str.str(), 2, 0.5, 2.5);
77  ME->setLumiFlag(); // Set LumiFlag in order to save histo every LS
78 
79  hActiveUnits.push_back(ME);
80  }
81 }
void setLumiFlag()
this ME is meant to be stored for each luminosity section
Definition: ME.h:11
std::string topFolder() const
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::dqmBeginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

By Lumi DCS DB Operation.

Reimplemented from DQMOneLumiEDAnalyzer<>.

Definition at line 83 of file DTDCSByLumiTask.cc.

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

83  {
84  theLumis++;
85 
86  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask")
87  << "[DTDCSByLumiTask]: Begin of processed lumi # " << lumiSeg.id().luminosityBlock() << " " << theLumis
88  << " lumi processed by this job" << endl;
89 
90  for (int wheel = 0; wheel < 5; wheel++) {
91  hActiveUnits[wheel]->Reset(); // Cb by lumi histo need to be resetted in between lumi boundaries
92  }
93 }
#define LogTrace(id)
std::vector< MonitorElement * > hActiveUnits
void DTDCSByLumiTask::dqmBeginRun ( const edm::Run run,
const edm::EventSetup context 
)
overrideprotected

Begin Run.

Definition at line 46 of file DTDCSByLumiTask.cc.

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

46  {
47  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "[DTDCSByLumiTask]: begin run" << endl;
48 
49  context.get<MuonGeometryRecord>().get(theDTGeom);
50 
51  DTHVRecordFound = true;
52 
54 
55  std::vector<eventsetup::EventSetupRecordKey> recordKeys;
56  context.fillAvailableRecordKeys(recordKeys);
57  vector<eventsetup::EventSetupRecordKey>::iterator it = find(recordKeys.begin(), recordKeys.end(), recordKey);
58 
59  if (it == recordKeys.end()) {
60  //record not found
61  LogTrace("DTDQM|DTMonitorModule|DTDCSByLumiTask") << "Record DTHVStatusRcd does not exist " << std::endl;
62 
63  DTHVRecordFound = false;
64  }
65 }
std::pair< const char *, const std::type_info * > findType(const char *iClassName)
Definition: typelookup.cc:69
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::ESHandle< DTGeometry > theDTGeom
#define LogTrace(id)
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
T get() const
Definition: EventSetup.h:73
void DTDCSByLumiTask::dqmEndLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup setup 
)
overrideprotected

By Lumi DCS DB Operation.

Definition at line 95 of file DTDCSByLumiTask.cc.

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

95  {
96  if (DTHVRecordFound) {
97  context.get<DTHVStatusRcd>().get(hvStatus);
98  }
99 
100  vector<const DTLayer*>::const_iterator layersIt = theDTGeom->layers().begin();
101  vector<const DTLayer*>::const_iterator layersEnd = theDTGeom->layers().end();
102 
103  for (; layersIt != layersEnd; ++layersIt) {
104  int wheel = (*layersIt)->id().wheel();
105 
106  int nWiresLayer = (*layersIt)->specificTopology().channels();
107  hActiveUnits[wheel + 2]->Fill(1, nWiresLayer); // CB first bin is # of layers
108  int nActiveWires = nWiresLayer;
109 
110  int flagA = -100;
111  int flagC = -100;
112  int flagS = -100;
113  int first = -100;
114  int last = -100;
115 
116  // CB info is not stored if HV is ON -> in this case get returns 1
117  // process all other cases and removed wires with "BAD HV" from active
118  // wires list
119 
120  if (DTHVRecordFound) {
121  if (!hvStatus->get((*layersIt)->id(), 0, first, last, flagA, flagC, flagS) && (flagA || flagC || flagS)) {
122  nActiveWires -= (last - first + 1);
123  }
124 
125  if (!hvStatus->get((*layersIt)->id(), 1, first, last, flagA, flagC, flagS) && (flagA || flagC || flagS)) {
126  nActiveWires -= (last - first + 1);
127  }
128  } else {
129  nActiveWires = -1.;
130  }
131 
132  hActiveUnits[wheel + 2]->Fill(2, nActiveWires); // CB 2nd bin is the list of wires wit HV ON
133  }
134 }
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
edm::ESHandle< DTHVStatus > hvStatus
edm::ESHandle< DTGeometry > theDTGeom
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:88
std::vector< MonitorElement * > hActiveUnits
string DTDCSByLumiTask::topFolder ( ) const
private

Definition at line 138 of file DTDCSByLumiTask.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by bookHistograms().

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

Member Data Documentation

bool DTDCSByLumiTask::DTHVRecordFound
private

Definition at line 63 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and dqmEndLuminosityBlock().

std::vector<MonitorElement*> DTDCSByLumiTask::hActiveUnits
private
edm::ESHandle<DTHVStatus> DTDCSByLumiTask::hvStatus
private

Definition at line 67 of file DTDCSByLumiTask.h.

Referenced by dqmEndLuminosityBlock().

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

Definition at line 65 of file DTDCSByLumiTask.h.

Referenced by dqmBeginRun(), and dqmEndLuminosityBlock().

int DTDCSByLumiTask::theEvents
private

Definition at line 60 of file DTDCSByLumiTask.h.

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

int DTDCSByLumiTask::theLumis
private

Definition at line 61 of file DTDCSByLumiTask.h.

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