CMS 3D CMS Logo

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

#include <DTEfficiencyTest.h>

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

Public Member Functions

 DTEfficiencyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTEfficiencyTest () 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 ()
 
 DQMEDHarvester (edm::ParameterSet const &iConfig)
 
virtual void dqmEndRun (DQMStore::IBooker &, DQMStore::IGetter &, edm::Run const &, edm::EventSetup const &)
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &es) 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::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources, edm::Accumulator >
 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 beginRun (const edm::Run &r, const edm::EventSetup &c) override
 beginrun More...
 
void bookHistos (DQMStore::IBooker &, const DTLayerId &ch, int firstWire, int lastWire)
 book the new ME More...
 
void bookHistos (DQMStore::IBooker &, int wh)
 book the summary histograms More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 DQM Client Diagnostic. More...
 
std::string getMEName (std::string histoTag, const DTLayerId &lID)
 Get the ME name. More...
 
- 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 Attributes

std::map< DTLayerId, MonitorElement * > EfficiencyHistos
 
edm::ESHandle< DTGeometrymuonGeom
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int percentual
 
int prescaleFactor
 
int run
 
std::map< DTLayerId, MonitorElement * > UnassEfficiencyHistos
 
std::map< int, MonitorElement * > wheelHistos
 
std::map< int, MonitorElement * > wheelUnassHistos
 

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< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 41 of file DTEfficiencyTest.h.

Constructor & Destructor Documentation

◆ DTEfficiencyTest()

DTEfficiencyTest::DTEfficiencyTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 31 of file DTEfficiencyTest.cc.

31  {
32  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Constructor";
33 
34  parameters = ps;
35 
36  prescaleFactor = parameters.getUntrackedParameter<int>("diagnosticPrescale", 1);
37 
38  percentual = parameters.getUntrackedParameter<int>("BadSLpercentual", 10);
39 }

References Skims_PDWG_cff::prescaleFactor.

◆ ~DTEfficiencyTest()

DTEfficiencyTest::~DTEfficiencyTest ( )
override

Destructor.

Definition at line 41 of file DTEfficiencyTest.cc.

41  {
42  edm::LogVerbatim("efficiency") << "DTEfficiencyTest: analyzed " << nevents << " events";
43 }

References cmsHarvester::nevents.

Member Function Documentation

◆ beginRun()

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

beginrun

Definition at line 45 of file DTEfficiencyTest.cc.

45  {
46  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Begin run";
47 
48  nevents = 0;
49 
50  // Get the geometry
51  context.get<MuonGeometryRecord>().get(muonGeom);
52 }

References edm::EventSetup::get(), edm::get(), and cmsHarvester::nevents.

◆ bookHistos() [1/2]

void DTEfficiencyTest::bookHistos ( DQMStore::IBooker ibooker,
const DTLayerId ch,
int  firstWire,
int  lastWire 
)
protected

book the new ME

Definition at line 347 of file DTEfficiencyTest.cc.

347  {
348  stringstream wheel;
349  wheel << lId.superlayerId().wheel();
350  stringstream station;
351  station << lId.superlayerId().station();
352  stringstream sector;
353  sector << lId.superlayerId().sector();
354  stringstream superLayer;
355  superLayer << lId.superlayerId().superlayer();
356  stringstream layer;
357  layer << lId.layer();
358 
359  string HistoName =
360  "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" + superLayer.str() + "_L" + layer.str();
361  string EfficiencyHistoName = "Efficiency_" + HistoName;
362  string UnassEfficiencyHistoName = "UnassEfficiency_" + HistoName;
363 
364  ibooker.setCurrentFolder("DT/Tests/DTEfficiency/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
365  sector.str());
366 
367  EfficiencyHistos[lId] = ibooker.book1D(EfficiencyHistoName.c_str(),
368  EfficiencyHistoName.c_str(),
369  lastWire - firstWire + 1,
370  firstWire - 0.5,
371  lastWire + 0.5);
372  UnassEfficiencyHistos[lId] = ibooker.book1D(UnassEfficiencyHistoName.c_str(),
373  UnassEfficiencyHistoName.c_str(),
374  lastWire - firstWire + 1,
375  firstWire - 0.5,
376  lastWire + 0.5);
377 }

References dqm::implementation::IBooker::book1D(), DTLayerId::layer(), DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

◆ bookHistos() [2/2]

void DTEfficiencyTest::bookHistos ( DQMStore::IBooker ibooker,
int  wh 
)
protected

