26 ATH_MSG_INFO(
"List of modification tools in execution sequence:");
37 ATH_MSG_INFO(
"List of official tools in execution sequence:");
49 ATH_MSG_ERROR(
"Missing input/output containers required for tool " << tool->name() <<
" (" << tool->type() <<
")");
50 return StatusCode::FAILURE;
60 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
70 if (!tauInputHandle.
isValid()) {
71 ATH_MSG_ERROR(
"Could not retrieve TauJetContainer with key " << tauInputHandle.
key());
72 return StatusCode::FAILURE;
82 ATH_CHECK(outputTauTrackHandle.
record(std::make_unique<xAOD::TauTrackContainer>(), std::make_unique<xAOD::TauTrackAuxContainer>()));
83 newTauTrkCon = outputTauTrackHandle.
ptr();
88 ATH_CHECK(outputTauHandle.
record(std::make_unique<xAOD::TauJetContainer>(), std::make_unique<xAOD::TauJetAuxContainer>()));
102 acc_ori_tau_link(*newTau) = link_to_ori_tau;
113 *newTauTrk = *tauTrk;
123 acc_modified(*newTau) =
static_cast<char>(
false);
128 if(tool->execute(*newTau).isFailure())
break;
144 if(!pi0ClusterInHandle.
isValid()) {
145 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << pi0ClusterInHandle.
key());
146 return StatusCode::FAILURE;
148 pi0ClusterContainer = pi0ClusterInHandle.
cptr();
156 ATH_CHECK(chargedPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
157 chargedPFOContainer = chargedPFOHandle.
ptr();
165 ATH_CHECK(neutralPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
166 neutralPFOContainer = neutralPFOHandle.
ptr();
174 ATH_CHECK(pi0Handle.
record(std::make_unique<xAOD::ParticleContainer>(), std::make_unique<xAOD::ParticleAuxContainer>()));
175 pi0Container = pi0Handle.
ptr();
183 ATH_CHECK(hadronicPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
184 hadronicClusterPFOContainer = hadronicPFOHandle.
ptr();
192 ATH_CHECK(vertOutHandle.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
193 pSecVtxContainer = vertOutHandle.
ptr();
199 StatusCode
sc = StatusCode::SUCCESS;
202 if (tool->type() ==
"TauPi0ClusterCreator")
203 sc = tool->executePi0ClusterCreator(*pTau, *neutralPFOContainer, *hadronicClusterPFOContainer, *pi0ClusterContainer);
204 else if (tool->type() ==
"TauVertexVariables")
205 sc = tool->executeVertexVariables(*pTau, *pSecVtxContainer);
206 else if (tool->type() ==
"TauPi0ClusterScaler")
207 sc = tool->executePi0ClusterScaler(*pTau, *neutralPFOContainer, *chargedPFOContainer);
208 else if (tool->type() ==
"TauPi0ScoreCalculator")
209 sc = tool->executePi0nPFO(*pTau, *neutralPFOContainer);
210 else if (tool->type() ==
"TauPi0Selector")
211 sc = tool->executePi0nPFO(*pTau, *neutralPFOContainer);
212 else if (tool->type() ==
"PanTau::PanTauProcessor")
213 sc = tool->executePanTau(*pTau, *pi0Container, *neutralPFOContainer);
214 else if (tool->type() ==
"tauRecTools::TauTrackRNNClassifier")
215 sc = tool->executeTrackClassifier(*pTau, *newTauTrkCon);
217 sc = tool->execute(*pTau);
219 if (
sc.isFailure())
break;
221 if (
sc.isSuccess())
ATH_MSG_VERBOSE(
"The tau candidate has been modified successfully by the invoked official tools.");
224 ATH_MSG_VERBOSE(
"The tau candidate container has been modified by the rest of the tools");
227 return StatusCode::SUCCESS;
234 return acc_modified(*newtau);
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
An algorithm that can be simultaneously executed in multiple threads.
void pop_back()
Remove the last element from the collection.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
bool toContainedElement(BaseConstReference data, ElementType element, IProxyDict *sg=0)
Set from element pointer and a reference to the container (storable)
Helper class to provide type-safe access to aux data.
Helper class to provide constant type-safe access to aux data.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
pointer_type ptr()
Dereference the pointer.
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
ToolHandleArray< ITauToolBase > m_modificationTools
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauContainer
SG::WriteHandleKey< xAOD::TauJetContainer > m_tauOutContainer
SG::WriteHandleKey< xAOD::PFOContainer > m_neutralPFOOutputContainer
SG::WriteHandleKey< xAOD::ParticleContainer > m_pi0Container
TauAODRunnerAlg(const std::string &name, ISvcLocator *)
ToolHandleArray< ITauToolBase > m_officialTools
SG::WriteHandleKey< xAOD::PFOContainer > m_chargedPFOOutputContainer
SG::WriteHandleKey< xAOD::PFOContainer > m_hadronicPFOOutputContainer
static bool isTauModified(const xAOD::TauJet *newtau)
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_pi0ClusterInputContainer
SG::WriteHandleKey< xAOD::VertexContainer > m_vertexOutputContainer
SG::WriteHandleKey< xAOD::TauTrackContainer > m_tauTrackOutputContainer
void clearTauTrackLinks()
Remove all tracks from the tau.
void addTauTrackLink(const ElementLink< TauTrackContainer > &tr)
add a TauTrack to the tau
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
PFOContainer_v1 PFOContainer
Definition of the current "pfo container version".
ParticleContainer_v1 ParticleContainer
Define the latest version of the particle class.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
TauTrack_v1 TauTrack
Definition of the current version.
TauJet_v3 TauJet
Definition of the current "tau version".
TauTrackContainer_v1 TauTrackContainer
Definition of the current TauTrack container version.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".