ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauRecMerged.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGTAUREC_TRIGTAURECMERGED_H
6#define TRIGTAUREC_TRIGTAURECMERGED_H
7
8#include "GaudiKernel/ToolHandle.h"
9#include "Gaudi/Parsers/Factory.h"
10
15
18
24
26public:
27 TrigTauRecMerged(const std::string& name, ISvcLocator* pSvcLocator);
28
29 virtual StatusCode initialize() override;
30 virtual StatusCode execute(const EventContext& ctx) const override;
31
32private:
33 template<class V> StatusCode deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const;
34
35 // Error codes for calo reconstruction
48
49 // Error codes for tracking
54
55 // Internal tools store
56 // The sequence of tool execution goes as follows:
57 // VertexFinderTools -> CommonToolsBeforeTF -> TrackFinderTools -> CommonTools -> VertexVarsTools -> IDTools
58 const ToolHandleArray<ITauToolBase> m_commonTools {this, "CommonTools", {}, "List of ITauToolBase common tools"};
59 const ToolHandleArray<ITauToolBase> m_commonToolsBeforeTF {this, "CommonToolsBeforeTF", {}, "List of ITauToolBase common tools to execute before the Track Finder tools"};
60 const ToolHandleArray<ITauToolBase> m_vertexFinderTools {this, "VertexFinderTools", {}, "Vertex Finder tools"};
61 const ToolHandleArray<ITauToolBase> m_trackFinderTools {this, "TrackFinderTools", {}, "Track Finder tools"};
62 const ToolHandleArray<ITauToolBase> m_vertexVarsTools {this, "VertexVarsTools", {}, "Vertex Variables tools"};
63 const ToolHandleArray<ITauToolBase> m_idTools {this, "IDTools", {}, "Vertex Variables tools"};
64
65 // Monitoring tool
66 const ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool"};
67 Gaudi::Property<std::map<std::string, std::pair<std::string, std::string>>> m_monitoredIdScores {this, "MonitoredIDScores", {}, "Pairs of the TauID score and signal-transformed scores for each TauID algorithm to be monitored"};
68 std::map<std::string, std::pair<SG::ConstAccessor<float>, SG::ConstAccessor<float>>> m_monitoredIdAccessors;
69
70 // Inputs
71 SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiInputKey {this, "InputRoIs", "", "Input RoI name"};
72 SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clustersInputKey {this, "InputCaloClusterContainer", "", "Caloclusters in view"};
73 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputKey {this, "InputVertexContainer", "", "Input vertex container"};
74 SG::ReadHandleKey<xAOD::TauJetContainer> m_tauJetInputKey {this, "InputTauJetContainer", "", "Input TauJet container"};
75 SG::ReadHandleKey<xAOD::TauTrackContainer> m_tauTrackInputKey {this, "InputTauTrackContainer", "", "Input TauTrack container" };
76
77 // Outputs
78 SG::WriteHandleKey<xAOD::JetContainer> m_tauSeedOutputKey {this, "OutputJetSeed", "", "Output jets which are seeds for tau jets"};
79 SG::WriteHandleKey<xAOD::TauJetContainer> m_tauJetOutputKey {this, "OutputTauJetContainer", "", "Output TauJet container"};
80 SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputKey {this, "OutputTauTrackContainer", "", "Output TauTrack container"};
81
82 // Helper methods
83 bool doCaloReconstruction() const { return m_tauJetInputKey.key().empty() && !m_clustersInputKey.key().empty(); }
84};
85
86// Function to perform deep copy on container
87template<class V> StatusCode TrigTauRecMerged::deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const {
88 if(!writeHandle.isValid()) {
89 ATH_MSG_FATAL("Provided with an invalid write handle");
90 return StatusCode::FAILURE;
91 }
92
93 if(oldContainer){
94 for(const V* v : *oldContainer) {
95 // Build a new object in the new container
96 writeHandle->push_back(std::make_unique<V>());
97 // Copy across the aux store
98 *writeHandle->back() = *v;
99 }
100 }
101 return StatusCode::SUCCESS;
102}
103
104#endif
#define ATH_MSG_FATAL(x)
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
An algorithm that can be simultaneously executed in multiple threads.
Derived DataVector<T>.
Definition DataVector.h:795
Helper class to provide constant type-safe access to aux data.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
const ToolHandleArray< ITauToolBase > m_idTools
StatusCode deepCopy(SG::WriteHandle< DataVector< V > > &writeHandle, const DataVector< V > *oldContainer) const
virtual StatusCode execute(const EventContext &ctx) const override
const ToolHandleArray< ITauToolBase > m_commonTools
const ToolHandle< GenericMonitoringTool > m_monTool
SG::WriteHandleKey< xAOD::TauJetContainer > m_tauJetOutputKey
bool doCaloReconstruction() const
SG::WriteHandleKey< xAOD::TauTrackContainer > m_tauTrackOutputKey
const ToolHandleArray< ITauToolBase > m_commonToolsBeforeTF
SG::ReadHandleKey< xAOD::TauTrackContainer > m_tauTrackInputKey
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::JetContainer > m_tauSeedOutputKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clustersInputKey
const ToolHandleArray< ITauToolBase > m_vertexFinderTools
const ToolHandleArray< ITauToolBase > m_trackFinderTools
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauJetInputKey
TrigTauRecMerged(const std::string &name, ISvcLocator *pSvcLocator)
const ToolHandleArray< ITauToolBase > m_vertexVarsTools
Gaudi::Property< std::map< std::string, std::pair< std::string, std::string > > > m_monitoredIdScores
SG::ReadHandleKey< TrigRoiDescriptorCollection > m_roiInputKey
std::map< std::string, std::pair< SG::ConstAccessor< float >, SG::ConstAccessor< float > > > m_monitoredIdAccessors