CMS 3D CMS Logo

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

#include <DTLocalTriggerEfficiencyTest.h>

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

 DTLocalTriggerEfficiencyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTLocalTriggerEfficiencyTest () override
 Destructor. More...
 
- Public Member Functions inherited from DTLocalTriggerBaseTest
 DTLocalTriggerBaseTest ()
 Constructor. More...
 
 ~DTLocalTriggerBaseTest () 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
 BeginRun. More...
 
void bookChambHistos (DQMStore::IBooker &, DTChamberId chambId, std::string htype)
 Book the new MEs (for each chamber) More...
 
void Bookings (DQMStore::IBooker &, DQMStore::IGetter &)
 
void makeEfficiencyME (TH1D *numerator, TH1D *denominator, MonitorElement *result)
 Compute efficiency plots. More...
 
void makeEfficiencyME2D (TH2F *numerator, TH2F *denominator, MonitorElement *result)
 Compute 2D efficiency plots. More...
 
void runClientDiagnostic (DQMStore::IBooker &, DQMStore::IGetter &) override
 DQM Client Diagnostic. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
void beginRun (edm::Run const &run, edm::EventSetup const &context) override
 BeginRun. More...
 
void bookCmsHistos (DQMStore::IBooker &, std::string hTag, std::string folder="", bool isGlb=false)
 Book the new MEs (CMS summary) More...
 
void bookSectorHistos (DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector) More...
 
void bookWheelHistos (DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
 Book the new MEs (for each wheel) More...
 
std::string category ()
 Get message logger name. More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 Perform client diagnostic in online. More...
 
void endRun (edm::Run const &run, edm::EventSetup const &context) override
 Perform client diagnostic in offline. More...
 
std::string fullName (std::string htype)
 Create fullname from histo partial name. More...
 
template<class T >
TgetHisto (MonitorElement *me)
 Convert ME to Histogram fo type T. More...
 
std::string getMEName (std::string histoTag, std::string subfolder, const DTChamberId &chambid)
 Get the ME name (by chamber) More...
 
std::string getMEName (std::string histoTag, std::string subfolder, int wh)
 Get the ME name (by wheel) More...
 
std::pair< float, float > phiRange (const DTChamberId &id)
 Calculate phi range for histograms. More...
 
void setConfig (const edm::ParameterSet &ps, std::string name)
 Set configuration variables. More...
 
std::string & topFolder ()
 Get top folder name. More...
 
- 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)
 

Protected Attributes

const int wheelArrayShift = 3
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderTM
 
std::map< std::string, MonitorElement * > cmsME
 
std::string hwSource
 
std::vector< std::string > hwSources
 
const DTGeometrymuonGeom
 
edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeomToken_
 
int nevents
 
unsigned int nLumiSegs
 
edm::ParameterSet parameters
 
int prescaleFactor
 
int run
 
bool runOnline
 
std::map< int, std::map< std::string, MonitorElement * > > secME
 
std::string sourceFolder
 
std::string testName
 
std::string trigSource
 
std::vector< std::string > trigSources
 
std::map< int, std::map< std::string, MonitorElement * > > whME
 
- Protected Attributes inherited from DQMEDHarvester
DQMStoredqmstore_
 
edm::GetterOfProducts< DQMTokenjobmegetter_
 
edm::EDPutTokenT< DQMTokenjobToken_
 
edm::GetterOfProducts< DQMTokenlumimegetter_
 
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::GetterOfProducts< DQMTokenrunmegetter_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Private Attributes

bool bookingdone
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
 
DTTrigGeomUtilstrigGeomUtils
 

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
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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)
 

Detailed Description

Definition at line 19 of file DTLocalTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

◆ DTLocalTriggerEfficiencyTest()

DTLocalTriggerEfficiencyTest::DTLocalTriggerEfficiencyTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file DTLocalTriggerEfficiencyTest.cc.

References DTLocalTriggerBaseTest::baseFolderTM, bookingdone, and DTLocalTriggerBaseTest::setConfig().

