19 float LeadingTracknormalizedChi2 = 0;
24 LeadingTracknormalizedChi2 = (
float)(tref -> normalizedChi2());
27 return LeadingTracknormalizedChi2;
31 std::vector<reco::PFCandidatePtr> constsignal = tau.
signalPFCands();
32 float EcalEnInSignalPFCands = 0;
33 float HcalEnInSignalPFCands = 0;
34 typedef std::vector <reco::PFCandidatePtr>::iterator constituents_iterator;
35 for(constituents_iterator it=constsignal.begin(); it != constsignal.end(); ++it) {
37 EcalEnInSignalPFCands += icand -> ecalEnergy();
38 HcalEnInSignalPFCands += icand -> hcalEnergy();
40 float total = EcalEnInSignalPFCands + HcalEnInSignalPFCands;
44 return EcalEnInSignalPFCands/
total;
49 float total = EcalEnInSignalCands + HcalEnInSignalCands;
53 return EcalEnInSignalCands/
total;
63 for (
const auto&
cand : cands) {
65 if ((
float)
cand->pt() < 0.5){
74 if (
mode == 2 || (
mode == 0 && dr < signalrad) || (
mode == 1 && dr > signalrad)) {
79 sum_dx_pt += pt * deta;
81 sum_dx_pt += pt * dphi;
85 if( (
mode==2 && flag==
false) || (
mode==1 && flag==
true) ||
mode==0){
90 sum_dx_pt += pt * deta;
92 sum_dx_pt += pt * dphi;
97 return sum_dx_pt/sum_pt;
103 float sum_dx_pt = 0.;
107 for (
const auto&
cand : cands) {
109 if (
cand->pt() < 0.5){
118 if (
mode == 2 || (
mode == 0 && dr < signalrad) || (
mode == 1 && dr > signalrad)) {
121 sum_dx_pt += pt *
dr;
123 sum_dx_pt += pt * deta;
125 sum_dx_pt += pt * dphi;
128 else if(is3prong==1){
129 if( (
mode==2 && flag==
false) || (
mode==1 && flag==
true) ||
mode==0){
132 sum_dx_pt += pt *
dr;
134 sum_dx_pt += pt * deta;
136 sum_dx_pt += pt * dphi;
141 return sum_dx_pt/sum_pt;
179 unsigned int n_photons = 0;
181 if ((
float)
cand->pt() > 0.5)
185 if ((
float)
cand->pt() > 0.5)
191 unsigned int n_photons = 0;
193 if (
cand->pt() > 0.5)
197 if (
cand->pt() > 0.5)
218 bool isInside(
float photon_pt,
float deta,
float dphi)
const {
219 const double stripEtaAssociationDistance_0p95_p0 = 0.197077;
220 const double stripEtaAssociationDistance_0p95_p1 = 0.658701;
221 const double stripPhiAssociationDistance_0p95_p0 = 0.352476;
222 const double stripPhiAssociationDistance_0p95_p1 = 0.707716;
226 if((dphi<0.3 && dphi<
std::max(0.05, stripPhiAssociationDistance_0p95_p0*
std::pow(photon_pt, -stripPhiAssociationDistance_0p95_p1))) && \
227 (deta<0.15 && deta<
std::max(0.05, stripEtaAssociationDistance_0p95_p0*
std::pow(photon_pt, -stripEtaAssociationDistance_0p95_p1)))){
float tau_pt_weighted_dr_signal(const pat::Tau &tau, int dm) const
virtual double pt() const final
transverse momentum
bool isNonnull() const
Checks for non-null.
float tau_Eratio(const reco::PFTau &tau) const
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
const PFCandidatePtr & leadPFChargedHadrCand() const
float tau_pt_weighted_deta_strip(const pat::Tau &tau, int dm) const
virtual double eta() const final
momentum pseudorapidity
const std::vector< reco::PFCandidatePtr > & getPFGammas(const reco::PFTau &tau, bool signal=true) const
return pf photon candidates that are associated to signal
reco::CandidatePtrVector getGammas(const pat::Tau &tau, bool signal=true) const
float tau_pt_weighted_dphi_strip(const pat::Tau &tau, int dm) const
const std::vector< reco::PFCandidatePtr > & signalPFGammaCands() const
Gamma candidates in signal region.
~TauIdMVAAuxiliaries()
default destructor
TauIdMVAAuxiliaries()
default constructor
float hcalEnergy() const
return sum of hcal energies from signal candidates
const std::vector< reco::PFCandidatePtr > & signalPFCands() const
PFCandidates in signal region.
reco::CandidatePtrVector signalGammaCands() const
const std::vector< reco::PFCandidatePtr > & isolationPFGammaCands() const
Gamma candidates in isolation region.
bool isInside(float photon_pt, float deta, float dphi) const
decide if photon candidate is inside the cone to be associated to the tau signal
virtual double phi() const final
momentum azimuthal angle
float tau_pt_weighted_dphi_strip(const reco::PFTau &tau, int dm) const
Abs< T >::type abs(const T &t)
auto deltaR(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
float tau_pt_weighted_dr_signal(const reco::PFTau &tau, int dm) const
float tau_leadTrackChi2(const reco::PFTau &tau) const
return chi2 of the leading track ==> deprecated? <==
Analysis-level tau class.
float tau_pt_weighted_dr_iso(const reco::PFTau &tau, int dm) const
bool isNonnull() const
Checks for non-null.
double deltaPhi(double phi1, double phi2)
float tau_pt_weighted_deta_strip(const reco::PFTau &tau, int dm) const
float pt_weighted_dx(const reco::PFTau &tau, int mode=0, int var=0, int decaymode=-1) const
float pt_weighted_dx(const pat::Tau &tau, int mode=0, int var=0, int decaymode=-1) const
reco::CandidatePtrVector isolationGammaCands() const
Power< A, B >::type pow(const A &a, const B &b)
float tau_Eratio(const pat::Tau &tau) const
float tau_pt_weighted_dr_iso(const pat::Tau &tau, int dm) const
unsigned int tau_n_photons_total(const pat::Tau &tau) const
unsigned int tau_n_photons_total(const reco::PFTau &tau) const
return total number of pf photon candidates with pT>500 MeV, which are associated to signal ...