CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
TrackEfficiencyClient Class Reference

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

Inheritance diagram for TrackEfficiencyClient:
DQMEDHarvester edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 TrackEfficiencyClient (const edm::ParameterSet &ps)
 Constructor. More...
 
virtual ~TrackEfficiencyClient ()
 Destructor. More...
 
- Public Member Functions inherited from DQMEDHarvester
virtual void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
 DQMEDHarvester (void)
 
virtual void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void endJob () override final
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override final
 
virtual void endRun (edm::Run const &, edm::EventSetup const &) override
 
virtual void produce (edm::Event &, edm::EventSetup const &) override final
 
virtual ~DQMEDHarvester ()=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::one::WatchRuns, edm::one::WatchLuminosityBlocks, edm::one::SharedResources, edm::EndLuminosityBlockProducer >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void beginJob (void)
 BeginJob. More...
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup)
 BeginRun. More...
 
void dqmEndJob (DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_)
 EndJob. 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 Member Functions

void bookMEs (DQMStore::IBooker &ibooker_)
 book MEs More...
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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 25 of file TrackEfficiencyClient.cc.

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

27 {
28  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
29 
30  FolderName_ = iConfig.getParameter<std::string>("FolderName");
31  algoName_ = iConfig.getParameter<std::string>("AlgoName");
32  trackEfficiency_ = iConfig.getParameter<bool>("trackEfficiency");
33 
34  conf_ = iConfig;
35 }
TrackEfficiencyClient::~TrackEfficiencyClient ( )
virtual

Destructor.

Definition at line 39 of file TrackEfficiencyClient.cc.

41 {
42  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::Deleting TrackEfficiencyClient ";
43 }

Member Function Documentation

void TrackEfficiencyClient::beginJob ( void  )
protectedvirtual

BeginJob.

Reimplemented from edm::one::EDProducerBase.

Definition at line 47 of file TrackEfficiencyClient.cc.

49 {
50 
51  edm::LogInfo("TrackEfficiencyClient") << "TrackEfficiencyClient::beginJob done";
52 }
void TrackEfficiencyClient::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
protectedvirtual

BeginRun.

Reimplemented from DQMEDHarvester.

Definition at line 56 of file TrackEfficiencyClient.cc.

58 {
59  edm::LogInfo ("TrackEfficiencyClient") <<"TrackEfficiencyClient:: Begining of Run";
60 }
void TrackEfficiencyClient::bookMEs ( DQMStore::IBooker ibooker_)
private

book MEs

Definition at line 63 of file TrackEfficiencyClient.cc.

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

Referenced by dqmEndJob().

