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

#include <DQM/TrackingMonitor/interface/TrackEfficiencyClient.h>

Inheritance diagram for TrackEfficiencyClient:
edm::EDAnalyzer

Public Member Functions

 TrackEfficiencyClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~TrackEfficiencyClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup)
 Analyze. More...
 
void beginJob (void)
 BeginJob. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun. More...
 
void endJob ()
 Endjob. More...
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup)
 End Luminosity Block. More...
 
void endRun ()
 EndRun. More...
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Private Attributes

std::string algoName_
 
edm::ParameterSet conf_
 
DQMStoredqmStore_
 
MonitorElementeffCompatibleLayers
 
MonitorElementeffD0
 
MonitorElementeffEta
 
MonitorElementeffPhi
 
MonitorElementeffX
 
MonitorElementeffY
 
MonitorElementeffZ
 
std::string FolderName_
 
std::string histName
 
bool trackEfficiency_
 

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

Detailed Description

DQM class to compute the tracking efficiency

Definition at line 33 of file TrackEfficiencyClient.h.

Constructor & Destructor Documentation

TrackEfficiencyClient::TrackEfficiencyClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 29 of file TrackEfficiencyClient.cc.

References algoName_, conf_, dqmStore_, FolderName_, edm::ParameterSet::getParameter(), cppFunctionSkipper::operator, and trackEfficiency_.

31 {
32  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
33 
34  // get back-end interface
36 
37  FolderName_ = iConfig.getParameter<std::string>("FolderName");
38  algoName_ = iConfig.getParameter<std::string>("AlgoName");
39  trackEfficiency_ = iConfig.getParameter<bool>("trackEfficiency");
40 
41  conf_ = iConfig;
42 }
TrackEfficiencyClient::~TrackEfficiencyClient ( )
virtual

Destructor.

Definition at line 46 of file TrackEfficiencyClient.cc.

48 {
49  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
50 }

Member Function Documentation

void TrackEfficiencyClient::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
protectedvirtual

Analyze.

Implements edm::EDAnalyzer.

Definition at line 145 of file TrackEfficiencyClient.cc.

147 {
148  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::analyze";
149 }
void TrackEfficiencyClient::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 54 of file TrackEfficiencyClient.cc.

References algoName_, DQMStore::book1D(), conf_, dqmStore_, effCompatibleLayers, effD0, effEta, effPhi, effX, effY, effZ, FolderName_, edm::ParameterSet::getParameter(), MonitorElement::getTH1F(), histName, MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

