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::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 ()
 
 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 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)
 Compute 2D efficiency plots. More...
 
void makeEfficiencyME (TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
 Compute 1D/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<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

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
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
 
edm::ESHandle< DTGeometrymuonGeom
 
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< 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.

36  {
37  setConfig(ps, "DTTriggerEfficiency");
38  baseFolderTM = "DT/03-LocalTrigger-TM/";
39  detailedPlots = ps.getUntrackedParameter<bool>("detailedAnalysis", true);
40 
41  bookingdone = false;
42 }

References edm::ParameterSet::getUntrackedParameter().

◆ ~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

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ Bookings()

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

Definition at line 294 of file DTTriggerEfficiencyTest.cc.

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 }

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

◆ 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.

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 }

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

◆ 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.

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 }

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

◆ makeEfficiencyME() [1/2]

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

Compute 2D efficiency plots.

Definition at line 155 of file DTTriggerEfficiencyTest.cc.

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 }

References HLTTauDQMOffline_cfi::denominator, L1TObjectsTimingClient_cff::efficiency, relativeConstraints::error, dqm::legacy::MonitorElement::getTH2F(), HLTTauDQMOffline_cfi::numerator, and mathSSE::sqrt().

◆ makeEfficiencyME() [2/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.

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 }

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

◆ runClientDiagnostic()

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

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 51 of file DTTriggerEfficiencyTest.cc.

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 }

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

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.

DTLocalTriggerBaseTest::sourceFolder
std::string sourceFolder
Definition: DTLocalTriggerBaseTest.h:106
DTLocalTriggerBaseTest::beginRun
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
Definition: DTLocalTriggerBaseTest.cc:37
min
T min(T a, T b)
Definition: MathUtil.h:58
printsummarytable.folder
folder
Definition: printsummarytable.py:7
relativeConstraints.station
station
Definition: relativeConstraints.py:67
DTLocalTriggerBaseTest::hwSources
std::vector< std::string > hwSources
Definition: DTLocalTriggerBaseTest.h:104
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
DTLocalTriggerBaseTest::fullName
std::string fullName(std::string htype)
Create fullname from histo partial name.
Definition: DTLocalTriggerBaseTest.cc:99
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTTriggerEfficiencyTest::globalEffDistr
std::map< std::string, MonitorElement * > globalEffDistr
Definition: DTTriggerEfficiencyTest.h:60
L1TObjectsTimingClient_cff.efficiency
efficiency
Definition: L1TObjectsTimingClient_cff.py:10
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
DTLocalTriggerBaseTest::whME
std::map< int, std::map< std::string, MonitorElement * > > whME
Definition: DTLocalTriggerBaseTest.h:114
relativeConstraints.error
error
Definition: relativeConstraints.py:53
parameters
parameters
Definition: BeamSpot_PayloadInspector.cc:14
DTLocalTriggerBaseTest::setConfig
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.
Definition: DTLocalTriggerBaseTest.cc:78
hgcalPlots.stat
stat
Definition: hgcalPlots.py:1111
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
DTTriggerEfficiencyTest::bookWheelHistos
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
Definition: DTTriggerEfficiencyTest.cc:206
LaserClient_cfi.nbins
nbins
Definition: LaserClient_cfi.py:51
makeHippyCampaign.basedir
basedir
Definition: makeHippyCampaign.py:14
DTTriggerEfficiencyTest::bookingdone
bool bookingdone
Definition: DTTriggerEfficiencyTest.h:66
DTTrigGeomUtils::phiRange
void phiRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute phi range in local chamber coordinates.
Definition: DTTrigGeomUtils.cc:67
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
dtResolutionTest_cfi.histoTag
histoTag
Definition: dtResolutionTest_cfi.py:21
DTTriggerEfficiencyTest::EffDistrPerWh
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
Definition: DTTriggerEfficiencyTest.h:61
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
cscdqm::HistoName
std::string HistoName
Definition: CSCDQM_HistoDef.h:32
DTTriggerEfficiencyTest::bookChambHistos
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
Definition: DTTriggerEfficiencyTest.cc:258
HLTTauDQMOffline_cfi.numerator
numerator
Definition: HLTTauDQMOffline_cfi.py:194
DTLocalTriggerBaseTest::hwSource
std::string hwSource
Definition: DTLocalTriggerBaseTest.h:111
DTLocalTriggerBaseTest::muonGeom
edm::ESHandle< DTGeometry > muonGeom
Definition: DTLocalTriggerBaseTest.h:112
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
DTTriggerEfficiencyTest::getMEName
std::string getMEName(std::string histoTag, std::string folder, int wh)
Get the ME name (by wheel)
Definition: DTTriggerEfficiencyTest.cc:178
DTLocalTriggerBaseTest::trigSource
std::string trigSource
Definition: DTLocalTriggerBaseTest.h:110
ALCARECODTCalibSynchCosmicsDQM_cff.folderName
folderName
Definition: ALCARECODTCalibSynchCosmicsDQM_cff.py:9
alignCSCRings.r
r
Definition: alignCSCRings.py:93
DTLocalTriggerBaseTest::topFolder
std::string & topFolder()
Get top folder name.
Definition: DTLocalTriggerBaseTest.h:93
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
DTChamberId::sector
int sector() const
Definition: DTChamberId.h:49
DTTriggerEfficiencyTest::trigGeomUtils
DTTrigGeomUtils * trigGeomUtils
Definition: DTTriggerEfficiencyTest.h:63
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
DTLocalTriggerBaseTest::trigSources
std::vector< std::string > trigSources
Definition: DTLocalTriggerBaseTest.h:103
DTTrigGeomUtils
Definition: DTTrigGeomUtils.h:21
DTTriggerEfficiencyTest::bookHistos
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)
Definition: DTTriggerEfficiencyTest.cc:189
DTTriggerEfficiencyTest::detailedPlots
bool detailedPlots
Definition: DTTriggerEfficiencyTest.h:64
DTLocalTriggerBaseTest::category
std::string category()
Get message logger name.
Definition: DTLocalTriggerBaseTest.h:96
DTTriggerEfficiencyTest::Bookings
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
Definition: DTTriggerEfficiencyTest.cc:294
DTLocalTriggerBaseTest::baseFolderTM
std::string baseFolderTM
Definition: DTLocalTriggerBaseTest.h:109
DTChamberId
Definition: DTChamberId.h:14
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
DTLocalTriggerBaseTest::testName
std::string testName
Definition: DTLocalTriggerBaseTest.h:102
DTChamberId::wheel
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:39
DTTriggerEfficiencyTest::makeEfficiencyME
void makeEfficiencyME(TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
Compute 1D/2D efficiency plots.
Definition: DTTriggerEfficiencyTest.cc:125
DTChamberId::station
int station() const
Return the station number.
Definition: DTChamberId.h:42
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490
DTTriggerEfficiencyTest::chambME
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
Definition: DTTriggerEfficiencyTest.h:62