CMS 3D CMS Logo

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

#include <DTOfflineSummaryClients.h>

Inheritance diagram for DTOfflineSummaryClients:
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

void beginRun (const edm::Run &r, const edm::EventSetup &c) override
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 EndJob. More...
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 EndLumi. More...
 
 DTOfflineSummaryClients (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTOfflineSummaryClients () 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)
 

Private Attributes

bool bookingdone
 
int nevents
 
MonitorElementsummaryReport
 
MonitorElementsummaryReportMap
 
std::vector< MonitorElement * > theSummaryContents
 

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 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)
 
- Protected Attributes inherited from DQMEDHarvester
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 25 of file DTOfflineSummaryClients.h.

Constructor & Destructor Documentation

DTOfflineSummaryClients::DTOfflineSummaryClients ( const edm::ParameterSet ps)

Constructor.

Definition at line 30 of file DTOfflineSummaryClients.cc.

References bookingdone.

30  : nevents(0) {
31 
32  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "[DTOfflineSummaryClients]: Constructor";
33 
34  bookingdone = false;
35 
36 }
DTOfflineSummaryClients::~DTOfflineSummaryClients ( )
override

Destructor.

Definition at line 38 of file DTOfflineSummaryClients.cc.

References nevents.

38  {
39  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") << "DTOfflineSummaryClients: analyzed " << nevents << " events";
40 
41 }

Member Function Documentation

void DTOfflineSummaryClients::beginRun ( const edm::Run r,
const edm::EventSetup c 
)
override

BeginRun.

Definition at line 44 of file DTOfflineSummaryClients.cc.

44 {};
void DTOfflineSummaryClients::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overridevirtual

EndJob.

Implements DQMEDHarvester.

Definition at line 54 of file DTOfflineSummaryClients.cc.

References DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), MonitorElement::Fill(), DQMStore::IGetter::get(), MonitorElement::getBinContent(), MonitorElement::getBinError(), MonitorElement::getFloatValue(), cuy::ii, LogTrace, funct::pow(), MonitorElement::Reset(), MonitorElement::setAxisTitle(), DQMStore::IBooker::setCurrentFolder(), relativeConstraints::station, str, summaryReport, summaryReportMap, theSummaryContents, and makeMuonMisalignmentScenario::wheel.

