7 #include "GaudiKernel/SystemOfUnits.h"
16 ISvcLocator *pSvcLocator)
36 ATH_MSG_ERROR(
"evtStore() does not contain tau Collection with name "
38 return StatusCode::FAILURE;
42 std::unique_ptr<xAOD::TauJetContainer> shallowTaus(shallowCopy.first);
43 std::unique_ptr<xAOD::ShallowAuxContainer> shallowTausAux(shallowCopy.second);
45 const int lowerEtThreshold = 15;
46 const int higherEtThreshold = 75;
54 auto panModeEt15RNNLoose =
56 auto panModeSubstructure =
75 auto NumTracksEt15RNNLoose =
79 auto nHighPtTauCandidates =
82 auto nClustersEt15RNNLoose =
179 auto trackZ0SinthetaTJVA =
182 auto trackZ0sinthetaSigTJVA =
188 auto trackPtRatioSeedJet =
191 auto trackNInnermostPixHits =
195 auto trackeProbabilityHT =
197 auto trackeProbabilityNN =
199 auto trackeProbabilityHTorNN =
210 auto clusterSecondLambda =
212 auto clusterCenterLambda =
214 auto clusterFirstEngDens =
217 auto clustersMeanCenterLambda =
219 auto clustersMeanFirstEngDens =
221 auto clustersMeanEMProbability =
223 auto clustersMeanSecondLambda =
225 auto clustersMeanPresamplerFrac =
227 auto clustersPFOEngRelDiff =
234 for (
const auto tau : *shallowTaus) {
236 if (!passThinningAcc.
withDefault(*tau,
true))
continue;
240 tauEt = tau->pt() /
GeV;
241 tauCharge = tau->charge();
242 NumTracks = tau->nTracks();
256 jetSeedEta = tau->etaJetSeed();
257 jetSeedPhi = tau->phiJetSeed();
258 jetSeedPt = tau->ptJetSeed() /
GeV;
279 panEta = tau->etaPanTauCellBased();
280 panPhi = tau->phiPanTauCellBased();
281 panPt = tau->ptPanTauCellBased() /
GeV;
286 EMFrac = EMFracFixedAcc(*tau);
290 EfracL2EffCluster = tau->detail<
float>(
297 nNeutPFO = tau->nProtoNeutralPFOs();
298 nShot = tau->nShotPFOs();
300 int panModeDummy = -1;
301 int panModeSubstructureDummy = -1;
307 if (tauEt > higherEtThreshold) {
308 nHighPtTauCandidates += 1;
313 tauEt > lowerEtThreshold && tauRNNLoose) {
314 tauPhiEt15RNNLoose = tau->phi();
315 tauEtaEt15RNNLoose = tau->eta();
316 tauEtEt15RNNLoose = tau->pt() /
GeV;
317 nClustersEt15RNNLoose =
319 NumTracksEt15RNNLoose = tau->nTracks();
323 panModeEt15RNNLoose = panModeDummy;
324 fill(
tool, tauPhiEt15RNNLoose, tauEtaEt15RNNLoose,
325 nClustersEt15RNNLoose, NumTracksEt15RNNLoose, tauEtEt15RNNLoose,
326 panModeEt15RNNLoose);
330 tauPhiRNNLoose = tau->phi();
331 tauEtaRNNLoose = tau->eta();
332 tauEtRNNLoose = tau->pt() /
GeV;
333 NumTracksRNNLoose = tau->nTracks();
335 fill(
tool, tauPhiRNNLoose, tauEtaRNNLoose, NumTracksRNNLoose,
340 tauPhiRNNMedium = tau->phi();
341 tauEtaRNNMedium = tau->eta();
342 tauEtRNNMedium = tau->pt() /
GeV;
343 NumTracksRNNMedium = tau->nTracks();
345 fill(
tool, tauPhiRNNMedium, tauEtaRNNMedium, NumTracksRNNMedium,
350 tauPhiRNNTight = tau->phi();
351 tauEtaRNNTight = tau->eta();
352 tauEtRNNTight = tau->pt() /
GeV;
353 NumTracksRNNTight = tau->nTracks();
355 fill(
tool, tauPhiRNNTight, tauEtaRNNTight, NumTracksRNNTight,
361 if (tau->nTracks() != 0) {
370 if (d0SigTJVAAcc.isAvailable(*tau->track(0))) {
378 if (z0sinthetaSigTJVAAcc.
isAvailable(*tau->track(0))) {
438 phiTrack = perigee.parameters()[
Trk::phi];
439 etaTrack = perigee.eta();
440 ptTrack = perigee.pT() /
GeV;
456 double tauSeedPt = tau->ptJetSeed();
457 double logTauSeedPt =
std::log(tauSeedPt);
458 trackLogSeedJetPt = logTauSeedPt;
471 trackAcc(
"trackLinks");
472 if (!trackAcc(*
track)[0]) {
479 trackZ0SinthetaTJVA =
track->z0sinThetaTJVA(*tau);
480 trackD0SigTJVA = 999.;
481 trackZ0sinthetaSigTJVA = 999.;
483 float rConvII = 999.;
487 trackZ0SinthetaTJVA =
track->z0sinthetaTJVA();
488 trackD0SigTJVA =
track->d0SigTJVA();
489 trackZ0sinthetaSigTJVA =
track->z0sinthetaSigTJVA();
490 rConv =
track->rConv();
491 rConvII =
track->rConvII();
497 uint8_t nInnermostPixelLayerHits = 0;
524 trackeProbabilityHTorNN =
531 trackd0TJVA = std::tanh(
d0TJVA / 10.);
532 trackCharge = trackParticle->
charge();
533 trackqOverP =
qOverP * 1000.;
535 trackTanhRConvII = std::tanh(rConvII / 500.0);
536 trackPtRatioSeedJet =
trackPt / tauSeedPt;
537 trackNInnermostPixHits = nInnermostPixelLayerHits;
538 trackNPixHits =
nPixelHits + nPixelDeadSensors;
543 trackD0SigTJVA, trackZ0sinthetaSigTJVA, trackCharge, trackqOverP,
544 trackLogRConv, trackTanhRConvII, trackPtRatioSeedJet,
545 trackdRJetSeedAxis, trackNInnermostPixHits,
548 trackeProbabilityHT, trackeProbabilityNN, trackeProbabilityHTorNN);
551 float chargedScore = acc_trackScoreCharged(*
track);
552 float isolationScore = acc_trackScoreIso(*
track);
553 float conversionScore = acc_trackScoreConv(*
track);
554 float fakeScore = 1. - chargedScore - isolationScore - conversionScore;
559 trackIdScoreCharged = chargedScore;
560 trackIdScoreIso = isolationScore;
561 trackIdScoreConv = conversionScore;
562 trackIdScoreFake = fakeScore;
564 fill(
tool, trackIdScoreCharged, trackIdScoreIso, trackIdScoreConv,
570 std::vector<const xAOD::IParticle *> particleList = tau->clusters();
571 std::vector<xAOD::CaloVertexedTopoCluster>
clusters;
573 if (tau->vertexLink().isValid())
580 clusters.emplace_back(*cluster, xAOD::CaloCluster::State::CALIBRATED,
583 clusters.emplace_back(*cluster, xAOD::CaloCluster::State::CALIBRATED);
590 return lhs.
p4().Et() > rhs.p4().Et();
600 for (
const auto& vertexedCluster :
clusters) {
603 clusterLogEt = std::log10(vertexedCluster.p4().Et());
604 clusterEta = vertexedCluster.eta();
605 clusterPhi = vertexedCluster.phi();
608 clusterSecondR = std::log10(moment + 0.1);
612 clusterSecondLambda = std::log10(moment + 0.1);
616 clusterCenterLambda = std::log10(moment + 1
e-6);
621 moment = std::log10(std::abs(moment));
622 clusterFirstEngDens = moment;
626 clusterEMproba = moment;
628 fill(
tool, clusterLogEt, clusterEta, clusterPhi, clusterSecondR,
629 clusterSecondLambda, clusterCenterLambda, clusterFirstEngDens,
634 float avariable = 0.;
638 clustersMeanCenterLambda = avariable;
643 clustersMeanFirstEngDens = avariable;
648 clustersMeanEMProbability = avariable;
653 clustersMeanSecondLambda = avariable;
658 clustersMeanPresamplerFrac = avariable;
662 clustersPFOEngRelDiff = avariable;
664 fill(
tool, clustersMeanCenterLambda, clustersMeanFirstEngDens,
665 clustersMeanEMProbability, clustersMeanSecondLambda,
666 clustersMeanPresamplerFrac, clustersPFOEngRelDiff);
668 for (
int s = 0;
s < nShot;
s++) {
670 if (shot !=
nullptr) {
671 float pt3Temp = -9.0;
679 for (
unsigned int np = 0;
np < nNeutPFO;
np++) {
685 if (tauEt > lowerEtThreshold) {
686 tauPhiEt15 = tau->phi();
687 tauEtaEt15 = tau->eta();
694 muonVeto, tauRNNLoose, tauRNNMedium, tauRNNTight, PSSFrac, EMFrac, EMFracTrk,
695 EfracL2EffCluster, EisoEffCluster, InvMassEffClusters, nNeutPFO,
696 nShot, NumTracks, nClusters, jetSeedEta, jetSeedPhi, jetSeedPt,
700 panModeSubstructureDummy);
701 panModeSubstructure = panModeSubstructureDummy;
710 fill(
tool, nHighPtTauCandidates, nTauCandidates, nHighPtTaus);
712 return StatusCode::SUCCESS;