CMS 3D CMS Logo

Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes

muonisolation::IsolatorByDeposit Class Reference

#include <IsolatorByDeposit.h>

Inheritance diagram for muonisolation::IsolatorByDeposit:
muonisolation::MuIsoBaseIsolator

List of all members.

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 (const DepositContainer &deposits, const edm::Event *=0) 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

Detailed Description

Definition at line 19 of file IsolatorByDeposit.h.


Member Typedef Documentation

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.

{}

Member Function Documentation

virtual float muonisolation::IsolatorByDeposit::coneSize ( float  eta,
float  pT 
) const [inline, virtual]
MuIsoBaseIsolator::Result IsolatorByDeposit::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 30 of file IsolatorByDeposit.cc.

References coneSize(), eta(), 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.

{theWeights=weights;}
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().

                                                   {
  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;
}

Member Data Documentation

Definition at line 69 of file IsolatorByDeposit.h.

Referenced by coneSize(), and setConeSize().

Definition at line 68 of file IsolatorByDeposit.h.

Referenced by coneSize(), and setConeSize().

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