CMS 3D CMS Logo

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

#include <DTTriggerEfficiencyTest.h>

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

 DTTriggerEfficiencyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
 ~DTTriggerEfficiencyTest () 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 &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
 Book the new MEs (for each chamber) More...
 
void bookHistos (DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
 Book the new MEs (global) More...
 
void Bookings (DQMStore::IBooker &, DQMStore::IGetter &)
 
void bookWheelHistos (DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
 Book the new MEs (for each wheel) More...
 
std::string getMEName (std::string histoTag, std::string folder, int wh)
 Get the ME name (by wheel) More...
 
void makeEfficiencyME (TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
 Compute 1D/2D efficiency plots. More...
 
void makeEfficiencyME (TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh)
 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)
 

Private Attributes

bool bookingdone
 
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
 
bool detailedPlots
 
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
 
std::map< std::string, MonitorElement * > globalEffDistr
 
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)
 
- 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_
 

Detailed Description

Definition at line 21 of file DTTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

◆ DTTriggerEfficiencyTest()

DTTriggerEfficiencyTest::DTTriggerEfficiencyTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 36 of file DTTriggerEfficiencyTest.cc.

References edm::ParameterSet::getUntrackedParameter().

36  {
37  setConfig(ps, "DTTriggerEfficiency");
38  baseFolderTM = "DT/03-LocalTrigger-TM/";
39  detailedPlots = ps.getUntrackedParameter<bool>("detailedAnalysis", true);
40 
41  bookingdone = false;
42 }
T getUntrackedParameter(std::string const &, T const &) const
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.

◆ ~DTTriggerEfficiencyTest()

DTTriggerEfficiencyTest::~DTTriggerEfficiencyTest ( )
override

Destructor.

Definition at line 44 of file DTTriggerEfficiencyTest.cc.

44 {}

Member Function Documentation

◆ beginRun()

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

BeginRun.

Definition at line 46 of file DTTriggerEfficiencyTest.cc.

References DTLocalTriggerBaseTest::beginRun(), and HltBtagPostValidation_cff::c.

46  {
49 }
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.

◆ bookChambHistos()

void DTTriggerEfficiencyTest::bookChambHistos ( DQMStore::IBooker ibooker,
DTChamberId  chambId,
std::string  htype,
std::string  folder = "" 
)
protected

Book the new MEs (for each chamber)

Definition at line 258 of file DTTriggerEfficiencyTest.cc.

References dqm::implementation::IBooker::book2D(), validateAlignments::category, printsummarytable::folder, newFWLiteAna::fullName, LogTrace, edm::max(), edm::min(), LaserClient_cfi::nbins, DetId::rawId(), hgcalTBTopologyTester_cfi::sector, DTChamberId::sector(), dqm::implementation::NavigatorBase::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, L1TBPTX_cfi::testName, DTChamberId::wheel(), and makeMuonMisalignmentScenario::wheel.

261  {
262  stringstream wheel;
263  wheel << chambId.wheel();
264  stringstream station;
265  station << chambId.station();
266  stringstream sector;
267  sector << chambId.sector();
268 
269  string fullType = fullName(htype);
270  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
271 
272  ibooker.setCurrentFolder(topFolder() + "Wheel" + wheel.str() + "/Sector" + sector.str() + "/Station" + station.str() +
273  "/" + folder + "/");
274 
275  LogTrace(category()) << "[" << testName << "Test]: booking " + topFolder() + "Wheel" << wheel.str() << "/Sector"
276  << sector.str() << "/Station" << station.str() << "/" + folder + "/" << HistoName;
277 
278  uint32_t indexChId = chambId.rawId();
279  float min, max;
280  int nbins;
281  trigGeomUtils->phiRange(chambId, min, max, nbins, 20);
282  if (htype.find("TrigEffPosvsAnglePhi") == 0) {
283  chambME[indexChId][fullType] = ibooker.book2D(
284  HistoName.c_str(), "Trigger efficiency (any qual.) position vs angle (Phi)", 12, -30., 30., nbins, min, max);
285  return;
286  }
287  if (htype.find("TrigEffPosvsAngleCorrPhi") == 0) {
288  chambME[indexChId][fullType] = ibooker.book2D(
289  HistoName.c_str(), "Trigger efficiency (correlated) pos vs angle (Phi)", 12, -30., 30., nbins, min, max);
290  return;
291  }
292 }
int station() const
Return the station number.
Definition: DTChamberId.h:42
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
std::string & topFolder()
Get top folder name.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
#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
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
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.

◆ bookHistos()

void DTTriggerEfficiencyTest::bookHistos ( DQMStore::IBooker ibooker,
std::string  hTag,
std::string  folder 
)
protected

Book the new MEs (global)

Definition at line 189 of file DTTriggerEfficiencyTest.cc.

References makeHippyCampaign::basedir, dqm::implementation::IBooker::book1D(), printsummarytable::folder, newFWLiteAna::fullName, dqm::impl::MonitorElement::setAxisTitle(), and dqm::implementation::NavigatorBase::setCurrentFolder().

189  {
190  string basedir;
191  basedir = topFolder(); //Book summary histo outside Task directory
192 
193  if (!folder.empty()) {
194  basedir += folder + "/";
195  }
196 
197  ibooker.setCurrentFolder(basedir);
198 
199  string fullTag = fullName(hTag);
200  string hname = fullTag + "_All";
201 
202  globalEffDistr[fullTag] = ibooker.book1D(hname.c_str(), hname.c_str(), 51, 0., 1.02);
203  globalEffDistr[fullTag]->setAxisTitle("Trig Eff", 1);
204 }
std::string & topFolder()
Get top folder name.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
std::map< std::string, MonitorElement * > globalEffDistr
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ Bookings()

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

Definition at line 294 of file DTTriggerEfficiencyTest.cc.

References bookHistos(), dtFineDelayCorr_cfi::hwSource, dtFineDelayCorr_cfi::hwSources, and edm_modernize_messagelogger::stat.

294  {
295  vector<string>::const_iterator iTr = trigSources.begin();
296  vector<string>::const_iterator trEnd = trigSources.end();
297  vector<string>::const_iterator iHw = hwSources.begin();
298  vector<string>::const_iterator hwEnd = hwSources.end();
299 
300  //Booking
301  if (parameters.getUntrackedParameter<bool>("staticBooking", true)) {
302  for (; iTr != trEnd; ++iTr) {
303  trigSource = (*iTr);
304  for (; iHw != hwEnd; ++iHw) {
305  hwSource = (*iHw);
306  // Loop over the TriggerUnits
307 
308  bookHistos(ibooker, "TrigEffPhi", "");
309  bookHistos(ibooker, "TrigEffCorrPhi", "");
310  for (int wh = -2; wh <= 2; ++wh) {
311  if (detailedPlots) {
312  for (int sect = 1; sect <= 12; ++sect) {
313  for (int stat = 1; stat <= 4; ++stat) {
314  DTChamberId chId(wh, stat, sect);
315 
316  bookChambHistos(ibooker, chId, "TrigEffPosvsAnglePhi", "Segment");
317  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleCorrPhi", "Segment");
318  }
319  }
320  }
321 
322  bookWheelHistos(ibooker, wh, "TrigEffPhi", "");
323  bookWheelHistos(ibooker, wh, "TrigEffCorrPhi", "");
324  }
325  }
326  }
327  }
328  bookingdone = true;
329 }
std::vector< std::string > trigSources
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
T getUntrackedParameter(std::string const &, T const &) const
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
std::vector< std::string > hwSources
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)

