#include <IsolatorByDeposit.h>
Classes | |
struct | ConeSizeFunction |
Public Types | |
typedef MuIsoBaseIsolator::DepositContainer | DepositContainer |
Public Member Functions | |
virtual float | coneSize (float eta, float pT) const |
Get the cone size. | |
IsolatorByDeposit (float conesize, const std::vector< double > &weights) | |
construct with no addtnl thresholds on deposits | |
IsolatorByDeposit (const ConeSizeFunction *conesize, const std::vector< double > &weights, const std::vector< double > &thresh) | |
IsolatorByDeposit (const ConeSizeFunction *conesize, const std::vector< double > &weights) | |
IsolatorByDeposit (float conesize, const std::vector< double > &weights, const std::vector< double > &thresh) | |
construct with non-default thresholds per deposit | |
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 ConeSizeFunction * | theConeSizeFunction |
std::vector< double > | theDepThresholds |
std::vector< double > | theWeights |
Definition at line 19 of file IsolatorByDeposit.h.
Reimplemented from muonisolation::MuIsoBaseIsolator.
Definition at line 21 of file IsolatorByDeposit.h.
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.
{}
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().
{ return theConeSizeFunction ? theConeSizeFunction->coneSize(eta,pT) : theConeSize; }
MuIsoBaseIsolator::Result IsolatorByDeposit::result | ( | DepositContainer | deposits | ) | const [virtual] |
Compute the deposit within the cone and return the isolation result.
Implements muonisolation::MuIsoBaseIsolator.
Definition at line 30 of file IsolatorByDeposit.cc.
References coneSize(), eta(), ExpressReco_HICollisions_FallBack::pt, resultType(), muonisolation::MuIsoBaseIsolator::Result::valFloat, and weightedSum().
Referenced by MuIsoByTrackPt::isolation().
{ if (deposits.empty()) return Result(resultType()); // To determine the threshold, the direction of the cone of the first // set of deposits is used. // For algorithms where different cone axis definitions are used // for different types deposits (eg. HCAL and ECAL deposits for // calorimeter isolation), the first one is used to determine the threshold // value! float eta = deposits.front().dep->eta(); float pt = deposits.front().dep->candEnergy(); float dr= coneSize(eta,pt); float sumDep = weightedSum(deposits,dr); Result res(resultType()); res.valFloat = sumDep; return res; }
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().
{ return ISOL_FLOAT_TYPE;}
void muonisolation::IsolatorByDeposit::setConeSize | ( | ConeSizeFunction * | conesize | ) | [inline] |
Definition at line 52 of file IsolatorByDeposit.h.
References theConeSizeFunction.
{ 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().
{ 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, and ExpressReco_HICollisions_FallBack::weights.
double IsolatorByDeposit::weightedSum | ( | const DepositContainer & | deposits, |
float | dRcone | ||
) | const [private] |
Definition at line 51 of file IsolatorByDeposit.cc.
References theDepThresholds, and theWeights.
Referenced by result().
{ double sumDep=0; assert(deposits.size()==theWeights.size()); vector<double>::const_iterator w = theWeights.begin(); vector<double>::const_iterator dThresh = theDepThresholds.begin(); typedef DepositContainer::const_iterator DI; for (DI dep = deposits.begin(), depEnd = deposits.end(); dep != depEnd; ++dep) { if (dep->vetos != 0){ sumDep += dep->dep->depositAndCountWithin(dRcone, *dep->vetos, (*dThresh)).first * (*w); } else { sumDep += dep->dep->depositAndCountWithin(dRcone, Vetos(), (*dThresh)).first * (*w); } // cout << "IsolatorByDeposit: type = " << (*dep)->type() << " weight = " << (*w) << endl; w++; dThresh++; } return sumDep; }
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().