65 {
66 
67  ibooker_.setCurrentFolder(FolderName_);
68 
69  //
70  int effXBin = conf_.getParameter<int> ("effXBin");
71  double effXMin = conf_.getParameter<double>("effXMin");
72  double effXMax = conf_.getParameter<double>("effXMax");
73 
74  histName = "effX_";
75  effX = ibooker_.book1D(histName+algoName_, histName+algoName_, effXBin, effXMin, effXMax);
76  if (effX->getTH1F()) effX->getTH1F()->Sumw2();
77  effX->setAxisTitle("");
78 
79 
80  //
81  int effYBin = conf_.getParameter<int> ("effYBin");
82  double effYMin = conf_.getParameter<double>("effYMin");
83  double effYMax = conf_.getParameter<double>("effYMax");
84 
85  histName = "effY_";
86  effY = ibooker_.book1D(histName+algoName_, histName+algoName_, effYBin, effYMin, effYMax);
87  if (effY->getTH1F()) effY->getTH1F()->Sumw2();
88  effY->setAxisTitle("");
89 
90  //
91  int effZBin = conf_.getParameter<int> ("effZBin");
92  double effZMin = conf_.getParameter<double>("effZMin");
93  double effZMax = conf_.getParameter<double>("effZMax");
94 
95  histName = "effZ_";
96  effZ = ibooker_.book1D(histName+algoName_, histName+algoName_, effZBin, effZMin, effZMax);
97  if (effZ->getTH1F()) effZ->getTH1F()->Sumw2();
98  effZ->setAxisTitle("");
99 
100  //
101  int effEtaBin = conf_.getParameter<int> ("effEtaBin");
102  double effEtaMin = conf_.getParameter<double>("effEtaMin");
103  double effEtaMax = conf_.getParameter<double>("effEtaMax");
104 
105  histName = "effEta_";
106  effEta = ibooker_.book1D(histName+algoName_, histName+algoName_, effEtaBin, effEtaMin, effEtaMax);
107  if (effEta->getTH1F()) effEta->getTH1F()->Sumw2();
108  effEta->setAxisTitle("");
109 
110  //
111  int effPhiBin = conf_.getParameter<int> ("effPhiBin");
112  double effPhiMin = conf_.getParameter<double>("effPhiMin");
113  double effPhiMax = conf_.getParameter<double>("effPhiMax");
114 
115  histName = "effPhi_";
116  effPhi = ibooker_.book1D(histName+algoName_, histName+algoName_, effPhiBin, effPhiMin, effPhiMax);
117  if (effPhi->getTH1F()) effPhi->getTH1F()->Sumw2();
118  effPhi->setAxisTitle("");
119 
120  //
121  int effD0Bin = conf_.getParameter<int> ("effD0Bin");
122  double effD0Min = conf_.getParameter<double>("effD0Min");
123  double effD0Max = conf_.getParameter<double>("effD0Max");
124 
125  histName = "effD0_";
126  effD0 = ibooker_.book1D(histName+algoName_, histName+algoName_, effD0Bin, effD0Min, effD0Max);
127  if (effD0->getTH1F()) effD0->getTH1F()->Sumw2();
128  effD0->setAxisTitle("");
129 
130 
131  //
132  int effCompatibleLayersBin = conf_.getParameter<int> ("effCompatibleLayersBin");
133  double effCompatibleLayersMin = conf_.getParameter<double>("effCompatibleLayersMin");
134  double effCompatibleLayersMax = conf_.getParameter<double>("effCompatibleLayersMax");
135 
136  histName = "effCompatibleLayers_";
137  effCompatibleLayers = ibooker_.book1D(histName+algoName_, histName+algoName_, effCompatibleLayersBin, effCompatibleLayersMin, effCompatibleLayersMax);
140 
141 }
T getParameter(std::string const &) const
MonitorElement * effCompatibleLayers
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
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 TrackEfficiencyClient::dqmEndJob ( DQMStore::IBooker ibooker_,
DQMStore::IGetter igetter_ 
)
protectedvirtual

EndJob.

Implements DQMEDHarvester.

Definition at line 144 of file TrackEfficiencyClient.cc.

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

