15 bool operator()(
const T& t1,
const T& t2)
const {
26 bool operator()(
const T& t1,
const T& t2)
const {
27 return t1->pt() > t2->pt();
32 class MultiTrackDRFilter {
34 MultiTrackDRFilter(
double deltaR,
const std::vector<reco::CandidatePtr>& trks)
37 bool operator()(
const T&
t)
const {
38 for(
auto const& trk :
tracks_) {
46 const std::vector<reco::CandidatePtr>&
tracks_;
49 double square(
double x) {
return x*x; }
52 std::vector<reco::PFCandidatePtr> convertRefCollection(
const T&
coll) {
53 std::vector<reco::PFCandidatePtr>
output;
54 output.reserve(coll.size());
55 for(
auto const&
cand : coll) {
56 output.push_back(
cand);
77 typedef std::list<reco::CandidatePtr> CandList;
83 std::back_inserter(output.
h0s));
85 std::vector<CandList*> courses;
86 courses.push_back(&(output.
h0s));
87 courses.push_back(&(output.
gammas));
90 double trackerEnergy =
track->energy();
91 double linkedEcalEnergy =
track->ecalEnergy();
92 double linkedHcalEnergy =
track->hcalEnergy();
95 double linkedSumErrSquared = 0;
96 linkedSumErrSquared +=
square(
97 resolutions_->getEnergyResolutionEm(linkedEcalEnergy, posAtCalo.eta()));
98 linkedSumErrSquared +=
square(
100 linkedHcalEnergy, posAtCalo.eta(), posAtCalo.phi()));
103 double energyDelta = linkedEcalEnergy + linkedHcalEnergy - trackerEnergy;
109 for(
auto* course : courses) {
111 course->sort(sorter);
112 CandList::iterator toEatIter = course->begin();
115 while (toEatIter != course->end()) {
117 double toEatEnergy = toEat.
energy();
122 linkedSumErrSquared + toEatErrorSq) <
maxSigmas_ ) {
123 energyDelta += toEatEnergy;
124 linkedSumErrSquared += toEatErrorSq;
125 toEatIter = course->erase(toEatIter);
138 std::remove_if(output.
h0s.begin(), output.
h0s.end(), hcalFinalFilter);
145 if (cand.
pdgId() == 130) {
149 }
else if (cand.
pdgId() == 22) {
156 <<
"Unknown PF PDG ID: " << cand.
pdgId();
164 if (cand.
pdgId() == 130) {
166 }
else if (cand.
pdgId() == 22 ||
171 <<
"Unknown PF PDG ID: " << cand.
pdgId();
T getParameter(std::string const &) const
std::list< reco::CandidatePtr > gammas
const reco::Candidate::LorentzVector axis_
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
const math::XYZPointF & positionAtECALEntrance() const
const std::vector< reco::CandidatePtr > & isolationGammaCands() const
Gamma candidates in isolation region.
RecoTauIsolationMasking(const edm::ParameterSet &pset)
virtual double energy() const =0
energy
virtual const LorentzVector & p4() const =0
four-momentum Lorentz vector
virtual int pdgId() const =0
PDG identifier.
Abs< T >::type abs(const T &t)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
virtual double eta() const =0
momentum pseudorapidity
static double square(double x)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const std::vector< reco::CandidatePtr > & signalChargedHadrCands() const
Charged hadrons in signal region.
Particle reconstructed by the particle flow algorithm.
const std::vector< reco::CandidatePtr > & tracks_
std::list< reco::CandidatePtr > h0s
const std::vector< reco::CandidatePtr > & isolationNeutrHadrCands() const
bool inCone(const reco::PFCandidate &track, const reco::Candidate &cand) const
~RecoTauIsolationMasking()
virtual double phi() const =0
momentum azimuthal angle
std::unique_ptr< PFEnergyResolution > resolutions_
double resolution(const reco::Candidate &cand) const
IsoMaskResult mask(const reco::PFTau &) const
Return a new isolation collections with masking applied.