56 {
57 
59 
60  //
61  int effXBin = conf_.getParameter<int> ("effXBin");
62  double effXMin = conf_.getParameter<double>("effXMin");
63  double effXMax = conf_.getParameter<double>("effXMax");
64 
65  histName = "effX_";
66  effX = dqmStore_->book1D(histName+algoName_, histName+algoName_, effXBin, effXMin, effXMax);
67  if (effX->getTH1F()) effX->getTH1F()->Sumw2();
68  effX->setAxisTitle("");
69 
70 
71  //
72  int effYBin = conf_.getParameter<int> ("effYBin");
73  double effYMin = conf_.getParameter<double>("effYMin");
74  double effYMax = conf_.getParameter<double>("effYMax");
75 
76  histName = "effY_";
77  effY = dqmStore_->book1D(histName+algoName_, histName+algoName_, effYBin, effYMin, effYMax);
78  if (effY->getTH1F()) effY->getTH1F()->Sumw2();
79  effY->setAxisTitle("");
80 
81  //
82  int effZBin = conf_.getParameter<int> ("effZBin");
83  double effZMin = conf_.getParameter<double>("effZMin");
84  double effZMax = conf_.getParameter<double>("effZMax");
85 
86  histName = "effZ_";
87  effZ = dqmStore_->book1D(histName+algoName_, histName+algoName_, effZBin, effZMin, effZMax);
88  if (effZ->getTH1F()) effZ->getTH1F()->Sumw2();
89  effZ->setAxisTitle("");
90 
91  //
92  int effEtaBin = conf_.getParameter<int> ("effEtaBin");
93  double effEtaMin = conf_.getParameter<double>("effEtaMin");
94  double effEtaMax = conf_.getParameter<double>("effEtaMax");
95 
96  histName = "effEta_";
97  effEta = dqmStore_->book1D(histName+algoName_, histName+algoName_, effEtaBin, effEtaMin, effEtaMax);
98  if (effEta->getTH1F()) effEta->getTH1F()->Sumw2();
99  effEta->setAxisTitle("");
100 
101  //
102  int effPhiBin = conf_.getParameter<int> ("effPhiBin");
103  double effPhiMin = conf_.getParameter<double>("effPhiMin");
104  double effPhiMax = conf_.getParameter<double>("effPhiMax");
105 
106  histName = "effPhi_";
107  effPhi = dqmStore_->book1D(histName+algoName_, histName+algoName_, effPhiBin, effPhiMin, effPhiMax);
108  if (effPhi->getTH1F()) effPhi->getTH1F()->Sumw2();
109  effPhi->setAxisTitle("");
110 
111  //
112  int effD0Bin = conf_.getParameter<int> ("effD0Bin");
113  double effD0Min = conf_.getParameter<double>("effD0Min");
114  double effD0Max = conf_.getParameter<double>("effD0Max");
115 
116  histName = "effD0_";
117  effD0 = dqmStore_->book1D(histName+algoName_, histName+algoName_, effD0Bin, effD0Min, effD0Max);
118  if (effD0->getTH1F()) effD0->getTH1F()->Sumw2();
119  effD0->setAxisTitle("");
120 
121 
122  //
123  int effCompatibleLayersBin = conf_.getParameter<int> ("effCompatibleLayersBin");
124  double effCompatibleLayersMin = conf_.getParameter<double>("effCompatibleLayersMin");
125  double effCompatibleLayersMax = conf_.getParameter<double>("effCompatibleLayersMax");
126 
127  histName = "effCompatibleLayers_";
128  effCompatibleLayers = dqmStore_->book1D(histName+algoName_, histName+algoName_, effCompatibleLayersBin, effCompatibleLayersMin, effCompatibleLayersMax);
131 
132  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::beginJob done";
133 }
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
MonitorElement * effCompatibleLayers
TH1F * getTH1F(void) const
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void TrackEfficiencyClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file TrackEfficiencyClient.cc.

139 {
140  edm::LogInfo ("TrackEfficiencyClient") <<"TrackEfficiencyClient:: Begining of Run";
141 }
void TrackEfficiencyClient::endJob ( void  )
protectedvirtual

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file TrackEfficiencyClient.cc.

154 {
155 }
void TrackEfficiencyClient::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
protectedvirtual

End Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file TrackEfficiencyClient.cc.

References algoName_, dqmStore_, effCompatibleLayers, effD0, effEta, effPhi, effX, effY, effZ, FolderName_, DQMStore::get(), getTH1F(), MonitorElement::getTH1F(), histName, trackEfficiency_, reco::btau::trackEta, and reco::btau::trackPhi.

