16 template<
class T>
T const& removePtr(
T const&
t) {
return t; }
17 template<
class T>
T const& removePtr(
edm::Ptr<T> const&
t) {
return *
t; }
19 template<
class T,
class F>
22 for(
auto const& x : cands)
output.push_back(
f(removePtr(x)));
41 for (
size_t itrk = 0; itrk < 3; ++itrk) {
52 std::vector<CandidatePtr>
output;
55 if (ptr != mainTrackPtr)
56 output.push_back(ptr);
77 return tau.
jetRef()->eta();
111 return sum/tau.
jetRef()->pt();
116 tau.
jetRef()->etaetaMoment()));
121 double weightedDeltaR = 0;
123 double candEt =
cand->et();
126 weightedDeltaR += candDeltaR*candEt;
128 return (sumEt > 0) ? weightedDeltaR/sumEt : 0.0;
133 double weightedAngle = 0;
135 double candE =
cand->energy();
138 weightedAngle += candAngle*candE;
140 return (sumE > 0) ? weightedAngle/sumE : 0.0;
145 const std::vector<CandidatePtr>& cands = tau.
signalCands();
146 for (
size_t i = 0;
i < cands.size()-1; ++
i) {
147 for (
size_t j =
i+1; j < cands.size(); ++j) {
148 double deltaRVal =
deltaR(cands[
i]->
p4(), cands[j]->
p4());
149 if (deltaRVal > max) {
158 return max*tau.
pt();;
163 tau.
jetRef()->phiphiMoment()));
168 double averagePt = (nIsoCharged) ?
179 std::vector<CandidatePtr> otherSignalTracks =
notMainTrack(tau);
182 output.reserve(otherSignalTracks.size() + pizeros.size());
184 for(
auto const& trk : otherSignalTracks) {
186 output.push_back(p4.mass());
189 for(
auto const& pizero : pizeros) {
191 output.push_back(p4.mass());
199 for(
double pt : isocands) {
209 for(
double pt : isocands) {
228 for(
double pt : isocands) {
238 for(
double pt : isocands) {
257 gammaP4 +=
gamma->p4();
259 double result = gammaP4.pt()/tau.
pt();
262 LogDebug(
"TauDiscFunctions") <<
"EM fraction = " << result
264 LogDebug(
"TauDiscFunctions") <<
"charged" ;
265 for(
auto const&
cand : tau.signalChargedHadrCands()) {
266 LogDebug(
"TauDiscFunctions") <<
" pt: " <<
cand->pt() <<
" pdgId: " <<
cand->pdgId() <<
" key: " <<
cand.key() ;
268 LogDebug(
"TauDiscFunctions") <<
"gammas" ;
269 for(
auto const&
cand : tau.signalGammaCands()) {
270 LogDebug(
"TauDiscFunctions") <<
" pt: " <<
cand->pt() <<
" pdgId: " <<
cand->pdgId() <<
" key: " <<
cand.key() ;
291 return (!trk) ? 0.0 : trk->pt();
296 return (!trk) ? 0.0 : trk->eta();
301 return (!trk) ? 0.0 :
deltaR(trk->p4(), tau.
p4());
double NeutralOutlierSumPt(Tau)
double IsolationECALSumHardRelative(Tau tau)
double ScaledPhiJetCollimation(Tau tau)
float isolationPFGammaCandsEtSum() const
double eta() const final
momentum pseudorapidity
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 pt() const final
transverse momentum
double IsolationChargedSumSoftRelative(Tau tau)
int charge() const final
electric charge
const std::vector< reco::CandidatePtr > & signalGammaCands() const
Gamma candidates in signal region.
double ScaledOpeningDeltaR(Tau tau)
double IsolationChargedPtFraction(Tau tau)
VDouble InvariantMass(Tau)
const std::vector< reco::CandidatePtr > & isolationGammaCands() const
Gamma candidates in isolation region.
double ScaledEtaJetCollimation(Tau tau)
double ImpactParameterSignificance(Tau tau)
hadronicDecayMode decayMode() const
VDouble OutlierAngle(Tau)
VDouble GammaOccupancy(Tau)
const CandidatePtr & leadChargedHadrCand() const
const std::vector< RecoTauPiZero > & signalPiZeroCandidates() const
Retrieve the association of signal region gamma candidates into candidate PiZeros.
double IsolationChargedSumHard(Tau tau)
const JetBaseRef & jetRef() const
double IsolationChargedAveragePtFraction(Tau tau)
const reco::Candidate::LorentzVector & axis_
Abs< T >::type abs(const T &t)
const LorentzVector & p4() const final
four-momentum Lorentz vector
double IsolationECALPtFraction(Tau tau)
double MainTrackPtFraction(Tau tau)
std::vector< CandidatePtr > notMainTrack(Tau tau)
VDouble InvariantMassOfSignalWithFiltered(Tau)
float leadPFChargedHadrCandsignedSipt() const
VDouble FilteredObjectPt(Tau)
VDouble ChargedOutlierAngle(Tau)
constexpr auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
double EMFraction(Tau tau)
int extract(std::vector< int > *output, const std::string &dati)
const std::vector< reco::CandidatePtr > & isolationChargedHadrCands() const
Charged candidates in isolation region.
virtual double eta() const =0
momentum pseudorapidity
double IsolationChargedSumHardRelative(Tau tau)
virtual double pt() const =0
transverse momentum
double MainTrackAngle(Tau)
double IsolationECALSumSoftRelative(Tau tau)
double IsolationChargedSumSoft(Tau tau)
math::XYZTLorentzVector LorentzVector
Lorentz vector.
const std::vector< reco::CandidatePtr > & signalChargedHadrCands() const
Charged hadrons in signal region.
CandidatePtr mainTrack(const PFTau &tau)
double IsolationNeutralHadronPtFraction(Tau tau)
double IsolationECALSumSoft(Tau tau)
double InvariantMassOfSignal(Tau tau)
const std::vector< reco::CandidatePtr > & isolationNeutrHadrCands() const
const std::vector< reco::CandidatePtr > & isolationCands() const
Candidates in isolation region.
double OpeningDeltaR(Tau tau)
VDouble NeutralOutlierAngle(Tau)
const std::vector< reco::CandidatePtr > & signalCands() const
Candidates in signal region.
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
double AbsJetEta(Tau tau)
double DecayMode(Tau tau)
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)