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 edm::EDAnalyzer 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 edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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
 
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 (DTChamberId chambId, std::string htype)
 Book the new MEs (for each chamber) 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 ()
 DQM Client Diagnostic. More...
 
- Protected Member Functions inherited from DTLocalTriggerBaseTest
void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze. More...
 
void beginJob ()
 BeginJob. More...
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Perform begin lumiblock operations. More...
 
void bookCmsHistos (std::string hTag, std::string folder="", bool isGlb=false)
 Book the new MEs (CMS summary) More...
 
void bookSectorHistos (int wheel, int sector, std::string hTag, std::string folder="")
 Book the new MEs (for each sector) More...
 
void bookWheelHistos (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 endJob ()
 EndJob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
 Perform client diagnostic in online. 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::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

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Attributes inherited from DTLocalTriggerBaseTest
std::string baseFolderDCC
 
std::string baseFolderDDU
 
std::map< std::string,
MonitorElement * > 
cmsME
 
DQMStoredbe
 
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 19 of file DTLocalTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 35 of file DTLocalTriggerEfficiencyTest.cc.

References DTLocalTriggerBaseTest::baseFolderDCC, DTLocalTriggerBaseTest::baseFolderDDU, and DTLocalTriggerBaseTest::setConfig().

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

Destructor.

Definition at line 44 of file DTLocalTriggerEfficiencyTest.cc.

References trigGeomUtils.

44  {
45 
46  if (trigGeomUtils) {
47  delete trigGeomUtils;
48  }
49 
50 }

Member Function Documentation

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

BeginRun.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 53 of file DTLocalTriggerEfficiencyTest.cc.

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

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

Book the new MEs (for each chamber)

Definition at line 294 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by beginRun(), and runClientDiagnostic().

294  {
295 
296  stringstream wheel; wheel << chambId.wheel();
297  stringstream station; station << chambId.station();
298  stringstream sector; sector << chambId.sector();
299 
300  string fullType = fullName(htype);
301  bool isDCC = hwSource=="DCC" ;
302  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
303 
304  dbe->setCurrentFolder(topFolder(isDCC) + "Wheel" + wheel.str() +
305  "/Sector" + sector.str() +
306  "/Station" + station.str() + "/Segment");
307 
308  LogTrace(category()) << "[" << testName << "Test]: booking " + topFolder(isDCC) + "Wheel" << wheel.str()
309  <<"/Sector" << sector.str() << "/Station" << station.str() << "/Segment/" << HistoName;
310 
311 
312  uint32_t indexChId = chambId.rawId();
313  if (htype.find("TrigEffAnglePhi") == 0){
314  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency vs angle of incidence (Phi)",16,-40.,40.);
315  }
316  else if (htype.find("TrigEffAngleHHHLPhi") == 0){
317  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency (HH/HL) vs angle of incidence (Phi)",16,-40.,40.);
318  }
319  else if (htype.find("TrigEffAngleTheta") == 0){
320  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency vs angle of incidence (Theta)",16,-40.,40.);
321  }
322  else if (htype.find("TrigEffAngleHTheta") == 0){
323  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency (H) vs angle of incidence (Theta)",16,-40.,40.);
324  }
325  else if (htype.find("TrigEffPosPhi") == 0 ){
326  float min,max;
327  int nbins;
328  trigGeomUtils->phiRange(chambId,min,max,nbins);
329  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency vs position (Phi)",nbins,min,max);
330  }
331  else if (htype.find("TrigEffPosvsAnglePhi") == 0 ){
332  float min,max;
333  int nbins;
334  trigGeomUtils->phiRange(chambId,min,max,nbins);
335  chambME[indexChId][fullType] = dbe->book2D(HistoName.c_str(),"Trigger efficiency position vs angle (Phi)",16,-40.,40.,nbins,min,max);
336  }
337  else if (htype.find("TrigEffPosvsAngleHHHLPhi") == 0 ){
338  float min,max;
339  int nbins;
340  trigGeomUtils->phiRange(chambId,min,max,nbins);
341  chambME[indexChId][fullType] = dbe->book2D(HistoName.c_str(),"Trigger efficiency (HH/HL) pos vs angle (Phi)",16,-40.,40.,nbins,min,max);
342  }
343  else if (htype.find("TrigEffPosHHHLPhi") == 0 ){
344  float min,max;
345  int nbins;
346  trigGeomUtils->phiRange(chambId,min,max,nbins);
347  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency (HH/HL) vs position (Phi)",nbins,min,max);
348  }
349  else if (htype.find("TrigEffPosTheta") == 0){
350  float min,max;
351  int nbins;
352  trigGeomUtils->thetaRange(chambId,min,max,nbins);
353  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency vs position (Theta)",nbins,min,max);
354  }
355  else if (htype.find("TrigEffPosHTheta") == 0){
356  float min,max;
357  int nbins;
358  trigGeomUtils->thetaRange(chambId,min,max,nbins);
359  chambME[indexChId][fullType] = dbe->book1D(HistoName.c_str(),"Trigger efficiency (H) vs position (Theta)",nbins,min,max);
360  }
361  else if (htype.find("TrigEffPosvsAngleTheta") == 0 ){
362  float min,max;
363  int nbins;
364  trigGeomUtils->thetaRange(chambId,min,max,nbins);
365  chambME[indexChId][fullType] = dbe->book2D(HistoName.c_str(),"Trigger efficiency pos vs angle (Theta)",16,-40.,40.,nbins,min,max);
366  }
367  else if (htype.find("TrigEffPosvsAngleHTheta") == 0 ){
368  float min,max;
369  int nbins;
370  trigGeomUtils->thetaRange(chambId,min,max,nbins);
371  chambME[indexChId][fullType] = dbe->book2D(HistoName.c_str(),"Trigger efficiency (H) pos vs angle (Theta)",16,-40.,40.,nbins,min,max);
372  }
373 
374 }
void thetaRange(const DTChamberId &id, float &min, float &max, int &nbins, float step=15)
Compute theta range in local chamber coordinates.
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
const T & max(const T &a, const T &b)
#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
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
int wheel() const
Return the wheel number.
Definition: DTChamberId.h:45
std::string fullName(std::string htype)
Create fullname from histo partial name.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
void DTLocalTriggerEfficiencyTest::makeEfficiencyME ( TH1D *  numerator,
TH1D *  denominator,
MonitorElement result 
)
protected

Compute efficiency plots.

Definition at line 243 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by runClientDiagnostic().

243  {
244 
245  TH1F* efficiency = result->getTH1F();
246  efficiency->Divide(numerator,denominator,1,1,"");
247 
248  int nbins = efficiency->GetNbinsX();
249  for (int bin=1; bin<=nbins; ++bin){
250  float error = 0;
251  float bineff = efficiency->GetBinContent(bin);
252 
253  if (denominator->GetBinContent(bin)){
254  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(bin));
255  }
256  else {
257  error = 1;
258  efficiency->SetBinContent(bin,1.);
259  }
260 
261  efficiency->SetBinError(bin,error);
262  }
263 
264 }
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 267 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by runClientDiagnostic().