34  : trigGeomUtils(nullptr) {
35  setConfig(ps, "DTLocalTriggerEfficiency");
36  baseFolderTM = "DT/03-LocalTrigger-TM/";
37 
38  bookingdone = false;
39 }
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.

◆ ~DTLocalTriggerEfficiencyTest()

DTLocalTriggerEfficiencyTest::~DTLocalTriggerEfficiencyTest ( )
override

Destructor.

Definition at line 41 of file DTLocalTriggerEfficiencyTest.cc.

References trigGeomUtils.

41  {
42  if (trigGeomUtils) {
43  delete trigGeomUtils;
44  }
45 }

Member Function Documentation

◆ beginRun()

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

◆ bookChambHistos()

void DTLocalTriggerEfficiencyTest::bookChambHistos ( DQMStore::IBooker ,
DTChamberId  chambId,
std::string  htype 
)
protected

Book the new MEs (for each chamber)

Definition at line 294 of file DTLocalTriggerEfficiencyTest.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), DTLocalTriggerBaseTest::category(), chambME, DTLocalTriggerBaseTest::fullName(), LogTrace, SiStripPI::max, SiStripPI::min, LaserClient_cfi::nbins, DTTrigGeomUtils::phiRange(), DetId::rawId(), hgcalTBTopologyTester_cfi::sector, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, DTLocalTriggerBaseTest::testName, DTTrigGeomUtils::thetaRange(), DTLocalTriggerBaseTest::topFolder(), trigGeomUtils, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

Referenced by Bookings(), and runClientDiagnostic().

