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 {
35 MultiTrackDRFilter(
double deltaR,
const std::vector<reco::PFCandidatePtr>& trks)
38 bool operator()(
const T&
t)
const {
47 const std::vector<reco::PFCandidatePtr>&
tracks_;
50 double square(
double x) {
return x*x; }
53 std::vector<reco::PFCandidatePtr> convertRefCollection(
const T&
coll) {
54 std::vector<reco::PFCandidatePtr>
output;
55 output.reserve(coll.size());
57 output.push_back(cand);
78 typedef std::list<reco::PFCandidatePtr> 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::PFCandidatePtr > h0s
T getParameter(std::string const &) const
const std::vector< reco::PFCandidatePtr > & tracks_
double resolution(const reco::PFCandidate &cand) const
double deltaR(const T1 &t1, const T2 &t2)
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
std::auto_ptr< PFEnergyResolution > resolutions_
virtual double eta() const
momentum pseudorapidity
const math::XYZPointF & positionAtECALEntrance() const
const std::vector< reco::PFCandidatePtr > & isolationPFGammaCands() const
Gamma candidates in isolation region.
RecoTauIsolationMasking(const edm::ParameterSet &pset)
virtual double energy() const
energy
const reco::Candidate::LorentzVector & axis_
bool inCone(const reco::PFCandidate &track, const reco::PFCandidate &cand) const
const std::vector< reco::PFCandidatePtr > & isolationPFNeutrHadrCands() const
std::list< reco::PFCandidatePtr > gammas
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Particle reconstructed by the particle flow algorithm.
double square(const double a)
virtual ParticleType particleId() const
~RecoTauIsolationMasking()
virtual double phi() const
momentum azimuthal angle
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
Charged hadrons in signal region.
IsoMaskResult mask(const reco::PFTau &) const
Return a new isolation collections with masking applied.