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
DTTriggerEfficiencyTest Class Reference

#include <DTTriggerEfficiencyTest.h>

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

Public Member Functions

 DTTriggerEfficiencyTest (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~DTTriggerEfficiencyTest ()
 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 &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
 Book the new MEs (for each chamber) More...
 
void bookHistos (DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
 Book the new MEs (global) More...
 
void bookWheelHistos (DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
 Book the new MEs (for each wheel) 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...
 
std::string getMEName (std::string histoTag, std::string folder, int wh)
 Get the ME name (by wheel) More...
 
void makeEfficiencyME (TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
 Compute 1D/2D efficiency plots. More...
 
void makeEfficiencyME (TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh)
 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
 
bool detailedPlots
 
std::map< int, std::map
< std::string, MonitorElement * > > 
EffDistrPerWh
 
std::map< std::string,
MonitorElement * > 
globalEffDistr
 
DTTrigGeomUtilstrigGeomUtils
 

Additional Inherited Members

- Public Types inherited from 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 23 of file DTTriggerEfficiencyTest.h.

Constructor & Destructor Documentation

DTTriggerEfficiencyTest::DTTriggerEfficiencyTest ( const edm::ParameterSet ps)

Constructor.

Definition at line 40 of file DTTriggerEfficiencyTest.cc.

References edm::ParameterSet::getUntrackedParameter().

40  {
41 
42  setConfig(ps,"DTTriggerEfficiency");
43  baseFolderDCC = "DT/03-LocalTrigger-DCC/";
44  baseFolderDDU = "DT/04-LocalTrigger-DDU/";
45  detailedPlots = ps.getUntrackedParameter<bool>("detailedAnalysis",true);
46 
47  bookingdone = 0;
48 }
T getUntrackedParameter(std::string const &, T const &) const
void setConfig(const edm::ParameterSet &ps, std::string name)
Set configuration variables.
DTTriggerEfficiencyTest::~DTTriggerEfficiencyTest ( )
virtual

Destructor.

Definition at line 51 of file DTTriggerEfficiencyTest.cc.

51  {
52 
53 }

Member Function Documentation

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

BeginRun.

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 56 of file DTTriggerEfficiencyTest.cc.

References DTLocalTriggerBaseTest::beginRun().

56  {
57 
60 
61 }
void beginRun(edm::Run const &run, edm::EventSetup const &context)
BeginRun.
edm::ESHandle< DTGeometry > muonGeom
void DTTriggerEfficiencyTest::bookChambHistos ( DQMStore::IBooker ibooker,
DTChamberId  chambId,
std::string  htype,
std::string  folder = "" 
)
protected

Book the new MEs (for each chamber)

Definition at line 288 of file DTTriggerEfficiencyTest.cc.

References DQMStore::IBooker::book2D(), python.rootplot.argparse::category, newFWLiteAna::fullName, LogTrace, edm::max(), edm::min(), pileupCalc::nbins, DetId::rawId(), DTChamberId::sector(), DQMStore::IBooker::setCurrentFolder(), DTChamberId::station(), relativeConstraints::station, and DTChamberId::wheel().

289  {
290 
291  stringstream wheel; wheel << chambId.wheel();
292  stringstream station; station << chambId.station();
293  stringstream sector; sector << chambId.sector();
294 
295  string fullType = fullName(htype);
296  bool isDCC = hwSource=="DCC" ;
297  string HistoName = fullType + "_W" + wheel.str() + "_Sec" + sector.str() + "_St" + station.str();
298 
299  ibooker.setCurrentFolder(topFolder(isDCC) +
300  "Wheel" + wheel.str() +
301  "/Sector" + sector.str() +
302  "/Station" + station.str() +
303  "/" + folder + "/");
304 
305  LogTrace(category()) << "[" << testName << "Test]: booking " + topFolder(isDCC) + "Wheel" << wheel.str()
306  <<"/Sector" << sector.str() << "/Station" << station.str() << "/" + folder + "/" << HistoName;
307 
308 
309  uint32_t indexChId = chambId.rawId();
310  float min, max;
311  int nbins;
312  trigGeomUtils->phiRange(chambId,min,max,nbins,20);
313  if (htype.find("TrigEffPosvsAnglePhi") == 0 ){
314 
315  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency (any qual.) position vs angle (Phi)",12,-30.,30.,nbins,min,max);
316  return;
317  }
318  if (htype.find("TrigEffPosvsAngleCorrPhi") == 0 ){
319 
320  chambME[indexChId][fullType] = ibooker.book2D(HistoName.c_str(),"Trigger efficiency (correlated) pos vs angle (Phi)",12,-30.,30.,nbins,min,max);
321  return;
322  }
323 
324 }
std::map< uint32_t, std::map< std::string, MonitorElement * > > chambME
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
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.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
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 DTTriggerEfficiencyTest::bookHistos ( DQMStore::IBooker ibooker,
std::string  hTag,
std::string  folder 
)
protected

Book the new MEs (global)

Definition at line 210 of file DTTriggerEfficiencyTest.cc.

References DQMStore::IBooker::book1D(), newFWLiteAna::fullName, MonitorElement::setAxisTitle(), and DQMStore::IBooker::setCurrentFolder().

210  {
211 
212  string basedir;
213  bool isDCC = hwSource=="DCC" ;
214  basedir = topFolder(isDCC); //Book summary histo outside Task directory
215 
216  if (folder != "") {
217  basedir += folder +"/" ;
218  }
219 
220  ibooker.setCurrentFolder(basedir);
221 
222  string fullTag = fullName(hTag);
223  string hname = fullTag + "_All";
224 
225  globalEffDistr[fullTag] = ibooker.book1D(hname.c_str(),hname.c_str(),51,0.,1.02);
226  globalEffDistr[fullTag] ->setAxisTitle("Trig Eff",1);
227 
228 }
std::map< std::string, MonitorElement * > globalEffDistr
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
std::string & topFolder(bool isDCC)
Get top folder name.
std::string fullName(std::string htype)
Create fullname from histo partial name.
void DTTriggerEfficiencyTest::bookWheelHistos ( DQMStore::IBooker ibooker,
int  wheel,
std::string  hTag,
std::string  folder 
)
protected

Book the new MEs (for each wheel)

Definition at line 230 of file DTTriggerEfficiencyTest.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), python.rootplot.argparse::category, newFWLiteAna::fullName, LogTrace, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::IBooker::setCurrentFolder().

230  {
231 
232  stringstream wh; wh << wheel;
233  string basedir;
234  bool isDCC = hwSource=="DCC" ;
235  if (hTag.find("Summary") != string::npos) {
236  basedir = topFolder(isDCC); //Book summary histo outside wheel directories
237  } else {
238  basedir = topFolder(isDCC) + "Wheel" + wh.str() + "/" ;
239 
240  }
241  if (folder != "") {
242  basedir += folder +"/" ;
243  }
244 
245  ibooker.setCurrentFolder(basedir);
246 
247  string fullTag = fullName(hTag);
248  string hname = fullTag+ "_W" + wh.str();
249 
250  string hnameAll = fullTag+ "_All_W" + wh.str();
251 
252  LogTrace(category()) << "[" << testName << "Test]: booking "<< basedir << hname;
253 
254  (EffDistrPerWh[wheel])[fullTag] = ibooker.book1D(hnameAll.c_str(),hnameAll.c_str(),51,0.,1.02);
255 
256  if (hTag.find("Phi")!= string::npos ||
257  hTag.find("Summary") != string::npos ){
258 
259  MonitorElement* me = ibooker.book2D(hname.c_str(),hname.c_str(),12,1,13,4,1,5);
260 
261  // setLabelPh(me);
262  me->setBinLabel(1,"MB1",2);
263  me->setBinLabel(2,"MB2",2);
264  me->setBinLabel(3,"MB3",2);
265  me->setBinLabel(4,"MB4",2);
266  me->setAxisTitle("Sector",1);
267 
268  whME[wheel][fullTag] = me;
269  return;
270  }
271 
272  if (hTag.find("Theta") != string::npos){
273 
274  MonitorElement* me =ibooker.book2D(hname.c_str(),hname.c_str(),12,1,13,3,1,4);
275 
276  // setLabelTh(me);
277  me->setBinLabel(1,"MB1",2);
278  me->setBinLabel(2,"MB2",2);
279  me->setBinLabel(3,"MB3",2);
280  me->setAxisTitle("Sector",1);
281 
282  whME[wheel][fullTag] = me;
283  return;
284  }
285 
286 }
std::map< int, std::map< std::string, MonitorElement * > > whME
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
#define LogTrace(id)
std::string category()
Get message logger name.
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:274
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
std::string & topFolder(bool isDCC)
Get top folder name.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::string fullName(std::string htype)
Create fullname from histo partial name.
void DTTriggerEfficiencyTest::dqmEndJob ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

Reimplemented from DTLocalTriggerBaseTest.

Definition at line 327 of file DTTriggerEfficiencyTest.cc.

References bookHistos(), and Parameters::parameters.

327  {
328 
329 
330  vector<string>::const_iterator iTr = trigSources.begin();
331  vector<string>::const_iterator trEnd = trigSources.end();
332  vector<string>::const_iterator iHw = hwSources.begin();
333  vector<string>::const_iterator hwEnd = hwSources.end();
334 
335 
336  //Booking
337  if(parameters.getUntrackedParameter<bool>("staticBooking", true)){
338  for (; iTr != trEnd; ++iTr){
339  trigSource = (*iTr);
340  for (; iHw != hwEnd; ++iHw){
341  hwSource = (*iHw);
342  // Loop over the TriggerUnits
343 
344  bookHistos(ibooker,"TrigEffPhi","");
345  bookHistos(ibooker,"TrigEffCorrPhi","");
346  for (int wh=-2; wh<=2; ++wh){
347  if (detailedPlots) {
348  for (int sect=1; sect<=12; ++sect){
349  for (int stat=1; stat<=4; ++stat){
350  DTChamberId chId(wh,stat,sect);
351 
352  bookChambHistos(ibooker,chId,"TrigEffPosvsAnglePhi","Segment");
353  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleCorrPhi","Segment");
354  }
355  }
356  }
357 
358  bookWheelHistos(ibooker,wh,"TrigEffPhi","");
359  bookWheelHistos(ibooker,wh,"TrigEffCorrPhi","");
360  }
361  }
362  }
363  }
364  bookingdone = 1;
365 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::string > trigSources
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
std::vector< std::string > hwSources
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)
void DTTriggerEfficiencyTest::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 63 of file DTTriggerEfficiencyTest.cc.

64  {
65 }
string DTTriggerEfficiencyTest::getMEName ( std::string  histoTag,
std::string  folder,
int  wh 
)
protected

Get the ME name (by wheel)

Definition at line 197 of file DTTriggerEfficiencyTest.cc.

References newFWLiteAna::fullName.

197  {
198 
199  stringstream wheel; wheel << wh;
200 
201  string folderName = topFolder(hwSource=="DCC") + folder + "/";
202 
203  string histoname = sourceFolder + folderName
204  + fullName(histoTag) + "_W" + wheel.str();
205 
206  return histoname;
207 
208 }
std::string & topFolder(bool isDCC)
Get top folder name.
std::string fullName(std::string htype)
Create fullname from histo partial name.
void DTTriggerEfficiencyTest::makeEfficiencyME ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result2DWh,
MonitorElement result1DWh,
MonitorElement result1D 
)
protected

Compute 1D/2D efficiency plots.

Definition at line 142 of file DTTriggerEfficiencyTest.cc.

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

142  {
143 
144  TH2F* efficiency = result2DWh->getTH2F();
145  efficiency->Divide(numerator,denominator,1,1,"");
146 
147  int nbinsx = efficiency->GetNbinsX();
148  int nbinsy = efficiency->GetNbinsY();
149  for (int binx=1; binx<=nbinsx; ++binx){
150  for (int biny=1; biny<=nbinsy; ++biny){
151  float error = 0;
152  float bineff = efficiency->GetBinContent(binx,biny);
153 
154  result1DWh->Fill(bineff);
155  result1D->Fill(bineff);
156 
157  if (denominator->GetBinContent(binx,biny)){
158  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
159  }
160  else {
161  error = 1;
162  efficiency->SetBinContent(binx,biny,0.);
163  }
164 
165  efficiency->SetBinError(binx,biny,error);
166  }
167  }
168 
169 }
list numerator
Definition: cuy.py:483
void Fill(long long x)
list denominator
Definition: cuy.py:484
T sqrt(T t)
Definition: SSEVec.h:48
TH2F * getTH2F(void) const
void DTTriggerEfficiencyTest::makeEfficiencyME ( TH2F *  numerator,
TH2F *  denominator,
MonitorElement result2DWh 
)
protected

Compute 2D efficiency plots.

Definition at line 171 of file DTTriggerEfficiencyTest.cc.

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

171  {
172 
173  TH2F* efficiency = result2DWh->getTH2F();
174  efficiency->Divide(numerator,denominator,1,1,"");
175 
176  int nbinsx = efficiency->GetNbinsX();
177  int nbinsy = efficiency->GetNbinsY();
178  for (int binx=1; binx<=nbinsx; ++binx){
179  for (int biny=1; biny<=nbinsy; ++biny){
180  float error = 0;
181  float bineff = efficiency->GetBinContent(binx,biny);
182 
183  if (denominator->GetBinContent(binx,biny)){
184  error = sqrt(bineff*(1-bineff)/denominator->GetBinContent(binx,biny));
185  }
186  else {
187  error = 1;
188  efficiency->SetBinContent(binx,biny,0.);
189  }
190 
191  efficiency->SetBinError(binx,biny,error);
192  }
193  }
194 
195 }
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 DTTriggerEfficiencyTest::runClientDiagnostic ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
protectedvirtual

DQM Client Diagnostic.

Implements DTLocalTriggerBaseTest.

Definition at line 67 of file DTTriggerEfficiencyTest.cc.

References bookHistos(), spr::find(), newFWLiteAna::fullName, DQMStore::IGetter::get(), DetId::rawId(), and edm::second().

67  {
68 
69  // Loop over Trig & Hw sources
70  for (vector<string>::const_iterator iTr = trigSources.begin(); iTr != trigSources.end(); ++iTr){
71  trigSource = (*iTr);
72  for (vector<string>::const_iterator iHw = hwSources.begin(); iHw != hwSources.end(); ++iHw){
73  hwSource = (*iHw);
74  // Loop over the TriggerUnits
75  if( globalEffDistr.find(fullName("TrigEffPhi")) == globalEffDistr.end() ){
76 
77  bookHistos(ibooker,"TrigEffPhi","");
78  bookHistos(ibooker,"TrigEffCorrPhi","");
79  }
80  for (int wh=-2; wh<=2; ++wh){
81 
82  TH2F * TrigEffDenum = getHisto<TH2F>(igetter.get(getMEName("TrigEffDenum","Task",wh)));
83  TH2F * TrigEffNum = getHisto<TH2F>(igetter.get(getMEName("TrigEffNum","Task",wh)));
84  TH2F * TrigEffCorrNum = getHisto<TH2F>(igetter.get(getMEName("TrigEffCorrNum","Task",wh)));
85 
86  if (TrigEffDenum && TrigEffNum && TrigEffCorrNum && TrigEffDenum->GetEntries()>1) {
87 
88  if( whME[wh].find(fullName("TrigEffPhi")) == whME[wh].end() ){
89 
90  bookWheelHistos(ibooker,wh,"TrigEffPhi","");
91  bookWheelHistos(ibooker,wh,"TrigEffCorrPhi","");
92  }
93 
94  MonitorElement* Eff1DAll_TrigEffPhi = (&globalEffDistr)->find(fullName("TrigEffPhi"))->second;
95  MonitorElement* Eff1DAll_TrigEffCorrPhi = (&globalEffDistr)->find(fullName("TrigEffCorrPhi"))->second;
96 
97  MonitorElement* Eff1DWh_TrigEffPhi = (&(EffDistrPerWh[wh]))->find(fullName("TrigEffPhi"))->second;
98  MonitorElement* Eff1DWh_TrigEffCorrPhi = (&(EffDistrPerWh[wh]))->find(fullName("TrigEffCorrPhi"))->second;
99 
100  MonitorElement* Eff2DWh_TrigEffPhi = (&(whME[wh]))->find(fullName("TrigEffPhi"))->second;
101  MonitorElement* Eff2DWh_TrigEffCorrPhi = (&(whME[wh]))->find(fullName("TrigEffCorrPhi"))->second;
102 
103  makeEfficiencyME(TrigEffNum,TrigEffDenum,Eff2DWh_TrigEffPhi,Eff1DWh_TrigEffPhi,Eff1DAll_TrigEffPhi);
104  makeEfficiencyME(TrigEffCorrNum,TrigEffDenum,Eff2DWh_TrigEffCorrPhi,Eff1DWh_TrigEffCorrPhi,Eff1DAll_TrigEffCorrPhi);
105 
106  }
107 
108  if (detailedPlots) {
109  for (int stat=1; stat<=4; ++stat){
110  for (int sect=1; sect<=12; ++sect){
111  DTChamberId chId(wh,stat,sect);
112  uint32_t indexCh = chId.rawId();
113 
114  // Perform Efficiency analysis (Phi+Segments 2D)
115 
116  TH2F * TrackPosvsAngle = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngle","Segment", chId)));
117  TH2F * TrackPosvsAngleAnyQual = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleAnyQual","Segment", chId)));
118  TH2F * TrackPosvsAngleCorr = getHisto<TH2F>(igetter.get(getMEName("TrackPosvsAngleCorr","Segment", chId)));
119 
120  if (TrackPosvsAngle && TrackPosvsAngleAnyQual && TrackPosvsAngleCorr && TrackPosvsAngle->GetEntries()>1) {
121 
122  if( chambME[indexCh].find(fullName("TrigEffAnglePhi")) == chambME[indexCh].end()){
123  bookChambHistos(ibooker,chId,"TrigEffPosvsAnglePhi","Segment");
124  bookChambHistos(ibooker,chId,"TrigEffPosvsAngleCorrPhi","Segment");
125  }
126 
127  std::map<std::string,MonitorElement*> *innerME = &(chambME[indexCh]);
128  makeEfficiencyME(TrackPosvsAngleAnyQual,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAnglePhi"))->second);
129  makeEfficiencyME(TrackPosvsAngleCorr,TrackPosvsAngle,innerME->find(fullName("TrigEffPosvsAngleCorrPhi"))->second);
130 
131  }
132  }
133  }
134  }
135  }
136 
137  }
138  }
139 
140 }
void makeEfficiencyME(TH2F *numerator, TH2F *denominator, MonitorElement *result2DWh, MonitorElement *result1DWh, MonitorElement *result1D)
Compute 1D/2D efficiency plots.
std::vector< std::string > trigSources
std::map< int, std::map< std::string, MonitorElement * > > whME
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
std::map< int, std::map< std::string, MonitorElement * > > EffDistrPerWh
void bookWheelHistos(DQMStore::IBooker &ibooker, int wheel, std::string hTag, std::string folder)
Book the new MEs (for each wheel)
std::map< std::string, MonitorElement * > globalEffDistr
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
U second(std::pair< T, U > const &p)
void bookChambHistos(DQMStore::IBooker &ibooker, DTChamberId chambId, std::string htype, std::string folder="")
Book the new MEs (for each chamber)
std::string getMEName(std::string histoTag, std::string folder, int wh)
Get the ME name (by wheel)
std::vector< std::string > hwSources
std::string fullName(std::string htype)
Create fullname from histo partial name.
void bookHistos(DQMStore::IBooker &ibooker, std::string hTag, std::string folder)
Book the new MEs (global)

Member Data Documentation

bool DTTriggerEfficiencyTest::bookingdone
private

Definition at line 71 of file DTTriggerEfficiencyTest.h.

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

Definition at line 67 of file DTTriggerEfficiencyTest.h.

bool DTTriggerEfficiencyTest::detailedPlots
private

Definition at line 69 of file DTTriggerEfficiencyTest.h.

std::map<int,std::map<std::string,MonitorElement*> > DTTriggerEfficiencyTest::EffDistrPerWh
private

Definition at line 66 of file DTTriggerEfficiencyTest.h.

std::map<std::string, MonitorElement*> DTTriggerEfficiencyTest::globalEffDistr
private

Definition at line 65 of file DTTriggerEfficiencyTest.h.

DTTrigGeomUtils* DTTriggerEfficiencyTest::trigGeomUtils
private

Definition at line 68 of file DTTriggerEfficiencyTest.h.