294  {
295  stringstream wheel;
296  wheel << chambId.wheel();
297  stringstream station;
298  station << chambId.station();
299  stringstream sector;
300  sector << chambId.sector();
301 
302  string fullType = fullName(htype);
303  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
304 
305  ibooker.setCurrentFolder(topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() +
306  "/Segment");
307 
308  LogTrace(category()) << "[" << testName << "Test]: booking " + topFolder() + "Wheel" << wheel.str() << "/Sector"
309  << sector.str() << "/Station" << station.str() << "/Segment/" << HistoName;
310 
311  uint32_t indexChId = chambId.rawId();
312  if (htype.find("TrigEffAnglePhi") == 0) {
313  chambME[indexChId][fullType] =
314  ibooker.book1D(HistoName.c_str(), "Trigger efficiency vs angle of incidence (Phi)", 16, -40., 40.);
315  } else if (htype.find("TrigEffAngleHHHLPhi") == 0) {
316  chambME[indexChId][fullType] =
317  ibooker.book1D(HistoName.c_str(), "Trigger efficiency (HH/HL) vs angle of incidence (Phi)", 16, -40., 40.);
318  } else if (htype.find("TrigEffAngleTheta") == 0) {
319  chambME[indexChId][fullType] =
320  ibooker.book1D(HistoName.c_str(), "Trigger efficiency vs angle of incidence (Theta)", 16, -40., 40.);
321  } else if (htype.find("TrigEffAngleHTheta") == 0) {
322  chambME[indexChId][fullType] =
323  ibooker.book1D(HistoName.c_str(), "Trigger efficiency (H) vs angle of incidence (Theta)", 16, -40., 40.);
324  } else if (htype.find("TrigEffPosPhi") == 0) {
325  float min, max;
326  int nbins;
327  trigGeomUtils->phiRange(chambId, min, max, nbins);
328  chambME[indexChId][fullType] =
329  ibooker.book1D(HistoName.c_str(), "Trigger efficiency vs position (Phi)", nbins, min, max);
330  } else if (htype.find("TrigEffPosvsAnglePhi") == 0) {
331  float min, max;
332  int nbins;
333  trigGeomUtils->phiRange(chambId, min, max, nbins);
334  chambME[indexChId][fullType] =
335  ibooker.book2D(HistoName.c_str(), "Trigger efficiency position vs angle (Phi)", 16, -40., 40., nbins, min, max);
336  } else if (htype.find("TrigEffPosvsAngleHHHLPhi") == 0) {
337  float min, max;
338  int nbins;
339  trigGeomUtils->phiRange(chambId, min, max, nbins);
340  chambME[indexChId][fullType] = ibooker.book2D(
341  HistoName.c_str(), "Trigger efficiency (HH/HL) pos vs angle (Phi)", 16, -40., 40., nbins, min, max);
342  } else if (htype.find("TrigEffPosHHHLPhi") == 0) {
343  float min, max;
344  int nbins;
345  trigGeomUtils->phiRange(chambId, min, max, nbins);
346  chambME[indexChId][fullType] =
347  ibooker.book1D(HistoName.c_str(), "Trigger efficiency (HH/HL) vs position (Phi)", nbins, min, max);
348  } else if (htype.find("TrigEffPosTheta") == 0) {
349  float min, max;
350  int nbins;
351  trigGeomUtils->thetaRange(chambId, min, max, nbins);
352  chambME[indexChId][fullType] =
353  ibooker.book1D(HistoName.c_str(), "Trigger efficiency vs position (Theta)", nbins, min, max);
354  } else if (htype.find("TrigEffPosHTheta") == 0) {
355  float min, max;
356  int nbins;
357  trigGeomUtils->thetaRange(chambId, min, max, nbins);
358  chambME[indexChId][fullType] =
359  ibooker.book1D(HistoName.c_str(), "Trigger efficiency (H) vs position (Theta)", nbins, min, max);
360  } else if (htype.find("TrigEffPosvsAngleTheta") == 0) {
361  float min, max;
362  int nbins;
363  trigGeomUtils->thetaRange(chambId, min, max, nbins);
364  chambME[indexChId][fullType] =
365  ibooker.book2D(HistoName.c_str(), "Trigger efficiency pos vs angle (Theta)", 16, -40., 40., nbins, min, max);
366  } else if (htype.find("TrigEffPosvsAngleHTheta") == 0) {
367  float min, max;
368  int nbins;
369  trigGeomUtils->thetaRange(chambId, min, max, nbins);
370  chambME[indexChId][fullType] = ibooker.book2D(
371  HistoName.c_str(), "Trigger efficiency (H) pos vs angle (Theta)", 16, -40., 40., nbins, min, max);
372  }
373 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
std::string & topFolder()
Get top folder name.
#define LogTrace(id)
std::string category()
Get message logger name.
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
std::string HistoName
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
int sector() const
Definition: DTChamberId.h:49
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ Bookings()

void DTLocalTriggerEfficiencyTest::Bookings ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protected

Definition at line 52 of file DTLocalTriggerEfficiencyTest.cc.

References bookChambHistos(), bookingdone, DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), edm::ParameterSet::getUntrackedParameter(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, DTLocalTriggerBaseTest::parameters, edm_modernize_messagelogger::stat, DTLocalTriggerBaseTest::trigSource, and DTLocalTriggerBaseTest::trigSources.

Referenced by runClientDiagnostic().

52  {
53  vector<string>::const_iterator iTr = trigSources.begin();
54  vector<string>::const_iterator trEnd = trigSources.end();
55  vector<string>::const_iterator iHw = hwSources.begin();
56  vector<string>::const_iterator hwEnd = hwSources.end();
57 
58  //Booking
59  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
60  for (; iTr != trEnd; ++iTr) {
61  trigSource = (*iTr);
62  for (; iHw != hwEnd; ++iHw) {
63  hwSource = (*iHw);
64  // Loop over the TriggerUnits
65  for (int wh = -2; wh <= 2; ++wh) {
66  for (int sect = 1; sect <= 12; ++sect) {
67  for (int stat = 1; stat <= 4; ++stat) {
68  DTChamberId chId(wh, stat, sect);
69  bookChambHistos(ibooker, chId, "TrigEffPosvsAnglePhi");
70  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleHHHLPhi");
71  bookChambHistos(ibooker, chId, "TrigEffPosPhi");
72  bookChambHistos(ibooker, chId, "TrigEffPosHHHLPhi");
73  bookChambHistos(ibooker, chId, "TrigEffAnglePhi");
74  bookChambHistos(ibooker, chId, "TrigEffAngleHHHLPhi");
75  if (stat <= 3) {
76  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleTheta");
77  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleHTheta");
78  bookChambHistos(ibooker, chId, "TrigEffPosTheta");
79  bookChambHistos(ibooker, chId, "TrigEffPosHTheta");
80  bookChambHistos(ibooker, chId, "TrigEffAngleTheta");
81  bookChambHistos(ibooker, chId, "TrigEffAngleHTheta");
82  }
83  }
84 
85  bookSectorHistos(ibooker, wh, sect, "TrigEffPhi");
86  bookSectorHistos(ibooker, wh, sect, "TrigEffTheta");
87  }
88 
89  bookWheelHistos(ibooker, wh, "TrigEffPhi");
90  bookWheelHistos(ibooker, wh, "TrigEffHHHLPhi");
91  bookWheelHistos(ibooker, wh, "TrigEffTheta");
92  bookWheelHistos(ibooker, wh, "TrigEffHTheta");
93  }
94  }
95  }
96  }
97 
98  bookingdone = true;
99 }
std::vector< std::string > trigSources
T getUntrackedParameter(std::string const &, T const &) const
void bookChambHistos(DQMStore::IBooker &, DTChamberId chambId, std::string htype)
Book the new MEs (for each chamber)
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::vector< std::string > hwSources
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)

