24 float LeadingTracknormalizedChi2 = 0;
29 LeadingTracknormalizedChi2 = (
float)(tref -> normalizedChi2());
32 return LeadingTracknormalizedChi2;
36 std::vector<reco::PFCandidatePtr> constsignal = tau.
signalPFCands();
37 float EcalEnInSignalPFCands = 0;
38 float HcalEnInSignalPFCands = 0;
39 typedef std::vector <reco::PFCandidatePtr>::iterator constituents_iterator;
40 for(constituents_iterator it=constsignal.begin(); it != constsignal.end(); ++it) {
42 EcalEnInSignalPFCands += icand -> ecalEnergy();
43 HcalEnInSignalPFCands += icand -> hcalEnergy();
45 float total = EcalEnInSignalPFCands + HcalEnInSignalPFCands;
49 return EcalEnInSignalPFCands/
total;
54 float total = EcalEnInSignalCands + HcalEnInSignalCands;
58 return EcalEnInSignalCands/
total;
68 for (
const auto&
cand : cands) {
70 if ((
float)
cand->pt() < 0.5){
79 if (
mode == 2 || (
mode == 0 && dr < signalrad) || (
mode == 1 && dr > signalrad)) {
84 sum_dx_pt += pt * deta;
86 sum_dx_pt += pt * dphi;
90 if( (
mode==2 && flag==
false) || (
mode==1 && flag==
true) ||
mode==0){
95 sum_dx_pt += pt * deta;
97 sum_dx_pt += pt * dphi;
102 return sum_dx_pt/sum_pt;
108 float sum_dx_pt = 0.;
112 for (
const auto&
cand : cands) {
114 if (
cand->pt() < 0.5){
123 if (
mode == 2 || (
mode == 0 && dr < signalrad) || (
mode == 1 && dr > signalrad)) {
126 sum_dx_pt += pt *
dr;
128 sum_dx_pt += pt * deta;
130 sum_dx_pt += pt * dphi;
133 else if(is3prong==1){
134 if( (
mode==2 && flag==
false) || (
mode==1 && flag==
true) ||
mode==0){
137 sum_dx_pt += pt *
dr;
139 sum_dx_pt += pt * deta;
141 sum_dx_pt += pt * dphi;
146 return sum_dx_pt/sum_pt;
184 unsigned int n_photons = 0;
186 if ((
float)
cand->pt() > 0.5)
190 if ((
float)
cand->pt() > 0.5)
196 unsigned int n_photons = 0;
198 if (
cand->pt() > 0.5)
202 if (
cand->pt() > 0.5)
223 bool isInside(
float photon_pt,
float deta,
float dphi)
const {
224 const double stripEtaAssociationDistance_0p95_p0 = 0.197077;
225 const double stripEtaAssociationDistance_0p95_p1 = 0.658701;
226 const double stripPhiAssociationDistance_0p95_p0 = 0.352476;
227 const double stripPhiAssociationDistance_0p95_p1 = 0.707716;
231 if((dphi<0.3 && dphi<
std::max(0.05, stripPhiAssociationDistance_0p95_p0*
std::pow(photon_pt, -stripPhiAssociationDistance_0p95_p1))) && \
232 (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
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
double eta() const final
momentum pseudorapidity
const PFCandidatePtr & leadPFChargedHadrCand() const
float tau_pt_weighted_deta_strip(const pat::Tau &tau, int dm) const
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.
double pt() const final
transverse momentum
~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
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
double phi() const final
momentum azimuthal angle
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 ...