CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< DepositAndVetos
DepositContainer
 
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)
 
virtual Result result (const DepositContainer &deposits, const edm::Event *=0) const
 Compute the deposit within the cone and return the isolation result. More...
 
virtual ResultType resultType () const
 
void setConeSize (float conesize)
 
void setConeSize (ConeSizeFunction *conesize)
 
virtual ~IsolatorByDepositCount ()
 
- 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 19 of file IsolatorByDepositCount.h.

Member Typedef Documentation

Definition at line 21 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 
)

Definition at line 11 of file IsolatorByDepositCount.cc.

virtual muonisolation::IsolatorByDepositCount::~IsolatorByDepositCount ( )
inlinevirtual

Definition at line 31 of file IsolatorByDepositCount.h.

31 {}

Member Function Documentation

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

Get the cone size.

Definition at line 43 of file IsolatorByDepositCount.h.

References muonisolation::IsolatorByDepositCount::ConeSizeFunction::coneSize(), theConeSize, and theConeSizeFunction.

Referenced by result().

43  {
45  }
virtual float coneSize(float eta, float pt) const =0
T eta() const
MuIsoBaseIsolator::Result IsolatorByDepositCount::result ( const DepositContainer deposits,
const edm::Event = 0 
) const
virtual

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(), eta(), muonisolation::MuIsoBaseIsolator::ISOL_INVALID_TYPE, 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 }
T eta() const
virtual float coneSize(float eta, float pT) const
Get the cone size.
virtual ResultType muonisolation::IsolatorByDepositCount::resultType ( ) const
inlinevirtual
void muonisolation::IsolatorByDepositCount::setConeSize ( float  conesize)
inline
void muonisolation::IsolatorByDepositCount::setConeSize ( ConeSizeFunction conesize)
inline

Definition at line 39 of file IsolatorByDepositCount.h.

References theConeSizeFunction.

39 { theConeSizeFunction = conesize; }

Member Data Documentation

float muonisolation::IsolatorByDepositCount::theConeSize
private

Definition at line 52 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

const ConeSizeFunction* muonisolation::IsolatorByDepositCount::theConeSizeFunction
private

Definition at line 51 of file IsolatorByDepositCount.h.

Referenced by coneSize(), and setConeSize().

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

Definition at line 53 of file IsolatorByDepositCount.h.

Referenced by result().