book the summary histograms

Definition at line 379 of file DTEfficiencyTest.cc.

379  {
380  ibooker.setCurrentFolder("DT/Tests/DTEfficiency/SummaryPlot");
381 
382  if (wheelHistos.find(3) == wheelHistos.end()) {
383  string histoName = "ESummary_testFailedByAtLeastBadSL";
384  wheelHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 2);
385  wheelHistos[3]->setBinLabel(1, "Sector1", 1);
386  wheelHistos[3]->setBinLabel(1, "Sector1", 1);
387  wheelHistos[3]->setBinLabel(2, "Sector2", 1);
388  wheelHistos[3]->setBinLabel(3, "Sector3", 1);
389  wheelHistos[3]->setBinLabel(4, "Sector4", 1);
390  wheelHistos[3]->setBinLabel(5, "Sector5", 1);
391  wheelHistos[3]->setBinLabel(6, "Sector6", 1);
392  wheelHistos[3]->setBinLabel(7, "Sector7", 1);
393  wheelHistos[3]->setBinLabel(8, "Sector8", 1);
394  wheelHistos[3]->setBinLabel(9, "Sector9", 1);
395  wheelHistos[3]->setBinLabel(10, "Sector10", 1);
396  wheelHistos[3]->setBinLabel(11, "Sector11", 1);
397  wheelHistos[3]->setBinLabel(12, "Sector12", 1);
398  wheelHistos[3]->setBinLabel(13, "Sector13", 1);
399  wheelHistos[3]->setBinLabel(14, "Sector14", 1);
400  wheelHistos[3]->setBinLabel(1, "Wheel-2", 2);
401  wheelHistos[3]->setBinLabel(2, "Wheel-1", 2);
402  wheelHistos[3]->setBinLabel(3, "Wheel0", 2);
403  wheelHistos[3]->setBinLabel(4, "Wheel+1", 2);
404  wheelHistos[3]->setBinLabel(5, "Wheel+2", 2);
405  }
406  if (wheelUnassHistos.find(3) == wheelUnassHistos.end()) {
407  string histoName = "UESummary_testFailedByAtLeastBadSL";
408  wheelUnassHistos[3] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 5, -2, 2);
409  wheelUnassHistos[3]->setBinLabel(1, "Sector1", 1);
410  wheelUnassHistos[3]->setBinLabel(1, "Sector1", 1);
411  wheelUnassHistos[3]->setBinLabel(2, "Sector2", 1);
412  wheelUnassHistos[3]->setBinLabel(3, "Sector3", 1);
413  wheelUnassHistos[3]->setBinLabel(4, "Sector4", 1);
414  wheelUnassHistos[3]->setBinLabel(5, "Sector5", 1);
415  wheelUnassHistos[3]->setBinLabel(6, "Sector6", 1);
416  wheelUnassHistos[3]->setBinLabel(7, "Sector7", 1);
417  wheelUnassHistos[3]->setBinLabel(8, "Sector8", 1);
418  wheelUnassHistos[3]->setBinLabel(9, "Sector9", 1);
419  wheelUnassHistos[3]->setBinLabel(10, "Sector10", 1);
420  wheelUnassHistos[3]->setBinLabel(11, "Sector11", 1);
421  wheelUnassHistos[3]->setBinLabel(12, "Sector12", 1);
422  wheelUnassHistos[3]->setBinLabel(13, "Sector13", 1);
423  wheelUnassHistos[3]->setBinLabel(14, "Sector14", 1);
424  wheelUnassHistos[3]->setBinLabel(1, "Wheel-2", 2);
425  wheelUnassHistos[3]->setBinLabel(2, "Wheel-1", 2);
426  wheelUnassHistos[3]->setBinLabel(3, "Wheel0", 2);
427  wheelUnassHistos[3]->setBinLabel(4, "Wheel+1", 2);
428  wheelUnassHistos[3]->setBinLabel(5, "Wheel+2", 2);
429  }
430 
431  stringstream wheel;
432  wheel << wh;
433 
434  if (wheelHistos.find(wh) == wheelHistos.end()) {
435  string histoName = "ESummary_testFailed_W" + wheel.str();
436  wheelHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
437  wheelHistos[wh]->setBinLabel(1, "Sector1", 1);
438  wheelHistos[wh]->setBinLabel(2, "Sector2", 1);
439  wheelHistos[wh]->setBinLabel(3, "Sector3", 1);
440  wheelHistos[wh]->setBinLabel(4, "Sector4", 1);
441  wheelHistos[wh]->setBinLabel(5, "Sector5", 1);
442  wheelHistos[wh]->setBinLabel(6, "Sector6", 1);
443  wheelHistos[wh]->setBinLabel(7, "Sector7", 1);
444  wheelHistos[wh]->setBinLabel(8, "Sector8", 1);
445  wheelHistos[wh]->setBinLabel(9, "Sector9", 1);
446  wheelHistos[wh]->setBinLabel(10, "Sector10", 1);
447  wheelHistos[wh]->setBinLabel(11, "Sector11", 1);
448  wheelHistos[wh]->setBinLabel(12, "Sector12", 1);
449  wheelHistos[wh]->setBinLabel(13, "Sector13", 1);
450  wheelHistos[wh]->setBinLabel(14, "Sector14", 1);
451  wheelHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
452  wheelHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
453  wheelHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
454  wheelHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
455  wheelHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
456  wheelHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
457  wheelHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
458  wheelHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
459  wheelHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
460  wheelHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
461  wheelHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
462  }
463  if (wheelUnassHistos.find(wh) == wheelUnassHistos.end()) {
464  string histoName = "UESummary_testFailed_W" + wheel.str();
465  wheelUnassHistos[wh] = ibooker.book2D(histoName.c_str(), histoName.c_str(), 14, 0, 14, 11, 0, 11);
466  wheelUnassHistos[wh]->setBinLabel(1, "Sector1", 1);
467  wheelUnassHistos[wh]->setBinLabel(2, "Sector2", 1);
468  wheelUnassHistos[wh]->setBinLabel(3, "Sector3", 1);
469  wheelUnassHistos[wh]->setBinLabel(4, "Sector4", 1);
470  wheelUnassHistos[wh]->setBinLabel(5, "Sector5", 1);
471  wheelUnassHistos[wh]->setBinLabel(6, "Sector6", 1);
472  wheelUnassHistos[wh]->setBinLabel(7, "Sector7", 1);
473  wheelUnassHistos[wh]->setBinLabel(8, "Sector8", 1);
474  wheelUnassHistos[wh]->setBinLabel(9, "Sector9", 1);
475  wheelUnassHistos[wh]->setBinLabel(10, "Sector10", 1);
476  wheelUnassHistos[wh]->setBinLabel(11, "Sector11", 1);
477  wheelUnassHistos[wh]->setBinLabel(12, "Sector12", 1);
478  wheelUnassHistos[wh]->setBinLabel(13, "Sector13", 1);
479  wheelUnassHistos[wh]->setBinLabel(14, "Sector14", 1);
480  wheelUnassHistos[wh]->setBinLabel(1, "MB1_SL1", 2);
481  wheelUnassHistos[wh]->setBinLabel(2, "MB1_SL2", 2);
482  wheelUnassHistos[wh]->setBinLabel(3, "MB1_SL3", 2);
483  wheelUnassHistos[wh]->setBinLabel(4, "MB2_SL1", 2);
484  wheelUnassHistos[wh]->setBinLabel(5, "MB2_SL2", 2);
485  wheelUnassHistos[wh]->setBinLabel(6, "MB2_SL3", 2);
486  wheelUnassHistos[wh]->setBinLabel(7, "MB3_SL1", 2);
487  wheelUnassHistos[wh]->setBinLabel(8, "MB3_SL2", 2);
488  wheelUnassHistos[wh]->setBinLabel(9, "MB3_SL3", 2);
489  wheelUnassHistos[wh]->setBinLabel(10, "MB4_SL1", 2);
490  wheelUnassHistos[wh]->setBinLabel(11, "MB4_SL3", 2);
491  }
492 }