◆ bookWheelHistos()

void DTTriggerEfficiencyTest::bookWheelHistos ( DQMStore::IBooker ibooker,
int  wheel,
std::string  hTag,
std::string  folder 
)
protected

Book the new MEs (for each wheel)

Definition at line 206 of file DTTriggerEfficiencyTest.cc.

References makeHippyCampaign::basedir, dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), validateAlignments::category, printsummarytable::folder, newFWLiteAna::fullName, LogTrace, hlt_dqm_clientPB-live_cfg::me, dqm::implementation::NavigatorBase::setCurrentFolder(), L1TBPTX_cfi::testName, and makeMuonMisalignmentScenario::wheel.

206  {
207  stringstream wh;
208  wh << wheel;
209  string basedir;
210  if (hTag.find("Summary") != string::npos) {
211  basedir = topFolder(); //Book summary histo outside wheel directories
212  } else {
213  basedir = topFolder() + "Wheel" + wh.str() + "/";
214  }
215  if (!folder.empty()) {
216  basedir += folder + "/";
217  }
218 
219  ibooker.setCurrentFolder(basedir);
220 
221  string fullTag = fullName(hTag);
222  string hname = fullTag + "_W" + wh.str();
223 
224  string hnameAll = fullTag + "_All_W" + wh.str();
225 
226  LogTrace(category()) << "[" << testName << "Test]: booking " << basedir << hname;
227 
228  (EffDistrPerWh[wheel])[fullTag] = ibooker.book1D(hnameAll.c_str(), hnameAll.c_str(), 51, 0., 1.02);
229 
230  if (hTag.find("Phi") != string::npos || hTag.find("Summary") != string::npos) {
231  MonitorElement* me = ibooker.book2D(hname.c_str(), hname.c_str(), 12, 1, 13, 4, 1, 5);
232 
233  // setLabelPh(me);
234  me->setBinLabel(1, "MB1", 2);
235  me->setBinLabel(2, "MB2", 2);
236  me->setBinLabel(3, "MB3", 2);
237  me->setBinLabel(4, "MB4", 2);
238  me->setAxisTitle("Sector", 1);
239 
240  whME[wheel][fullTag] = me;
241  return;
242  }
243 
244  if (hTag.find("Theta") != string::npos) {
245  MonitorElement* me = ibooker.book2D(hname.c_str(), hname.c_str(), 12, 1, 13, 3, 1, 4);
246 
247  // setLabelTh(me);
248  me->setBinLabel(1, "MB1", 2);
249  me->setBinLabel(2, "MB2", 2);
250  me->setBinLabel(3, "MB3", 2);
251  me->setAxisTitle("Sector", 1);
252 
253  whME[wheel][fullTag] = me;
254  return;
255  }
256 }
std::string & topFolder()
Get top folder name.
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
#define LogTrace(id)
std::map< int, std::map< std::string, MonitorElement * > > whME
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
std::string category()
Get message logger name.
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:212
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ getMEName()

