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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 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 beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 DQMEDHarvester ()
 
void endJob () final
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &, edm::EventSetup const &) final
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDHarvester () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns, edm::one::SharedResources >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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 (bool isTM)
 Get top folder name. More...
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Protected Attributes

const int wheelArrayShift = 3
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderDDU
 
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
edm::EDPutTokenT< DQMTokenlumiToken_
 
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 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)
 

Detailed Description

Definition at line 22 of file DTLocalTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 38 of file DTLocalTriggerEfficiencyTest.cc.

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

38  : trigGeomUtils(nullptr) {
39 
40  setConfig(ps,"DTLocalTriggerEfficiency");
41  baseFolderTM = "DT/03-LocalTrigger-TM/";
42  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
43 
44  bookingdone = false;
45 
46 }
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.
DTLocalTriggerEfficiencyTest::~DTLocalTriggerEfficiencyTest ( )
override

Destructor.

Definition at line 49 of file DTLocalTriggerEfficiencyTest.cc.

References trigGeomUtils.

49  {
50 
51  if (trigGeomUtils) {
52  delete trigGeomUtils;
53  }
54 
55 }

Member Function Documentation

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

BeginRun.

Definition at line 58 of file DTLocalTriggerEfficiencyTest.cc.

References DTLocalTriggerBaseTest::beginRun(), DTLocalTriggerBaseTest::muonGeom, and trigGeomUtils.

58  {
59 
62 }
edm::ESHandle< DTGeometry > muonGeom
void beginRun(edm::Run const &run, edm::EventSetup const &context) override
BeginRun.
void DTLocalTriggerEfficiencyTest::bookChambHistos ( DQMStore::IBooker ,
DTChamberId  chambId,
std::string  htype 
)
protected

Book the new MEs (for each chamber)

Definition at line 312 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by Bookings(), and runClientDiagnostic().

312  {
313 
314  stringstream wheel; wheel << chambId.wheel();
315  stringstream station; station << chambId.station();
316  stringstream sector; sector << chambId.sector();
317 
318  string fullType = fullName(htype);
319  bool isTM = hwSource=="TM" ;
320  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
321 
322  ibooker.setCurrentFolder(topFolder(isTM) + "Wheel" + wheel.str() +
323  "/Sector" + sector.str() +
324  "/Station" + station.str() + "/Segment");
325 
326  LogTrace(category()) << "[" << testName << "Test]: booking " + topFolder(isTM) + "Wheel" << wheel.str()
327  <<"/Sector" << sector.str() << "/Station" << station.str() << "/Segment/" << HistoName;
328 
329 
330  uint32_t indexChId = chambId.rawId();
331  if (htype.find("TrigEffAnglePhi") == 0){
332  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency vs angle of incidence (Phi)",16,-40.,40.);
333  }
334  else if (htype.find("TrigEffAngleHHHLPhi") == 0){
335  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency (HH/HL) vs angle of incidence (Phi)",16,-40.,40.);
336  }
337  else if (htype.find("TrigEffAngleTheta") == 0){
338  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency vs angle of incidence (Theta)",16,-40.,40.);
339  }
340  else if (htype.find("TrigEffAngleHTheta") == 0){
341  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency (H) vs angle of incidence (Theta)",16,-40.,40.);
342  }
343  else if (htype.find("TrigEffPosPhi") == 0 ){
344  float min,max;
345  int nbins;
346  trigGeomUtils->phiRange(chambId,min,max,nbins);
347  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency vs position (Phi)",nbins,min,max);
348  }
349  else if (htype.find("TrigEffPosvsAnglePhi") == 0 ){
350  float min,max;
351  int nbins;
352  trigGeomUtils->phiRange(chambId,min,max,nbins);
353  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency position vs angle (Phi)",16,-40.,40.,nbins,min,max);
354  }
355  else if (htype.find("TrigEffPosvsAngleHHHLPhi") == 0 ){
356  float min,max;
357  int nbins;
358  trigGeomUtils->phiRange(chambId,min,max,nbins);
359  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency (HH/HL) pos vs angle (Phi)",16,-40.,40.,nbins,min,max);
360  }
361  else if (htype.find("TrigEffPosHHHLPhi") == 0 ){
362  float min,max;
363  int nbins;
364  trigGeomUtils->phiRange(chambId,min,max,nbins);
365  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency (HH/HL) vs position (Phi)",nbins,min,max);
366  }
367  else if (htype.find("TrigEffPosTheta") == 0){
368  float min,max;
369  int nbins;
370  trigGeomUtils->thetaRange(chambId,min,max,nbins);
371  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency vs position (Theta)",nbins,min,max);
372  }
373  else if (htype.find("TrigEffPosHTheta") == 0){
374  float min,max;
375  int nbins;
376  trigGeomUtils->thetaRange(chambId,min,max,nbins);
377  chambME[indexChId][fullType] = ibooker.book1D(HistoName.c_str(),"Trigger efficiency (H) vs position (Theta)",nbins,min,max);
378  }
379  else if (htype.find("TrigEffPosvsAngleTheta") == 0 ){
380  float min,max;
381  int nbins;
382  trigGeomUtils->thetaRange(chambId,min,max,nbins);
383  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency pos vs angle (Theta)",16,-40.,40.,nbins,min,max);
384  }
385  else if (htype.find("TrigEffPosvsAngleHTheta") == 0 ){
386  float min,max;
387  int nbins;
388  trigGeomUtils->thetaRange(chambId,min,max,nbins);
389  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency (H) pos vs angle (Theta)",16,-40.,40.,nbins,min,max);
390  }
391 
392 }
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
T min(T a, T b)
Definition: MathUtil.h:58
#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.
std::string HistoName
std::string & topFolder(bool isTM)
Get top folder name.
int sector() const
Definition: DTChamberId.h:61
int station() const
Return the station number.
Definition: DTChamberId.h:51
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::string fullName(std::string htype)
Create fullname from histo partial name.
void DTLocalTriggerEfficiencyTest::Bookings ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protected

