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 *=0) 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 *=0) 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 *=0) 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 17 of file IsolatorByDepositCount.h.

Member Typedef Documentation

Definition at line 19 of file IsolatorByDepositCount.h.

Constructor & Destructor Documentation

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::IsolatorByDepositCount ( const ConeSizeFunction conesize,
const std::vector< double > &  thresh 
)
muonisolation::IsolatorByDepositCount::~IsolatorByDepositCount ( )
overridedefault

Member Function Documentation

virtual float muonisolation::IsolatorByDepositCount::coneSize ( float  eta,
float  pT 
) const
inlinevirtual
MuIsoBaseIsolator::Result IsolatorByDepositCount::result ( const DepositContainer deposits,
const edm::Event = 0 
) const
overridevirtual

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

Implements muonisolation::MuIsoBaseIsolator.

Definition at line 16 of file IsolatorByDepositCount.cc.

References coneSize(), muonisolation::MuIsoBaseIsolator::DepositAndVetos::dep, reco::IsoDeposit::depositAndCountWithin(), runTauDisplay::dr, PVValHelper::eta, muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE, EnergyCorrector::pt, resultType(), theDepThresholds, muonisolation::MuIsoBaseIsolator::Result::valInt, and muonisolation::MuIsoBaseIsolator::DepositAndVetos::vetos.

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

Definition at line 36 of file IsolatorByDepositCount.h.

References theConeSize, and theConeSizeFunction.

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

Definition at line 38 of file IsolatorByDepositCount.h.

References theConeSizeFunction.

38 { theConeSizeFunction = conesize; }

Member Data Documentation

float muonisolation::IsolatorByDepositCount::theConeSize
private

Definition at line 51 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

const ConeSizeFunction* muonisolation::IsolatorByDepositCount::theConeSizeFunction
private

Definition at line 50 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

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

Definition at line 52 of file IsolatorByDepositCount.h.

Referenced by result().