string DTTriggerEfficiencyTest::getMEName ( std::string  histoTag,
std::string  folder,
int  wh 
)
protected

Get the ME name (by wheel)

Definition at line 178 of file DTTriggerEfficiencyTest.cc.

References printsummarytable::folder, ctppsRandomDQMSource_cfi::folderName, newFWLiteAna::fullName, dtResolutionTest_cfi::histoTag, and makeMuonMisalignmentScenario::wheel.

178  {
179  stringstream wheel;
180  wheel << wh;
181 
182  string folderName = topFolder() + folder + "/";
183 
184  string histoname = sourceFolder + folderName + fullName(histoTag) + "_W" + wheel.str();
185 
186  return histoname;
187 }
std::string & topFolder()
Get top folder name.
std::string fullName(std::string htype)
Create fullname from histo partial name.

◆ makeEfficiencyME() [1/2]

void DTTriggerEfficiencyTest::makeEfficiencyME ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result2DWh,
MonitorElement result1DWh,
MonitorElement result1D 
)
protected

Compute 1D/2D efficiency plots.

Definition at line 125 of file DTTriggerEfficiencyTest.cc.

References bTagMiniDQMDeepCSV::denominator, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, dqm::impl::MonitorElement::Fill(), dqm::legacy::MonitorElement::getTH2F(), totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, bTagMiniDQMDeepCSV::numerator, and mathSSE::sqrt().

129  {
130  TH2F* efficiency = result2DWh->getTH2F();
131  efficiency->Divide(numerator, denominator, 1, 1, "");
132 
133  int nbinsx = efficiency->GetNbinsX();
134  int nbinsy = efficiency->GetNbinsY();
135  for (int binx = 1; binx <= nbinsx; ++binx) {
136  for (int biny = 1; biny <= nbinsy; ++biny) {
137  float error = 0;
138  float bineff = efficiency->GetBinContent(binx, biny);
139 
140  result1DWh->Fill(bineff);
141  result1D->Fill(bineff);
142 
143  if (denominator->GetBinContent(binx, biny)) {
144  error = sqrt(bineff * (1 - bineff) / denominator->GetBinContent(binx, biny));
145  } else {
146  error = 1;
147  efficiency->SetBinContent(binx, biny, 0.);
148  }
149 
150  efficiency->SetBinError(binx, biny, error);
151  }
152  }
153 }
void Fill(long long x)
virtual TH2F * getTH2F() const
T sqrt(T t)
Definition: SSEVec.h:19

