15 declareInterface<DerivationFramework::IAugmentationTool>(
this);
25 if (
tool->type() !=
"TauWPDecorator")
continue;
28 BooleanProperty useAbsEta(
"UseAbsEta",
false);
30 if (useAbsEta.value()) {
35 StringProperty scoreName(
"ScoreName",
"");
38 if (scoreName.value() !=
"RNNEleScore") {
39 m_scores.push_back(scoreName.value());
42 StringProperty newScoreName(
"NewScoreName",
"");
44 m_scores.push_back(newScoreName.value());
46 StringArrayProperty decorWPNames(
"DecorWPNames", {});
48 for (
const auto&
WP : decorWPNames.value())
m_WPs.push_back(
WP);
54 for (
const std::string&
WP :
m_WPs) {
64 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
76 if (!tauJetsReadHandle.
isValid()) {
77 ATH_MSG_ERROR (
"Could not retrieve TauJetContainer with key " << tauJetsReadHandle.
key());
78 return StatusCode::FAILURE;
85 ATH_MSG_ERROR (
"Could not retrieve VertexContainer with key " << vtxReadHandle.
key());
86 return StatusCode::FAILURE;
90 float sumpt_PV0 = 0., sumpt2_PV0 = 0.;
93 if (vtxContainer !=
nullptr && !vtxContainer->
empty()) {
94 auto itrVtx = std::find_if(vtxContainer->
begin(), vtxContainer->
end(),
96 return vtx->vertexType() == xAOD::VxType::PriVtx;
98 pVtx = (itrVtx == vtxContainer->
end() ? nullptr : *itrVtx);
100 ATH_MSG_DEBUG(
"No PV found, using the first element instead!");
101 pVtx = vtxContainer->
at(0);
105 sumpt_PV0 += (*trk)->pt();
106 sumpt2_PV0 +=
std::pow((*trk)->pt(), 2.);
119 for (
const auto tau : *tauContainer) {
120 float tauTrackBasedWidth = 0.;
122 std::vector<const xAOD::TauTrack *> tauTracks = tau->tracks();
124 tauTracks.push_back(trk);
126 double sumWeightedDR = 0.;
131 ptSum +=
track->pt();
134 tauTrackBasedWidth = sumWeightedDR / ptSum;
137 acc_trackWidth(*tau) = tauTrackBasedWidth;
143 for (
auto tau : *shallowCopy.first) {
146 float dz0_TV_PV0 = -999., sumpt_TV = 0., sumpt2_TV = 0.;
150 sumpt_TV += (*trk)->pt();
151 sumpt2_TV +=
std::pow((*trk)->pt(), 2.);
155 acc_log_sumpt_TV(*tau) = (sumpt_TV>0.) ?
std::log(sumpt_TV) : 0.;
156 acc_log_sumpt2_TV(*tau) = (sumpt2_TV>0.) ?
std::log(sumpt2_TV) : 0.;
157 acc_log_sumpt_PV0(*tau) = (sumpt_PV0>0.) ?
std::log(sumpt_PV0) : 0.;
158 acc_log_sumpt2_PV0(*tau) = (sumpt2_PV0>0.) ?
std::log(sumpt2_PV0) : 0.;
163 float absEtaLead = -1111.;
164 if(tau->nTracks() > 0) {
166 absEtaLead = std::abs(
track->eta() );
168 acc_absEtaLead(*tau) = absEtaLead;
177 const xAOD::TauJet* xTau = tauContainer->at(tau->index());
181 scoreDec(*xTau) = scoreAcc(*tau);
183 for (
const std::string&
WP :
m_WPs) {
186 WPDec(*xTau) = WPAcc(*tau);
190 delete shallowCopy.first;
191 delete shallowCopy.second;
193 return StatusCode::SUCCESS;