146 {
147  edm::LogInfo( "TrackEfficiencyClient") << "TrackEfficiencyClient::endLuminosityBlock";
148 
149  bookMEs(ibooker_);
150 
151  histName = "/trackX_";
152  MonitorElement* trackX = igetter_.get(FolderName_+histName+algoName_);
153 
154  histName = "/muonX_";
155  MonitorElement* muonX = igetter_.get(FolderName_+histName+algoName_);
156 
157  histName = "/trackY_";
158  MonitorElement* trackY = igetter_.get(FolderName_+histName+algoName_);
159  histName = "/muonY_";
160  MonitorElement* muonY = igetter_.get(FolderName_+histName+algoName_);
161 
162  histName = "/trackZ_";
163  MonitorElement* trackZ = igetter_.get(FolderName_+histName+algoName_);
164  histName = "/muonZ_";
165  MonitorElement* muonZ = igetter_.get(FolderName_+histName+algoName_);
166 
167  histName = "/trackEta_";
169  histName = "/muonEta_";
171 
172  histName = "/trackPhi_";
174  histName = "/muonPhi_";
176 
177  histName = "/trackD0_";
178  MonitorElement* trackD0 = igetter_.get(FolderName_+histName+algoName_);
179  histName = "/muonD0_";
180  MonitorElement* muonD0 = igetter_.get(FolderName_+histName+algoName_);
181 
182  histName = "/trackCompatibleLayers_";
183  MonitorElement* trackCompatibleLayers = igetter_.get(FolderName_+histName+algoName_);
184  histName = "/muonCompatibleLayers_";
185  MonitorElement* muonCompatibleLayers = igetter_.get(FolderName_+histName+algoName_);
186 
187  if(trackX && muonX && trackY && muonY && trackZ && muonZ && trackEta && muonEta && trackPhi && muonPhi && trackD0 && muonD0 && trackCompatibleLayers && muonCompatibleLayers){
188  if (trackEfficiency_)
189  {
190  if (effX ->getTH1F() && trackX ->getTH1F() && muonX ->getTH1F()) { effX -> getTH1F()->Divide(trackX->getTH1F(),muonX->getTH1F(),1.,1.,"");}
191  if (effY ->getTH1F() && trackY ->getTH1F() && muonY ->getTH1F()) { effY -> getTH1F()->Divide(trackY->getTH1F(),muonY->getTH1F(),1.,1.,"");}
192  if (effZ ->getTH1F() && trackZ ->getTH1F() && muonZ ->getTH1F()) { effZ -> getTH1F()->Divide(trackZ->getTH1F(),muonZ->getTH1F(),1.,1.,"");}
193  if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(trackEta->getTH1F(),muonEta->getTH1F(),1.,1.,"");}
194  if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(trackPhi->getTH1F(),muonPhi->getTH1F(),1.,1.,"");}
195  if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0 -> getTH1F()->Divide(trackD0->getTH1F(),muonD0->getTH1F(),1.,1.,"");}
196  if (effCompatibleLayers->getTH1F() && trackCompatibleLayers->getTH1F() && muonCompatibleLayers->getTH1F()) { effCompatibleLayers -> getTH1F()->Divide(trackCompatibleLayers->getTH1F(),muonCompatibleLayers->getTH1F(),1.,1.,"");}
197  }
198  else {
199  if (effX ->getTH1F() && trackX ->getTH1F() && muonX ->getTH1F()) { effX -> getTH1F()->Divide(muonX->getTH1F(),trackX->getTH1F(),1.,1.,"");}
200  if (effY ->getTH1F() && trackY ->getTH1F() && muonY ->getTH1F()) { effY -> getTH1F()->Divide(muonY->getTH1F(),trackY->getTH1F(),1.,1.,"");}
201  if (effZ ->getTH1F() && trackZ ->getTH1F() && muonZ ->getTH1F()) { effZ -> getTH1F()->Divide(muonZ->getTH1F(),trackZ->getTH1F(),1.,1.,"");}
202  if (effEta->getTH1F() && trackEta->getTH1F() && muonEta->getTH1F()) { effEta -> getTH1F()->Divide(muonEta->getTH1F(),trackEta->getTH1F(),1.,1.,"");}
203  if (effPhi->getTH1F() && trackPhi->getTH1F() && muonPhi->getTH1F()) { effPhi -> getTH1F()->Divide(muonPhi->getTH1F(),trackPhi->getTH1F(),1.,1.,"");}
204  if (effD0 ->getTH1F() && trackD0 ->getTH1F() && muonD0 ->getTH1F()) { effD0 -> getTH1F()->Divide(muonD0->getTH1F(),trackD0->getTH1F(),1.,1.,"");}
205  }
206  }
207 
208 }
void bookMEs(DQMStore::IBooker &ibooker_)
book MEs
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:305
MonitorElement * effCompatibleLayers
TH1F * getTH1F(void) const

Member Data Documentation

std::string TrackEfficiencyClient::algoName_
private

Definition at line 66 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), dqmEndJob(), and TrackEfficiencyClient().

edm::ParameterSet TrackEfficiencyClient::conf_
private

Definition at line 60 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and TrackEfficiencyClient().

MonitorElement* TrackEfficiencyClient::effCompatibleLayers
private

Definition at line 75 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effD0
private

Definition at line 74 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effEta
private

Definition at line 72 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effPhi
private

Definition at line 73 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effX
private

Definition at line 69 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effY
private

Definition at line 70 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

MonitorElement* TrackEfficiencyClient::effZ
private

Definition at line 71 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

std::string TrackEfficiencyClient::FolderName_
private

Definition at line 67 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), dqmEndJob(), and TrackEfficiencyClient().

std::string TrackEfficiencyClient::histName
private

Definition at line 65 of file TrackEfficiencyClient.h.

Referenced by bookMEs(), and dqmEndJob().

bool TrackEfficiencyClient::trackEfficiency_
private

Definition at line 62 of file TrackEfficiencyClient.h.

Referenced by dqmEndJob(), and TrackEfficiencyClient().