◆ makeEfficiencyME() [2/2]

void DTTriggerEfficiencyTest::makeEfficiencyME ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result2DWh 
)
protected

Compute 2D efficiency plots.

Definition at line 155 of file DTTriggerEfficiencyTest.cc.

References bTagMiniDQMDeepCSV::denominator, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, dqm::legacy::MonitorElement::getTH2F(), totemT2DQMSource_cfi::nbinsx, totemT2DQMSource_cfi::nbinsy, bTagMiniDQMDeepCSV::numerator, and mathSSE::sqrt().

155  {
156  TH2F* efficiency = result2DWh->getTH2F();
157  efficiency->Divide(numerator, denominator, 1, 1, "");
158 
159  int nbinsx = efficiency->GetNbinsX();
160  int nbinsy = efficiency->GetNbinsY();
161  for (int binx = 1; binx <= nbinsx; ++binx) {
162  for (int biny = 1; biny <= nbinsy; ++biny) {
163  float error = 0;
164  float bineff = efficiency->GetBinContent(binx, biny);
165 
166  if (denominator->GetBinContent(binx, biny)) {
167  error = sqrt(bineff * (1 - bineff) / denominator->GetBinContent(binx, biny));
168  } else {
169  error = 1;
170  efficiency->SetBinContent(binx, biny, 0.);
171  }
172 
173  efficiency->SetBinError(binx, biny, error);
174  }
175  }
176 }
virtual TH2F * getTH2F() const
T sqrt(T t)
Definition: SSEVec.h:19

◆ runClientDiagnostic()

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

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 51 of file DTTriggerEfficiencyTest.cc.

References bookHistos(), spr::find(), newFWLiteAna::fullName, dqm::implementation::IGetter::get(), dtFineDelayCorr_cfi::hwSource, dtFineDelayCorr_cfi::hwSources, DetId::rawId(), edm::second(), and edm_modernize_messagelogger::stat.