References dqm::implementation::IBooker::book2D(), HltBtagPostValidation_cff::histoName, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), and makeMuonMisalignmentScenario::wheel.

◆ dqmEndJob()

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

Implements DQMEDHarvester.

Definition at line 321 of file DTEfficiencyTest.cc.

321  {
322  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest] endjob called!";
323 }

◆ dqmEndLuminosityBlock()

void DTEfficiencyTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Reimplemented from DQMEDHarvester.

Definition at line 54 of file DTEfficiencyTest.cc.

57  {
58  for (map<int, MonitorElement*>::const_iterator histo = wheelHistos.begin(); histo != wheelHistos.end(); histo++) {
59  (*histo).second->Reset();
60  }
61 
62  for (map<int, MonitorElement*>::const_iterator histo = wheelUnassHistos.begin(); histo != wheelUnassHistos.end();
63  histo++) {
64  (*histo).second->Reset();
65  }
66 
67  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: End of LS transition, performing the DQM client operation";
68 
69  // counts number of lumiSegs
70  nLumiSegs = lumiSeg.id().luminosityBlock();
71 
72  // prescale factor
73  if (nLumiSegs % prescaleFactor != 0)
74  return;
75 
76  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: " << nLumiSegs << " updates";
77 
78  vector<const DTChamber*>::const_iterator ch_it = muonGeom->chambers().begin();
79  vector<const DTChamber*>::const_iterator ch_end = muonGeom->chambers().end();
80 
81  edm::LogVerbatim("efficiency") << "[DTEfficiencyTest]: Efficiency tests results";
82 
83  map<DTLayerId, vector<double> > LayerBadCells;
84  LayerBadCells.clear();
85  map<DTLayerId, vector<double> > LayerUnassBadCells;
86  LayerUnassBadCells.clear();
87  map<DTSuperLayerId, vector<double> > SuperLayerBadCells;
88  SuperLayerBadCells.clear();
89  map<DTSuperLayerId, vector<double> > SuperLayerUnassBadCells;
90  SuperLayerUnassBadCells.clear();
91  map<pair<int, int>, int> cmsHistos;
92  cmsHistos.clear();
93  map<pair<int, int>, bool> filled;
94  for (int i = -2; i < 3; i++) {
95  for (int j = 1; j < 15; j++) {
96  filled[make_pair(i, j)] = false;
97  }
98  }
99  map<pair<int, int>, int> cmsUnassHistos;
100  cmsUnassHistos.clear();
101  map<pair<int, int>, bool> UnassFilled;
102  for (int i = -2; i < 3; i++) {
103  for (int j = 1; j < 15; j++) {
104  UnassFilled[make_pair(i, j)] = false;
105  }
106  }
107 
108  // Loop over the chambers
109  for (; ch_it != ch_end; ++ch_it) {
110  DTChamberId chID = (*ch_it)->id();
111  vector<const DTSuperLayer*>::const_iterator sl_it = (*ch_it)->superLayers().begin();
112  vector<const DTSuperLayer*>::const_iterator sl_end = (*ch_it)->superLayers().end();
113 
114  // Loop over the SuperLayers
115  for (; sl_it != sl_end; ++sl_it) {
116  DTSuperLayerId slID = (*sl_it)->id();
117  vector<const DTLayer*>::const_iterator l_it = (*sl_it)->layers().begin();
118  vector<const DTLayer*>::const_iterator l_end = (*sl_it)->layers().end();
119 
120  // Loop over the layers
121  for (; l_it != l_end; ++l_it) {
122  DTLayerId lID = (*l_it)->id();
123 
124  stringstream wheel;
125  wheel << chID.wheel();
126  stringstream station;
127  station << chID.station();
128  stringstream sector;
129  sector << chID.sector();
130  stringstream superLayer;
131  superLayer << slID.superlayer();
132  stringstream layer;
133  layer << lID.layer();
134 
135  string HistoName = "W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() + "_SL" +
136  superLayer.str() + "_L" + layer.str();
137 
138  // Get the ME produced by EfficiencyTask Source
139  MonitorElement* occupancy_histo = igetter.get(getMEName("hEffOccupancy", lID));
140  MonitorElement* unassOccupancy_histo = igetter.get(getMEName("hEffUnassOccupancy", lID));
141  MonitorElement* recSegmOccupancy_histo = igetter.get(getMEName("hRecSegmOccupancy", lID));
142 
143  // ME -> TH1F
144  if (occupancy_histo && unassOccupancy_histo && recSegmOccupancy_histo) {
145  TH1F* occupancy_histo_root = occupancy_histo->getTH1F();
146  TH1F* unassOccupancy_histo_root = unassOccupancy_histo->getTH1F();
147  TH1F* recSegmOccupancy_histo_root = recSegmOccupancy_histo->getTH1F();
148 
149  const int firstWire = muonGeom->layer(lID)->specificTopology().firstChannel();
150  const int lastWire = muonGeom->layer(lID)->specificTopology().lastChannel();
151 
152  // Loop over the TH1F bin and fill the ME to be used for the Quality Test
153  for (int bin = firstWire; bin <= lastWire; bin++) {
154  if ((recSegmOccupancy_histo_root->GetBinContent(bin)) != 0) {
155  if (EfficiencyHistos.find(lID) == EfficiencyHistos.end())
156  bookHistos(ibooker, lID, firstWire, lastWire);
157  float efficiency =
158  occupancy_histo_root->GetBinContent(bin) / recSegmOccupancy_histo_root->GetBinContent(bin);
159  float errorEff = sqrt(efficiency * (1 - efficiency) / recSegmOccupancy_histo_root->GetBinContent(bin));
160  EfficiencyHistos.find(lID)->second->setBinContent(bin, efficiency);
161  EfficiencyHistos.find(lID)->second->setBinError(bin, errorEff);
162 
163  if (UnassEfficiencyHistos.find(lID) == EfficiencyHistos.end())
164  bookHistos(ibooker, lID, firstWire, lastWire);
165  float unassEfficiency =
166  unassOccupancy_histo_root->GetBinContent(bin) / recSegmOccupancy_histo_root->GetBinContent(bin);
167  float errorUnassEff =
168  sqrt(unassEfficiency * (1 - unassEfficiency) / recSegmOccupancy_histo_root->GetBinContent(bin));
169  UnassEfficiencyHistos.find(lID)->second->setBinContent(bin, unassEfficiency);
170  UnassEfficiencyHistos.find(lID)->second->setBinError(bin, errorUnassEff);
171  }
172  }
173  }
174  } // loop on layers
175  } // loop on superlayers
176  } //loop on chambers
177 
178  // Efficiency test
179  //cout<<"[DTEfficiencyTest]: Efficiency Tests results"<<endl;
180  string EfficiencyCriterionName = parameters.getUntrackedParameter<string>("EfficiencyTestName", "EfficiencyInRange");
181  for (map<DTLayerId, MonitorElement*>::const_iterator hEff = EfficiencyHistos.begin(); hEff != EfficiencyHistos.end();
182  hEff++) {
183  const QReport* theEfficiencyQReport = (*hEff).second->getQReport(EfficiencyCriterionName);
184  double counter = 0;
185  if (theEfficiencyQReport) {
186  vector<dqm::me_util::Channel> badChannels = theEfficiencyQReport->getBadChannels();
187  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
188  channel++) {
189  edm::LogError("efficiency") << "LayerID : " << getMEName("hEffOccupancy", (*hEff).first)
190  << " Bad efficiency channels: " << (*channel).getBin()
191  << " Contents : " << (*channel).getContents();
192  counter++;
193  }
194  LayerBadCells[(*hEff).first].push_back(counter);
195  LayerBadCells[(*hEff).first].push_back(muonGeom->layer((*hEff).first)->specificTopology().channels());
196  // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
197  // edm::LogWarning ("efficiency") << "-------- "<<theEfficiencyQReport->getMessage()<<" ------- "<<theEfficiencyQReport->getStatus();
198  }
199  }
200 
201  // UnassEfficiency test
202  //cout<<"[DTEfficiencyTest]: UnassEfficiency Tests results"<<endl;
203  string UnassEfficiencyCriterionName =
204  parameters.getUntrackedParameter<string>("UnassEfficiencyTestName", "UnassEfficiencyInRange");
205  for (map<DTLayerId, MonitorElement*>::const_iterator hUnassEff = UnassEfficiencyHistos.begin();
206  hUnassEff != UnassEfficiencyHistos.end();
207  hUnassEff++) {
208  const QReport* theUnassEfficiencyQReport = (*hUnassEff).second->getQReport(UnassEfficiencyCriterionName);
209  double counter = 0;
210  if (theUnassEfficiencyQReport) {
211  vector<dqm::me_util::Channel> badChannels = theUnassEfficiencyQReport->getBadChannels();
212  for (vector<dqm::me_util::Channel>::iterator channel = badChannels.begin(); channel != badChannels.end();
213  channel++) {
214  edm::LogError("efficiency") << "Bad unassEfficiency channels: " << (*channel).getBin() << " "
215  << (*channel).getContents();
216  counter++;
217  }
218  LayerUnassBadCells[(*hUnassEff).first].push_back(counter);
219  LayerUnassBadCells[(*hUnassEff).first].push_back(
220  double(muonGeom->layer((*hUnassEff).first)->specificTopology().channels()));
221  // FIXME: getMessage() sometimes returns and invalid string (null pointer inside QReport data member)
222  // edm::LogWarning ("efficiency") << theUnassEfficiencyQReport->getMessage()<<" ------- "<<theUnassEfficiencyQReport->getStatus();
223  }
224  }
225 
226  vector<const DTChamber*>::const_iterator ch2_it = muonGeom->chambers().begin();
227  vector<const DTChamber*>::const_iterator ch2_end = muonGeom->chambers().end();
228  for (; ch2_it != ch2_end; ++ch2_it) {
229  vector<const DTSuperLayer*>::const_iterator sl2_it = (*ch2_it)->superLayers().begin();
230  vector<const DTSuperLayer*>::const_iterator sl2_end = (*ch2_it)->superLayers().end();
231  // Loop over the SLs
232  for (; sl2_it != sl2_end; ++sl2_it) {
233  DTSuperLayerId sl = (*sl2_it)->id();
234  double superLayerBadC = 0;
235  double superLayerTotC = 0;
236  double superLayerUnassBadC = 0;
237  double superLayerUnassTotC = 0;
238  bool fill = false;
239  vector<const DTLayer*>::const_iterator l2_it = (*sl2_it)->layers().begin();
240  vector<const DTLayer*>::const_iterator l2_end = (*sl2_it)->layers().end();
241  // Loop over the Ls
242  for (; l2_it != l2_end; ++l2_it) {
243  DTLayerId layerId = (*l2_it)->id();
244  if (LayerBadCells.find(layerId) != LayerBadCells.end() &&
245  LayerUnassBadCells.find(layerId) != LayerUnassBadCells.end()) {
246  fill = true;
247  superLayerBadC += LayerBadCells[layerId][0];
248  superLayerTotC += LayerBadCells[layerId][1];
249  superLayerUnassBadC += LayerUnassBadCells[layerId][0];
250  superLayerUnassTotC += LayerUnassBadCells[layerId][1];
251  }
252  }
253  if (fill) {
254  SuperLayerBadCells[sl].push_back(superLayerBadC);
255  SuperLayerBadCells[sl].push_back(superLayerTotC);
256  SuperLayerUnassBadCells[sl].push_back(superLayerUnassBadC);
257  SuperLayerUnassBadCells[sl].push_back(superLayerUnassTotC);
258  }
259  }
260  }
261 
262  for (map<DTSuperLayerId, vector<double> >::const_iterator SLBCells = SuperLayerBadCells.begin();
263  SLBCells != SuperLayerBadCells.end();
264  SLBCells++) {
265  if ((*SLBCells).second[0] / (*SLBCells).second[1] > double(percentual / 100)) {
266  if (wheelHistos.find((*SLBCells).first.wheel()) == wheelHistos.end())
267  bookHistos(ibooker, (*SLBCells).first.wheel());
268  if (!((*SLBCells).first.station() == 4 && (*SLBCells).first.superlayer() == 3))
269  wheelHistos[(*SLBCells).first.wheel()]->Fill(
270  (*SLBCells).first.sector() - 1,
271  ((*SLBCells).first.superlayer() - 1) + 3 * ((*SLBCells).first.station() - 1));
272  else
273  wheelHistos[(*SLBCells).first.wheel()]->Fill((*SLBCells).first.sector() - 1, 10);
274  // fill the cms summary histo if the percentual of SL which have not passed the test
275  // is more than a predefined treshold
276  cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]++;
277  if (((*SLBCells).first.sector() < 13 &&
278  double(cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]) / 11 >
279  double(percentual) / 100 &&
280  filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] == false) ||
281  ((*SLBCells).first.sector() >= 13 &&
282  double(cmsHistos[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())]) / 2 >
283  double(percentual) / 100 &&
284  filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] == false)) {
285  filled[make_pair((*SLBCells).first.wheel(), (*SLBCells).first.sector())] = true;
286  wheelHistos[3]->Fill((*SLBCells).first.sector() - 1, (*SLBCells).first.wheel());
287  }
288  }
289  }
290 
291  for (map<DTSuperLayerId, vector<double> >::const_iterator SLUBCells = SuperLayerUnassBadCells.begin();
292  SLUBCells != SuperLayerUnassBadCells.end();
293  SLUBCells++) {
294  if ((*SLUBCells).second[0] / (*SLUBCells).second[1] > double(percentual / 100)) {
295  if (wheelUnassHistos.find((*SLUBCells).first.wheel()) == wheelUnassHistos.end())
296  bookHistos(ibooker, (*SLUBCells).first.wheel());
297  if (!((*SLUBCells).first.station() == 4 && (*SLUBCells).first.superlayer() == 3))
298  wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill(
299  (*SLUBCells).first.sector() - 1,
300  ((*SLUBCells).first.superlayer() - 1) + 3 * ((*SLUBCells).first.station() - 1));
301  else
302  wheelUnassHistos[(*SLUBCells).first.wheel()]->Fill((*SLUBCells).first.sector() - 1, 10);
303  // fill the cms summary histo if the percentual of SL which have not passed the test
304  // is more than a predefined treshold
305  cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]++;
306  if (((*SLUBCells).first.sector() < 13 &&
307  double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]) / 11 >
308  double(percentual) / 100 &&
309  UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] == false) ||
310  ((*SLUBCells).first.sector() >= 13 &&
311  double(cmsUnassHistos[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())]) / 2 >
312  double(percentual) / 100 &&
313  UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] == false)) {
314  UnassFilled[make_pair((*SLUBCells).first.wheel(), (*SLUBCells).first.sector())] = true;
315  wheelUnassHistos[3]->Fill((*SLUBCells).first.sector() - 1, (*SLUBCells).first.wheel());
316  }
317  }
318  }
319 }