◆ makeEfficiencyME()

void DTLocalTriggerEfficiencyTest::makeEfficiencyME ( TH1D *  numerator,
TH1D *  denominator,
MonitorElement result 
)
protected

Compute efficiency plots.

Definition at line 251 of file DTLocalTriggerEfficiencyTest.cc.

References newFWLiteAna::bin, bTagMiniDQMDeepCSV::denominator, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, LaserClient_cfi::nbins, bTagMiniDQMDeepCSV::numerator, mps_fire::result, and mathSSE::sqrt().

Referenced by runClientDiagnostic().

251  {
252  TH1F* efficiency = result->getTH1F();
253  efficiency->Divide(numerator, denominator, 1, 1, "");
254 
255  int nbins = efficiency->GetNbinsX();
256  for (int bin = 1; bin <= nbins; ++bin) {
257  float error = 0;
258  float bineff = efficiency->GetBinContent(bin);
259 
260  if (denominator->GetBinContent(bin)) {
261  error = sqrt(bineff * (1 - bineff) / denominator->GetBinContent(bin));
262  } else {
263  error = 1;
264  efficiency->SetBinContent(bin, 1.);
265  }
266 
267  efficiency->SetBinError(bin, error);
268  }
269 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ makeEfficiencyME2D()

void DTLocalTriggerEfficiencyTest::makeEfficiencyME2D ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result 
)
protected

Compute 2D efficiency plots.

Definition at line 271 of file DTLocalTriggerEfficiencyTest.cc.

References bTagMiniDQMDeepCSV::denominator, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, bTagMiniDQMDeepCSV::numerator, mps_fire::result, and mathSSE::sqrt().

Referenced by runClientDiagnostic().

