1 #include <boost/foreach.hpp>
16 bool operator()(
const T& t1,
const T& t2)
const {
27 bool operator()(
const T& t1,
const T& t2)
const {
28 return t1->pt() > t2->pt();
33 class MultiTrackDRFilter {
38 bool operator()(
const T&
t)
const {
50 double square(
double x) {
return x*
x; }
78 typedef std::list<reco::PFCandidateRef> PFCandList;
84 std::back_inserter(output.
h0s));
86 std::vector<PFCandList*> courses;
87 courses.push_back(&(output.
h0s));
88 courses.push_back(&(output.
gammas));
92 double trackerEnergy = track->energy();
93 double linkedEcalEnergy = track->ecalEnergy();
94 double linkedHcalEnergy = track->hcalEnergy();
97 double linkedSumErrSquared = 0;
98 linkedSumErrSquared +=
square(
99 resolutions_->getEnergyResolutionEm(linkedEcalEnergy, posAtCalo.eta()));
100 linkedSumErrSquared +=
square(
102 linkedHcalEnergy, posAtCalo.eta(), posAtCalo.phi()));
105 double energyDelta = linkedEcalEnergy + linkedHcalEnergy - trackerEnergy;
111 BOOST_FOREACH(PFCandList* course, courses) {
113 course->sort(sorter);
114 PFCandList::iterator toEatIter = course->begin();
117 while (toEatIter != course->end()) {
119 double toEatEnergy = toEat.
energy();
122 if (
inCone(*track, **toEatIter) &&
124 linkedSumErrSquared + toEatErrorSq) <
maxSigmas_ ) {
125 energyDelta += toEatEnergy;
126 linkedSumErrSquared += toEatErrorSq;
127 toEatIter = course->erase(toEatIter);
140 std::remove_if(output.
h0s.begin(), output.
h0s.end(), hcalFinalFilter);
std::list< reco::PFCandidateRef > gammas
T getParameter(std::string const &) const
double resolution(const reco::PFCandidate &cand) const
const PFCandidateRefVector & signalPFChargedHadrCands() const
Charged hadrons in signal region.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
std::auto_ptr< PFEnergyResolution > resolutions_
const_iterator end() const
Termination of iteration.
virtual double eta() const
momentum pseudorapidity
const math::XYZPointF & positionAtECALEntrance() const
const_iterator begin() const
Initialize an iterator over the RefVector.
double deltaR(double eta1, double phi1, double eta2, double phi2)
RecoTauIsolationMasking(const edm::ParameterSet &pset)
virtual double energy() const
energy
const PFCandidateRefVector & isolationPFGammaCands() const
Gamma candidates in isolation region.
const reco::Candidate::LorentzVector & axis_
bool inCone(const reco::PFCandidate &track, const reco::PFCandidate &cand) const
void reserve(size_type n)
Reserve space for RefVector.
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
const reco::PFCandidateRefVector & tracks_
std::list< reco::PFCandidateRef > h0s
virtual ParticleType particleId() const
~RecoTauIsolationMasking()
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
const PFCandidateRefVector & isolationPFNeutrHadrCands() const
IsoMaskResult mask(const reco::PFTau &) const
Return a new isolation collections with masking applied.