CMS 3D CMS Logo

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

#include <MuIsoByTrackPt.h>

Inheritance diagram for MuIsoByTrackPt:
MuIsoBaseAlgorithm

Public Member Functions

virtual reco::isodeposit::IsoDepositExtractorextractor ()
 
bool isIsolated (const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
 
bool isIsolated (const edm::Event &ev, const edm::EventSetup &es, const reco::TrackRef &muon) override
 
float isolation (const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
 The isolation result for one muon. More...
 
float isolation (const edm::Event &ev, const edm::EventSetup &es, const reco::TrackRef &muon) override
 
virtual muonisolation::IsolatorByDepositisolator ()
 
 MuIsoByTrackPt (const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
 
void setConeSize (float dr)
 
void setCut (float cut)
 
 ~MuIsoByTrackPt () override
 
- Public Member Functions inherited from MuIsoBaseAlgorithm
virtual ~MuIsoBaseAlgorithm ()
 Destructor. More...
 

Private Attributes

float theCut
 
std::unique_ptr< reco::isodeposit::IsoDepositExtractortheExtractor
 
std::unique_ptr< muonisolation::IsolatorByDeposittheIsolator
 

Detailed Description

Definition at line 16 of file MuIsoByTrackPt.h.

Constructor & Destructor Documentation

MuIsoByTrackPt::MuIsoByTrackPt ( const edm::ParameterSet conf,
edm::ConsumesCollector &&  iC 
)

Definition at line 22 of file MuIsoByTrackPt.cc.

References highPtTrackIsolations_cff::coneSize, reco::get(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), HGCalRecHit_cfi::weights, and ~MuIsoByTrackPt().

23 {
24  edm::ParameterSet extractorPSet = conf.getParameter<edm::ParameterSet>("ExtractorPSet");
25  string extractorName = extractorPSet.getParameter<string>("ComponentName");
26  theExtractor = std::unique_ptr<reco::isodeposit::IsoDepositExtractor>(IsoDepositExtractorFactoryFromHelper::get()->create(extractorName, extractorPSet, iC));
27 
28  theCut = conf.getUntrackedParameter<double>("Threshold", 0.);
29  float coneSize = conf.getUntrackedParameter<double>("ConeSize", 0.);
30  vector<double> weights(1,1.);
31  theIsolator = std::make_unique<IsolatorByDeposit>(coneSize, weights);
32 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
std::unique_ptr< muonisolation::IsolatorByDeposit > theIsolator
T get(const Candidate &c)
Definition: component.h:55
MuIsoByTrackPt::~MuIsoByTrackPt ( )
overridedefault

Referenced by MuIsoByTrackPt().

Member Function Documentation

virtual reco::isodeposit::IsoDepositExtractor* MuIsoByTrackPt::extractor ( )
inlinevirtual

Definition at line 35 of file MuIsoByTrackPt.h.

35 { return theExtractor.get(); }
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
bool MuIsoByTrackPt::isIsolated ( const edm::Event ,
const edm::EventSetup ,
const reco::Track muon 
)
overridevirtual

Return logical result of isolaton is all parameters and cuts are fixe (may remain not implemented for all types of isolation)

Implements MuIsoBaseAlgorithm.

Definition at line 53 of file MuIsoByTrackPt.cc.

54 {
55  return (isolation(ev,es,muon) > theCut);
56 }
bool ev
float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
The isolation result for one muon.
bool MuIsoByTrackPt::isIsolated ( const edm::Event ev,
const edm::EventSetup es,
const reco::TrackRef muon 
)
inlineoverridevirtual

Implements MuIsoBaseAlgorithm.

Definition at line 27 of file MuIsoByTrackPt.h.

References runTauDisplay::dr.

28  {
29  return isIsolated(ev, es, *muon);
30  }
bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
float MuIsoByTrackPt::isolation ( const edm::Event ,
const edm::EventSetup ,
const reco::Track muon 
)
overridevirtual

The isolation result for one muon.

Implements MuIsoBaseAlgorithm.

Definition at line 41 of file MuIsoByTrackPt.cc.

References CandIsolatorFromDeposits_cfi::deposits, and muonisolation::MuIsoBaseIsolator::ISOL_FLOAT_TYPE.

42 {
43  IsoDeposit dep = extractor()->deposit(ev,es,muon);
45  deposits.push_back(&dep);
46  if (isolator()->resultType() == MuIsoBaseIsolator::ISOL_FLOAT_TYPE){
47  return isolator()->result(deposits).valFloat;
48  }
49 
50  return -999.;
51 }
Result result(const DepositContainer &deposits, const edm::Event *=0) const override
Compute the deposit within the cone and return the isolation result.
virtual muonisolation::IsolatorByDeposit * isolator()
virtual reco::isodeposit::IsoDepositExtractor * extractor()
bool ev
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const =0
std::vector< DepositAndVetos > DepositContainer
float MuIsoByTrackPt::isolation ( const edm::Event ev,
const edm::EventSetup es,
const reco::TrackRef muon 
)
inlineoverridevirtual

Implements MuIsoBaseAlgorithm.

Definition at line 22 of file MuIsoByTrackPt.h.

23  {
24  return isolation(ev, es, *muon);
25  }
float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
The isolation result for one muon.
virtual muonisolation::IsolatorByDeposit* MuIsoByTrackPt::isolator ( )
inlinevirtual

Definition at line 36 of file MuIsoByTrackPt.h.

36 { return theIsolator.get(); }
std::unique_ptr< muonisolation::IsolatorByDeposit > theIsolator
void MuIsoByTrackPt::setConeSize ( float  dr)

Definition at line 36 of file MuIsoByTrackPt.cc.

37 {
38  theIsolator->setConeSize(dr);
39 }
std::unique_ptr< muonisolation::IsolatorByDeposit > theIsolator
void MuIsoByTrackPt::setCut ( float  cut)
inline

Definition at line 33 of file MuIsoByTrackPt.h.

References TkAlMuonSelectors_cfi::cut.

Member Data Documentation

float MuIsoByTrackPt::theCut
private

Definition at line 39 of file MuIsoByTrackPt.h.

std::unique_ptr<reco::isodeposit::IsoDepositExtractor> MuIsoByTrackPt::theExtractor
private

Definition at line 40 of file MuIsoByTrackPt.h.

std::unique_ptr<muonisolation::IsolatorByDeposit> MuIsoByTrackPt::theIsolator
private

Definition at line 41 of file MuIsoByTrackPt.h.