51  {
52  if (!bookingdone)
53  Bookings(ibooker, igetter);
54 
55  // Loop over Trig & Hw sources
56  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr) {
57  trigSource = (*iTr);
58  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw) {
59  hwSource = (*iHw);
60  // Loop over the TriggerUnits
61  if (globalEffDistr.find(fullName("TrigEffPhi")) == globalEffDistr.end()) {
62  bookHistos(ibooker, "TrigEffPhi", "");
63  bookHistos(ibooker, "TrigEffCorrPhi", "");
64  }
65  for (int wh = -2; wh <= 2; ++wh) {
66  TH2F* TrigEffDenum = getHisto<TH2F>(igetter.get(getMEName("TrigEffDenum", "Task", wh)));
67  TH2F* TrigEffNum = getHisto<TH2F>(igetter.get(getMEName("TrigEffNum", "Task", wh)));
68  TH2F* TrigEffCorrNum = getHisto<TH2F>(igetter.get(getMEName("TrigEffCorrNum", "Task", wh)));
69 
70  if (TrigEffDenum && TrigEffNum && TrigEffCorrNum && TrigEffDenum->GetEntries() > 1) {
71  if (whME[wh].find(fullName("TrigEffPhi")) == whME[wh].end()) {
72  bookWheelHistos(ibooker, wh, "TrigEffPhi", "");
73  bookWheelHistos(ibooker, wh, "TrigEffCorrPhi", "");
74  }
75 
76  MonitorElement* Eff1DAll_TrigEffPhi = (&globalEffDistr)->find(fullName("TrigEffPhi"))->second;
77  MonitorElement* Eff1DAll_TrigEffCorrPhi = (&globalEffDistr)->find(fullName("TrigEffCorrPhi"))->second;
78 
79  MonitorElement* Eff1DWh_TrigEffPhi = (&(EffDistrPerWh[wh]))->find(fullName("TrigEffPhi"))->second;
80  MonitorElement* Eff1DWh_TrigEffCorrPhi = (&(EffDistrPerWh[wh]))->find(fullName("TrigEffCorrPhi"))->second;
81 
82  MonitorElement* Eff2DWh_TrigEffPhi = (&(whME[wh]))->find(fullName("TrigEffPhi"))->second;
83  MonitorElement* Eff2DWh_TrigEffCorrPhi = (&(whME[wh]))->find(fullName("TrigEffCorrPhi"))->second;
84 
85  makeEfficiencyME(TrigEffNum, TrigEffDenum, Eff2DWh_TrigEffPhi, Eff1DWh_TrigEffPhi, Eff1DAll_TrigEffPhi);
87  TrigEffCorrNum, TrigEffDenum, Eff2DWh_TrigEffCorrPhi, Eff1DWh_TrigEffCorrPhi, Eff1DAll_TrigEffCorrPhi);
88  }
89 
90  if (detailedPlots) {
91  for (int stat = 1; stat <= 4; ++stat) {
92  for (int sect = 1; sect <= 12; ++sect) {
93  DTChamberId chId(wh, stat, sect);
94  uint32_t indexCh = chId.rawId();
95 
96  // Perform Efficiency analysis (Phi+Segments 2D)
97 
98  TH2F* TrackPosvsAngle = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngle", "Segment", chId)));
99  TH2F* TrackPosvsAngleAnyQual =
100  getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleAnyQual", "Segment", chId)));
101  TH2F* TrackPosvsAngleCorr =
102  getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleCorr", "Segment", chId)));
103 
104  if (TrackPosvsAngle && TrackPosvsAngleAnyQual && TrackPosvsAngleCorr &&
105  TrackPosvsAngle->GetEntries() > 1) {
106  if (chambME[indexCh].find(fullName("TrigEffAnglePhi")) == chambME[indexCh].end()) {
107  bookChambHistos(ibooker, chId, "TrigEffPosvsAnglePhi", "Segment");
108  bookChambHistos(ibooker, chId, "TrigEffPosvsAngleCorrPhi", "Segment");
109  }
110 
111  std::map<std::string, MonitorElement*>* innerME = &(chambME[indexCh]);
113  TrackPosvsAngleAnyQual, TrackPosvsAngle, innerME->find(fullName("TrigEffPosvsAnglePhi"))->second);
115  TrackPosvsAngleCorr, TrackPosvsAngle, innerME->find(fullName("TrigEffPosvsAngleCorrPhi"))->second);
116  }
117  }
118  }
119  }
120  }
121  }
122  }
123 }
void makeEfficiencyME(TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
Compute 1D/2D efficiency plots.
std::vector< std::string > trigSources
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
std::map< std::string, MonitorElement * > globalEffDistr
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
U second(std::pair< T, U > const &p)
std::map< int, std::map< std::string, MonitorElement * > > whME
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
std::string getMEName(std::string histoTag, std::string folder, int wh)
Get the ME name (by wheel)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::vector< std::string > hwSources
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
std::string fullName(std::string htype)
Create fullname from histo partial name.
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)

Member Data Documentation

◆ bookingdone

bool DTTriggerEfficiencyTest::bookingdone
private

Definition at line 66 of file DTTriggerEfficiencyTest.h.

◆ chambME

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

Definition at line 62 of file DTTriggerEfficiencyTest.h.

◆ detailedPlots

bool DTTriggerEfficiencyTest::detailedPlots
private

Definition at line 64 of file DTTriggerEfficiencyTest.h.

◆ EffDistrPerWh

std::map<int, std::map<std::string, MonitorElement*> > DTTriggerEfficiencyTest::EffDistrPerWh
private

Definition at line 61 of file DTTriggerEfficiencyTest.h.

◆ globalEffDistr

std::map<std::string, MonitorElement*> DTTriggerEfficiencyTest::globalEffDistr
private

Definition at line 60 of file DTTriggerEfficiencyTest.h.

◆ trigGeomUtils

DTTrigGeomUtils* DTTriggerEfficiencyTest::trigGeomUtils
private

Definition at line 63 of file DTTriggerEfficiencyTest.h.