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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 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 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::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

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 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
edm::EDPutTokenT< DQMTokenlumiToken_
 
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 29 of file DTDCSByLumiSummary.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 28 of file DTDCSByLumiSummary.cc.

28  {
29 
30  bookingdone = false;
31 
32 }
DTDCSByLumiSummary::~DTDCSByLumiSummary ( )
override

Destructor.

Definition at line 35 of file DTDCSByLumiSummary.cc.

35 {}

Member Function Documentation

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

Definition at line 38 of file DTDCSByLumiSummary.cc.

38  {
39 
40 }
void DTDCSByLumiSummary::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

Implements DQMEDHarvester.

Definition at line 129 of file DTDCSByLumiSummary.cc.

References alignCSCRings::r, DQMStore::IBooker::setCurrentFolder(), and DTTimeEvolutionHisto::setTimeSlotValue().

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

Reimplemented from DQMEDHarvester.

Definition at line 42 of file DTDCSByLumiSummary.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), edm::LuminosityBlockBase::id(), LogTrace, edm::LuminosityBlockID::luminosityBlock(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), and MonitorElement::setLumiFlag().

43  {
44 
45  if (!bookingdone) {
46 
47 
48  ibooker.setCurrentFolder("DT/EventInfo/DCSContents");
49 
50  totalDCSFraction = ibooker.bookFloat("DTDCSSummary");
51  totalDCSFraction->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
52 
53  globalHVSummary = ibooker.book2D("HVGlbSummary","HV Status Summary",1,1,13,5,-2,3);
54  globalHVSummary->setAxisTitle("Sectors",1);
55  globalHVSummary->setAxisTitle("Wheel",2);
56 
57  for(int wh=-2;wh<=2;wh++){
58 
59  stringstream wheel_str; wheel_str << wh;
60 
61  MonitorElement* FractionWh = ibooker.bookFloat("DT_Wheel"+wheel_str.str());
62  FractionWh->setLumiFlag(); // set LumiFlag to DCS content value (save it by lumi)
63 
64  totalDCSFractionWh.push_back(FractionWh);
65  }
66 
68 
69  // CB LumiFlag marked products are reset on LS boundaries
71 
72  for(int wh=-2;wh<=2;wh++){
73  totalDCSFractionWh[wh+2]->Reset();
74  }
75 
76  }
77  bookingdone = true;
78 
79  // Get the by lumi product plot from the task
80  int lumiNumber = lumi.id().luminosityBlock();
81 
82  bool null_pointer_histo(false);
83 
84  std::vector<float> wh_activeFrac;
85 
86  for(int wh=-2;wh<=2;wh++){
87 
88  stringstream wheel_str; wheel_str << wh;
89 
90  string hActiveUnitsPath = "DT/EventInfo/DCSContents/hActiveUnits"+wheel_str.str();
91 
92  MonitorElement *hActiveUnits = igetter.get(hActiveUnitsPath);
93 
94  if (hActiveUnits) {
95  float activeFrac = static_cast<float>(hActiveUnits->getBinContent(2)) / // CB 2nd bin is # of active channels
96  hActiveUnits->getBinContent(1); // first bin is overall number of channels
97 
98  if(activeFrac < 0.) activeFrac=-1;
99 
100  wh_activeFrac.push_back(activeFrac);
101 
102  // Fill by lumi Certification ME
103  totalDCSFraction->Fill(activeFrac);
104  totalDCSFractionWh[wh+2]->Fill(activeFrac);
105 
106  } else {
107  LogTrace("DTDQM|DTMonitorClient|DTDCSByLumiSummary")
108  << "[DTDCSByLumiSummary]: got null pointer retrieving histo at :"
109  << hActiveUnitsPath << " for lumi # " << lumiNumber
110  << "client operation not performed." << endl;
111 
112  null_pointer_histo=true;
113  }
114 
115  } // end loop on wheels
116 
117  if(!null_pointer_histo) dcsFracPerLumi[lumiNumber] = wh_activeFrac; // Fill map to be used to compute trend plots
118 
119 
120  // CB LumiFlag marked products are reset on LS boundaries
122 
123  for(int wh=-2;wh<=2;wh++){
124  totalDCSFractionWh[wh+2]->Reset();
125  }
126 
127 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
MonitorElement * globalHVSummary
void Fill(long long x)
void setLumiFlag()
this ME is meant to be stored for each luminosity section
MonitorElement * totalDCSFraction
void Reset()
reset ME (ie. contents, errors, etc)
#define LogTrace(id)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
std::map< int, std::vector< float > > dcsFracPerLumi
std::vector< MonitorElement * > totalDCSFractionWh
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

Member Data Documentation

bool DTDCSByLumiSummary::bookingdone
private

Definition at line 59 of file DTDCSByLumiSummary.h.

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

Definition at line 57 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::globalHVSummary
private

Definition at line 52 of file DTDCSByLumiSummary.h.

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

Definition at line 54 of file DTDCSByLumiSummary.h.

MonitorElement* DTDCSByLumiSummary::totalDCSFraction
private

Definition at line 51 of file DTDCSByLumiSummary.h.

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

Definition at line 55 of file DTDCSByLumiSummary.h.