31 isoDeposit.addCandEnergy(tauCandidate.pt());
39 for ( reco::PFTauCollection::const_iterator pfTau = pfTaus->begin();
40 pfTau != pfTaus->end(); ++pfTau ) {
41 double dR =
deltaR(pfTau->eta(), pfTau->phi(), tauCandidate.eta(), tauCandidate.phi());
42 if ( pfTau_matched == 0 || dR < dR_min ) {
44 pfTau_matched = &(*pfTau);
54 double dRsignalCone_max = 0.;
56 candidate != candidates->end(); ++candidate ) {
62 (candidate->vertex() - tauVertex).Rho() <
maxDxyTrack_ &&
63 fabs(candidate->vertex().z() - tauVertex.z()) <
maxDzTrack_ ) {
67 bool isSignalCone =
false;
68 for ( std::vector<reco::PFCandidatePtr>::const_iterator tauSignalConeConstituent = pfTau_matched->
signalPFCands().begin();
69 tauSignalConeConstituent != pfTau_matched->
signalPFCands().end(); ++tauSignalConeConstituent ) {
70 double dR =
deltaR(candidate->momentum(), (*tauSignalConeConstituent)->momentum());
74 if ( !isSignalCone ) {
76 isoDeposit.addDeposit(candidateDirection, candidate->pt());
86 isoDepositVeto.
vetoDir = tauCandidateDirection;
87 isoDepositVeto.
dR = dRsignalCone_max + 1.e-3;
88 isoDeposit.setVeto(isoDepositVeto);
90 edm::LogWarning (
"PFTauExtractor::depositFromObject") <<
" Failed to match PFTau to tauCandidate direction given by" 91 <<
" eta = " << tauCandidate.eta() <<
", phi = " << tauCandidate.phi()
92 <<
" --> skipping computation of IsoDeposit !!";
T getParameter(std::string const &) const
std::vector< PFTau > PFTauCollection
collection of PFTau objects
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
Vector momentum() const final
spatial momentum vector
const Point & vertex() const override
vertex position (overwritten by PF...)
math::XYZPoint Point
point in the space
double deltaR(double eta1, double eta2, double phi1, double phi2)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
#define DEFINE_EDM_PLUGIN(factory, type, name)