8 #include <boost/foreach.hpp>
10 namespace reco {
namespace tau {
namespace disc {
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();
30 cand != cands.end(); ++cand) {
31 output.push_back(func(removeRef(*cand)));
51 for (
size_t itrk = 0; itrk < 3; ++itrk) {
65 if (ref != mainTrackRef)
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;
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) ?
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();
281 std::cout <<
" pt: " << cand->pt() <<
" type: " << cand->particleId() <<
" key: " << cand.
key() << std::endl;
285 std::cout <<
" pt: " << cand->pt() <<
" type: " << cand->particleId() <<
" key: " << cand.
key() << std::endl;
306 return (!trk) ? 0.0 : trk->pt();
311 return (!trk) ? 0.0 : trk->eta();
316 return (!trk) ? 0.0 :
deltaR(trk->p4(), tau.
p4());
double NeutralOutlierSumPt(Tau)
double IsolationECALSumHardRelative(Tau tau)
double ScaledPhiJetCollimation(Tau tau)
float isolationPFGammaCandsEtSum() const
const PFCandidateRefVector & isolationPFCands() const
PFCandidates in isolation region.
const PFJetRef & jetRef() const
float isolationPFChargedHadrCandsPtSum() const
VDouble ChargedOutlierPt(Tau)
double OutlierNCharged(Tau)
double ChargedOutlierSumPt(Tau)
std::vector< double > VDouble
double IsolationECALSumHard(Tau tau)
double SignalPtFraction(Tau tau)
double IsolationChargedSumSoftRelative(Tau tau)
const PFCandidateRefVector & signalPFChargedHadrCands() const
Charged hadrons in signal region.
double ScaledOpeningDeltaR(Tau tau)
double IsolationChargedPtFraction(Tau tau)
virtual double eta() const
momentum pseudorapidity
const PFCandidateRefVector & signalPFCands() const
PFCandidates in signal region.
VDouble InvariantMass(Tau)
double ScaledEtaJetCollimation(Tau tau)
double deltaR(double eta1, double phi1, double eta2, double phi2)
double ImpactParameterSignificance(Tau tau)
hadronicDecayMode decayMode() const
virtual double mass() const
mass
void dump(std::ostream &out=std::cout) const
prints information on this PFTau
VDouble OutlierAngle(Tau)
VDouble GammaOccupancy(Tau)
PFCandidateRef mainTrack(const PFTau &tau)
PFCandidateRefVector notMainTrack(Tau tau)
const T & max(const T &a, const T &b)
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
double IsolationChargedSumHard(Tau tau)
const PFCandidateRefVector & isolationPFGammaCands() const
Gamma candidates in isolation region.
double IsolationChargedAveragePtFraction(Tau tau)
virtual int charge() const
electric charge
const reco::Candidate::LorentzVector & axis_
double IsolationECALPtFraction(Tau tau)
double MainTrackPtFraction(Tau tau)
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
void reserve(size_type n)
Reserve space for RefVector.
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)
const PFCandidateRef & leadPFChargedHadrCand() const
const PFCandidateRefVector & signalPFGammaCands() const
Gamma candidates in signal region.
double IsolationChargedSumHardRelative(Tau tau)
virtual double pt() const
transverse momentum
double MainTrackAngle(Tau)
key_type key() const
Accessor for product key.
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)
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
size_type size() const
Size of the RefVector.
double OpeningDeltaR(Tau tau)
VDouble NeutralOutlierAngle(Tau)
double AbsJetEta(Tau tau)
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
double DecayMode(Tau tau)
VDouble NeutralOutlierPt(Tau)
double OpeningAngle3D(Tau tau)
const PFCandidateRefVector & isolationPFNeutrHadrCands() const
const PFCandidateRefVector & isolationPFChargedHadrCands() const
Charged candidates in isolation region.
T angle(T x1, T y1, T z1, T x2, T y2, T z2)