CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
muonisolation::IsolatorByDepositCount Class Reference

#include <IsolatorByDepositCount.h>

Inheritance diagram for muonisolation::IsolatorByDepositCount:
muonisolation::MuIsoBaseIsolator

Classes

struct  ConeSizeFunction
 

Public Types

typedef MuIsoBaseIsolator::DepositContainer DepositContainer
 
- Public Types inherited from muonisolation::MuIsoBaseIsolator
typedef std::vector< DepositAndVetosDepositContainer
 
enum  ResultType { ISOL_INT_TYPE = 0, ISOL_FLOAT_TYPE, ISOL_BOOL_TYPE, ISOL_INVALID_TYPE }
 
typedef reco::IsoDeposit::Veto Veto
 
typedef reco::IsoDeposit::Vetos Vetos
 

Public Member Functions

virtual float coneSize (float eta, float pT) const
 Get the cone size. More...
 
 IsolatorByDepositCount (const ConeSizeFunction *conesize, const std::vector< double > &thresh)
 
 IsolatorByDepositCount (float conesize, const std::vector< double > &thresh)
 construct with non-default thresholds per deposit More...
 
Result result (const DepositContainer &deposits, const edm::Event *=nullptr) const override
 Compute the deposit within the cone and return the isolation result. More...
 
ResultType resultType () const override
 
void setConeSize (ConeSizeFunction *conesize)
 
void setConeSize (float conesize)
 
 ~IsolatorByDepositCount () override=default
 
- Public Member Functions inherited from muonisolation::MuIsoBaseIsolator
virtual Result result (const DepositContainer &deposits, const reco::Candidate &muon, const edm::Event *=nullptr) const
 Compute and return the isolation variable, with vetoes and the muon. More...
 
virtual Result result (const DepositContainer &deposits, const reco::Track &muon, const edm::Event *=nullptr) const
 Compute and return the isolation variable, with vetoes and the muon. More...
 
virtual ~MuIsoBaseIsolator ()
 

Private Attributes

float theConeSize
 
const ConeSizeFunctiontheConeSizeFunction
 
std::vector< double > theDepThresholds
 

Detailed Description

Definition at line 16 of file IsolatorByDepositCount.h.

Member Typedef Documentation

◆ DepositContainer

Definition at line 18 of file IsolatorByDepositCount.h.

Constructor & Destructor Documentation

◆ IsolatorByDepositCount() [1/2]

IsolatorByDepositCount::IsolatorByDepositCount ( float  conesize,
const std::vector< double > &  thresh 
)

construct with non-default thresholds per deposit

Definition at line 7 of file IsolatorByDepositCount.cc.

8  : theConeSizeFunction(nullptr), theConeSize(conesize), theDepThresholds(dThresh) {}

◆ IsolatorByDepositCount() [2/2]

IsolatorByDepositCount::IsolatorByDepositCount ( const ConeSizeFunction conesize,
const std::vector< double > &  thresh 
)

Definition at line 10 of file IsolatorByDepositCount.cc.

11  : theConeSizeFunction(conesize), theConeSize(0.), theDepThresholds(dThresh) {}

◆ ~IsolatorByDepositCount()

muonisolation::IsolatorByDepositCount::~IsolatorByDepositCount ( )
overridedefault

Member Function Documentation

◆ coneSize()

virtual float muonisolation::IsolatorByDepositCount::coneSize ( float  eta,
float  pT 
) const
inlinevirtual

◆ result()

MuIsoBaseIsolator::Result IsolatorByDepositCount::result ( const DepositContainer deposits,
const edm::Event = nullptr 
) const
overridevirtual

Compute the deposit within the cone and return the isolation result.

Implements muonisolation::MuIsoBaseIsolator.

Definition at line 13 of file IsolatorByDepositCount.cc.

