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

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
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

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::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

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
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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 21 of file DTLocalTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 37 of file DTLocalTriggerEfficiencyTest.cc.

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

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

Destructor.

Definition at line 46 of file DTLocalTriggerEfficiencyTest.cc.

References trigGeomUtils.

46  {
47 
48  if (trigGeomUtils) {
49  delete trigGeomUtils;
50  }
51 
52 }

Member Function Documentation

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

BeginRun.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 55 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.

55  {
56 
59 
60  vector<string>::const_iterator iTr = trigSources.begin();
61  vector<string>::const_iterator trEnd = trigSources.end();
62  vector<string>::const_iterator iHw = hwSources.begin();
63  vector<string>::const_iterator hwEnd = hwSources.end();
64 
65 
66  //Booking
67  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
68  for (; iTr != trEnd; ++iTr){
69  trigSource = (*iTr);
70  for (; iHw != hwEnd; ++iHw){
71  hwSource = (*iHw);
72  // Loop over the TriggerUnits
73  for (int wh=-2; wh<=2; ++wh){
74  for (int sect=1; sect<=12; ++sect){
75  for (int stat=1; stat<=4; ++stat){
76  DTChamberId chId(wh,stat,sect);
77  bookChambHistos(chId,"TrigEffPosvsAnglePhi");
78  bookChambHistos(chId,"TrigEffPosvsAngleHHHLPhi");
79  bookChambHistos(chId,"TrigEffPosPhi");
80  bookChambHistos(chId,"TrigEffPosHHHLPhi");
81  bookChambHistos(chId,"TrigEffAnglePhi");
82  bookChambHistos(chId,"TrigEffAngleHHHLPhi");
83  if (stat<=3) {
84  bookChambHistos(chId,"TrigEffPosvsAngleTheta");
85  bookChambHistos(chId,"TrigEffPosvsAngleHTheta");
86  bookChambHistos(chId,"TrigEffPosTheta");
87  bookChambHistos(chId,"TrigEffPosHTheta");
88  bookChambHistos(chId,"TrigEffAngleTheta");
89  bookChambHistos(chId,"TrigEffAngleHTheta");
90  }
91  }
92  bookSectorHistos(wh,sect,"TrigEffPhi");
93  bookSectorHistos(wh,sect,"TrigEffTheta");
94  }
95  bookWheelHistos(wh,"TrigEffPhi");
96  bookWheelHistos(wh,"TrigEffHHHLPhi");
97  bookWheelHistos(wh,"TrigEffTheta");
98  bookWheelHistos(wh,"TrigEffHTheta");
99  }
100  }
101  }
102  }
103 
104 }
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 296 of file DTLocalTriggerEfficiencyTest.cc.

References DQMStore::book1D(), DQMStore::book2D(), DTLocalTriggerBaseTest::category(), chambME, DTLocalTriggerBaseTest::dbe, DTLocalTriggerBaseTest::fullName(), DTLocalTriggerBaseTest::hwSource, LogTrace, max(), 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().

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

Compute efficiency plots.

Definition at line 245 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by runClientDiagnostic().

245  {
246 
247  TH1F* efficiency = result->getTH1F();
248  efficiency->Divide(numerator,denominator,1,1,"");
249 
250  int nbins = efficiency->GetNbinsX();
251  for (int bin=1; bin<=nbins; ++bin){
252  float error = 0;
253  float bineff = efficiency->GetBinContent(bin);
254 
255  if (denominator->GetBinContent(bin)){
256  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(bin));
257  }
258  else {
259  error = 1;
260  efficiency->SetBinContent(bin,1.);
261  }
262 
263  efficiency->SetBinError(bin,error);
264  }
265 
266 }
T sqrt(T t)
Definition: SSEVec.h:46
TH1F * getTH1F(void) const
void DTLocalTriggerEfficiencyTest::makeEfficiencyME2D ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result 
)
protected

Compute 2D efficiency plots.

Definition at line 269 of file DTLocalTriggerEfficiencyTest.cc.

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

Referenced by runClientDiagnostic().

269  {
270 
271  TH2F* efficiency = result->getTH2F();
272  efficiency->Divide(numerator,denominator,1,1,"");
273 
274  int nbinsx = efficiency->GetNbinsX();
275  int nbinsy = efficiency->GetNbinsY();
276  for (int binx=1; binx<=nbinsx; ++binx){
277  for (int biny=1; biny<=nbinsy; ++biny){
278  float error = 0;
279  float bineff = efficiency->GetBinContent(binx,biny);
280 
281  if (denominator->GetBinContent(binx,biny)){
282  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
283  }
284  else {
285  error = 1;
286  efficiency->SetBinContent(binx,biny,0.);
287  }
288 
289  efficiency->SetBinError(binx,biny,error);
290  }
291  }
292 
293 }
T sqrt(T t)
Definition: SSEVec.h:46
TH2F * getTH2F(void) const
void DTLocalTriggerEfficiencyTest::runClientDiagnostic ( )
protectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 107 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.

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

Referenced by bookChambHistos(), and runClientDiagnostic().

DTTrigGeomUtils* DTLocalTriggerEfficiencyTest::trigGeomUtils
private