Definition at line 66 of file DTLocalTriggerEfficiencyTest.cc.

References bookChambHistos(), bookingdone, DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, trackingPlots::stat, DTLocalTriggerBaseTest::trigSource, and DTLocalTriggerBaseTest::trigSources.

Referenced by runClientDiagnostic().

66  {
67 
68  vector<string>::const_iterator iTr = trigSources.begin();
69  vector<string>::const_iterator trEnd = trigSources.end();
70  vector<string>::const_iterator iHw = hwSources.begin();
71  vector<string>::const_iterator hwEnd = hwSources.end();
72 
73 
74  //Booking
75  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
76  for (; iTr != trEnd; ++iTr){
77  trigSource = (*iTr);
78  for (; iHw != hwEnd; ++iHw){
79  hwSource = (*iHw);
80  // Loop over the TriggerUnits
81  for (int wh=-2; wh<=2; ++wh){
82  for (int sect=1; sect<=12; ++sect){
83  for (int stat=1; stat<=4; ++stat){
84  DTChamberId chId(wh,stat,sect);
85  bookChambHistos(ibooker,chId,"TrigEffPosvsAnglePhi");
86  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleHHHLPhi");
87  bookChambHistos(ibooker,chId,"TrigEffPosPhi");
88  bookChambHistos(ibooker,chId,"TrigEffPosHHHLPhi");
89  bookChambHistos(ibooker,chId,"TrigEffAnglePhi");
90  bookChambHistos(ibooker,chId,"TrigEffAngleHHHLPhi");
91  if (stat<=3) {
92  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleTheta");
93  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleHTheta");
94  bookChambHistos(ibooker,chId,"TrigEffPosTheta");
95  bookChambHistos(ibooker,chId,"TrigEffPosHTheta");
96  bookChambHistos(ibooker,chId,"TrigEffAngleTheta");
97  bookChambHistos(ibooker,chId,"TrigEffAngleHTheta");
98  }
99  }
100 
101  bookSectorHistos(ibooker,wh,sect,"TrigEffPhi");
102  bookSectorHistos(ibooker,wh,sect,"TrigEffTheta");
103  }
104 
105  bookWheelHistos(ibooker,wh,"TrigEffPhi");
106  bookWheelHistos(ibooker,wh,"TrigEffHHHLPhi");
107  bookWheelHistos(ibooker,wh,"TrigEffTheta");
108  bookWheelHistos(ibooker,wh,"TrigEffHTheta");
109  }
110  }
111  }
112  }
113 
114  bookingdone = true;
115 }
std::vector< std::string > trigSources
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)
void DTLocalTriggerEfficiencyTest::makeEfficiencyME ( TH1D *  numerator,
TH1D *  denominator,
MonitorElement result 
)
protected

Compute efficiency plots.

Definition at line 262 of file DTLocalTriggerEfficiencyTest.cc.

