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 (float conesize, const std::vector< double > &thresh)
 construct with non-default thresholds per deposit More...
 
 IsolatorByDepositCount (const ConeSizeFunction *conesize, const std::vector< double > &thresh)
 
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 (float conesize)
 
void setConeSize (ConeSizeFunction *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.

◆ IsolatorByDepositCount() [2/2]

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

◆ ~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.

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.

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 }
Definition: Electron.h:6
virtual float coneSize(float eta, float pT) const
Get the cone size.

◆ resultType()

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

◆ setConeSize() [1/2]

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

◆ setConeSize() [2/2]

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

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