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 edm::EDConsumerBase

Public Member Functions

 TrackEfficiencyClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~TrackEfficiencyClient ()
 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 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::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::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
 
- 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 27 of file TrackEfficiencyClient.cc.

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

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

Destructor.

Definition at line 44 of file TrackEfficiencyClient.cc.

46 {
47  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
48 }

Member Function Documentation

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

Analyze.

Implements edm::EDAnalyzer.

Definition at line 143 of file TrackEfficiencyClient.cc.

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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 52 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().

54 {
55 
57 
58  //
59  int effXBin = conf_.getParameter<int> ("effXBin");
60  double effXMin = conf_.getParameter<double>("effXMin");
61  double effXMax = conf_.getParameter<double>("effXMax");
62 
63  histName = "effX_";
64  effX = dqmStore_->book1D(histName+algoName_, histName+algoName_, effXBin, effXMin, effXMax);
65  if (effX->getTH1F()) effX->getTH1F()->Sumw2();
66  effX->setAxisTitle("");
67 
68 
69  //
70  int effYBin = conf_.getParameter<int> ("effYBin");
71  double effYMin = conf_.getParameter<double>("effYMin");
72  double effYMax = conf_.getParameter<double>("effYMax");
73 
74  histName = "effY_";
75  effY = dqmStore_->book1D(histName+algoName_, histName+algoName_, effYBin, effYMin, effYMax);
76  if (effY->getTH1F()) effY->getTH1F()->Sumw2();
77  effY->setAxisTitle("");
78 
79  //
80  int effZBin = conf_.getParameter<int> ("effZBin");
81  double effZMin = conf_.getParameter<double>("effZMin");
82  double effZMax = conf_.getParameter<double>("effZMax");
83 
84  histName = "effZ_";
85  effZ = dqmStore_->book1D(histName+algoName_, histName+algoName_, effZBin, effZMin, effZMax);
86  if (effZ->getTH1F()) effZ->getTH1F()->Sumw2();
87  effZ->setAxisTitle("");
88 
89  //
90  int effEtaBin = conf_.getParameter<int> ("effEtaBin");
91  double effEtaMin = conf_.getParameter<double>("effEtaMin");
92  double effEtaMax = conf_.getParameter<double>("effEtaMax");
93 
94  histName = "effEta_";
95  effEta = dqmStore_->book1D(histName+algoName_, histName+algoName_, effEtaBin, effEtaMin, effEtaMax);
96  if (effEta->getTH1F()) effEta->getTH1F()->Sumw2();
97  effEta->setAxisTitle("");
98 
99  //
100  int effPhiBin = conf_.getParameter<int> ("effPhiBin");
101  double effPhiMin = conf_.getParameter<double>("effPhiMin");
102  double effPhiMax = conf_.getParameter<double>("effPhiMax");
103 
104  histName = "effPhi_";
105  effPhi = dqmStore_->book1D(histName+algoName_, histName+algoName_, effPhiBin, effPhiMin, effPhiMax);
106  if (effPhi->getTH1F()) effPhi->getTH1F()->Sumw2();
107  effPhi->setAxisTitle("");
108 
109  //
110  int effD0Bin = conf_.getParameter<int> ("effD0Bin");
111  double effD0Min = conf_.getParameter<double>("effD0Min");
112  double effD0Max = conf_.getParameter<double>("effD0Max");
113 
114  histName = "effD0_";
115  effD0 = dqmStore_->book1D(histName+algoName_, histName+algoName_, effD0Bin, effD0Min, effD0Max);
116  if (effD0->getTH1F()) effD0->getTH1F()->Sumw2();
117  effD0->setAxisTitle("");
118 
119 
120  //
121  int effCompatibleLayersBin = conf_.getParameter<int> ("effCompatibleLayersBin");
122  double effCompatibleLayersMin = conf_.getParameter<double>("effCompatibleLayersMin");
123  double effCompatibleLayersMax = conf_.getParameter<double>("effCompatibleLayersMax");
124 
125  histName = "effCompatibleLayers_";
126  effCompatibleLayers = dqmStore_->book1D(histName+algoName_, histName+algoName_, effCompatibleLayersBin, effCompatibleLayersMin, effCompatibleLayersMax);
129 
130  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::beginJob done";
131 }
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:954
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:667
void TrackEfficiencyClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file TrackEfficiencyClient.cc.

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

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 150 of file TrackEfficiencyClient.cc.

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

End Luminosity Block.

Reimplemented from edm::EDAnalyzer.

Definition at line 163 of file TrackEfficiencyClient.cc.

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

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

EndRun.

Definition at line 156 of file TrackEfficiencyClient.cc.

158 {
159 }

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().