198 if ( tau->leadPFChargedHadrCand().
isNull() )
return 0.;
200 int tauDecayMode = tau->decayMode();
203 && (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 10))
206 && (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 5 || tauDecayMode == 6 || tauDecayMode == 10 || tauDecayMode == 11))
220 float decayDistMag =
std::sqrt(decayDistX*decayDistX + decayDistY*decayDistY + decayDistZ*decayDistZ);
231 float gjAngleDiff = -999;
232 if ( tauDecayMode == 10 ) {
233 double mTau = 1.77682;
234 double mAOne = tau->p4().M();
235 double pAOneMag = tau->p();
236 double argumentThetaGJmax = (
std::pow(mTau,2) -
std::pow(mAOne,2) ) / ( 2 * mTau * pAOneMag );
237 double argumentThetaGJmeasured = ( tau->p4().px() * decayDistX + tau->p4().py() * decayDistY + tau->p4().pz() * decayDistZ ) / ( pAOneMag * decayDistMag );
238 if (
std::abs(argumentThetaGJmax) <= 1. &&
std::abs(argumentThetaGJmeasured) <= 1. ) {
239 double thetaGJmax = std::asin( argumentThetaGJmax );
240 double thetaGJmeasured = std::acos( argumentThetaGJmeasured );
241 gjAngleDiff = thetaGJmeasured - thetaGJmax;
251 mvaInput_[5] = tauDecayMode;
254 mvaInput_[1] =
std::abs((
float)tau->eta());
258 mvaInput_[5] = tauDecayMode;
259 mvaInput_[6] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
267 mvaInput_[1] =
std::abs((
float)tau->eta());
272 mvaInput_[6] = tauDecayMode;
274 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
275 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
276 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
277 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
278 mvaInput_[12] =
std::min(100.
f, leadingTrackChi2);
280 mvaInput_[14] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
283 mvaInput_[17] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
291 mvaInput_[1] =
std::abs((
float)tau->eta());
296 mvaInput_[6] = tauDecayMode;
298 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
299 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
300 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
301 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
302 mvaInput_[12] =
std::min(100.
f, leadingTrackChi2);
304 mvaInput_[14] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
307 mvaInput_[17] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
315 mvaInput_[1] =
std::abs((
float)tau->eta());
320 mvaInput_[6] = tauDecayMode;
322 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
323 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
324 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
325 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
327 mvaInput_[13] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
330 mvaInput_[16] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
336 mvaInput_[22] =
std::max(-1.
f, gjAngleDiff);
341 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
"<PFRecoTauDiscriminationByMVAIsolationRun2::discriminate>:";
342 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" tau: Pt = " << tau->pt() <<
", eta = " << tau->eta();
343 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" isolation: charged = " << chargedIsoPtSum <<
", neutral = " << neutralIsoPtSum <<
", PUcorr = " <<
puCorrPtSum;
344 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" decay mode = " << tauDecayMode;
345 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" impact parameter: distance = " << tauLifetimeInfo.
dxy() <<
", significance = " << tauLifetimeInfo.
dxy_Sig();
347 <<
" distance = " << decayDistMag <<
", significance = " << tauLifetimeInfo.
flightLengthSig();
348 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
"--> mvaValue = " << mvaValue;
bool hasSecondaryVertex() const
float tau_Eratio(const reco::PFTau &tau) const
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
TauIdMVAAuxiliaries clusterVariables_
double flightLengthSig() const
const Vector & flightLength() const
float tau_pt_weighted_dphi_strip(const reco::PFTau &tau, int dm) const
Abs< T >::type abs(const T &t)
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? <==
bool isNull() const
Checks for null.
float tau_pt_weighted_dr_iso(const reco::PFTau &tau, int dm) const
photonPtSumOutsideSignalCone
const GBRForest * mvaReader_
float tau_pt_weighted_deta_strip(const reco::PFTau &tau, int dm) const
double GetClassifier(const float *vector) const
std::unique_ptr< PFTauDiscriminator > category_output_
Power< A, B >::type pow(const A &a, const B &b)
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 ...