271  {
272  TH2F* efficiency = result->getTH2F();
273  efficiency->Divide(numerator, denominator, 1, 1, "");
274 
275  int nbinsx = efficiency->GetNbinsX();
276  int nbinsy = efficiency->GetNbinsY();
277  for (int binx = 1; binx <= nbinsx; ++binx) {
278  for (int biny = 1; biny <= nbinsy; ++biny) {
279  float error = 0;
280  float bineff = efficiency->GetBinContent(binx, biny);
281 
282  if (denominator->GetBinContent(binx, biny)) {
283  error = sqrt(bineff * (1 - bineff) / denominator->GetBinContent(binx, biny));
284  } else {
285  error = 1;
286  efficiency->SetBinContent(binx, biny, 0.);
287  }
288 
289  efficiency->SetBinError(binx, biny, error);
290  }
291  }
292 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ runClientDiagnostic()

void DTLocalTriggerEfficiencyTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 101 of file DTLocalTriggerEfficiencyTest.cc.

References bookChambHistos(), bookingdone, Bookings(), DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), chambME, mps_fire::end, spr::find(), dqmMemoryStats::float, DTLocalTriggerBaseTest::fullName(), dqm::implementation::IGetter::get(), DTLocalTriggerBaseTest::getMEName(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, makeEfficiencyME(), makeEfficiencyME2D(), DetId::rawId(), DTLocalTriggerBaseTest::secME, dqm::impl::MonitorElement::setBinContent(), mathSSE::sqrt(), edm_modernize_messagelogger::stat, DTLocalTriggerBaseTest::trigSource, DTLocalTriggerBaseTest::trigSources, wheelArrayShift, and DTLocalTriggerBaseTest::whME.

101  {
102  if (!bookingdone)
103  Bookings(ibooker, igetter);
104 
105  // Loop over Trig & Hw sources
106  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
107  trigSource = (*iTr);
108  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
109  hwSource = (*iHw);
110  // Loop over the TriggerUnits
111  for (int stat = 1; stat <= 4; ++stat) {
112  for (int wh = -2; wh <= 2; ++wh) {
113  for (int sect = 1; sect <= 12; ++sect) {
114  DTChamberId chId(wh, stat, sect);
115  int sector_id = (wh + wheelArrayShift) + (sect - 1) * 5;
116  uint32_t indexCh = chId.rawId();
117 
118  TH2F* TrackPosvsAngle = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngle", "Segment", chId)));
119  TH2F* TrackPosvsAngleandTrig =
120  getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleandTrig", "Segment", chId)));
121  TH2F* TrackPosvsAngleandTrigHHHL =
122  getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleandTrigHHHL", "Segment", chId)));
123 
124  if (TrackPosvsAngle && TrackPosvsAngleandTrig && TrackPosvsAngleandTrigHHHL &&
125  TrackPosvsAngle->GetEntries() > 1) {
126  if (chambME[indexCh].find(fullName("TrigEffAnglePhi")) == chambME[indexCh].end()) {
127  bookChambHistos(ibooker, chId, "TrigEffPosvsAnglePhi");
128  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleHHHLPhi");
129  bookChambHistos(ibooker, chId, "TrigEffPosPhi");
130  bookChambHistos(ibooker, chId, "TrigEffPosHHHLPhi");
131  bookChambHistos(ibooker, chId, "TrigEffAnglePhi");
132  bookChambHistos(ibooker, chId, "TrigEffAngleHHHLPhi");
133  }
134  if (secME[sector_id].find(fullName("TrigEffPhi")) == secME[sector_id].end()) {
135  bookSectorHistos(ibooker, wh, sect, "TrigEffPhi");
136  }
137  if (whME[wh].find(fullName("TrigEffPhi")) == whME[wh].end()) {
138  bookWheelHistos(ibooker, wh, "TrigEffPhi");
139  bookWheelHistos(ibooker, wh, "TrigEffHHHLPhi");
140  }
141 
142  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
143  TH1D* TrackPos = TrackPosvsAngle->ProjectionY();
144  TH1D* TrackAngle = TrackPosvsAngle->ProjectionX();
145  TH1D* TrackPosandTrig = TrackPosvsAngleandTrig->ProjectionY();
146  TH1D* TrackAngleandTrig = TrackPosvsAngleandTrig->ProjectionX();
147  TH1D* TrackPosandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionY();
148  TH1D* TrackAngleandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionX();
149  float binEff = float(TrackPosandTrig->GetEntries()) / TrackPos->GetEntries();
150  float binEffHHHL = float(TrackPosandTrigHHHL->GetEntries()) / TrackPos->GetEntries();
151  float binErr = sqrt(binEff * (1 - binEff) / TrackPos->GetEntries());
152  float binErrHHHL = sqrt(binEffHHHL * (1 - binEffHHHL) / TrackPos->GetEntries());
153 
154  MonitorElement* globalEff = innerME->find(fullName("TrigEffPhi"))->second;
155  globalEff->setBinContent(stat, binEff);
156  globalEff->setBinError(stat, binErr);
157 
158  innerME = &(whME[wh]);
159  globalEff = innerME->find(fullName("TrigEffPhi"))->second;
160  globalEff->setBinContent(sect, stat, binEff);
161  globalEff->setBinError(sect, stat, binErr);
162  globalEff = innerME->find(fullName("TrigEffHHHLPhi"))->second;
163  globalEff->setBinContent(sect, stat, binEffHHHL);
164  globalEff->setBinError(sect, stat, binErrHHHL);
165 
166  innerME = &(chambME[indexCh]);
167  makeEfficiencyME(TrackPosandTrig, TrackPos, innerME->find(fullName("TrigEffPosPhi"))->second);
168  makeEfficiencyME(TrackPosandTrigHHHL, TrackPos, innerME->find(fullName("TrigEffPosHHHLPhi"))->second);
169  makeEfficiencyME(TrackAngleandTrig, TrackAngle, innerME->find(fullName("TrigEffAnglePhi"))->second);
171  TrackAngleandTrigHHHL, TrackAngle, innerME->find(fullName("TrigEffAngleHHHLPhi"))->second);
173  TrackPosvsAngleandTrig, TrackPosvsAngle, innerME->find(fullName("TrigEffPosvsAnglePhi"))->second);
174  makeEfficiencyME2D(TrackPosvsAngleandTrigHHHL,
175  TrackPosvsAngle,
176  innerME->find(fullName("TrigEffPosvsAngleHHHLPhi"))->second);
177  }
178 
179  // Perform Efficiency analysis (Theta+Segments) CB FIXME -> no TM theta qual info
180  TH2F* TrackThetaPosvsAngle =
181  getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngle", "Segment", chId)));
182  TH2F* TrackThetaPosvsAngleandTrig =
183  getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngleandTrig", "Segment", chId)));
184  TH2F* TrackThetaPosvsAngleandTrigH =
185  getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngleandTrigH", "Segment", chId)));
186 
187  if (TrackThetaPosvsAngle && TrackThetaPosvsAngleandTrig && TrackThetaPosvsAngleandTrigH &&
188  TrackThetaPosvsAngle->GetEntries() > 1) {
189  if (chambME[indexCh].find(fullName("TrigEffAngleTheta")) == chambME[indexCh].end()) {
190  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleTheta");
191  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleHTheta");
192  bookChambHistos(ibooker, chId, "TrigEffPosTheta");
193  bookChambHistos(ibooker, chId, "TrigEffPosHTheta");
194  bookChambHistos(ibooker, chId, "TrigEffAngleTheta");
195  bookChambHistos(ibooker, chId, "TrigEffAngleHTheta");
196  }
197  if (secME[sector_id].find(fullName("TrigEffTheta")) == secME[sector_id].end()) {
198  bookSectorHistos(ibooker, wh, sect, "TrigEffTheta");
199  }
200  if (whME[wh].find(fullName("TrigEffTheta")) == whME[wh].end()) {
201  bookWheelHistos(ibooker, wh, "TrigEffTheta");
202  bookWheelHistos(ibooker, wh, "TrigEffHTheta");
203  }
204 
205  std::map<std::string, MonitorElement*>* innerME = &(secME[sector_id]);
206  TH1D* TrackThetaPos = TrackThetaPosvsAngle->ProjectionY();
207  TH1D* TrackThetaAngle = TrackThetaPosvsAngle->ProjectionX();
208  TH1D* TrackThetaPosandTrig = TrackThetaPosvsAngleandTrig->ProjectionY();
209  TH1D* TrackThetaAngleandTrig = TrackThetaPosvsAngleandTrig->ProjectionX();
210  TH1D* TrackThetaPosandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionY();
211  TH1D* TrackThetaAngleandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionX();
212  float binEff = float(TrackThetaPosandTrig->GetEntries()) / TrackThetaPos->GetEntries();
213  float binErr = sqrt(binEff * (1 - binEff) / TrackThetaPos->GetEntries());
214  float binEffH = float(TrackThetaPosandTrigH->GetEntries()) / TrackThetaPos->GetEntries();
215  float binErrH = sqrt(binEffH * (1 - binEffH) / TrackThetaPos->GetEntries());
216 
217  MonitorElement* globalEff = innerME->find(fullName("TrigEffTheta"))->second;
218  globalEff->setBinContent(stat, binEff);
219  globalEff->setBinError(stat, binErr);
220 
221  innerME = &(whME[wh]);
222  globalEff = innerME->find(fullName("TrigEffTheta"))->second;
223  globalEff->setBinContent(sect, stat, binEff);
224  globalEff->setBinError(sect, stat, binErr);
225  globalEff = innerME->find(fullName("TrigEffHTheta"))->second;
226  globalEff->setBinContent(sect, stat, binEffH);
227  globalEff->setBinError(sect, stat, binErrH);
228 
229  innerME = &(chambME[indexCh]);
230  makeEfficiencyME(TrackThetaPosandTrig, TrackThetaPos, innerME->find(fullName("TrigEffPosTheta"))->second);
232  TrackThetaPosandTrigH, TrackThetaPos, innerME->find(fullName("TrigEffPosHTheta"))->second);
234  TrackThetaAngleandTrig, TrackThetaAngle, innerME->find(fullName("TrigEffAngleTheta"))->second);
236  TrackThetaAngleandTrigH, TrackThetaAngle, innerME->find(fullName("TrigEffAngleHTheta"))->second);
237  makeEfficiencyME2D(TrackThetaPosvsAngleandTrig,
238  TrackThetaPosvsAngle,
239  innerME->find(fullName("TrigEffPosvsAngleTheta"))->second);
240  makeEfficiencyME2D(TrackThetaPosvsAngleandTrigH,
241  TrackThetaPosvsAngle,
242  innerME->find(fullName("TrigEffPosvsAngleHTheta"))->second);
243  }
244  }
245  }
246  }
247  }
248  }
249 }
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
std::vector< std::string > trigSources
void makeEfficiencyME(TH1D *numerator, TH1D *denominator, MonitorElement *result)
Compute efficiency plots.
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
void makeEfficiencyME2D(TH2F *numerator, TH2F *denominator, MonitorElement *result)
Compute 2D efficiency plots.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
std::map< int, std::map< std::string, MonitorElement * > > whME
void bookChambHistos(DQMStore::IBooker &, DTChamberId chambId, std::string htype)
Book the new MEs (for each chamber)
T sqrt(T t)
Definition: SSEVec.h:19
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
void bookSectorHistos(DQMStore::IBooker &, int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::vector< std::string > hwSources
std::map< int, std::map< std::string, MonitorElement * > > secME
void bookWheelHistos(DQMStore::IBooker &, int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
std::string fullName(std::string htype)
Create fullname from histo partial name.

Member Data Documentation

◆ bookingdone

bool DTLocalTriggerEfficiencyTest::bookingdone
private

◆ chambME

std::map<uint32_t, std::map<std::string, MonitorElement*> > DTLocalTriggerEfficiencyTest::chambME
private

Definition at line 48 of file DTLocalTriggerEfficiencyTest.h.

Referenced by bookChambHistos(), and runClientDiagnostic().

◆ trigGeomUtils

DTTrigGeomUtils* DTLocalTriggerEfficiencyTest::trigGeomUtils
private

◆ wheelArrayShift

const int DTLocalTriggerEfficiencyTest::wheelArrayShift = 3
protected

Definition at line 45 of file DTLocalTriggerEfficiencyTest.h.

Referenced by runClientDiagnostic().