54  {
55 
56  LogVerbatim ("DTDQM|DTMonitorClient|DTOfflineSummaryClients") <<"[DTOfflineSummaryClients]: end job. Performin client operation";
57 
58  // book the summary histos
59 
60  ibooker.setCurrentFolder("DT/EventInfo");
61  summaryReport = ibooker.bookFloat("reportSummary");
62  // Initialize to 1 so that no alarms are thrown at the beginning of the run
63  summaryReport->Fill(1.);
64 
65  summaryReportMap = ibooker.book2D("reportSummaryMap","DT Report Summary Map",12,1,13,5,-2,3);
66  summaryReportMap->setAxisTitle("sector",1);
67  summaryReportMap->setAxisTitle("wheel",2);
68 
69  ibooker.setCurrentFolder("DT/EventInfo/reportSummaryContents");
70 
71  for(int wheel = -2; wheel != 3; ++wheel) {
72  stringstream streams;
73  streams << "DT_Wheel" << wheel;
74  string meName = streams.str();
75 
76  theSummaryContents.push_back(ibooker.bookFloat(meName));
77  // Initialize to 1 so that no alarms are thrown at the beginning of the run
78  theSummaryContents[wheel+2]->Fill(1.);
79  }
80 
81  // reset the monitor elements
83  summaryReport->Fill(0.);
84  for(int ii = 0; ii != 5; ++ii) {
85  theSummaryContents[ii]->Fill(0.);
86  }
87 
88  // Fill the map using, at the moment, only the information from DT chamber efficiency
89  // problems at a granularity smaller than the chamber are ignored
90  for(int wheel=-2; wheel<=2; wheel++) { // loop over wheels
91  // retrieve the chamber efficiency summary
92  stringstream str;
93  str << "DT/05-ChamberEff/EfficiencyMap_All_W" << wheel;
94  MonitorElement * segmentWheelSummary = igetter.get(str.str());
95  if(segmentWheelSummary != nullptr) {
96 
97  float nFailingChambers = 0.;
98 
99  for(int sector=1; sector<=12; sector++) { // loop over sectors
100 
101  double meaneff = 0.;
102  double errorsum = 0.;
103 
104  for(int station = 1; station != 5; ++station) { // loop over stations
105 
106  const double tmpefficiency = segmentWheelSummary->getBinContent(sector, station);
107  const double tmpvariance = pow(segmentWheelSummary->getBinError(sector, station),2);
108 
109  if(tmpefficiency == 0 || tmpvariance == 0){
110  nFailingChambers++;
111  continue;
112  }
113 
114  meaneff += tmpefficiency/tmpvariance;
115  errorsum += 1./tmpvariance;
116 
117  if(tmpefficiency < 0.2) nFailingChambers++;
118 
119  LogTrace("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
120  << "Wheel: " << wheel << " Stat: " << station << " Sect: " << sector << " status: " << meaneff/errorsum << endl;
121  }
122 
123  const double eff_result = meaneff/errorsum;
124 
125  if(eff_result > 0.7) summaryReportMap->Fill(sector,wheel,1.);
126  else if(eff_result < 0.7 && eff_result > 0.5) summaryReportMap->Fill(sector,wheel,0.6);
127  else if(eff_result < 0.5 && eff_result > 0.3) summaryReportMap->Fill(sector,wheel,0.4);
128  else if(eff_result < 0.3 && eff_result > 0.) summaryReportMap->Fill(sector,wheel,0.15);
129 
130  }
131  theSummaryContents[wheel+2]->Fill((48.-nFailingChambers)/48.);
132  summaryReport->Fill(summaryReport->getFloatValue() + theSummaryContents[wheel+2]->getFloatValue()/5.);
133  } else {
134  LogWarning("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
135  << " [DTOfflineSummaryClients] Segment Summary not found with name: " << str.str() << endl;
136  }
137  }
138 
139 }
double getFloatValue() const
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
void Fill(long long x)
void Reset()
reset ME (ie. contents, errors, etc)
#define LogTrace(id)
ii
Definition: cuy.py:589
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
double getBinError(int binx) const
get uncertainty on content of bin (1-D) - See TH1::GetBinError for details
std::vector< MonitorElement * > theSummaryContents
double getBinContent(int binx) const
get content of bin (1-D)
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
#define str(s)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
void DTOfflineSummaryClients::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overridevirtual

EndLumi.

Reimplemented from DQMEDHarvester.

Definition at line 46 of file DTOfflineSummaryClients.cc.

47  {
48 
49  LogVerbatim("DTDQM|DTMonitorClient|DTOfflineSummaryClients")
50  << "[DTOfflineSummaryClients]: End of LS transition" << endl;
51 
52 }

Member Data Documentation

bool DTOfflineSummaryClients::bookingdone
private

Definition at line 50 of file DTOfflineSummaryClients.h.

Referenced by DTOfflineSummaryClients().

int DTOfflineSummaryClients::nevents
private

Definition at line 48 of file DTOfflineSummaryClients.h.

Referenced by ~DTOfflineSummaryClients().

MonitorElement* DTOfflineSummaryClients::summaryReport
private

Definition at line 52 of file DTOfflineSummaryClients.h.

Referenced by dqmEndJob().

MonitorElement* DTOfflineSummaryClients::summaryReportMap
private

Definition at line 53 of file DTOfflineSummaryClients.h.

Referenced by dqmEndJob().

std::vector<MonitorElement*> DTOfflineSummaryClients::theSummaryContents
private

Definition at line 54 of file DTOfflineSummaryClients.h.

Referenced by dqmEndJob().