ATLAS Offline Software
Loading...
Searching...
No Matches
HLTEDMCreator.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef TRIGOUTPUTHANDLING_HLTEDMCREATOR_H
5#define TRIGOUTPUTHANDLING_HLTEDMCREATOR_H 1
6
7// STL includes
8#include <string>
9// FrameWork includes
11
12// OutputHandling includes
17#include "AthViews/View.h"
18
27
29
32
45
48
50
52
54
60
72
86
87class HLTEDMCreator: public extends<AthAlgTool, IHLTOutputTool> {
88 public:
89 HLTEDMCreator( const std::string& type,
90 const std::string& name,
91 const IInterface* parent );
92
93 virtual ~HLTEDMCreator() override = default;
94 virtual StatusCode createOutput(const EventContext& context) const override;
95 virtual StatusCode initialize() override;
96
97
98 private:
99
101 Gaudi::Property<std::vector<std::string>> m_fixLinks{ this, "FixLinks", {}, "Which keys of the TrigCompositeContainer WriteHandleKeyArray might need to have their (e.g. feature) element links re-mapped outside of views"};
102 SG::WriteDecorHandleKeyArray<xAOD::TrigCompositeContainer, std::vector<SG::sgkey_t> > m_remapLinkColKeys{ this, "DoNotSet_RemapLinkColKeys", {}, "Do not set, it is configured accordingly to FixLinks & TC output property"};
103 SG::WriteDecorHandleKeyArray<xAOD::TrigCompositeContainer, std::vector<xAOD::TrigComposite::index_type> > m_remapLinkColIndices{ this, "DoNotSet_RemapLinkColIndices", {}, "Do not set, it is configured accordingly to FixLinks & TC output property"};
104
105 Gaudi::Property<bool> m_dumpSGBefore{ this, "dumpSGBefore", false, "Dump SG content before the merging"}; // for debugging
106 Gaudi::Property<bool> m_dumpSGAfter { this, "dumpSGAfter", false, "Dump SG content after the merging"};
107 Gaudi::Property<bool> m_renounceOutputs { this, "RenounceOutputs", false, "Renounce outputs so that no algs can become dependent on this tool's output. Done in HLT jobs"};
108
109#define DEF_VIEWS(__TYPE) \
110 SG::ReadHandleKeyArray< ViewContainer > m_##__TYPE##Views{ this, #__TYPE"Views", {}, "Name views from where the "#__TYPE" will be read"}
111
112
113
114#define DEF_KEY(__TYPE) \
115 SG::WriteHandleKeyArray<__TYPE> m_##__TYPE{ this, #__TYPE, {}, "Required collections of "#__TYPE}; \
116 DEF_VIEWS(__TYPE); \
117 SG::ReadHandleKeyArray<__TYPE> m_##__TYPE##InViews{ this, #__TYPE"InViews", {}, "Names of "#__TYPE" in respective views"}
118
119#define DEF_XAOD_KEY(__TYPE) \
120 SG::WriteHandleKeyArray<xAOD::__TYPE> m_##__TYPE{ this, #__TYPE, {}, "Required collections of xAOD::"#__TYPE};\
121 DEF_VIEWS(__TYPE); \
122 SG::ReadHandleKeyArray<xAOD::__TYPE> m_##__TYPE##InViews{ this, #__TYPE"InViews", {}, "Names of xAOD::"#__TYPE" in respective views"}
123
125
129 DEF_XAOD_KEY( TrigRingerRingsContainer );
134 DEF_XAOD_KEY( TrackParticleContainer );
136 DEF_XAOD_KEY( L2StandAloneMuonContainer );
137 DEF_XAOD_KEY( L2CombinedMuonContainer );
138 DEF_XAOD_KEY( L2IsoMuonContainer );
140 DEF_XAOD_KEY( TauJetContainer );
141 DEF_XAOD_KEY( DiTauJetContainer );
142 DEF_XAOD_KEY( TauTrackContainer );
144 DEF_XAOD_KEY( FlowElementContainer );
146 DEF_XAOD_KEY( VertexContainer );
147 DEF_XAOD_KEY( BTaggingContainer );
148 DEF_XAOD_KEY( BTagVertexContainer );
149 DEF_XAOD_KEY( TrigBphysContainer );
151 DEF_XAOD_KEY( HIEventShapeContainer );
153 DEF_XAOD_KEY( AFPSiHitsClusterContainer );
154 DEF_XAOD_KEY( AFPTrackContainer );
155 DEF_XAOD_KEY( AFPToFTrackContainer );
156 DEF_XAOD_KEY( AFPProtonContainer );
157 DEF_XAOD_KEY( AFPVertexContainer );
158
159 // Phase-I L1 RoIs EDM
160 DEF_XAOD_KEY( eFexEMRoIContainer );
161 DEF_XAOD_KEY( eFexTauRoIContainer );
162 DEF_XAOD_KEY( jFexTauRoIContainer );
163 DEF_XAOD_KEY( jFexFwdElRoIContainer );
164 DEF_XAOD_KEY( jFexSRJetRoIContainer );
165 DEF_XAOD_KEY( jFexLRJetRoIContainer );
166 DEF_XAOD_KEY( jFexMETRoIContainer );
167 DEF_XAOD_KEY( jFexSumETRoIContainer );
168 DEF_XAOD_KEY( gFexJetRoIContainer );
169 DEF_XAOD_KEY( gFexGlobalRoIContainer );
170 DEF_XAOD_KEY( MuonRoIContainer );
171
172#undef DEF_VIEWS
173#undef DEF_KEY
174#undef DEF_XAOD_KEY
175
176// special cases with different (ShallowAuxContainer ) (containers not in views)
177#define DEF_XAOD_KEY_SHALLOW(__TYPE) \
178 SG::ReadHandleKeyArray<xAOD::__TYPE> m_##__TYPE##ShallowCopy{ this, #__TYPE"ShallowCopy", {}, "Required collections with Aux of type ShallowAuxContainerxAOD::"#__TYPE}; \
179 SG::WriteHandleKeyArray<xAOD::__TYPE> m_##__TYPE##ShallowCopyOut{ this, #__TYPE"ShallowCopyOut", {}, "Output collections with Aux of type ShallowAuxContainerxAOD::"#__TYPE}
180
183
184
185#undef DEF_XAOD_KEY_SHALLOW
186
187 template<typename T>
198
207 template<typename T>
208 StatusCode initHandles( const HandlesGroup<T>& handles );
209
215 template<typename T>
216 StatusCode initAuxKey( const std::vector<SG::VarHandleKey*>& keys );
217
218 template<typename T>
229
230 StatusCode fixLinks( EventContext const& context ) const;
231
232 template<typename T, typename STORE, typename G, typename M >
233 StatusCode createIfMissing( const EventContext& context, const ConstHandlesGroup<T>& handles,
234 G& generator, M merger ) const;
235
236
237 template<typename T>
238 StatusCode viewsMerge( ViewContainer const& views, const SG::ReadHandleKey<T>& inViewKey,
239 EventContext const& context, T & output ) const;
240
241 template<typename T>
242 StatusCode noMerge( ViewContainer const& views, const SG::ReadHandleKey<T>& inViewKey,
243 EventContext const& context, T & output ) const;
244
245};
246
247
248#endif //> !TRIGOUTPUTHANDLING_HLTEDMCREATOR_H
JetContainer_v1 JetContainer
Definition of the current "jet container version".
#define G(x, y, z)
Definition MD5.cxx:113
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
DataVector< SG::View > ViewContainer
View container for recording in StoreGate.
Definition View.h:290
DEF_XAOD_KEY(jFexSRJetRoIContainer)
DEF_XAOD_KEY(L2StandAloneMuonContainer)
HLTEDMCreator(const std::string &type, const std::string &name, const IInterface *parent)
StatusCode createIfMissing(const EventContext &context, const ConstHandlesGroup< T > &handles, G &generator, M merger) const
DEF_XAOD_KEY(TrigT2MbtsBitsContainer)
Gaudi::Property< bool > m_dumpSGAfter
DEF_XAOD_KEY(eFexTauRoIContainer)
Gaudi::Property< bool > m_renounceOutputs
DEF_XAOD_KEY(MuonContainer)
virtual ~HLTEDMCreator() override=default
DEF_XAOD_KEY(gFexJetRoIContainer)
DEF_XAOD_KEY(TrigCompositeContainer)
DEF_XAOD_KEY_SHALLOW(CaloClusterContainer)
DEF_XAOD_KEY(TrackParticleContainer)
DEF_XAOD_KEY(DiTauJetContainer)
DEF_XAOD_KEY(BTagVertexContainer)
DEF_XAOD_KEY(gFexGlobalRoIContainer)
DEF_XAOD_KEY(TrigRingerRingsContainer)
DEF_XAOD_KEY(TrigCaloClusterContainer)
DEF_XAOD_KEY_SHALLOW(JetContainer)
StatusCode initAuxKey(const std::vector< SG::VarHandleKey * > &keys)
Register AuxStore keys for the given keys.
virtual StatusCode initialize() override
DEF_XAOD_KEY(jFexFwdElRoIContainer)
DEF_XAOD_KEY(TrigMissingETContainer)
DEF_XAOD_KEY(MuonRoIContainer)
DEF_XAOD_KEY(TrigEMClusterContainer)
DEF_XAOD_KEY(jFexTauRoIContainer)
StatusCode viewsMerge(ViewContainer const &views, const SG::ReadHandleKey< T > &inViewKey, EventContext const &context, T &output) const
DEF_XAOD_KEY(PhotonContainer)
DEF_XAOD_KEY(VertexContainer)
DEF_XAOD_KEY(jFexMETRoIContainer)
DEF_XAOD_KEY(ElectronContainer)
DEF_XAOD_KEY(FlowElementContainer)
StatusCode initHandles(const HandlesGroup< T > &handles)
Init related handles.
SG::WriteDecorHandleKeyArray< xAOD::TrigCompositeContainer, std::vector< SG::sgkey_t > > m_remapLinkColKeys
DEF_XAOD_KEY(AFPTrackContainer)
DEF_XAOD_KEY(TrigElectronContainer)
SG::WriteDecorHandleKeyArray< xAOD::TrigCompositeContainer, std::vector< xAOD::TrigComposite::index_type > > m_remapLinkColIndices
DEF_XAOD_KEY(AFPSiHitsClusterContainer)
DEF_XAOD_KEY(eFexEMRoIContainer)
DEF_XAOD_KEY(AFPToFTrackContainer)
DEF_XAOD_KEY(AFPProtonContainer)
DEF_XAOD_KEY(CaloClusterContainer)
Gaudi::Property< bool > m_dumpSGBefore
DEF_XAOD_KEY(TauJetContainer)
DEF_XAOD_KEY(JetContainer)
Gaudi::Property< std::vector< std::string > > m_fixLinks
DEF_XAOD_KEY(jFexSumETRoIContainer)
DEF_XAOD_KEY(AFPVertexContainer)
DEF_XAOD_KEY(L2CombinedMuonContainer)
DEF_XAOD_KEY(jFexLRJetRoIContainer)
virtual StatusCode createOutput(const EventContext &context) const override
DEF_XAOD_KEY(BTaggingContainer)
StatusCode fixLinks(EventContext const &context) const
StatusCode noMerge(ViewContainer const &views, const SG::ReadHandleKey< T > &inViewKey, EventContext const &context, T &output) const
DEF_XAOD_KEY(TrigPhotonContainer)
DEF_KEY(TrigRoiDescriptorCollection)
DEF_XAOD_KEY(TrigRNNOutputContainer)
DEF_XAOD_KEY(TauTrackContainer)
DEF_XAOD_KEY(L2IsoMuonContainer)
DEF_XAOD_KEY(HIEventShapeContainer)
DEF_XAOD_KEY(TrigBphysContainer)
Property holding a SG store/key/clid from which a ReadHandle is made.
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
HandleKeyArray< WriteHandle< T >, WriteHandleKey< T >, Gaudi::DataHandle::Writer > WriteHandleKeyArray
ConstHandlesGroup(const SG::WriteHandleKeyArray< T > &out_, const SG::ReadHandleKeyArray< T > &in_, const SG::ReadHandleKeyArray< ViewContainer > &views_)
const SG::WriteHandleKeyArray< T > & out
const SG::ReadHandleKeyArray< T > & in
const SG::ReadHandleKeyArray< ViewContainer > & views
SG::ReadHandleKeyArray< ViewContainer > & views
SG::WriteHandleKeyArray< T > & out
HandlesGroup(SG::WriteHandleKeyArray< T > &out_, SG::ReadHandleKeyArray< T > &in_, SG::ReadHandleKeyArray< ViewContainer > &views_)
SG::ReadHandleKeyArray< T > & in