267  {
268 
269  TH2F* efficiency = result->getTH2F();
270  efficiency->Divide(numerator,denominator,1,1,"");
271 
272  int nbinsx = efficiency->GetNbinsX();
273  int nbinsy = efficiency->GetNbinsY();
274  for (int binx=1; binx<=nbinsx; ++binx){
275  for (int biny=1; biny<=nbinsy; ++biny){
276  float error = 0;
277  float bineff = efficiency->GetBinContent(binx,biny);
278 
279  if (denominator->GetBinContent(binx,biny)){
280  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
281  }
282  else {
283  error = 1;
284  efficiency->SetBinContent(binx,biny,0.);
285  }
286 
287  efficiency->SetBinError(binx,biny,error);
288  }
289  }
290 
291 }
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 ( )
protectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 105 of file DTLocalTriggerEfficiencyTest.cc.

References bookChambHistos(), DTLocalTriggerBaseTest::bookSectorHistos(), DTLocalTriggerBaseTest::bookWheelHistos(), chambME, DTLocalTriggerBaseTest::dbe, end, spr::find(), DTLocalTriggerBaseTest::fullName(), DQMStore::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.

105  {
106 
107  // Loop over Trig & Hw sources
108  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
109  trigSource = (*iTr);
110  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
111  hwSource = (*iHw);
112  // Loop over the TriggerUnits
113  for (int stat=1; stat<=4; ++stat){
114  for (int wh=-2; wh<=2; ++wh){
115  for (int sect=1; sect<=12; ++sect){
116  DTChamberId chId(wh,stat,sect);
117  int sector_id = (wh+3)+(sect-1)*5;
118  uint32_t indexCh = chId.rawId();
119 
120  // Perform Efficiency analysis (Phi+Segments 2D)
121  TH2F * TrackPosvsAngle = getHisto<TH2F>(dbe->get(getMEName("TrackPosvsAngle","Segment", chId)));
122  TH2F * TrackPosvsAngleandTrig = getHisto<TH2F>(dbe->get(getMEName("TrackPosvsAngleandTrig","Segment", chId)));
123  TH2F * TrackPosvsAngleandTrigHHHL = getHisto<TH2F>(dbe->get(getMEName("TrackPosvsAngleandTrigHHHL","Segment", chId)));
124 
125  if (TrackPosvsAngle && TrackPosvsAngleandTrig && TrackPosvsAngleandTrigHHHL && TrackPosvsAngle->GetEntries()>1) {
126 
127  if( chambME[indexCh].find(fullName("TrigEffAnglePhi")) == chambME[indexCh].end()){
128  bookChambHistos(chId,"TrigEffPosvsAnglePhi");
129  bookChambHistos(chId,"TrigEffPosvsAngleHHHLPhi");
130  bookChambHistos(chId,"TrigEffPosPhi");
131  bookChambHistos(chId,"TrigEffPosHHHLPhi");
132  bookChambHistos(chId,"TrigEffAnglePhi");
133  bookChambHistos(chId,"TrigEffAngleHHHLPhi");
134  }
135  if( secME[sector_id].find(fullName("TrigEffPhi")) == secME[sector_id].end() ){
136  bookSectorHistos(wh,sect,"TrigEffPhi");
137  }
138  if( whME[wh].find(fullName("TrigEffPhi")) == whME[wh].end() ){
139  bookWheelHistos(wh,"TrigEffPhi");
140  bookWheelHistos(wh,"TrigEffHHHLPhi");
141  }
142 
143  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
144  TH1D* TrackPos = TrackPosvsAngle->ProjectionY();
145  TH1D* TrackAngle = TrackPosvsAngle->ProjectionX();
146  TH1D* TrackPosandTrig = TrackPosvsAngleandTrig->ProjectionY();
147  TH1D* TrackAngleandTrig = TrackPosvsAngleandTrig->ProjectionX();
148  TH1D* TrackPosandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionY();
149  TH1D* TrackAngleandTrigHHHL = TrackPosvsAngleandTrigHHHL->ProjectionX();
150  float binEff = float(TrackPosandTrig->GetEntries())/TrackPos->GetEntries();
151  float binEffHHHL = float(TrackPosandTrigHHHL->GetEntries())/TrackPos->GetEntries();
152  float binErr = sqrt(binEff*(1-binEff)/TrackPos->GetEntries());
153  float binErrHHHL = sqrt(binEffHHHL*(1-binEffHHHL)/TrackPos->GetEntries());
154 
155  MonitorElement* globalEff = innerME->find(fullName("TrigEffPhi"))->second;
156  globalEff->setBinContent(stat,binEff);
157  globalEff->setBinError(stat,binErr);
158 
159  innerME = &(whME[wh]);
160  globalEff = innerME->find(fullName("TrigEffPhi"))->second;
161  globalEff->setBinContent(sect,stat,binEff);
162  globalEff->setBinError(sect,stat,binErr);
163  globalEff = innerME->find(fullName("TrigEffHHHLPhi"))->second;
164  globalEff->setBinContent(sect,stat,binEffHHHL);
165  globalEff->setBinError(sect,stat,binErrHHHL);
166 
167 
168  innerME = &(chambME[indexCh]);
169  makeEfficiencyME(TrackPosandTrig,TrackPos,innerME->find(fullName("TrigEffPosPhi"))->second);
170  makeEfficiencyME(TrackPosandTrigHHHL,TrackPos,innerME->find(fullName("TrigEffPosHHHLPhi"))->second);
171  makeEfficiencyME(TrackAngleandTrig,TrackAngle,innerME->find(fullName("TrigEffAnglePhi"))->second);
172  makeEfficiencyME(TrackAngleandTrigHHHL,TrackAngle,innerME->find(fullName("TrigEffAngleHHHLPhi"))->second);
173  makeEfficiencyME2D(TrackPosvsAngleandTrig,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAnglePhi"))->second);
174  makeEfficiencyME2D(TrackPosvsAngleandTrigHHHL,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleHHHLPhi"))->second);
175 
176  }
177 
178  // Perform Efficiency analysis (Theta+Segments) CB FIXME -> no DCC theta qual info
179  TH2F * TrackThetaPosvsAngle = getHisto<TH2F>(dbe->get(getMEName("TrackThetaPosvsAngle","Segment", chId)));
180  TH2F * TrackThetaPosvsAngleandTrig = getHisto<TH2F>(dbe->get(getMEName("TrackThetaPosvsAngleandTrig","Segment", chId)));
181  TH2F * TrackThetaPosvsAngleandTrigH = getHisto<TH2F>(dbe->get(getMEName("TrackThetaPosvsAngleandTrigH","Segment", chId)));
182 
183  if (TrackThetaPosvsAngle && TrackThetaPosvsAngleandTrig && TrackThetaPosvsAngleandTrigH && TrackThetaPosvsAngle->GetEntries()>1) {
184 
185  if( chambME[indexCh].find(fullName("TrigEffAngleTheta")) == chambME[indexCh].end()){
186  bookChambHistos(chId,"TrigEffPosvsAngleTheta");
187  bookChambHistos(chId,"TrigEffPosvsAngleHTheta");
188  bookChambHistos(chId,"TrigEffPosTheta");
189  bookChambHistos(chId,"TrigEffPosHTheta");
190  bookChambHistos(chId,"TrigEffAngleTheta");
191  bookChambHistos(chId,"TrigEffAngleHTheta");
192  }
193  if( secME[sector_id].find(fullName("TrigEffTheta")) == secME[sector_id].end() ){
194  bookSectorHistos(wh,sect,"TrigEffTheta");
195  }
196  if( whME[wh].find(fullName("TrigEffTheta")) == whME[wh].end() ){
197  bookWheelHistos(wh,"TrigEffTheta");
198  bookWheelHistos(wh,"TrigEffHTheta");
199  }
200 
201  std::map<std::string,MonitorElement*> *innerME = &(secME[sector_id]);
202  TH1D* TrackThetaPos = TrackThetaPosvsAngle->ProjectionY();
203  TH1D* TrackThetaAngle = TrackThetaPosvsAngle->ProjectionX();
204  TH1D* TrackThetaPosandTrig = TrackThetaPosvsAngleandTrig->ProjectionY();
205  TH1D* TrackThetaAngleandTrig = TrackThetaPosvsAngleandTrig->ProjectionX();
206  TH1D* TrackThetaPosandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionY();
207  TH1D* TrackThetaAngleandTrigH = TrackThetaPosvsAngleandTrigH->ProjectionX();
208  float binEff = float(TrackThetaPosandTrig->GetEntries())/TrackThetaPos->GetEntries();
209  float binErr = sqrt(binEff*(1-binEff)/TrackThetaPos->GetEntries());
210  float binEffH = float(TrackThetaPosandTrigH->GetEntries())/TrackThetaPos->GetEntries();
211  float binErrH = sqrt(binEffH*(1-binEffH)/TrackThetaPos->GetEntries());
212 
213  MonitorElement* globalEff = innerME->find(fullName("TrigEffTheta"))->second;
214  globalEff->setBinContent(stat,binEff);
215  globalEff->setBinError(stat,binErr);
216 
217  innerME = &(whME[wh]);
218  globalEff = innerME->find(fullName("TrigEffTheta"))->second;
219  globalEff->setBinContent(sect,stat,binEff);
220  globalEff->setBinError(sect,stat,binErr);
221  globalEff = innerME->find(fullName("TrigEffHTheta"))->second;
222  globalEff->setBinContent(sect,stat,binEffH);
223  globalEff->setBinError(sect,stat,binErrH);
224 
225  innerME = &(chambME[indexCh]);
226  makeEfficiencyME(TrackThetaPosandTrig,TrackThetaPos,innerME->find(fullName("TrigEffPosTheta"))->second);
227  makeEfficiencyME(TrackThetaPosandTrigH,TrackThetaPos,innerME->find(fullName("TrigEffPosHTheta"))->second);
228  makeEfficiencyME(TrackThetaAngleandTrig,TrackThetaAngle,innerME->find(fullName("TrigEffAngleTheta"))->second);
229  makeEfficiencyME(TrackThetaAngleandTrigH,TrackThetaAngle,innerME->find(fullName("TrigEffAngleHTheta"))->second);
230  makeEfficiencyME2D(TrackThetaPosvsAngleandTrig,TrackThetaPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleTheta"))->second);
231  makeEfficiencyME2D(TrackThetaPosvsAngleandTrigH,TrackThetaPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleHTheta"))->second);
232  }
233 
234  }
235  }
236  }
237  }
238  }
239 
240 }
void bookChambHistos(DTChamberId chambId, std::string htype)
Book the new MEs (for each chamber)
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 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
void bookWheelHistos(int wheel, std::string hTag, std::string folder="")
Book the new MEs (for each wheel)
void bookSectorHistos(int wheel, int sector, std::string hTag, std::string folder="")
Book the new MEs (for each sector)
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
T sqrt(T t)
Definition: SSEVec.h:48
#define end
Definition: vmac.h:37
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1696
std::string getMEName(std::string histoTag, std::string subfolder, const DTChamberId &chambid)
Get the ME name (by chamber)
std::vector< std::string > hwSources
std::string fullName(std::string htype)
Create fullname from histo partial name.

Member Data Documentation

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

Definition at line 50 of file DTLocalTriggerEfficiencyTest.h.

Referenced by bookChambHistos(), and runClientDiagnostic().

DTTrigGeomUtils* DTLocalTriggerEfficiencyTest::trigGeomUtils
private