167 {
168  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::endLuminosityBlock";
169 
170  histName = "/trackX_";
172 
173  histName = "/muonX_";
175 
176  histName = "/trackY_";
178  histName = "/muonY_";
180 
181  histName = "/trackZ_";
183  histName = "/muonZ_";
185 
186  histName = "/trackEta_";
188  histName = "/muonEta_";
190 
191  histName = "/trackPhi_";
193  histName = "/muonPhi_";
195 
196  histName = "/trackD0_";
198  histName = "/muonD0_";
200 
201  histName = "/trackCompatibleLayers_";
202  MonitorElement* trackCompatibleLayers = dqmStore_->get(FolderName_+histName+algoName_);
203  histName = "/muonCompatibleLayers_";
204  MonitorElement* muonCompatibleLayers = dqmStore_->get(FolderName_+histName+algoName_);
205 
206  if(trackX && muonX && trackY && muonY && trackZ && muonZ && trackEta && muonEta && trackPhi && muonPhi && trackD0 && muonD0 && trackCompatibleLayers && muonCompatibleLayers){
207  if (trackEfficiency_)
208  {
209  if (effX ->getTH1F() && trackX ->getTH1F() && muonX ->getTH1F()) { effX -> getTH1F()->Divide(trackX->getTH1F(),muonX->getTH1F(),1.,1.,"");}
210  if (effY ->getTH1F() && trackY ->getTH1F() && muonY ->getTH1F()) { effY -> getTH1F()->Divide(trackY->getTH1F(),muonY->getTH1F(),1.,1.,"");}
211  if (effZ ->getTH1F() && trackZ ->getTH1F() && muonZ ->getTH1F()) { effZ -> getTH1F()->Divide(trackZ->getTH1F(),muonZ->getTH1F(),1.,1.,"");}
212  if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(trackEta->getTH1F(),muonEta->getTH1F(),1.,1.,"");}
213  if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(trackPhi->getTH1F(),muonPhi->getTH1F(),1.,1.,"");}
214  if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0 -> getTH1F()->Divide(trackD0->getTH1F(),muonD0->getTH1F(),1.,1.,"");}
215  if (effCompatibleLayers->getTH1F() && trackCompatibleLayers->getTH1F() && muonCompatibleLayers->getTH1F()) { effCompatibleLayers -> getTH1F()->Divide(trackCompatibleLayers->getTH1F(),muonCompatibleLayers->getTH1F(),1.,1.,"");}
216  }
217  else {
218  if (effX ->getTH1F() && trackX ->getTH1F() && muonX ->getTH1F()) { effX -> getTH1F()->Divide(muonX->getTH1F(),trackX->getTH1F(),1.,1.,"");}
219  if (effY ->getTH1F() && trackY ->getTH1F() && muonY ->getTH1F()) { effY -> getTH1F()->Divide(muonY->getTH1F(),trackY->getTH1F(),1.,1.,"");}
220  if (effZ ->getTH1F() && trackZ ->getTH1F() && muonZ ->getTH1F()) { effZ -> getTH1F()->Divide(muonZ->getTH1F(),trackZ->getTH1F(),1.,1.,"");}
221  if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(muonEta->getTH1F(),trackEta->getTH1F(),1.,1.,"");}
222  if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(muonPhi->getTH1F(),trackPhi->getTH1F(),1.,1.,"");}
223  if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0 -> getTH1F()->Divide(muonD0->getTH1F(),trackD0->getTH1F(),1.,1.,"");}
224  }
225  }
226 
227 }
MonitorElement * effCompatibleLayers
TH1F * getTH1F(std::string name, std::string process, std::string rootfolder, DQMStore *dbe_, bool verb, bool clone)
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
TH1F * getTH1F(void) const
void TrackEfficiencyClient::endRun ( void  )
protected

EndRun.

Definition at line 158 of file TrackEfficiencyClient.cc.

160 {
161 }

Member Data Documentation

std::string TrackEfficiencyClient::algoName_
private

Definition at line 73 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

edm::ParameterSet TrackEfficiencyClient::conf_
private

Definition at line 67 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and TrackEfficiencyClient().

DQMStore* TrackEfficiencyClient::dqmStore_
private

Definition at line 66 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

MonitorElement* TrackEfficiencyClient::effCompatibleLayers
private

Definition at line 82 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effD0
private

Definition at line 81 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effEta
private

Definition at line 79 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effPhi
private

Definition at line 80 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effX
private

Definition at line 76 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effY
private

Definition at line 77 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

MonitorElement* TrackEfficiencyClient::effZ
private

Definition at line 78 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

std::string TrackEfficiencyClient::FolderName_
private

Definition at line 74 of file TrackEfficiencyClient.h.

Referenced by beginJob(), endLuminosityBlock(), and TrackEfficiencyClient().

std::string TrackEfficiencyClient::histName
private

Definition at line 72 of file TrackEfficiencyClient.h.

Referenced by beginJob(), and endLuminosityBlock().

bool TrackEfficiencyClient::trackEfficiency_
private

Definition at line 69 of file TrackEfficiencyClient.h.

Referenced by endLuminosityBlock(), and TrackEfficiencyClient().