221 if (tau->leadChargedHadrCand().
isNull())
224 int tauDecayMode = tau->decayMode();
228 (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 10)) ||
231 (tauDecayMode == 0 || tauDecayMode == 1 || tauDecayMode == 2 || tauDecayMode == 5 || tauDecayMode == 6 ||
232 tauDecayMode == 10 || tauDecayMode == 11))) {
233 auto const rawValues = (*basicTauDiscriminators_)[
tau].rawValues;
245 float decayDistMag =
std::sqrt(decayDistX * decayDistX + decayDistY * decayDistY + decayDistZ * decayDistZ);
256 float gjAngleDiff = -999;
257 if (tauDecayMode == 10) {
258 double mTau = 1.77682;
259 double mAOne = tau->p4().M();
260 double pAOneMag = tau->p();
261 double argumentThetaGJmax = (
std::pow(mTau, 2) -
std::pow(mAOne, 2)) / (2 * mTau * pAOneMag);
262 double argumentThetaGJmeasured =
263 (tau->p4().px() * decayDistX + tau->p4().py() * decayDistY + tau->p4().pz() * decayDistZ) /
264 (pAOneMag * decayDistMag);
265 if (
std::abs(argumentThetaGJmax) <= 1. &&
std::abs(argumentThetaGJmeasured) <= 1.) {
266 double thetaGJmax = std::asin(argumentThetaGJmax);
267 double thetaGJmeasured = std::acos(argumentThetaGJmeasured);
268 gjAngleDiff = thetaGJmeasured - thetaGJmax;
278 mvaInput_[5] = tauDecayMode;
281 mvaInput_[1] =
std::abs((
float)tau->eta());
285 mvaInput_[5] = tauDecayMode;
286 mvaInput_[6] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
294 mvaInput_[1] =
std::abs((
float)tau->eta());
299 mvaInput_[6] = tauDecayMode;
301 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
302 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
303 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
304 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
305 mvaInput_[12] =
std::min(100.
f, leadingTrackChi2);
307 mvaInput_[14] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
310 mvaInput_[17] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
318 mvaInput_[1] =
std::abs((
float)tau->eta());
323 mvaInput_[6] = tauDecayMode;
325 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
326 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
327 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
328 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
329 mvaInput_[12] =
std::min(100.
f, leadingTrackChi2);
331 mvaInput_[14] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
334 mvaInput_[17] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
342 mvaInput_[1] =
std::abs((
float)tau->eta());
347 mvaInput_[6] = tauDecayMode;
349 mvaInput_[8] =
std::min(0.5
f, ptWeightedDetaStrip);
350 mvaInput_[9] =
std::min(0.5
f, ptWeightedDphiStrip);
351 mvaInput_[10] =
std::min(0.5
f, ptWeightedDrSignal);
352 mvaInput_[11] =
std::min(0.5
f, ptWeightedDrIsolation);
354 mvaInput_[13] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
dxy());
357 mvaInput_[16] = std::copysign(+1.
f, (
float)tauLifetimeInfo.
ip3d());
363 mvaInput_[22] =
std::max(-1.
f, gjAngleDiff);
368 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
"<PFRecoTauDiscriminationByMVAIsolationRun2::discriminate>:";
369 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" tau: Pt = " << tau->pt() <<
", eta = " << tau->eta();
370 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" isolation: charged = " << chargedIsoPtSum
371 <<
", neutral = " << neutralIsoPtSum <<
", PUcorr = " << puCorrPtSum;
372 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" decay mode = " << tauDecayMode;
373 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
" impact parameter: distance = " << tauLifetimeInfo.
dxy()
374 <<
", significance = " << tauLifetimeInfo.
dxy_Sig();
377 <<
" distance = " << decayDistMag <<
", significance = " << tauLifetimeInfo.
flightLengthSig();
378 edm::LogPrint(
"PFTauDiscByMVAIsol2") <<
"--> mvaValue = " << mvaValue;
unsigned int n_photons_total(const reco::PFTau &tau)
return total number of pf photon candidates with pT>500 MeV, which are associated to signal ...
bool hasSecondaryVertex() const
static std::vector< std::string > checklist log
const GBRForest * mvaReader_
float pt_weighted_dr_signal(const reco::PFTau &tau, int dm)
int chargedIsoPtSum_index_
double flightLengthSig() const
const Vector & flightLength() const
float pt_weighted_deta_strip(const reco::PFTau &tau, int dm)
int footprintCorrection_index_
Abs< T >::type abs(const T &t)
float pt_weighted_dr_iso(const reco::PFTau &tau, int dm)
int neutralIsoPtSum_index_
Log< level::Warning, true > LogPrint
bool isNull() const
Checks for null.
float pt_weighted_dphi_strip(const reco::PFTau &tau, int dm)
float eratio(const reco::PFTau &tau)
return ratio of energy in ECAL over sum of energy in ECAL and HCAL
float lead_track_chi2(const reco::PFTau &tau)
return chi2 of the leading track ==> deprecated? <==
int photonPtSumOutsideSignalCone_index_
double GetClassifier(const float *vector) const
Power< A, B >::type pow(const A &a, const B &b)
std::vector< float > rawValues