References newFWLiteAna::bin, bookHistos(), L1TObjectsTimingClient_cff::efficiency, ntuplemaker::fill, dqm::implementation::IGetter::get(), MonitorElementData::QReport::getBadChannels(), dqm::legacy::MonitorElement::getTH1F(), timingPdfMaker::histo, mps_fire::i, edm::LuminosityBlockBase::id(), dqmiolumiharvest::j, DTLayerId::layer(), edm::LuminosityBlockID::luminosityBlock(), genParticles_cff::map, Skims_PDWG_cff::prescaleFactor, DTChamberId::sector(), mathSSE::sqrt(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

◆ getMEName()

string DTEfficiencyTest::getMEName ( std::string  histoTag,
const DTLayerId lID 
)
protected

Get the ME name.

Definition at line 325 of file DTEfficiencyTest.cc.

325  {
326  stringstream wheel;
327  wheel << lID.superlayerId().wheel();
328  stringstream station;
329  station << lID.superlayerId().station();
330  stringstream sector;
331  sector << lID.superlayerId().sector();
332  stringstream superLayer;
333  superLayer << lID.superlayerId().superlayer();
334  stringstream layer;
335  layer << lID.layer();
336 
337  string folderRoot = parameters.getUntrackedParameter<string>("folderRoot", "Collector/FU0/");
338  string folderName = folderRoot + "DT/DTEfficiencyTask/Wheel" + wheel.str() + "/Station" + station.str() + "/Sector" +
339  sector.str() + "/SuperLayer" + superLayer.str() + "/";
340 
341  string histoname = folderName + histoTag + "_W" + wheel.str() + "_St" + station.str() + "_Sec" + sector.str() +
342  "_SL" + superLayer.str() + "_L" + layer.str();
343 
344  return histoname;
345 }

References ALCARECODTCalibSynchCosmicsDQM_cff::folderName, dtChamberEfficiencyTest_cfi::folderRoot, dtResolutionTest_cfi::histoTag, DTLayerId::layer(), DTChamberId::sector(), DTChamberId::station(), relativeConstraints::station, DTSuperLayerId::superlayer(), DTLayerId::superlayerId(), DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Member Data Documentation

◆ EfficiencyHistos

std::map<DTLayerId, MonitorElement *> DTEfficiencyTest::EfficiencyHistos
private

Definition at line 82 of file DTEfficiencyTest.h.

◆ muonGeom

edm::ESHandle<DTGeometry> DTEfficiencyTest::muonGeom
private

Definition at line 80 of file DTEfficiencyTest.h.

◆ nevents

int DTEfficiencyTest::nevents
private

Definition at line 73 of file DTEfficiencyTest.h.

◆ nLumiSegs

unsigned int DTEfficiencyTest::nLumiSegs
private

Definition at line 74 of file DTEfficiencyTest.h.

◆ parameters

edm::ParameterSet DTEfficiencyTest::parameters
private

Definition at line 79 of file DTEfficiencyTest.h.

◆ percentual

int DTEfficiencyTest::percentual
private

Definition at line 77 of file DTEfficiencyTest.h.

◆ prescaleFactor

int DTEfficiencyTest::prescaleFactor
private

Definition at line 75 of file DTEfficiencyTest.h.

◆ run

int DTEfficiencyTest::run
private

◆ UnassEfficiencyHistos

std::map<DTLayerId, MonitorElement *> DTEfficiencyTest::UnassEfficiencyHistos
private

Definition at line 83 of file DTEfficiencyTest.h.

◆ wheelHistos

std::map<int, MonitorElement *> DTEfficiencyTest::wheelHistos
private

Definition at line 86 of file DTEfficiencyTest.h.

◆ wheelUnassHistos

std::map<int, MonitorElement *> DTEfficiencyTest::wheelUnassHistos
private

Definition at line 87 of file DTEfficiencyTest.h.

DTSuperLayerId
Definition: DTSuperLayerId.h:12
counter
Definition: counter.py:1
mps_fire.i
i
Definition: mps_fire.py:355
relativeConstraints.station
station
Definition: relativeConstraints.py:67
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
DTTopology::channels
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:76
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
DTSuperLayerId::superlayer
int superlayer() const
Return the superlayer number (deprecated method name)
Definition: DTSuperLayerId.h:42
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
DTTopology::firstChannel
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:79
DTGeometry::chambers
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:84
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
DTEfficiencyTest::bookHistos
void bookHistos(DQMStore::IBooker &, const DTLayerId &ch, int firstWire, int lastWire)
book the new ME
Definition: DTEfficiencyTest.cc:347
MonitorElementData::QReport::getBadChannels
const std::vector< DQMChannel > & getBadChannels() const
Definition: MonitorElementCollection.h:116
DTLayerId
Definition: DTLayerId.h:12
ntuplemaker.fill
fill
Definition: ntuplemaker.py:304
edm::LogError
Definition: MessageLogger.h:183
DTGeometry::layer
const DTLayer * layer(const DTLayerId &id) const
Return a layer given its id.
Definition: DTGeometry.cc:96
DTEfficiencyTest::prescaleFactor
int prescaleFactor
Definition: DTEfficiencyTest.h:75
DTEfficiencyTest::wheelHistos
std::map< int, MonitorElement * > wheelHistos
Definition: DTEfficiencyTest.h:86
dtResolutionTest_cfi.histoTag
histoTag
Definition: dtResolutionTest_cfi.py:21
MonitorElementData::QReport
Definition: MonitorElementCollection.h:55
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
edm::LogVerbatim
Definition: MessageLogger.h:297
cscdqm::HistoName
std::string HistoName
Definition: CSCDQM_HistoDef.h:32
DTEfficiencyTest::wheelUnassHistos
std::map< int, MonitorElement * > wheelUnassHistos
Definition: DTEfficiencyTest.h:87
DTEfficiencyTest::nevents
int nevents
Definition: DTEfficiencyTest.h:73
get
#define get
ALCARECODTCalibSynchCosmicsDQM_cff.folderName
folderName
Definition: ALCARECODTCalibSynchCosmicsDQM_cff.py:9
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
DTTopology::lastChannel
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:81
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DTLayerId::superlayerId
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
Definition: DTLayerId.h:45
DTEfficiencyTest::getMEName
std::string getMEName(std::string histoTag, const DTLayerId &lID)
Get the ME name.
Definition: DTEfficiencyTest.cc:325
DTEfficiencyTest::muonGeom
edm::ESHandle< DTGeometry > muonGeom
Definition: DTEfficiencyTest.h:80
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
DTEfficiencyTest::EfficiencyHistos
std::map< DTLayerId, MonitorElement * > EfficiencyHistos
Definition: DTEfficiencyTest.h:82
DTEfficiencyTest::UnassEfficiencyHistos
std::map< DTLayerId, MonitorElement * > UnassEfficiencyHistos
Definition: DTEfficiencyTest.h:83
dtChamberEfficiencyTest_cfi.folderRoot
folderRoot
Definition: dtChamberEfficiencyTest_cfi.py:9
DTLayer::specificTopology
const DTTopology & specificTopology() const
Definition: DTLayer.cc:37
DTEfficiencyTest::nLumiSegs
unsigned int nLumiSegs
Definition: DTEfficiencyTest.h:74
genParticles_cff.map
map
Definition: genParticles_cff.py:11
DTChamberId
Definition: DTChamberId.h:14
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
DTLayerId::layer
int layer() const
Return the layer number.
Definition: DTLayerId.h:42
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
DTEfficiencyTest::percentual
int percentual
Definition: DTEfficiencyTest.h:77