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
18
21
28
30
31#include <map>
32#include <memory>
33
35public:
36 TrigTauRecMerged(const std::string& name, ISvcLocator* pSvcLocator);
37
38 virtual StatusCode initialize() override;
39 virtual StatusCode execute(const EventContext& ctx) const override;
40
41private:
42 template<class V> StatusCode deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const;
43
44 // Reconstruction mode
45 enum Mode {
46 FromClusters=0, // Calo reconstruction from calo clusters: CaloMVA step
47 FromTauJet=1, // Full tau reconstruction from existing tau jets + tracks: CaloHits and Precision steps
48 };
49
50 // Error codes for calo reconstruction
63
64 // Error codes for tracking
69
70 // Internal tools store
71 // The sequence of tool execution goes as follows:
72 // VertexFinderTools -> CommonToolsBeforeTF -> TrackFinderTools -> CommonTools -> VertexVarsTools -> IDTools
73 const ToolHandleArray<ITauToolBase> m_commonTools {this, "CommonTools", {}, "List of ITauToolBase common tools"};
74 const ToolHandleArray<ITauToolBase> m_commonToolsBeforeTF {this, "CommonToolsBeforeTF", {}, "List of ITauToolBase common tools to execute before the Track Finder tools"};
75 const ToolHandleArray<ITauToolBase> m_vertexFinderTools {this, "VertexFinderTools", {}, "Vertex Finder tools"};
76 const ToolHandleArray<ITauToolBase> m_trackFinderTools {this, "TrackFinderTools", {}, "Track Finder tools"};
77 const ToolHandleArray<ITauToolBase> m_vertexVarsTools {this, "VertexVarsTools", {}, "Vertex Variables tools"};
78 const ToolHandleArray<ITauToolBase> m_idTools {this, "IDTools", {}, "Vertex Variables tools"};
79
80 // Monitoring tool
81 const ToolHandle<GenericMonitoringTool> m_monTool {this, "MonTool", "", "Monitoring tool"};
82 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"};
83 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"};
84 std::map<std::string, std::pair<SG::ConstAccessor<float>, SG::ConstAccessor<float>>> m_monitoredInferenceAccessors;
85
86
87 // Inputs
88 SG::ReadHandleKey<TrigRoiDescriptorCollection> m_roiInputKey {this, "InputRoIs", "", "Input RoI name"};
89 SG::ReadHandleKey<xAOD::CaloClusterContainer> m_clustersInputKey {this, "InputCaloClusterContainer", "", "Caloclusters in view"};
90 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexInputKey {this, "InputVertexContainer", "", "Input vertex container"};
91 SG::ReadHandleKey<xAOD::TauJetContainer> m_tauJetInputKey {this, "InputTauJetContainer", "", "Input TauJet container"};
92 SG::ReadDecorHandleKeyArray<xAOD::TauJetContainer> m_tauJetInputDecorKeysArray {this, "InputTauJetCopyDecorKeys", {}, "Array of input TauJet decoration keys to copy on the output TauJet"};
93 SG::ReadHandleKey<xAOD::TauTrackContainer> m_tauTrackInputKey {this, "InputTauTrackContainer", "", "Input TauTrack container" };
94 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_hitsInputDecorKey {this, "InputTauJetHitsKey", "", "Input TauJet hits decoration key"};
95
96 // Outputs
97 SG::WriteHandleKey<xAOD::JetContainer> m_tauSeedOutputKey {this, "OutputJetSeed", "", "Output jets which are seeds for tau jets"};
98 SG::WriteHandleKey<xAOD::TauJetContainer> m_tauJetOutputKey {this, "OutputTauJetContainer", "", "Output TauJet container"};
100 SG::WriteHandleKey<xAOD::TauTrackContainer> m_tauTrackOutputKey {this, "OutputTauTrackContainer", "", "Output TauTrack container"};
101 SG::WriteDecorHandleKey<xAOD::TauJetContainer> m_hitsOutputDecorKey {this, "OutputTauJetHitsKey", "", "Output TauJet hits decoration key"};
102
103 // Shift HitZ inferences to detector coordinates
104 Gaudi::Property<std::map<std::string, std::string>> m_shiftToDetectorCoordinates {this, "ShiftToDetectorCoordinates", {}, "Map of HitZ regression z variable to the corresponding shifted variable to be filled in the monitoring"};
107 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey {this, "BeamSpotKey", "BeamSpotData", "Key for BeamSpot condition data"};
108
109
110
112};
113
114// Function to perform deep copy on container
115template<class V> StatusCode TrigTauRecMerged::deepCopy(SG::WriteHandle<DataVector<V>>& writeHandle, const DataVector<V>* oldContainer) const {
116 if(!writeHandle.isValid()) {
117 ATH_MSG_FATAL("Provided with an invalid write handle");
118 return StatusCode::FAILURE;
119 }
120
121 if(oldContainer){
122 for(const V* v : *oldContainer) {
123 // Build a new object in the new container
124 writeHandle->push_back(std::make_unique<V>());
125 // Copy across the aux store
126 *writeHandle->back() = *v;
127 }
128 }
129 return StatusCode::SUCCESS;
130}
131
132#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
Gaudi::Property< std::map< std::string, std::string > > m_shiftToDetectorCoordinates
SG::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_shiftToDetectorCoordinatesOutDecorKeysArray
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_shiftToDetectorCoordinatesInDecorKeysArray
SG::ReadDecorHandleKeyArray< xAOD::TauJetContainer > m_tauJetInputDecorKeysArray
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
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