13  {
14  if (deposits.empty())
15  return Result(resultType());
16  if (deposits.size() > 1) {
17  return Result(ISOL_INVALID_TYPE);
18  }
19 
20  // To determine the threshold, the direction of the cone of the first
21  // set of deposits is used.
22  // For algorithms where different cone axis definitions are used
23  // for different types deposits (eg. HCAL and ECAL deposits for
24  // calorimeter isolation), the first one is used to determine the threshold
25  // value!
26  float eta = deposits.front().dep->eta();
27  float pt = deposits.front().dep->candEnergy();
28  float dr = coneSize(eta, pt);
29  DepositAndVetos depVet = deposits.front();
30  std::pair<double, int> sumAndCount = depVet.dep->depositAndCountWithin(dr, *depVet.vetos, theDepThresholds.front());
31 
32  Result res(resultType());
33  res.valInt = sumAndCount.second;
34  return res;
35 }

References coneSize(), muonisolation::MuIsoBaseIsolator::DepositAndVetos::dep, reco::IsoDeposit::depositAndCountWithin(), CandIsolatorFromDeposits_cfi::deposits, flavorHistoryFilter_cfi::dr, PVValHelper::eta, muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE, DiDispStaMuonMonitor_cfi::pt, resultType(), theDepThresholds, and muonisolation::MuIsoBaseIsolator::DepositAndVetos::vetos.

◆ resultType()

ResultType muonisolation::IsolatorByDepositCount::resultType ( ) const
inlineoverridevirtual

Implements muonisolation::MuIsoBaseIsolator.

Definition at line 46 of file IsolatorByDepositCount.h.

46 { return ISOL_INT_TYPE; }

References muonisolation::MuIsoBaseIsolator::ISOL_INT_TYPE.

Referenced by result().

◆ setConeSize() [1/2]

void muonisolation::IsolatorByDepositCount::setConeSize ( ConeSizeFunction conesize)
inline

Definition at line 39 of file IsolatorByDepositCount.h.

39 { theConeSizeFunction = conesize; }

References theConeSizeFunction.

◆ setConeSize() [2/2]

void muonisolation::IsolatorByDepositCount::setConeSize ( float  conesize)
inline

Definition at line 34 of file IsolatorByDepositCount.h.

34  {
35  theConeSize = conesize;
36  theConeSizeFunction = nullptr;
37  }

References theConeSize, and theConeSizeFunction.

Member Data Documentation

◆ theConeSize

float muonisolation::IsolatorByDepositCount::theConeSize
private

Definition at line 50 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

◆ theConeSizeFunction

const ConeSizeFunction* muonisolation::IsolatorByDepositCount::theConeSizeFunction
private

Definition at line 49 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

◆ theDepThresholds

std::vector<double> muonisolation::IsolatorByDepositCount::theDepThresholds
private

Definition at line 51 of file IsolatorByDepositCount.h.

Referenced by result().

DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
muonisolation::IsolatorByDepositCount::theConeSizeFunction
const ConeSizeFunction * theConeSizeFunction
Definition: IsolatorByDepositCount.h:49
muonisolation::IsolatorByDepositCount::coneSize
virtual float coneSize(float eta, float pT) const
Get the cone size.
Definition: IsolatorByDepositCount.h:42
muonisolation::MuIsoBaseIsolator::ISOL_INT_TYPE
Definition: MuIsoBaseIsolator.h:25
PVValHelper::eta
Definition: PVValidationHelpers.h:70
PVValHelper::pT
Definition: PVValidationHelpers.h:71
muonisolation::IsolatorByDepositCount::resultType
ResultType resultType() const override
Definition: IsolatorByDepositCount.h:46
muonisolation::IsolatorByDepositCount::theConeSize
float theConeSize
Definition: IsolatorByDepositCount.h:50
res
Definition: Electron.h:6
muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE
Definition: MuIsoBaseIsolator.h:25
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
muonisolation::IsolatorByDepositCount::ConeSizeFunction::coneSize
virtual float coneSize(float eta, float pt) const =0
muonisolation::IsolatorByDepositCount::theDepThresholds
std::vector< double > theDepThresholds
Definition: IsolatorByDepositCount.h:51
CandIsolatorFromDeposits_cfi.deposits
deposits
Definition: CandIsolatorFromDeposits_cfi.py:4