1 #ifndef RecoCandidate_IsoDeposit_H
2 #define RecoCandidate_IsoDeposit_H
31 namespace isodeposit {
35 virtual bool veto(
double eta,
double phi,
float value)
const = 0;
39 throw cms::Exception(
"Not Implemented") <<
"This AbsVeto implementation (" <<
typeid(
this).
name()
40 <<
") does not support the centerOn(eta,phi) method";
65 typedef std::vector<Veto>
Vetos;
91 bool skipDepositVeto =
false
98 bool skipDepositVeto =
false
105 bool skipDepositVeto =
false
113 bool skipDepositVeto =
false
119 bool skipDepositVeto =
false
125 bool skipDepositVeto =
false
144 float dR()
const {
return it_->first.deltaR; }
169 std::multimap<Distance, float>::const_iterator
it_;
210 if (deposit->second >
max_)
211 max_ = deposit->second;
227 sum_ += deposit->first.deltaR;
248 template <
typename Algo>
251 bool skipDepositVeto =
false
254 template <
typename Algo>
258 bool skipDepositVeto =
false
263 bool skipDepositVeto =
false
268 bool skipDepositVeto =
false
274 bool skipDepositVeto =
false
278 bool skipDepositVeto =
false
283 bool skipDepositVeto =
false
288 bool skipDepositVeto =
false
308 template <
typename Algo>
310 using namespace reco::isodeposit;
312 typedef AbsVetos::const_iterator IV;
313 IV ivEnd = vetos.end();
315 Distance maxDistance = {float(coneSize), 999.f};
316 typedef DepositsMultimap::const_iterator IM;
318 for (IM im =
theDeposits.begin(); im != imLoc; ++im) {
321 for (IV
iv = vetos.begin();
iv < ivEnd; ++
iv) {
322 if ((*iv)->veto(dirDep.
eta(), dirDep.
phi(), im->second)) {
333 return algo.result();
336 template <
typename Algo>
340 bool skipDepositVeto)
const {
341 using namespace reco::isodeposit;
343 typedef AbsVetos::const_iterator IV;
344 IV ivEnd = vetos.end();
345 typedef DepositsMultimap::const_iterator IM;
347 for (IM im =
theDeposits.begin(); im != imLoc; ++im) {
351 if (newDist.
deltaR > coneSize)
353 for (IV
iv = vetos.begin();
iv < ivEnd; ++
iv) {
354 if ((*iv)->veto(dirDep.
eta(), dirDep.
phi(), im->second)) {
365 return algo.result();
double candEnergy() const
Get energy or pT attached to cand trajectory.
const Direction & direction() const
Get direction of isolation cone.
double sum2Within(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
virtual void centerOn(double eta, double phi)
const Veto & veto() const
Get veto area.
void operator+=(double deposit)
virtual bool veto(double eta, double phi, float value) const =0
Return "true" if a deposit at specific (eta,phi) with that value must be vetoed in the sum...
void operator+=(DepIterator deposit)
DepositsMultimap::const_iterator DepIterator
void setVeto(const Veto &aVeto)
Set veto.
double algoWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Get some info about the deposit (e.g. sum, max, sum2, count)
const reco::IsoDeposit * parent_
Direction::Distance Distance
double countWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
void operator+=(DepIterator deposit)
virtual ~IsoDeposit()
Destructor.
double maxWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
Veto(Direction dir, double d)
void addDeposit(double dr, double deposit)
Add deposit (ie. transverse energy or pT)
double sumWithin(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
void operator+=(double deposit)
void operator+=(DepIterator deposit)
std::atomic< bool > cacheReady_
void operator+=(DepIterator deposit)
double depositWithin(double coneSize, const Vetos &vetos=Vetos(), bool skipDepositVeto=false) const
Get deposit.
const const_iterator * operator->() const
Veto theVeto
area to be excluded in computaion of depositWithin
void operator+=(DepIterator deposit)
DepositsMultimap theDeposits
the deposits identifed by relative position to center of cone and deposit value
double nearestDR(double coneSize, const AbsVetos &vetos=AbsVetos(), bool skipDepositVeto=false) const
const const_iterator & operator++()
void addCandEnergy(double et)
Set energy or pT attached to cand trajectory.
std::multimap< Distance, float > DepositsMultimap
const_iterator begin() const
std::multimap< Distance, float >::const_iterator it_
const_iterator(const IsoDeposit *parent, std::multimap< Distance, float >::const_iterator it)
void operator+=(double deposit)
isodeposit::AbsVeto AbsVeto
std::vector< Veto > Vetos
std::pair< double, int > depositAndCountWithin(double coneSize, const Vetos &vetos=Vetos(), double threshold=-1e+36, bool skipDepositVeto=false) const
Get deposit.
std::string print() const
std::vector< AbsVeto * > AbsVetos
void operator+=(DepIterator deposit)
isodeposit::Direction Direction
float theCandTag
float tagging cand, ment to be transverse energy or pT attached to cand,
Direction theDirection
direcion of deposit (center of isolation cone)
isodeposit::AbsVetos AbsVetos
const_iterator end() const
bool operator!=(const const_iterator &it2)
void operator+=(double deposit)
IsoDeposit(double eta=0, double phi=0)
Constructor.
Direction::Distance Distance
double deltaR(const Direction &dir2) const