27 ISvcLocator * pSvcLocator) :
46 return StatusCode::FAILURE;
70 unsigned int tool_count = 0;
71 for (ToolHandle<ITauToolBase>& tool :
m_tools) {
78 if (tool_count == 0) {
80 return StatusCode::FAILURE;
83 return StatusCode::SUCCESS;
94 ATH_CHECK(neutralPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
99 ATH_CHECK(hadronicPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
104 ATH_CHECK(vertOutHandle.
record(std::make_unique<xAOD::VertexContainer>(), std::make_unique<xAOD::VertexAuxContainer>()));
109 ATH_CHECK(chargedPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
114 ATH_CHECK(pi0Handle.
record(std::make_unique<xAOD::ParticleContainer>(), std::make_unique<xAOD::ParticleAuxContainer>()));
118 ATH_CHECK(tauShotClusHandle.
record(std::make_unique<xAOD::CaloClusterContainer>(), std::make_unique<xAOD::CaloClusterAuxContainer>()));
122 ATH_CHECK(tauShotPFOHandle.
record(std::make_unique<xAOD::PFOContainer>(), std::make_unique<xAOD::PFOAuxContainer>()));
127 if (!pi0ClusterInHandle.
isValid()) {
128 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << pi0ClusterInHandle.
key());
129 return StatusCode::FAILURE;
135 if (!tauInputHandle.
isValid()) {
136 ATH_MSG_ERROR (
"Could not retrieve HiveDataObj with key " << tauInputHandle.
key());
137 return StatusCode::FAILURE;
143 ATH_CHECK(outputTauHandle.
record(std::make_unique<xAOD::TauJetContainer>(), std::make_unique<xAOD::TauJetAuxContainer>()));
159 for (
const ToolHandle<ITauToolBase>& tool :
m_tools) {
161 if ( tool->type() ==
"TauPi0ClusterCreator"){
162 sc = tool->executeTool(*pTau, ctx, *neutralPFOContainer, *hadronicClusterPFOContainer, *pi0ClusterContainer);
164 else if ( tool->type() ==
"TauVertexVariables"){
165 sc = tool->executeTool(*pTau, ctx, *pSecVtxContainer);
167 else if (tool->type() ==
"TauShotFinder") {
168 sc = tool->executeTool(*pTau, ctx, *tauShotClusContainer, *tauShotPFOContainer);
170 else if ( tool->type() ==
"TauPi0ClusterScaler"){
171 sc = tool->executeTool(*pTau, ctx, *neutralPFOContainer, *chargedPFOContainer);
173 else if ( tool->type() ==
"TauPi0ScoreCalculator" || tool->type() ==
"TauPi0Selector" ){
174 sc = tool->executeTool(*pTau, ctx, *neutralPFOContainer);
176 else if ( tool->type() ==
"PanTau::PanTauProcessor"){
177 sc = tool->executeTool(*pTau, ctx, *pi0Container, *neutralPFOContainer);
180 sc = tool->executeTool(*pTau, ctx);
182 if (
sc.isFailure())
break;
184 if (
sc.isSuccess()) {
185 ATH_MSG_VERBOSE(
"The tau candidate has been modified successfully by all the invoked tools.");
191 ATH_CHECK( tauShotClusLinkHandle.
record (std::make_unique<CaloClusterCellLinkContainer>()) );
196 newTauCon->
sort( sortByPt );
200 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_VERBOSE(x,...)
#define ATH_MSG_INFO(x,...)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
static void finalizeClusters(const EventContext &ctx, SG::WriteHandle< xAOD::CaloClusterContainer > &outClusterContainer, SG::WriteHandle< CaloClusterCellLinkContainer > &outClusterContainerCellLink)
Finalize clusters (move CaloClusterCellLink to a separate container).
void sort()
Sort the container.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
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.
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_pi0ClusterInputContainer
SG::WriteHandleKey< xAOD::PFOContainer > m_neutralPFOOutputContainer
virtual StatusCode initialize() override
TauRunnerAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< xAOD::ParticleContainer > m_pi0Container
SG::WriteHandleKey< xAOD::VertexContainer > m_vertexOutputContainer
SG::WriteHandleKey< xAOD::TauJetContainer > m_tauOutputContainer
SG::WriteHandleKey< xAOD::PFOContainer > m_tauShotPFOOutputContainer
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< xAOD::PFOContainer > m_hadronicPFOOutputContainer
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauInputContainer
SG::WriteHandleKey< xAOD::PFOContainer > m_chargedPFOOutputContainer
SG::WriteHandleKey< CaloClusterCellLinkContainer > m_tauShotClusLinkContainer
ToolHandleArray< ITauToolBase > m_tools
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_tauShotClusOutputContainer
virtual double pt() const
The transverse momentum ( ) of the particle.
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".
TauJet_v3 TauJet
Definition of the current "tau version".
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".