References stringResolutionProvider_cfi::bin, PostProcessor_cff::efficiency, relativeConstraints::error, MonitorElement::getTH1F(), pileupCalc::nbins, and mathSSE::sqrt().

Referenced by runClientDiagnostic().

262  {
263 
264  TH1F* efficiency = result->getTH1F();
265  efficiency->Divide(numerator,denominator,1,1,"");
266 
267  int nbins = efficiency->GetNbinsX();
268  for (int bin=1; bin<=nbins; ++bin){
269  float error = 0;
270  float bineff = efficiency->GetBinContent(bin);
271 
272  if (denominator->GetBinContent(bin)){
273  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(bin));
274  }
275  else {
276  error = 1;
277  efficiency->SetBinContent(bin,1.);
278  }
279 
280  efficiency->SetBinError(bin,error);
281  }
282 
283 }
TH1F * getTH1F() const
T sqrt(T t)
Definition: SSEVec.h:18
bin
set the eta bin as selection string.
void DTLocalTriggerEfficiencyTest::makeEfficiencyME2D ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result 
)
protected

Compute 2D efficiency plots.

Definition at line 286 of file DTLocalTriggerEfficiencyTest.cc.

References PostProcessor_cff::efficiency, relativeConstraints::error, MonitorElement::getTH2F(), and mathSSE::sqrt().

Referenced by runClientDiagnostic().

286  {
287 
288  TH2F* efficiency = result->getTH2F();
289  efficiency->Divide(numerator,denominator,1,1,"");
290 
291  int nbinsx = efficiency->GetNbinsX();
292  int nbinsy = efficiency->GetNbinsY();
293  for (int binx=1; binx<=nbinsx; ++binx){
294  for (int biny=1; biny<=nbinsy; ++biny){
295  float error = 0;
296  float bineff = efficiency->GetBinContent(binx,biny);
297 
298  if (denominator->GetBinContent(binx,biny)){
299  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
300  }
301  else {
302  error = 1;
303  efficiency->SetBinContent(binx,biny,0.);
304  }
305 
306  efficiency->SetBinError(binx,biny,error);
307  }
308  }
309 
310 }
T sqrt(T t)
Definition: SSEVec.h:18
TH2F * getTH2F() const
void DTLocalTriggerEfficiencyTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
overrideprotectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 117 of file DTLocalTriggerEfficiencyTest.cc.

References bookChambHistos(), bookingdone, Bookings(), DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), chambME, end, spr::find(), objects.autophobj::float, DTLocalTriggerBaseTest::fullName(), DQMStore::IGetter::get(), DTLocalTriggerBaseTest::getMEName(), DTLocalTriggerBaseTest::hwSource, DTLocalTriggerBaseTest::hwSources, makeEfficiencyME(), makeEfficiencyME2D(), DetId::rawId(), DTLocalTriggerBaseTest::secME, MonitorElement::setBinContent(), mathSSE::sqrt(), trackingPlots::stat, reco::tau::disc::TrackAngle(), DTLocalTriggerBaseTest::trigSource, DTLocalTriggerBaseTest::trigSources, wheelArrayShift, and DTLocalTriggerBaseTest::whME.

