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 31 of file MuIsoByTrackPt.h.

Constructor & Destructor Documentation

◆ MuIsoByTrackPt()

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

Definition at line 21 of file MuIsoByTrackPt.cc.

21  {
22  edm::ParameterSet extractorPSet = conf.getParameter<edm::ParameterSet>("ExtractorPSet");
23  string extractorName = extractorPSet.getParameter<string>("ComponentName");
24  theExtractor = IsoDepositExtractorFactoryFromHelper::get()->create(extractorName, extractorPSet, iC);
25 
26  theCut = conf.getUntrackedParameter<double>("Threshold", 0.);
27  float coneSize = conf.getUntrackedParameter<double>("ConeSize", 0.);
28  vector<double> weights(1, 1.);
29  theIsolator = std::make_unique<IsolatorByDeposit>(coneSize, weights);
30 }

References HLT_2018_cff::coneSize, get, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and HLT_2018_cff::weights.

◆ ~MuIsoByTrackPt()

MuIsoByTrackPt::~MuIsoByTrackPt ( )
overridedefault

Member Function Documentation

◆ extractor()

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

Definition at line 48 of file MuIsoByTrackPt.h.

48 { return theExtractor.get(); }

References theExtractor.

◆ isIsolated() [1/2]

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 47 of file MuIsoByTrackPt.cc.

47  {
48  return (isolation(ev, es, muon) > theCut);
49 }

References ev.

Referenced by isIsolated().

◆ isIsolated() [2/2]

bool MuIsoByTrackPt::isIsolated ( const edm::Event ev,
const edm::EventSetup es,
const reco::TrackRef muon 
)
inlineoverridevirtual

Implements MuIsoBaseAlgorithm.

Definition at line 41 of file MuIsoByTrackPt.h.

41  {
42  return isIsolated(ev, es, *muon);
43  }

References ev, and isIsolated().

◆ isolation() [1/2]

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 36 of file MuIsoByTrackPt.cc.

36  {
37  IsoDeposit dep = extractor()->deposit(ev, es, muon);
39  deposits.push_back(&dep);
40  if (isolator()->resultType() == MuIsoBaseIsolator::ISOL_FLOAT_TYPE) {
41  return isolator()->result(deposits).valFloat;
42  }
43 
44  return -999.;
45 }

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

Referenced by isolation().

◆ isolation() [2/2]

float MuIsoByTrackPt::isolation ( const edm::Event ev,
const edm::EventSetup es,
const reco::TrackRef muon 
)
inlineoverridevirtual

Implements MuIsoBaseAlgorithm.

Definition at line 37 of file MuIsoByTrackPt.h.

37  {
38  return isolation(ev, es, *muon);
39  }

References ev, and isolation().

◆ isolator()

virtual muonisolation::IsolatorByDeposit* MuIsoByTrackPt::isolator ( )
inlinevirtual

Definition at line 49 of file MuIsoByTrackPt.h.

49 { return theIsolator.get(); }

References theIsolator.

◆ setConeSize()

void MuIsoByTrackPt::setConeSize ( float  dr)

Definition at line 34 of file MuIsoByTrackPt.cc.

34 { theIsolator->setConeSize(dr); }

References flavorHistoryFilter_cfi::dr.

◆ setCut()

void MuIsoByTrackPt::setCut ( float  cut)
inline

Definition at line 46 of file MuIsoByTrackPt.h.

46 { theCut = cut; }

References TkAlMuonSelectors_cfi::cut, and theCut.

Member Data Documentation

◆ theCut

float MuIsoByTrackPt::theCut
private

Definition at line 52 of file MuIsoByTrackPt.h.

Referenced by setCut().

◆ theExtractor

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

Definition at line 53 of file MuIsoByTrackPt.h.

Referenced by extractor().

◆ theIsolator

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

Definition at line 54 of file MuIsoByTrackPt.h.

Referenced by isolator().

HLT_2018_cff.weights
weights
Definition: HLT_2018_cff.py:87167
TkAlMuonSelectors_cfi.cut
cut
Definition: TkAlMuonSelectors_cfi.py:5
muon
Definition: MuonCocktails.h:17
MuIsoByTrackPt::isolator
virtual muonisolation::IsolatorByDeposit * isolator()
Definition: MuIsoByTrackPt.h:49
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MuIsoByTrackPt::extractor
virtual reco::isodeposit::IsoDepositExtractor * extractor()
Definition: MuIsoByTrackPt.h:48
MuIsoByTrackPt::isIsolated
bool isIsolated(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
Definition: MuIsoByTrackPt.cc:47
MuIsoByTrackPt::theCut
float theCut
Definition: MuIsoByTrackPt.h:52
HLT_2018_cff.coneSize
coneSize
Definition: HLT_2018_cff.py:49353
MuIsoByTrackPt::theIsolator
std::unique_ptr< muonisolation::IsolatorByDeposit > theIsolator
Definition: MuIsoByTrackPt.h:54
edm::ParameterSet
Definition: ParameterSet.h:36
MuIsoByTrackPt::isolation
float isolation(const edm::Event &, const edm::EventSetup &, const reco::Track &muon) override
The isolation result for one muon.
Definition: MuIsoByTrackPt.cc:36
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
reco::isodeposit::IsoDepositExtractor::deposit
virtual reco::IsoDeposit deposit(const edm::Event &ev, const edm::EventSetup &evSetup, const reco::Track &track) const =0
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
MuIsoByTrackPt::theExtractor
std::unique_ptr< reco::isodeposit::IsoDepositExtractor > theExtractor
Definition: MuIsoByTrackPt.h:53
reco::IsoDeposit
Definition: IsoDeposit.h:49
muonisolation::MuIsoBaseIsolator::Result::valFloat
float valFloat
Definition: MuIsoBaseIsolator.h:36
muonisolation::MuIsoBaseIsolator::DepositContainer
std::vector< DepositAndVetos > DepositContainer
Definition: MuIsoBaseIsolator.h:23
muonisolation::IsolatorByDeposit::result
Result result(const DepositContainer &deposits, const edm::Event *=nullptr) const override
Compute the deposit within the cone and return the isolation result.
Definition: IsolatorByDeposit.cc:25
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4