CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Attributes
DTLocalTriggerEfficiencyTest Class Reference

#include <DTLocalTriggerEfficiencyTest.h>

Inheritance diagram for DTLocalTriggerEfficiencyTest:
DTLocalTriggerBaseTest DQMEDHarvester edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTLocalTriggerEfficiencyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTLocalTriggerEfficiencyTest ()
 Destructor. More...
 
- Public Member Functions inherited from DTLocalTriggerBaseTest
 DTLocalTriggerBaseTest ()
 Constructor. More...
 
virtual ~DTLocalTriggerBaseTest ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void analyze (edm::Event const &, edm::EventSetup const &) final
 
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
 DQMEDHarvester (void)
 
virtual void endJob () final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Protected Member Functions

void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun. More...
 
void bookChambHistos (DQMStore::IBooker &, DTChamberId chambId, std::string htype)
 Book the new MEs (for each chamber) More...
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &)
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 Perform client diagnostic in online. More...
 
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 &)
 DQM Client Diagnostic. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
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 endRun (edm::Run const &run, edm::EventSetup const &context)
 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 isDCC)
 Get top folder name. More...
 
- Protected Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderDCC
 
std::string baseFolderDDU
 
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
 

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::baseFolderDCC, DTLocalTriggerBaseTest::baseFolderDDU, bookingdone, and DTLocalTriggerBaseTest::setConfig().

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

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 
)
protectedvirtual

BeginRun.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 58 of file DTLocalTriggerEfficiencyTest.cc.

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

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

Book the new MEs (for each chamber)

Definition at line 314 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by dqmEndLuminosityBlock(), and runClientDiagnostic().

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

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 398 of file DTLocalTriggerEfficiencyTest.cc.

398 {}
void DTLocalTriggerEfficiencyTest::dqmEndLuminosityBlock ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  context 
)
protectedvirtual

Perform client diagnostic in online.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 66 of file DTLocalTriggerEfficiencyTest.cc.

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

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

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

Referenced by runClientDiagnostic().

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

Compute 2D efficiency plots.

Definition at line 288 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by runClientDiagnostic().

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

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 120 of file DTLocalTriggerEfficiencyTest.cc.

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

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

Referenced by bookChambHistos(), and runClientDiagnostic().

DTTrigGeomUtils* DTLocalTriggerEfficiencyTest::trigGeomUtils
private