118  {
119  if (!bookingdone) Bookings(ibooker,igetter);
120 
121  // Loop over Trig & Hw sources
122  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
123  trigSource = (*iTr);
124  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
125  hwSource = (*iHw);
126  // Loop over the TriggerUnits
127  for (int stat=1; stat<=4; ++stat){
128  for (int wh=-2; wh<=2; ++wh){
129  for (int sect=1; sect<=12; ++sect){
130  DTChamberId chId(wh,stat,sect);
131  int sector_id = (wh+wheelArrayShift)+(sect-1)*5;
132  uint32_t indexCh = chId.rawId();
133 
134 
135  TH2F * TrackPosvsAngle = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngle","Segment", chId)));
136  TH2F * TrackPosvsAngleandTrig = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleandTrig","Segment", chId)));
137  TH2F * TrackPosvsAngleandTrigHHHL = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleandTrigHHHL","Segment", chId)));
138 
139  if (TrackPosvsAngle && TrackPosvsAngleandTrig && TrackPosvsAngleandTrigHHHL && TrackPosvsAngle->GetEntries()>1) {
140 
141  if( chambME[indexCh].find(fullName("TrigEffAnglePhi")) == chambME[indexCh].end()){
142 
143  bookChambHistos(ibooker,chId,"TrigEffPosvsAnglePhi");
144  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleHHHLPhi");
145  bookChambHistos(ibooker,chId,"TrigEffPosPhi");
146  bookChambHistos(ibooker,chId,"TrigEffPosHHHLPhi");
147  bookChambHistos(ibooker,chId,"TrigEffAnglePhi");
148  bookChambHistos(ibooker,chId,"TrigEffAngleHHHLPhi");
149  }
150  if( secME[sector_id].find(fullName("TrigEffPhi")) == secME[sector_id].end() ){
151 
152  bookSectorHistos(ibooker,wh,sect,"TrigEffPhi");
153  }
154  if( whME[wh].find(fullName("TrigEffPhi")) == whME[wh].end() ){
155 
156  bookWheelHistos(ibooker,wh,"TrigEffPhi");
157  bookWheelHistos(ibooker,wh,"TrigEffHHHLPhi");
158  }
159 
160  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
161  TH1D* TrackPos = TrackPosvsAngle->ProjectionY();
162  TH1D* TrackAngle = TrackPosvsAngle->ProjectionX();
163  TH1D* TrackPosandTrig = TrackPosvsAngleandTrig->ProjectionY();
164  TH1D* TrackAngleandTrig = TrackPosvsAngleandTrig->ProjectionX();
165  TH1D* TrackPosandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionY();
166  TH1D* TrackAngleandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionX();
167  float binEff = float(TrackPosandTrig->GetEntries())/TrackPos->GetEntries();
168  float binEffHHHL = float(TrackPosandTrigHHHL->GetEntries())/TrackPos->GetEntries();
169  float binErr = sqrt(binEff*(1-binEff)/TrackPos->GetEntries());
170  float binErrHHHL = sqrt(binEffHHHL*(1-binEffHHHL)/TrackPos->GetEntries());
171 
172  MonitorElement* globalEff = innerME->find(fullName("TrigEffPhi"))->second;
173  globalEff->setBinContent(stat,binEff);
174  globalEff->setBinError(stat,binErr);
175 
176  innerME = &(whME[wh]);
177  globalEff = innerME->find(fullName("TrigEffPhi"))->second;
178  globalEff->setBinContent(sect,stat,binEff);
179  globalEff->setBinError(sect,stat,binErr);
180  globalEff = innerME->find(fullName("TrigEffHHHLPhi"))->second;
181  globalEff->setBinContent(sect,stat,binEffHHHL);
182  globalEff->setBinError(sect,stat,binErrHHHL);
183 
184 
185  innerME = &(chambME[indexCh]);
186  makeEfficiencyME(TrackPosandTrig,TrackPos,innerME->find(fullName("TrigEffPosPhi"))->second);
187  makeEfficiencyME(TrackPosandTrigHHHL,TrackPos,innerME->find(fullName("TrigEffPosHHHLPhi"))->second);
188  makeEfficiencyME(TrackAngleandTrig,TrackAngle,innerME->find(fullName("TrigEffAnglePhi"))->second);
189  makeEfficiencyME(TrackAngleandTrigHHHL,TrackAngle,innerME->find(fullName("TrigEffAngleHHHLPhi"))->second);
190  makeEfficiencyME2D(TrackPosvsAngleandTrig,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAnglePhi"))->second);
191  makeEfficiencyME2D(TrackPosvsAngleandTrigHHHL,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleHHHLPhi"))->second);
192 
193  }
194 
195  // Perform Efficiency analysis (Theta+Segments) CB FIXME -> no TM theta qual info
196  TH2F * TrackThetaPosvsAngle = getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngle","Segment", chId)));
197  TH2F * TrackThetaPosvsAngleandTrig = getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngleandTrig","Segment", chId)));
198  TH2F * TrackThetaPosvsAngleandTrigH = getHisto<TH2F>(igetter.get(getMEName("TrackThetaPosvsAngleandTrigH","Segment", chId)));
199 
200  if (TrackThetaPosvsAngle && TrackThetaPosvsAngleandTrig && TrackThetaPosvsAngleandTrigH && TrackThetaPosvsAngle->GetEntries()>1) {
201 
202  if( chambME[indexCh].find(fullName("TrigEffAngleTheta")) == chambME[indexCh].end()){
203 
204  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleTheta");
205  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleHTheta");
206  bookChambHistos(ibooker,chId,"TrigEffPosTheta");
207  bookChambHistos(ibooker,chId,"TrigEffPosHTheta");
208  bookChambHistos(ibooker,chId,"TrigEffAngleTheta");
209  bookChambHistos(ibooker,chId,"TrigEffAngleHTheta");
210  }
211  if( secME[sector_id].find(fullName("TrigEffTheta")) == secME[sector_id].end() ){
212  bookSectorHistos(ibooker,wh,sect,"TrigEffTheta");
213  }
214  if( whME[wh].find(fullName("TrigEffTheta")) == whME[wh].end() ){
215  bookWheelHistos(ibooker,wh,"TrigEffTheta");
216  bookWheelHistos(ibooker,wh,"TrigEffHTheta");
217  }
218 
219 
220  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
221  TH1D* TrackThetaPos = TrackThetaPosvsAngle->ProjectionY();
222  TH1D* TrackThetaAngle = TrackThetaPosvsAngle->ProjectionX();
223  TH1D* TrackThetaPosandTrig = TrackThetaPosvsAngleandTrig->ProjectionY();
224  TH1D* TrackThetaAngleandTrig = TrackThetaPosvsAngleandTrig->ProjectionX();
225  TH1D* TrackThetaPosandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionY();
226  TH1D* TrackThetaAngleandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionX();
227  float binEff = float(TrackThetaPosandTrig->GetEntries())/TrackThetaPos->GetEntries();
228  float binErr = sqrt(binEff*(1-binEff)/TrackThetaPos->GetEntries());
229  float binEffH = float(TrackThetaPosandTrigH->GetEntries())/TrackThetaPos->GetEntries();
230  float binErrH = sqrt(binEffH*(1-binEffH)/TrackThetaPos->GetEntries());
231 
232  MonitorElement* globalEff = innerME->find(fullName("TrigEffTheta"))->second;
233  globalEff->setBinContent(stat,binEff);
234  globalEff->setBinError(stat,binErr);
235 
236  innerME = &(whME[wh]);
237  globalEff = innerME->find(fullName("TrigEffTheta"))->second;
238  globalEff->setBinContent(sect,stat,binEff);
239  globalEff->setBinError(sect,stat,binErr);
240  globalEff = innerME->find(fullName("TrigEffHTheta"))->second;
241  globalEff->setBinContent(sect,stat,binEffH);
242  globalEff->setBinError(sect,stat,binErrH);
243 
244  innerME = &(chambME[indexCh]);
245  makeEfficiencyME(TrackThetaPosandTrig,TrackThetaPos,innerME->find(fullName("TrigEffPosTheta"))->second);
246  makeEfficiencyME(TrackThetaPosandTrigH,TrackThetaPos,innerME->find(fullName("TrigEffPosHTheta"))->second);
247  makeEfficiencyME(TrackThetaAngleandTrig,TrackThetaAngle,innerME->find(fullName("TrigEffAngleTheta"))->second);
248  makeEfficiencyME(TrackThetaAngleandTrigH,TrackThetaAngle,innerME->find(fullName("TrigEffAngleHTheta"))->second);
249  makeEfficiencyME2D(TrackThetaPosvsAngleandTrig,TrackThetaPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleTheta"))->second);
250  makeEfficiencyME2D(TrackThetaPosvsAngleandTrigH,TrackThetaPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleHTheta"))->second);
251  }
252 
253  }
254  }
255  }
256  }
257  }
258 
259 }
std::map< int, std::map< std::string, MonitorElement * > > secME
std::vector< std::string > trigSources
void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< int, std::map< std::string, MonitorElement * > > whME
void makeEfficiencyME(TH1D *numerator, TH1D *denominator, MonitorElement *result)
Compute efficiency plots.
void Bookings(DQMStore::IBooker &, DQMStore::IGetter &)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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:20
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
void bookChambHistos(DQMStore::IBooker &, DTChamberId chambId, std::string htype)
Book the new MEs (for each chamber)
T sqrt(T t)
Definition: SSEVec.h:18
#define end
Definition: vmac.h:39
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
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

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

Definition at line 56 of file DTLocalTriggerEfficiencyTest.h.

Referenced by bookChambHistos(), and runClientDiagnostic().

DTTrigGeomUtils* DTLocalTriggerEfficiencyTest::trigGeomUtils
private
const int DTLocalTriggerEfficiencyTest::wheelArrayShift = 3
protected

Definition at line 52 of file DTLocalTriggerEfficiencyTest.h.

Referenced by runClientDiagnostic().