CMS 3D CMS Logo

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

#include <DTDCSByLumiSummary.h>

Inheritance diagram for DTDCSByLumiSummary:
DQMEDHarvester edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 DTDCSByLumiSummary (const edm::ParameterSet &pset)
 Constructor. More...
 
 ~DTDCSByLumiSummary () override
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &) override
 
virtual void dqmAnalyze (DQMStore::IBooker &, DQMStore::IGetter &, edm::Event const &, edm::EventSetup const &)
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
 DQMEDHarvester ()
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) final
 
void endProcessBlockProduce (edm::ProcessBlock &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &es) final
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::EndProcessBlockProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 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 beginRun (const edm::Run &r, const edm::EventSetup &c) override
 
void dqmEndJob (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
- 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

bool bookingdone
 
std::map< int, std::vector< float > > dcsFracPerLumi
 
MonitorElementglobalHVSummary
 
std::vector< DTTimeEvolutionHisto * > hDCSFracTrend
 
MonitorElementtotalDCSFraction
 
std::vector< MonitorElement * > totalDCSFractionWh
 

Additional Inherited Members

- Public Types inherited from DQMEDHarvester
typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::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 DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

No description available.

Author
C. Battilana - CIEMAT
P. Bellan - INFN PD
A. Branca = INFN PD

threadsafe version (//-) oct/nov 2014 - WATWanAbdullah ncpp-um-my

Definition at line 27 of file DTDCSByLumiSummary.h.

Constructor & Destructor Documentation

◆ DTDCSByLumiSummary()

DTDCSByLumiSummary::DTDCSByLumiSummary ( const edm::ParameterSet pset)

Constructor.

Definition at line 24 of file DTDCSByLumiSummary.cc.

24 { bookingdone = false; }

◆ ~DTDCSByLumiSummary()

DTDCSByLumiSummary::~DTDCSByLumiSummary ( )
override

Destructor.

Definition at line 26 of file DTDCSByLumiSummary.cc.

26 {}

Member Function Documentation

◆ beginRun()

void DTDCSByLumiSummary::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
overrideprotected

Definition at line 28 of file DTDCSByLumiSummary.cc.

28 {}

◆ dqmEndJob()

void DTDCSByLumiSummary::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 114 of file DTDCSByLumiSummary.cc.

References alignCSCRings::r, dqm::implementation::NavigatorBase::setCurrentFolder(), and DTTimeEvolutionHisto::setTimeSlotValue().

114  {
115  // Book trend plots ME & loop on map to fill it with by lumi info
116  map<int, std::vector<float> >::const_iterator fracPerLumiIt = dcsFracPerLumi.begin();
117  map<int, std::vector<float> >::const_iterator fracPerLumiEnd = dcsFracPerLumi.end();
118 
119  if (fracPerLumiIt != fracPerLumiEnd) {
120  int fLumi = dcsFracPerLumi.begin()->first;
121  int lLumi = dcsFracPerLumi.rbegin()->first;
122 
123  ibooker.setCurrentFolder("DT/EventInfo/DCSContents");
124 
125  int nLumis = lLumi - fLumi + 1.;
126 
127  // trend plots
128  for (int wh = -2; wh <= 2; wh++) {
129  stringstream wheel_str;
130  wheel_str << wh;
131 
132  DTTimeEvolutionHisto* trend;
133 
134  trend = new DTTimeEvolutionHisto(ibooker,
135  "hDCSFracTrendWh" + wheel_str.str(),
136  "Fraction of DT-HV ON Wh" + wheel_str.str(),
137  nLumis,
138  fLumi,
139  1,
140  false,
141  2);
142 
143  hDCSFracTrend.push_back(trend);
144  }
145  }
146 
147  float goodLSperWh[5] = {0, 0, 0, 0, 0};
148  float badLSperWh[5] = {0, 0, 0, 0, 0};
149 
150  // fill trend plots and save infos for summaryPlot
151  for (; fracPerLumiIt != fracPerLumiEnd; ++fracPerLumiIt) {
152  for (int wh = -2; wh <= 2; wh++) {
153  std::vector<float> activeFracPerWh;
154  activeFracPerWh = fracPerLumiIt->second;
155 
156  hDCSFracTrend[wh + 2]->setTimeSlotValue(activeFracPerWh[wh + 2], fracPerLumiIt->first);
157 
158  if (activeFracPerWh[wh + 2] > 0) { // we do not count the lumi were the DTs are off (no real problem),
159  // even if this can happen in the middle of a run (real problem: to be fixed)
160  if (activeFracPerWh[wh + 2] > 0.9)
161  goodLSperWh[wh + 2]++;
162  else {
163  badLSperWh[wh + 2]++;
164  }
165  } else { // there is no HV value OR all channels OFF
166  if (activeFracPerWh[wh + 2] < 0)
167  badLSperWh[wh + 2] = -1; // if there were no HV values, activeFrac returning -1
168  }
169  }
170  }
171 
172  // fill summaryPlot
173  for (int wh = -2; wh <= 2; wh++) {
174  if (goodLSperWh[wh + 2] != 0 || badLSperWh[wh + 2] == -1) {
175  float r = badLSperWh[wh + 2] / fabs(goodLSperWh[wh + 2] + badLSperWh[wh + 2]);
176  if (r > 0.5)
177  globalHVSummary->Fill(1, wh, 0);
178  else
179  globalHVSummary->Fill(1, wh, 1);
180  if (r == -1)
181  globalHVSummary->Fill(1, wh, -1);
182 
183  } else {
184  globalHVSummary->Fill(1, wh, 0);
185  }
186  }
187 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::vector< DTTimeEvolutionHisto * > hDCSFracTrend
MonitorElement * globalHVSummary
void Fill(long long x)
std::map< int, std::vector< float > > dcsFracPerLumi

◆ dqmEndLuminosityBlock()

void DTDCSByLumiSummary::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumi,
edm::EventSetup const &  setup 
)
overrideprotectedvirtual

Reimplemented from DQMEDHarvester.

Definition at line 30 of file DTDCSByLumiSummary.cc.

References dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), LogTrace, dqm::impl::MonitorElement::Reset(), dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

33  {
34  if (!bookingdone) {
35  ibooker.setCurrentFolder("DT/EventInfo/DCSContents");
36 
37  globalHVSummary = ibooker.book2D("HVGlbSummary", "HV Status Summary", 1, 1, 13, 5, -2, 3);
38  globalHVSummary->setAxisTitle("Sectors", 1);
39  globalHVSummary->setAxisTitle("Wheel", 2);
40 
41  {
42  auto scope = DQMStore::IBooker::UseLumiScope(ibooker);
43  totalDCSFraction = ibooker.bookFloat("DTDCSSummary");
44  for (int wh = -2; wh <= 2; wh++) {
45  stringstream wheel_str;
46  wheel_str << wh;
47 
48  MonitorElement* FractionWh = ibooker.bookFloat("DT_Wheel" + wheel_str.str());
49 
50  totalDCSFractionWh.push_back(FractionWh);
51  }
52  }
53 
55 
56  // CB LumiFlag marked products are reset on LS boundaries
58 
59  for (int wh = -2; wh <= 2; wh++) {
60  totalDCSFractionWh[wh + 2]->Reset();
61  }
62  }
63  bookingdone = true;
64 
65  // Get the by lumi product plot from the task
66  int lumiNumber = lumi.id().luminosityBlock();
67 
68  bool null_pointer_histo(false);
69 
70  std::vector<float> wh_activeFrac;
71 
72  for (int wh = -2; wh <= 2; wh++) {
73  stringstream wheel_str;
74  wheel_str << wh;
75 
76  string hActiveUnitsPath = "DT/EventInfo/DCSContents/hActiveUnits" + wheel_str.str();
77 
78  MonitorElement* hActiveUnits = igetter.get(hActiveUnitsPath);
79 
80  if (hActiveUnits) {
81  float activeFrac = static_cast<float>(hActiveUnits->getBinContent(2)) / // CB 2nd bin is # of active channels
82  hActiveUnits->getBinContent(1); // first bin is overall number of channels
83 
84  if (activeFrac < 0.)
85  activeFrac = -1;
86 
87  wh_activeFrac.push_back(activeFrac);
88 
89  // Fill by lumi Certification ME
90  totalDCSFraction->Fill(activeFrac);
91  totalDCSFractionWh[wh + 2]->Fill(activeFrac);
92 
93  } else {
94  LogTrace("DTDQM|DTMonitorClient|DTDCSByLumiSummary")
95  << "[DTDCSByLumiSummary]: got null pointer retrieving histo at :" << hActiveUnitsPath << " for lumi # "
96  << lumiNumber << "client operation not performed." << endl;
97 
98  null_pointer_histo = true;
99  }
100 
101  } // end loop on wheels
102 
103  if (!null_pointer_histo)
104  dcsFracPerLumi[lumiNumber] = wh_activeFrac; // Fill map to be used to compute trend plots
105 
106  // CB LumiFlag marked products are reset on LS boundaries
108 
109  for (int wh = -2; wh <= 2; wh++) {
110  totalDCSFractionWh[wh + 2]->Reset();
111  }
112 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * globalHVSummary
#define LogTrace(id)
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * totalDCSFraction
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:540
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::map< int, std::vector< float > > dcsFracPerLumi
std::vector< MonitorElement * > totalDCSFractionWh
virtual double getBinContent(int binx) const
get content of bin (1-D)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

◆ bookingdone

bool DTDCSByLumiSummary::bookingdone
private

Definition at line 53 of file DTDCSByLumiSummary.h.

◆ dcsFracPerLumi

std::map<int, std::vector<float> > DTDCSByLumiSummary::dcsFracPerLumi
private

Definition at line 51 of file DTDCSByLumiSummary.h.

◆ globalHVSummary

MonitorElement* DTDCSByLumiSummary::globalHVSummary
private

Definition at line 46 of file DTDCSByLumiSummary.h.

◆ hDCSFracTrend

std::vector<DTTimeEvolutionHisto*> DTDCSByLumiSummary::hDCSFracTrend
private

Definition at line 48 of file DTDCSByLumiSummary.h.

◆ totalDCSFraction

MonitorElement* DTDCSByLumiSummary::totalDCSFraction
private

Definition at line 45 of file DTDCSByLumiSummary.h.

◆ totalDCSFractionWh

std::vector<MonitorElement*> DTDCSByLumiSummary::totalDCSFractionWh
private

Definition at line 49 of file DTDCSByLumiSummary.h.