8 #include <boost/foreach.hpp> 19 const RecoTauPiZero& removeRef(
const RecoTauPiZero& piZero) {
24 template<
typename Collection,
typename Function>
28 output.reserve(cands.size());
29 for(
typename Collection::const_iterator
cand = cands.begin();
31 output.push_back(
func(removeRef(*
cand)));
51 for (
size_t itrk = 0; itrk < 3; ++itrk) {
62 std::vector<PFCandidatePtr>
output;
65 if (ptr != mainTrackPtr)
66 output.push_back(ptr);
87 return tau.
jetRef()->eta();
121 return sum/tau.
jetRef()->pt();
126 tau.
jetRef()->etaetaMoment()));
131 double weightedDeltaR = 0;
133 double candEt = cand->et();
136 weightedDeltaR += candDeltaR*candEt;
138 return (sumEt > 0) ? weightedDeltaR/sumEt : 0.0;
143 double weightedAngle = 0;
145 double candE = cand->energy();
146 double candAngle =
angle(cand->p4(), tau.
p4());
148 weightedAngle += candAngle*candE;
150 return (sumE > 0) ? weightedAngle/sumE : 0.0;
155 const std::vector<PFCandidatePtr>& cands = tau.
signalPFCands();
156 for (
size_t i = 0;
i < cands.size()-1; ++
i) {
157 for (
size_t j =
i+1; j < cands.size(); ++j) {
158 double deltaRVal =
deltaR(cands[
i]->
p4(), cands[j]->
p4());
159 if (deltaRVal > max) {
168 return max*tau.
pt();;
173 tau.
jetRef()->phiphiMoment()));
178 double averagePt = (nIsoCharged) ?
189 std::vector<PFCandidatePtr> otherSignalTracks =
notMainTrack(tau);
192 output.reserve(otherSignalTracks.size() + pizeros.size());
196 output.push_back(p4.mass());
201 output.push_back(p4.mass());
210 BOOST_FOREACH(
double pt, isocands) {
221 BOOST_FOREACH(
double pt, isocands) {
241 BOOST_FOREACH(
double pt, isocands) {
252 BOOST_FOREACH(
double pt, isocands) {
271 gammaP4 += gamma->p4();
273 double result = gammaP4.pt()/tau.
pt();
276 LogDebug(
"TauDiscFunctions") <<
"EM fraction = " << result
278 LogDebug(
"TauDiscFunctions") <<
"charged" ;
280 LogDebug(
"TauDiscFunctions") <<
" pt: " << cand->pt() <<
" type: " << cand->particleId() <<
" key: " << cand.
key() ;
282 LogDebug(
"TauDiscFunctions") <<
"gammas" ;
284 LogDebug(
"TauDiscFunctions") <<
" pt: " << cand->pt() <<
" type: " << cand->particleId() <<
" key: " << cand.
key() ;
305 return (!trk) ? 0.0 : trk->pt();
310 return (!trk) ? 0.0 : trk->eta();
315 return (!trk) ? 0.0 :
deltaR(trk->p4(), tau.
p4());
double NeutralOutlierSumPt(Tau)
double IsolationECALSumHardRelative(Tau tau)
double ScaledPhiJetCollimation(Tau tau)
float isolationPFGammaCandsEtSum() const
const PFJetRef & jetRef() const
double eta() const final
momentum pseudorapidity
const std::vector< reco::PFCandidatePtr > & isolationPFCands() const
PFCandidates in isolation region.
float isolationPFChargedHadrCandsPtSum() const
const PFCandidatePtr & leadPFChargedHadrCand() const
VDouble ChargedOutlierPt(Tau)
double OutlierNCharged(Tau)
double ChargedOutlierSumPt(Tau)
std::vector< double > VDouble
const std::vector< reco::PFCandidatePtr > & signalPFGammaCands() const
Gamma candidates in signal region.
double IsolationECALSumHard(Tau tau)
double SignalPtFraction(Tau tau)
double pt() const final
transverse momentum
double IsolationChargedSumSoftRelative(Tau tau)
int charge() const final
electric charge
double ScaledOpeningDeltaR(Tau tau)
double IsolationChargedPtFraction(Tau tau)
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
const std::vector< reco::PFCandidatePtr > & isolationPFGammaCands() const
Gamma candidates in isolation region.
std::vector< PFCandidatePtr > notMainTrack(Tau tau)
VDouble InvariantMass(Tau)
double ScaledEtaJetCollimation(Tau tau)
double ImpactParameterSignificance(Tau tau)
hadronicDecayMode decayMode() const
VDouble OutlierAngle(Tau)
VDouble GammaOccupancy(Tau)
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
double IsolationChargedSumHard(Tau tau)
double IsolationChargedAveragePtFraction(Tau tau)
const reco::Candidate::LorentzVector & axis_
Abs< T >::type abs(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
const LorentzVector & p4() const final
four-momentum Lorentz vector
const std::vector< reco::PFCandidatePtr > & isolationPFNeutrHadrCands() const
double IsolationECALPtFraction(Tau tau)
double MainTrackPtFraction(Tau tau)
const std::vector< reco::PFCandidatePtr > & isolationPFChargedHadrCands() const
Charged candidates in isolation region.
VDouble InvariantMassOfSignalWithFiltered(Tau)
float leadPFChargedHadrCandsignedSipt() const
VDouble FilteredObjectPt(Tau)
VDouble ChargedOutlierAngle(Tau)
double EMFraction(Tau tau)
int extract(std::vector< int > *output, const std::string &dati)
double IsolationChargedSumHardRelative(Tau tau)
double MainTrackAngle(Tau)
double IsolationECALSumSoftRelative(Tau tau)
double IsolationChargedSumSoft(Tau tau)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
double IsolationNeutralHadronPtFraction(Tau tau)
double IsolationECALSumSoft(Tau tau)
double InvariantMassOfSignal(Tau tau)
double OpeningDeltaR(Tau tau)
VDouble NeutralOutlierAngle(Tau)
double AbsJetEta(Tau tau)
edm::Ptr< PFCandidate > PFCandidatePtr
persistent Ptr to a PFCandidate
PFCandidatePtr mainTrack(const PFTau &tau)
double DecayMode(Tau tau)
const std::vector< reco::PFCandidatePtr > & signalPFChargedHadrCands() const
Charged hadrons in signal region.
VDouble NeutralOutlierPt(Tau)
double OpeningAngle3D(Tau tau)
double mass() const final
mass
T angle(T x1, T y1, T z1, T x2, T y2, T z2)