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->executePi0ClusterCreator(*pTau, *neutralPFOContainer, *hadronicClusterPFOContainer, *pi0ClusterContainer);
164 else if ( tool->type() ==
"TauVertexVariables"){
165 sc = tool->executeVertexVariables(*pTau, *pSecVtxContainer);
167 else if (tool->type() ==
"TauShotFinder") {
168 sc = tool->executeShotFinder(*pTau, *tauShotClusContainer,
169 *tauShotPFOContainer);
171 else if ( tool->type() ==
"TauPi0ClusterScaler"){
172 sc = tool->executePi0ClusterScaler(*pTau, *neutralPFOContainer, *chargedPFOContainer);
174 else if ( tool->type() ==
"TauPi0ScoreCalculator"){
175 sc = tool->executePi0nPFO(*pTau, *neutralPFOContainer);
177 else if ( tool->type() ==
"TauPi0Selector"){
178 sc = tool->executePi0nPFO(*pTau, *neutralPFOContainer);
180 else if ( tool->type() ==
"PanTau::PanTauProcessor"){
181 sc = tool->executePanTau(*pTau, *pi0Container, *neutralPFOContainer);
184 sc = tool->execute(*pTau);
186 if (
sc.isFailure())
break;
188 if (
sc.isSuccess()) {
189 ATH_MSG_VERBOSE(
"The tau candidate has been modified successfully by all the invoked tools.");
199 newTauCon->
sort( sortByPt );
203 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
Handle class for reading from StoreGate.
Handle class for recording to StoreGate.
An algorithm that can be simultaneously executed in multiple threads.
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
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".