24 if (
tool->type() !=
"TauWPDecorator")
continue;
27 BooleanProperty useAbsEta(
"UseAbsEta",
false);
29 if (useAbsEta.value()) {
34 StringProperty scoreName(
"ScoreName",
"");
37 if (scoreName.value() !=
"RNNEleScore") {
38 m_scores.push_back(scoreName.value());
41 StringProperty newScoreName(
"NewScoreName",
"");
43 m_scores.push_back(newScoreName.value());
45 StringArrayProperty decorWPNames(
"DecorWPNames", {});
47 for (
const auto&
WP : decorWPNames.value())
m_WPs.push_back(
WP);
54 for (
const std::string&
WP :
m_WPs) {
66 return StatusCode::SUCCESS;
71 return StatusCode::SUCCESS;
79 if (!tauJetsReadHandle.
isValid()) {
80 ATH_MSG_ERROR (
"Could not retrieve TauJetContainer with key " << tauJetsReadHandle.
key());
81 return StatusCode::FAILURE;
88 std::vector<SG::WriteDecorHandle<xAOD::TauJetContainer, float> > scoreDecors;
89 scoreDecors.reserve (
m_scores.size());
91 scoreDecors.emplace_back (
k, ctx);
93 std::vector<SG::WriteDecorHandle<xAOD::TauJetContainer, char> > WPDecors;
94 WPDecors.reserve (
m_WPs.size());
96 WPDecors.emplace_back (
k, ctx);
101 for (
const auto tau : *tauContainer) {
102 float tauTrackBasedWidth = 0.;
104 std::vector<const xAOD::TauTrack *> tauTracks = tau->tracks();
106 tauTracks.push_back(trk);
108 double sumWeightedDR = 0.;
113 ptSum +=
track->pt();
116 tauTrackBasedWidth = sumWeightedDR / ptSum;
119 dec_trackWidth(*tau) = tauTrackBasedWidth;
125 for (
auto tau : *shallowCopy.first) {
130 float absEtaLead = -1111.;
131 if(tau->nTracks() > 0) {
133 absEtaLead = std::abs(
track->eta() );
135 acc_absEtaLead(*tau) = absEtaLead;
144 const xAOD::TauJet* xTau = tauContainer->at(tau->index());
147 dec(*xTau) = scoreAcc(*tau);
151 dec(*xTau) = WPAcc(*tau);
155 delete shallowCopy.first;
156 delete shallowCopy.second;
160 if (!muonReadHandle.
isValid()) {
161 ATH_MSG_DEBUG (
"Could not retrieve MuonContainer with key " << muonReadHandle.
key() <<
" so won't add TAT MuonOLR flag");
162 return StatusCode::SUCCESS;
166 for (
const auto tau : *tauContainer) {
167 bool bTauMuonOLR =
true;
169 if(
muon->pt() < 2000.)
continue;
170 if(
muon->muonType() == xAOD::Muon::CaloTagged)
continue;
171 if(
muon->p4().DeltaR( tau->p4() ) > 0.2 )
continue;
175 dec_passTATTauMuonOLR(*tau) = bTauMuonOLR;
178 return StatusCode::SUCCESS;