ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauRecMerged.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
17
20
27
28#include <map>
29#include <memory>
30
32public:
33 TrigTauRecMerged(const std::string& name, ISvcLocator* pSvcLocator);
34
35 virtual StatusCode initialize() override;
36 virtual StatusCode execute(const EventContext& ctx) const override;
37
38private:
39 template<class V> StatusCode deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const;
40
41 // Reconstruction mode
42 enum Mode {
43 FromClusters=0, // Calo reconstruction from calo clusters: CaloMVA step
44 FromTauJet=1, // Full tau reconstruction from existing tau jets + tracks: CaloHits and Precision steps
45 };
46
47 // Error codes for calo reconstruction
60
61 // Error codes for tracking
66
67 // Internal tools store
68 // The sequence of tool execution goes as follows:
69 // VertexFinderTools -> CommonToolsBeforeTF -> TrackFinderTools -> CommonTools -> VertexVarsTools -> IDTools
70 const ToolHandleArray<ITauToolBase> m_commonTools {this, "CommonTools", {}, "List of ITauToolBase common tools"};
71 const ToolHandleArray<ITauToolBase> m_commonToolsBeforeTF {this, "CommonToolsBeforeTF", {}, "List of ITauToolBase common tools to execute before the Track Finder tools"};
72 const ToolHandleArray<ITauToolBase> m_vertexFinderTools {this, "VertexFinderTools", {}, "Vertex Finder tools"};
73 const ToolHandleArray<ITauToolBase> m_trackFinderTools {this, "TrackFinderTools", {}, "Track Finder tools"};
74 const ToolHandleArray<ITauToolBase> m_vertexVarsTools {this, "VertexVarsTools", {}, "Vertex Variables tools"};
75 const ToolHandleArray<ITauToolBase> m_idTools {this, "IDTools", {}, "Vertex Variables tools"};
76
77 // Monitoring tool
78 const ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool"};
79 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"};
80 Gaudi::Property<std::map<std::string, std::pair<std::string, std::string>>> m_monitoredHitZRegressions {this, "MonitoredHitZRegressions", {}, "Pairs of the z and sigma regression output variables for each HitZ algorithm to be monitored"};
81 std::map<std::string, std::pair<SG::ConstAccessor<float>, SG::ConstAccessor<float>>> m_monitoredInferenceAccessors;
82
83
84 // Inputs
85 SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiInputKey {this, "InputRoIs", "", "Input RoI name"};
86 SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clustersInputKey {this, "InputCaloClusterContainer", "", "Caloclusters in view"};
87 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputKey {this, "InputVertexContainer", "", "Input vertex container"};
88 SG::ReadHandleKey<xAOD::TauJetContainer> m_tauJetInputKey {this, "InputTauJetContainer", "", "Input TauJet container"};
89 SG::ReadDecorHandleKeyArray<xAOD::TauJetContainer> m_tauJetInputDecorKeysArray {this, "InputTauJetCopyDecorKeys", {}, "Array of input TauJet decoration keys to copy on the output TauJet"};
90 SG::ReadHandleKey<xAOD::TauTrackContainer> m_tauTrackInputKey {this, "InputTauTrackContainer", "", "Input TauTrack container" };
91 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_hitsInputDecorKey{this, "InputTauJetHitsKey", "", "Input TauJet hits decoration key"};
92
93 // Outputs
94 SG::WriteHandleKey<xAOD::JetContainer> m_tauSeedOutputKey {this, "OutputJetSeed", "", "Output jets which are seeds for tau jets"};
95 SG::WriteHandleKey<xAOD::TauJetContainer> m_tauJetOutputKey {this, "OutputTauJetContainer", "", "Output TauJet container"};
97 SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputKey {this, "OutputTauTrackContainer", "", "Output TauTrack container"};
98 SG::WriteDecorHandleKey<xAOD::TauJetContainer> m_hitsOutputDecorKey{this, "OutputTauJetHitsKey", "", "Output TauJet hits decoration key"};
99
100
102};
103
104// Function to perform deep copy on container
105template<class V> StatusCode TrigTauRecMerged::deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const {
106 if(!writeHandle.isValid()) {
107 ATH_MSG_FATAL("Provided with an invalid write handle");
108 return StatusCode::FAILURE;
109 }
110
111 if(oldContainer){
112 for(const V* v : *oldContainer) {
113 // Build a new object in the new container
114 writeHandle->push_back(std::make_unique<V>());
115 // Copy across the aux store
116 *writeHandle->back() = *v;
117 }
118 }
119 return StatusCode::SUCCESS;
120}
121
122#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/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle 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::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_tauJetOutputDecorKeysArray
SG::WriteHandleKey< xAOD::TauJetContainer > m_tauJetOutputKey
Gaudi::Property< std::map< std::string, std::pair< std::string, std::string > > > m_monitoredHitZRegressions
SG::WriteHandleKey< xAOD::TauTrackContainer > m_tauTrackOutputKey
const ToolHandleArray< ITauToolBase > m_commonToolsBeforeTF
std::map< std::string, std::pair< SG::ConstAccessor< float >, SG::ConstAccessor< float > > > m_monitoredInferenceAccessors
SG::ReadHandleKey< xAOD::TauTrackContainer > m_tauTrackInputKey
virtual StatusCode initialize() override
SG::WriteHandleKey< xAOD::JetContainer > m_tauSeedOutputKey
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_hitsInputDecorKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_hitsOutputDecorKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexInputKey
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_clustersInputKey
SG::ReadDecorHandleKeyArray< xAOD::TauJetContainer > m_tauJetInputDecorKeysArray
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
DecorHandleKeyArray< ReadDecorHandle< T, S >, ReadDecorHandleKey< T >, Gaudi::DataHandle::Reader > ReadDecorHandleKeyArray
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray