#include <IsoDeposit.h>
Classes | |
class | const_iterator |
class | CountAlgo |
class | MaxAlgo |
class | Sum2Algo |
class | SumAlgo |
struct | Veto |
Public Types | |
typedef isodeposit::AbsVeto | AbsVeto |
typedef isodeposit::AbsVetos | AbsVetos |
typedef isodeposit::Direction | Direction |
typedef std::vector< Veto > | Vetos |
Public Member Functions | |
void | addCandEnergy (double et) |
Set energy or pT attached to cand trajectory. | |
void | addDeposit (double dr, double deposit) |
Add deposit (ie. transverse energy or pT) | |
void | addDeposit (const Direction &depDir, double deposit) |
template<typename Algo > | |
double | algoWithin (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
Get some info about the deposit (e.g. sum, max, sum2, count) | |
template<typename Algo > | |
double | algoWithin (const Direction &, double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
Get some info about the deposit (e.g. sum, max, sum2, count) w.r.t. other direction. | |
const_iterator | begin () const |
double | candEnergy () const |
Get energy or pT attached to cand trajectory. | |
double | countWithin (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
std::pair< double, int > | depositAndCountWithin (double coneSize, const AbsVetos &vetos, bool skipDepositVeto=false) const |
Get deposit. | |
std::pair< double, int > | depositAndCountWithin (double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const |
Get deposit. | |
std::pair< double, int > | depositAndCountWithin (Direction dir, double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const |
Get deposit wrt other direction. | |
double | depositWithin (double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const |
Get deposit. | |
double | depositWithin (Direction dir, double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const |
Get deposit wrt other direction. | |
double | depositWithin (double coneSize, const AbsVetos &vetos, bool skipDepositVeto=false) const |
Get deposit with new style vetos. | |
const Direction & | direction () const |
Get direction of isolation cone. | |
const_iterator | end () const |
double | eta () const |
IsoDeposit (const Direction &candDirection) | |
IsoDeposit (double eta=0, double phi=0) | |
Constructor. | |
double | maxWithin (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
double | nearestDR (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
double | phi () const |
std::string | print () const |
void | setVeto (const Veto &aVeto) |
Set veto. | |
double | sum2Within (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
double | sumWithin (double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
double | sumWithin (const Direction &dir, double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const |
const Veto & | veto () const |
Get veto area. | |
virtual | ~IsoDeposit () |
Destructor. | |
Private Types | |
typedef std::multimap < Distance, float > | DepositsMultimap |
typedef Direction::Distance | Distance |
the deposits identifed by relative position to center of cone and deposit value | |
Private Attributes | |
float | theCandTag |
float tagging cand, ment to be transverse energy or pT attached to cand, | |
DepositsMultimap | theDeposits |
Direction | theDirection |
direcion of deposit (center of isolation cone) | |
Veto | theVeto |
area to be excluded in computaion of depositWithin |
Definition at line 45 of file IsoDeposit.h.
Definition at line 49 of file IsoDeposit.h.
Definition at line 50 of file IsoDeposit.h.
typedef std::multimap<Distance, float> reco::IsoDeposit::DepositsMultimap [private] |
Definition at line 253 of file IsoDeposit.h.
Definition at line 48 of file IsoDeposit.h.
typedef Direction::Distance reco::IsoDeposit::Distance [private] |
the deposits identifed by relative position to center of cone and deposit value
Definition at line 252 of file IsoDeposit.h.
typedef std::vector<Veto> reco::IsoDeposit::Vetos |
Definition at line 58 of file IsoDeposit.h.
IsoDeposit::IsoDeposit | ( | double | eta = 0 , |
double | phi = 0 |
||
) |
Constructor.
Definition at line 16 of file IsoDeposit.cc.
References reco::IsoDeposit::Veto::dR, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
: theDirection(Direction(eta,phi)), theCandTag(0.) { theVeto.vetoDir = theDirection; theVeto.dR = 0.; }
IsoDeposit::IsoDeposit | ( | const Direction & | candDirection | ) |
Definition at line 9 of file IsoDeposit.cc.
References reco::IsoDeposit::Veto::dR, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
: theDirection(candDirection),theCandTag(0.) { theVeto.vetoDir = theDirection; theVeto.dR = 0.; }
virtual reco::IsoDeposit::~IsoDeposit | ( | ) | [inline, virtual] |
void reco::IsoDeposit::addCandEnergy | ( | double | et | ) | [inline] |
Set energy or pT attached to cand trajectory.
Definition at line 134 of file IsoDeposit.h.
References theCandTag.
Referenced by muonisolation::PixelTrackExtractor::deposit(), egammaisolation::EgammaTrackExtractor::deposit(), and muonisolation::CaloExtractorByAssociator::deposits().
{ theCandTag += et;}
void IsoDeposit::addDeposit | ( | double | dr, |
double | deposit | ||
) |
Add deposit (ie. transverse energy or pT)
Definition at line 23 of file IsoDeposit.cc.
References theDeposits.
Referenced by egammaisolation::EgammaRecHitExtractor::collect(), muonisolation::PixelTrackExtractor::deposit(), egammaisolation::EgammaTrackExtractor::deposit(), and muonisolation::CaloExtractorByAssociator::deposits().
{ Distance relDir = {float(dr),0.f}; theDeposits.insert( std::make_pair( relDir, value)); }
void IsoDeposit::addDeposit | ( | const Direction & | depDir, |
double | deposit | ||
) |
Definition at line 28 of file IsoDeposit.cc.
References theDeposits, and theDirection.
{ Distance relDir = depDir - theDirection; theDeposits.insert( std::make_pair( relDir,deposit)); }
double IsoDeposit::algoWithin | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Get some info about the deposit (e.g. sum, max, sum2, count)
Definition at line 261 of file IsoDeposit.h.
References reco::isodeposit::Direction::deltaR(), reco::IsoDeposit::Veto::dR, reco::isodeposit::Direction::eta(), reco::isodeposit::Direction::phi(), theDeposits, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
{ using namespace reco::isodeposit; Algo algo; typedef AbsVetos::const_iterator IV; IV ivEnd = vetos.end(); Distance maxDistance = {float(coneSize),999.f}; typedef DepositsMultimap::const_iterator IM; IM imLoc = theDeposits.upper_bound( maxDistance ); for (IM im = theDeposits.begin(); im != imLoc; ++im) { bool vetoed = false; Direction dirDep = theDirection+im->first; for (IV iv = vetos.begin(); iv < ivEnd; ++iv) { if ((*iv)->veto(dirDep.eta(), dirDep.phi(), im->second)) { vetoed = true; break; } } if (!vetoed) { if (skipDepositVeto || (dirDep.deltaR(theVeto.vetoDir) > theVeto.dR)) { algo += im->second; } } } return algo.result(); }
double IsoDeposit::algoWithin | ( | const Direction & | dir, |
double | coneSize, | ||
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Get some info about the deposit (e.g. sum, max, sum2, count) w.r.t. other direction.
Definition at line 287 of file IsoDeposit.h.
References reco::isodeposit::Direction::deltaR(), reco::isodeposit::Direction::Distance::deltaR, dir, reco::IsoDeposit::Veto::dR, reco::isodeposit::Direction::eta(), reco::isodeposit::Direction::phi(), theDeposits, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
{ using namespace reco::isodeposit; Algo algo; typedef AbsVetos::const_iterator IV; IV ivEnd = vetos.end(); typedef DepositsMultimap::const_iterator IM; IM imLoc = theDeposits.end(); for (IM im = theDeposits.begin(); im != imLoc; ++im) { bool vetoed = false; Direction dirDep = theDirection+im->first; Distance newDist = dirDep - dir; if(newDist.deltaR > coneSize) continue; for (IV iv = vetos.begin(); iv < ivEnd; ++iv) { if ((*iv)->veto(dirDep.eta(), dirDep.phi(), im->second)) { vetoed = true; break; } } if (!vetoed) { if (skipDepositVeto || (dirDep.deltaR(theVeto.vetoDir) > theVeto.dR)) { algo += im->second; } } } return algo.result(); }
const_iterator reco::IsoDeposit::begin | ( | void | ) | const [inline] |
Definition at line 158 of file IsoDeposit.h.
References theDeposits.
Referenced by ZMuMuIsolationAnalyzer::Deposits().
{ return const_iterator(this, theDeposits.begin()); }
double reco::IsoDeposit::candEnergy | ( | ) | const [inline] |
Get energy or pT attached to cand trajectory.
Definition at line 131 of file IsoDeposit.h.
References theCandTag.
Referenced by ZMuMuIsolationAnalyzer::analyze(), CandIsolatorFromDeposits::SingleDeposit::compute(), MuonIdProducer::fillMuonIsolation(), and pat::helper::IsoDepositIsolator::getValue().
{return theCandTag;}
double IsoDeposit::countWithin | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 134 of file IsoDeposit.cc.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute(), and pat::helper::IsoDepositIsolator::getValue().
{
return algoWithin<CountAlgo>(coneSize, vetos, skipDepositVeto);
}
std::pair< double, int > IsoDeposit::depositAndCountWithin | ( | double | coneSize, |
const Vetos & | vetos = Vetos() , |
||
double | threshold = -1e+36 , |
||
bool | skipDepositVeto = false |
||
) | const |
Get deposit.
Definition at line 44 of file IsoDeposit.cc.
References prof2calltree::count, reco::isodeposit::Direction::deltaR(), query::result, theDeposits, theDirection, and theVeto.
Referenced by depositWithin(), MuonIdProducer::fillMuonIsolation(), L3MuonIsolationProducer::produce(), and muonisolation::IsolatorByDepositCount::result().
{ double result = 0; int count = 0; Vetos allVetos = vetos; typedef Vetos::const_iterator IV; if (!skipDepositVeto) allVetos.push_back(theVeto); IV ivEnd = allVetos.end(); Distance maxDistance = {float(coneSize),999.f}; typedef DepositsMultimap::const_iterator IM; IM imLoc = theDeposits.upper_bound( maxDistance ); for (IM im = theDeposits.begin(); im != imLoc; ++im) { bool vetoed = false; for ( IV iv = allVetos.begin(); iv < ivEnd; ++iv) { Direction dirDep = theDirection+im->first; if (dirDep.deltaR(iv->vetoDir) < iv->dR) vetoed = true; } if (!vetoed && im->second > threshold){ result += im->second; count++; } } return std::pair<double,int>(result,count); }
std::pair< double, int > IsoDeposit::depositAndCountWithin | ( | Direction | dir, |
double | coneSize, | ||
const Vetos & | vetos = Vetos() , |
||
double | threshold = -1e+36 , |
||
bool | skipDepositVeto = false |
||
) | const |
Get deposit wrt other direction.
Definition at line 72 of file IsoDeposit.cc.
References prof2calltree::count, reco::isodeposit::Direction::deltaR(), reco::isodeposit::Direction::Distance::deltaR, dir, query::result, theDeposits, theDirection, and theVeto.
{ double result = 0; int count = 0; Vetos allVetos = vetos; typedef Vetos::const_iterator IV; if (!skipDepositVeto) allVetos.push_back(theVeto); IV ivEnd = allVetos.end(); typedef DepositsMultimap::const_iterator IM; for (IM im = theDeposits.begin(); im != theDeposits.end(); ++im) { bool vetoed = false; Direction dirDep = theDirection+im->first; Distance newDist = dirDep - dir; if (newDist.deltaR > coneSize) continue; for ( IV iv = allVetos.begin(); iv < ivEnd; ++iv) { if (dirDep.deltaR(iv->vetoDir) < iv->dR) vetoed = true; } if (!vetoed && im->second > threshold){ result += im->second; count++; } } return std::pair<double,int>(result,count); }
std::pair< double, int > IsoDeposit::depositAndCountWithin | ( | double | coneSize, |
const AbsVetos & | vetos, | ||
bool | skipDepositVeto = false |
||
) | const |
Get deposit.
Definition at line 100 of file IsoDeposit.cc.
References prof2calltree::count, reco::isodeposit::Direction::deltaR(), reco::IsoDeposit::Veto::dR, reco::isodeposit::Direction::eta(), reco::isodeposit::Direction::phi(), query::result, theDeposits, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
{ using namespace reco::isodeposit; double result = 0; int count = 0; typedef AbsVetos::const_iterator IV; IV ivEnd = vetos.end(); Distance maxDistance = {float(coneSize),999.f}; typedef DepositsMultimap::const_iterator IM; IM imLoc = theDeposits.upper_bound( maxDistance ); for (IM im = theDeposits.begin(); im != imLoc; ++im) { bool vetoed = false; Direction dirDep = theDirection+im->first; for ( IV iv = vetos.begin(); iv < ivEnd; ++iv) { if ((*iv)->veto(dirDep.eta(), dirDep.phi(), im->second)) { vetoed = true; break; } } if (!vetoed) { if (skipDepositVeto || (dirDep.deltaR(theVeto.vetoDir) > theVeto.dR)) { result += im->second; count++; } } } return std::pair<double,int>(result,count); }
double IsoDeposit::depositWithin | ( | Direction | dir, |
double | coneSize, | ||
const Vetos & | vetos = Vetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Get deposit wrt other direction.
Definition at line 39 of file IsoDeposit.cc.
References depositAndCountWithin().
{ return depositAndCountWithin(dir, coneSize, vetos, -1e+36, skipDepositVeto).first; }
double IsoDeposit::depositWithin | ( | double | coneSize, |
const Vetos & | vetos = Vetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Get deposit.
Definition at line 34 of file IsoDeposit.cc.
References depositAndCountWithin().
Referenced by MuonIdProducer::fillMuonIsolation(), and IsolationProducerForTracks::produce().
{ return depositAndCountWithin(coneSize, vetos, -1e+36, skipDepositVeto).first; }
double IsoDeposit::depositWithin | ( | double | coneSize, |
const AbsVetos & | vetos, | ||
bool | skipDepositVeto = false |
||
) | const |
Get deposit with new style vetos.
Definition at line 129 of file IsoDeposit.cc.
References depositAndCountWithin().
{ return depositAndCountWithin(coneSize, vetos, skipDepositVeto).first; }
const Direction& reco::IsoDeposit::direction | ( | ) | const [inline] |
Get direction of isolation cone.
Definition at line 68 of file IsoDeposit.h.
References theDirection.
Referenced by reco::IsoDeposit::const_iterator::doDir().
{ return theDirection; }
const_iterator reco::IsoDeposit::end | ( | void | ) | const [inline] |
Definition at line 159 of file IsoDeposit.h.
References theDeposits.
Referenced by ZMuMuIsolationAnalyzer::Deposits().
{ return const_iterator(this, theDeposits.end()); }
double reco::IsoDeposit::eta | ( | ) | const [inline] |
Definition at line 69 of file IsoDeposit.h.
References reco::isodeposit::Direction::eta(), and theDirection.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute(), and pat::helper::IsoDepositIsolator::getValue().
{return theDirection.eta();}
double IsoDeposit::maxWithin | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 150 of file IsoDeposit.cc.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute(), and pat::helper::IsoDepositIsolator::getValue().
{
return algoWithin<MaxAlgo>(coneSize, vetos, skipDepositVeto);
}
double IsoDeposit::nearestDR | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 155 of file IsoDeposit.cc.
References reco::isodeposit::Direction::deltaR(), reco::IsoDeposit::Veto::dR, reco::isodeposit::Direction::eta(), reco::isodeposit::Direction::phi(), query::result, theDeposits, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute().
{ using namespace reco::isodeposit; double result = coneSize; typedef AbsVetos::const_iterator IV; IV ivEnd = vetos.end(); Distance maxDistance = {float(coneSize),999.f}; typedef DepositsMultimap::const_iterator IM; IM imLoc = theDeposits.upper_bound( maxDistance ); for (IM im = theDeposits.begin(); im != imLoc; ++im) { bool vetoed = false; Direction dirDep = theDirection+im->first; for ( IV iv = vetos.begin(); iv < ivEnd; ++iv) { if ((*iv)->veto(dirDep.eta(), dirDep.phi(), im->second)) { vetoed = true; break; } } if (!vetoed) { if (skipDepositVeto || (dirDep.deltaR(theVeto.vetoDir) > theVeto.dR)) { result = ( dirDep.deltaR(theVeto.vetoDir) < result ) ? dirDep.deltaR(theVeto.vetoDir) : result; } } } return result; }
double reco::IsoDeposit::phi | ( | ) | const [inline] |
Definition at line 70 of file IsoDeposit.h.
References reco::isodeposit::Direction::phi(), and theDirection.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute(), and pat::helper::IsoDepositIsolator::getValue().
{return theDirection.phi();}
std::string IsoDeposit::print | ( | void | ) | const |
Definition at line 181 of file IsoDeposit.cc.
References reco::IsoDeposit::Veto::dR, reco::isodeposit::Direction::eta(), reco::isodeposit::Direction::phi(), reco::isodeposit::Direction::print(), theDeposits, theDirection, theVeto, and reco::IsoDeposit::Veto::vetoDir.
Referenced by HLTMuonIsoFilter::filter(), and L3MuonIsolationProducer::produce().
{ std::ostringstream str; str<<"Direction : "<<theDirection.print()<<std::endl; str<<"Veto: ("<<theVeto.vetoDir.eta()<<", "<<theVeto.vetoDir.phi()<<" dR="<<theVeto.dR<<")"<<std::endl; typedef DepositsMultimap::const_iterator IM; IM imEnd = theDeposits.end(); for (IM im = theDeposits.begin(); im != imEnd; ++im) { str<<"(dR="<< im->first.deltaR<<", alpha="<<im->first.relativeAngle<<", Pt="<<im->second<<"),"; } str<<std::endl; return str.str(); }
void reco::IsoDeposit::setVeto | ( | const Veto & | aVeto | ) | [inline] |
Set veto.
Definition at line 75 of file IsoDeposit.h.
References theVeto.
Referenced by muonisolation::PixelTrackExtractor::deposit(), egammaisolation::EgammaTrackExtractor::deposit(), and muonisolation::CaloExtractorByAssociator::deposits().
{ theVeto = aVeto; }
double IsoDeposit::sum2Within | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 146 of file IsoDeposit.cc.
Referenced by CandIsolatorFromDeposits::SingleDeposit::compute(), and pat::helper::IsoDepositIsolator::getValue().
{
return algoWithin<Sum2Algo>(coneSize, vetos, skipDepositVeto);
}
double IsoDeposit::sumWithin | ( | double | coneSize, |
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 138 of file IsoDeposit.cc.
Referenced by ZMuMuIsolationAnalyzer::analyze(), ZMuMu_Radiative_analyzer::analyze(), CandIsolatorFromDeposits::SingleDeposit::compute(), pat::helper::IsoDepositIsolator::getValue(), ZGlobalVsSAIsolationAnalyzer::isolated(), isolation(), ZToMuMuIsoDepositSelector< Isolator >::isolation(), ZMuMuTrackUserData::isolation(), and ZMuMuMuonUserData::isolation().
{
return algoWithin<SumAlgo>(coneSize, vetos, skipDepositVeto);
}
double IsoDeposit::sumWithin | ( | const Direction & | dir, |
double | coneSize, | ||
const AbsVetos & | vetos = AbsVetos() , |
||
bool | skipDepositVeto = false |
||
) | const |
Definition at line 142 of file IsoDeposit.cc.
References dir.
{ return algoWithin<SumAlgo>(dir, coneSize, vetos, skipDepositVeto); }
const Veto& reco::IsoDeposit::veto | ( | ) | const [inline] |
Get veto area.
Definition at line 73 of file IsoDeposit.h.
References theVeto.
Referenced by muonisolation::CaloExtractorByAssociator::deposits(), and L3MuonIsolationProducer::produce().
{ return theVeto; }
float reco::IsoDeposit::theCandTag [private] |
float tagging cand, ment to be transverse energy or pT attached to cand,
Definition at line 249 of file IsoDeposit.h.
Referenced by addCandEnergy(), and candEnergy().
Definition at line 255 of file IsoDeposit.h.
Referenced by addDeposit(), algoWithin(), begin(), depositAndCountWithin(), end(), nearestDR(), and print().
Direction reco::IsoDeposit::theDirection [private] |
direcion of deposit (center of isolation cone)
Definition at line 243 of file IsoDeposit.h.
Referenced by addDeposit(), algoWithin(), depositAndCountWithin(), direction(), eta(), IsoDeposit(), nearestDR(), phi(), and print().
Veto reco::IsoDeposit::theVeto [private] |
area to be excluded in computaion of depositWithin
Definition at line 246 of file IsoDeposit.h.
Referenced by algoWithin(), depositAndCountWithin(), IsoDeposit(), nearestDR(), print(), setVeto(), and veto().