CMS 3D CMS Logo

muonisolation::IsolatorByDeposit Class Reference

#include <RecoMuon/MuonIsolation/interface/IsolatorByDeposit.h>

Inheritance diagram for muonisolation::IsolatorByDeposit:

muonisolation::MuIsoBaseIsolator

List of all members.

Public Types

typedef
MuIsoBaseIsolator::DepositContainer 
DepositContainer

Public Member Functions

virtual float coneSize (float eta, float pT) const
 Get the cone size.
 IsolatorByDeposit (const ConeSizeFunction *conesize, const std::vector< double > &weights, const std::vector< double > &thresh)
 IsolatorByDeposit (float conesize, const std::vector< double > &weights, const std::vector< double > &thresh)
 construct with non-default thresholds per deposit
 IsolatorByDeposit (const ConeSizeFunction *conesize, const std::vector< double > &weights)
 IsolatorByDeposit (float conesize, const std::vector< double > &weights)
 construct with no addtnl thresholds on deposits
virtual Result result (DepositContainer deposits) const
 Compute the deposit within the cone and return the isolation result.
virtual ResultType resultType () const
void setConeSize (ConeSizeFunction *conesize)
void setConeSize (float conesize)
 Compute the count of deposit within the cone and return the isolation result.
virtual void setWeights (const std::vector< double > &weights)
 Set the weights for summing deposits of different types.
virtual ~IsolatorByDeposit ()

Private Member Functions

double weightedSum (const DepositContainer &deposits, float dRcone) const

Private Attributes

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

Classes

struct  ConeSizeFunction


Detailed Description

Definition at line 19 of file IsolatorByDeposit.h.


Member Typedef Documentation

typedef MuIsoBaseIsolator::DepositContainer muonisolation::IsolatorByDeposit::DepositContainer

Reimplemented from muonisolation::MuIsoBaseIsolator.

Definition at line 21 of file IsolatorByDeposit.h.


Constructor & Destructor Documentation

muonisolation::IsolatorByDeposit::IsolatorByDeposit ( float  conesize,
const std::vector< double > &  weights 
)

construct with no addtnl thresholds on deposits

muonisolation::IsolatorByDeposit::IsolatorByDeposit ( const ConeSizeFunction conesize,
const std::vector< double > &  weights 
)

muonisolation::IsolatorByDeposit::IsolatorByDeposit ( float  conesize,
const std::vector< double > &  weights,
const std::vector< double > &  thresh 
)

construct with non-default thresholds per deposit

muonisolation::IsolatorByDeposit::IsolatorByDeposit ( const ConeSizeFunction conesize,
const std::vector< double > &  weights,
const std::vector< double > &  thresh 
)

virtual muonisolation::IsolatorByDeposit::~IsolatorByDeposit (  )  [inline, virtual]

Definition at line 37 of file IsolatorByDeposit.h.

00037 {}


Member Function Documentation

virtual float muonisolation::IsolatorByDeposit::coneSize ( float  eta,
float  pT 
) const [inline, virtual]

Get the cone size.

Definition at line 56 of file IsolatorByDeposit.h.

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

Referenced by result().

00056                                                     {
00057     return theConeSizeFunction ? theConeSizeFunction->coneSize(eta,pT) : theConeSize;
00058   }

MuIsoBaseIsolator::Result IsolatorByDeposit::result ( DepositContainer  deposits  )  const [virtual]

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

Definition at line 30 of file IsolatorByDeposit.cc.

References coneSize(), eta, res, resultType(), muonisolation::MuIsoBaseIsolator::Result::valFloat, and weightedSum().

Referenced by MuIsoByTrackPt::isolation().

00030                                                                                 {
00031   if (deposits.empty()) return Result(resultType());
00032 
00033   // To determine the threshold, the direction of the cone of the first
00034   // set of deposits is used.
00035   // For algorithms where different cone axis definitions are used
00036   // for different types deposits (eg. HCAL and ECAL deposits for
00037   // calorimeter isolation), the first one is used to determine the threshold
00038   // value!
00039   float eta = deposits.front().dep->eta();
00040   float pt = deposits.front().dep->candEnergy();
00041   float dr= coneSize(eta,pt);
00042   float sumDep = weightedSum(deposits,dr);
00043 
00044 
00045   Result res(resultType()); 
00046   res.valFloat = sumDep;
00047   return res;
00048 }

virtual ResultType muonisolation::IsolatorByDeposit::resultType (  )  const [inline, virtual]

Implements muonisolation::MuIsoBaseIsolator.

Definition at line 60 of file IsolatorByDeposit.h.

References muonisolation::MuIsoBaseIsolator::ISOL_FLOAT_TYPE.

Referenced by result().

00060 { return ISOL_FLOAT_TYPE;}

void muonisolation::IsolatorByDeposit::setConeSize ( ConeSizeFunction conesize  )  [inline]

Definition at line 52 of file IsolatorByDeposit.h.

References theConeSizeFunction.

00052 { theConeSizeFunction = conesize; }

void muonisolation::IsolatorByDeposit::setConeSize ( float  conesize  )  [inline]

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

Definition at line 50 of file IsolatorByDeposit.h.

References theConeSize, and theConeSizeFunction.

Referenced by MuIsoByTrackPt::setConeSize().

00050 { theConeSize = conesize; theConeSizeFunction = 0;} 

virtual void muonisolation::IsolatorByDeposit::setWeights ( const std::vector< double > &  weights  )  [inline, virtual]

Set the weights for summing deposits of different types.

Definition at line 40 of file IsolatorByDeposit.h.

References theWeights.

double IsolatorByDeposit::weightedSum ( const DepositContainer deposits,
float  dRcone 
) const [private]

Definition at line 51 of file IsolatorByDeposit.cc.

References theDepThresholds, theWeights, and w.

Referenced by result().

00052                                                    {
00053   double sumDep=0;
00054 
00055   assert(deposits.size()==theWeights.size());
00056 
00057   vector<double>::const_iterator w = theWeights.begin();
00058   vector<double>::const_iterator dThresh = theDepThresholds.begin();
00059 
00060   typedef DepositContainer::const_iterator DI;
00061   for (DI dep = deposits.begin(), depEnd = deposits.end(); dep != depEnd; ++dep) {
00062     if (dep->vetos != 0){
00063       sumDep += dep->dep->depositAndCountWithin(dRcone, *dep->vetos, (*dThresh)).first * (*w);
00064     } else {
00065       sumDep += dep->dep->depositAndCountWithin(dRcone, Vetos(), (*dThresh)).first * (*w);
00066     }
00067 //  cout << "IsolatorByDeposit: type = " << (*dep)->type() << " weight = " << (*w) << endl;
00068     w++;
00069     dThresh++;
00070   }
00071   return sumDep;
00072 }


Member Data Documentation

float muonisolation::IsolatorByDeposit::theConeSize [private]

Definition at line 69 of file IsolatorByDeposit.h.

Referenced by coneSize(), and setConeSize().

const ConeSizeFunction* muonisolation::IsolatorByDeposit::theConeSizeFunction [private]

Definition at line 68 of file IsolatorByDeposit.h.

Referenced by coneSize(), and setConeSize().

std::vector<double> muonisolation::IsolatorByDeposit::theDepThresholds [private]

Definition at line 71 of file IsolatorByDeposit.h.

Referenced by weightedSum().

std::vector<double> muonisolation::IsolatorByDeposit::theWeights [private]

Definition at line 70 of file IsolatorByDeposit.h.

Referenced by setWeights(), and weightedSum().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:49:13 2009 for CMSSW by  doxygen 1.5.4