ATLAS Offline Software
Loading...
Searching...
No Matches
TrigComposite_v1.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef XAODTRIGGER_VERSIONS_TRIGCOMPOSITE_V1_H
8#define XAODTRIGGER_VERSIONS_TRIGCOMPOSITE_V1_H
9
10// System include(s):
11extern "C" {
12# include <stdint.h>
13}
14#include <string>
15#include <vector>
16#include <set>
17
18// EDM include(s):
20#include "AthLinks/ElementLink.h"
22#include "SGCore/sgkey_t.h"
23
25
26namespace TrigCompositeUtils{
27 typedef unsigned int DecisionID;
28 typedef std::set<DecisionID> DecisionIDContainer;
29}
30
31namespace xAOD {
32
34 : public std::runtime_error
35 {
36 public:
37 ExcNotIParticleContainer (const std::string& msg);
38 };
39
50
51 public:
54
57
59 TrigComposite_v1( const TrigComposite_v1& parent );
60
63
66
68 const std::string& name() const;
70 void setName( const std::string& name );
71
73 const std::vector<TrigCompositeUtils::DecisionID>& decisions() const;
75 void setDecisions( const std::vector<TrigCompositeUtils::DecisionID>& decisions );
76
78
81
83 template< typename TYPE >
84 bool hasDetail( const std::string& name ) const;
85
87 template< typename TYPE >
88 bool setDetail( const std::string& name, const TYPE& value );
89
91 template< typename TYPE >
92 bool getDetail( const std::string& name, TYPE& value ) const;
93
95 template<typename TYPE>
96 TYPE getDetail( const std::string& name ) const;
97
99
102
104 template< class CONTAINER >
105 bool setObjectLink( const std::string& name,
106 const ElementLink< CONTAINER >& link );
108 bool hasObjectLink( const std::string& name, const CLID clid = CLID_NULL ) const;
110 template< class CONTAINER >
112 objectLink( const std::string& name ) const;
114 template< class OBJECT >
115 const OBJECT* object( const std::string& name ) const;
116
118 template< class CONTAINER >
119 bool addObjectCollectionLink( const std::string& collectionName,
120 const ElementLink< CONTAINER >& link );
122 template< class CONTAINER >
123 bool addObjectCollectionLinks( const std::string& collectionName,
124 const std::vector<ElementLink< CONTAINER >>& links );
126 bool hasObjectCollectionLinks( const std::string& collectionName, const CLID clid = CLID_NULL) const;
128 template< class CONTAINER >
129 std::vector<ElementLink< CONTAINER >>
130 objectCollectionLinks( const std::string& collectionName ) const;
131
133 void typelessSetObjectLink( const std::string& name,
134 const sgkey_t key,
135 const uint32_t clid,
136 const index_type beginIndex,
137 const index_type endIndex = 0 );
138
145 bool typelessGetObjectLink( const std::string& name,
146 sgkey_t& key,
147 uint32_t& clid,
148 index_type& index) const;
149
156 bool typelessGetObjectCollectionLinks( const std::string& name,
157 std::vector<sgkey_t>& keyVec,
158 std::vector<uint32_t>& clidVec,
159 std::vector<index_type>& indexVec) const;
160
161
164 template< class CONTAINER >
165 std::vector<std::string> getObjectNames() const;
166
169 template< class CONTAINER >
170 std::vector<std::string> getObjectCollectionNames() const;
171
174 std::vector<std::string> getObjectNames(const CLID clid) const;
175
178 std::vector<std::string> getObjectCollectionNames(const CLID clid) const;
179
183 bool removeObjectLink(const std::string& name);
184
188 bool removeObjectCollectionLinks(const std::string& name);
189
191
194
201 bool copyLinkFrom(const xAOD::TrigComposite_v1& other, const std::string& name, std::string newName = "");
202 bool copyLinkFrom(const xAOD::TrigComposite_v1* other, const std::string& name, std::string newName = "");
203
210 bool copyLinkCollectionFrom(const xAOD::TrigComposite_v1& other, const std::string& name, std::string newName = "");
211 bool copyLinkCollectionFrom(const xAOD::TrigComposite_v1* other, const std::string& name, std::string newName = "");
212
219
220
222
225
227 const std::vector< std::string >& linkColNames() const;
229 const std::vector< sgkey_t >& linkColKeys() const;
231 const std::vector< index_type >& linkColIndices() const;
233 const std::vector< uint32_t >& linkColClids() const;
234
238 bool isRemapped() const;
239
241 const std::vector< sgkey_t >& linkColKeysRemap() const;
243 const std::vector< index_type >& linkColIndicesRemap() const;
244
246
248 static bool s_throwOnCopyError ATLAS_THREAD_SAFE;
249
251 static const std::string s_initialRoIString;
253 static const std::string s_initialRecRoIString;
255 static const std::string s_roiString;
257 static const std::string s_viewString;
259 static const std::string s_featureString;
261 static const std::string s_seedString;
262
264 static const std::string s_hltSeedingNodeNameString;
266 static const std::string s_filterNodeNameString;
268 static const std::string s_inputMakerNodeNameString;
270 static const std::string s_hypoAlgNodeNameString;
272 static const std::string s_comboHypoAlgNodeNameString;
275 static const std::string s_summaryFilterNodeNameString;
278 static const std::string s_summaryPassNodeNameString;
281 static const std::string s_summaryPassExpressNodeNameString;
284 static const std::string s_summaryPrescaledNodeNameString;
285
286 private:
288 std::vector< std::string >& linkColNamesNC();
290 std::vector< sgkey_t >& linkColKeysNC();
292 std::vector< index_type >& linkColIndicesNC();
294 std::vector< uint32_t >& linkColClidsNC();
295
296 // Helper function, check for exact link match
297 bool hasObjectLinkExact(const std::string& name, const sgkey_t key, const index_type index, const uint32_t clid) const;
298
300 void copyLinkInternal(const xAOD::TrigComposite_v1& other, const size_t index, const std::string& newName);
301
303 bool derivesFromIParticle(const CLID clid) const;
304
306 template< class CONTAINER >
307 void checkTypes(const CLID storedCLID, const std::string& name) const;
308
309
310 static const std::string s_collectionSuffix;
311
312 }; // class TrigComposite_v1
313
317std::ostream& operator<<(std::ostream& os, const xAOD::TrigComposite_v1& tc);
318
319
320} // namespace xAOD
321
322// Include the template implementation:
323#include "TrigComposite_v1.icc"
324
325#endif // XAODTRIGGER_VERSIONS_TRIGCOMPOSITE_V1_H
Base class for elements of a container that can have aux data.
uint32_t CLID
The Class ID type.
static Double_t tc
#define TYPE(CODE, TYP, IOTYP)
Define macros for attributes used to control the static checker.
Base class for elements of a container that can have aux data.
Definition AuxElement.h:483
ExcNotIParticleContainer(const std::string &msg)
Class used to describe composite objects in the HLT.
bool derivesFromIParticle(const CLID clid) const
Helper function. Check if the requested type can be down cast to an IParticle transient interface.
static const std::string s_summaryFilterNodeNameString
Constant used to identify a navigation graph node as being from a final Filter created by the Decisio...
static const std::string s_collectionSuffix
static const std::string s_filterNodeNameString
Constant used to identify a navigation graph node as being from a Filter.
bool copyAllLinksFrom(const xAOD::TrigComposite_v1 &other)
Copy all single links and collections of links from another object.
bool hasDetail(const std::string &name) const
Check if a given type of detail is available.
void setDecisions(const std::vector< TrigCompositeUtils::DecisionID > &decisions)
Set positive HLT chain decisions associated with this TrigComposite. Navigation use.
bool isRemapped() const
Information on if linkColKeys() and linkColIndices() are able to access remapped link data Remapping ...
void checkTypes(const CLID storedCLID, const std::string &name) const
Helper function. Contains type logic check for use during actual link retrieval. Throws on error.
void setName(const std::string &name)
Set a human-readable name for the object.
bool addObjectCollectionLink(const std::string &collectionName, const ElementLink< CONTAINER > &link)
Add a link to a single object within a collection. Performs de-duplication.
std::vector< index_type > & linkColIndicesNC()
Raw access to the persistent link indices (non-const)
bool setObjectLink(const std::string &name, const ElementLink< CONTAINER > &link)
Set the link to an object.
const std::vector< sgkey_t > & linkColKeysRemap() const
Raw access to the persistent link labels. Will attempt to access remapped link data.
static bool s_throwOnCopyError ATLAS_THREAD_SAFE
For use in validation, when copying element links from one object to another.
const std::vector< std::string > & linkColNames() const
Raw access to the persistent link names.
static const std::string s_inputMakerNodeNameString
Constant used to identify a navigation graph node as being from a Input Maker.
void typelessSetObjectLink(const std::string &name, const sgkey_t key, const uint32_t clid, const index_type beginIndex, const index_type endIndex=0)
Add a link without type.
const std::vector< TrigCompositeUtils::DecisionID > & decisions() const
Get positive HLT chain decisions associated with this TrigComposite. Navigation use.
TrigComposite_v1 & operator=(const TrigComposite_v1 &rhs)
Assignment operator.
bool hasObjectLink(const std::string &name, const CLID clid=CLID_NULL) const
Check if a link to an object with a given name and type exists. CLID_NULL to not check type.
void copyLinkInternal(const xAOD::TrigComposite_v1 &other, const size_t index, const std::string &newName)
Helper function, copy one link into this object.
const std::vector< index_type > & linkColIndicesRemap() const
Raw access to the persistent link indices. Will attempt to access remapped link data.
static const std::string s_summaryPrescaledNodeNameString
Constant used to identify the single prescaled graph node.
bool setDetail(const std::string &name, const TYPE &value)
Set an TYPE detail on the object.
std::vector< ElementLink< CONTAINER > > objectCollectionLinks(const std::string &collectionName) const
Get a vector of all element links from the collection.
std::vector< uint32_t > & linkColClidsNC()
Raw access to the persistent link CLIDs (non-const)
bool removeObjectLink(const std::string &name)
Delete any stored element link with the given name.
const OBJECT * object(const std::string &name) const
Get a bare pointer with the requested name.
bool addObjectCollectionLinks(const std::string &collectionName, const std::vector< ElementLink< CONTAINER > > &links)
Add links to multiple objects within a collection. Performs de-duplication.
bool typelessGetObjectLink(const std::string &name, sgkey_t &key, uint32_t &clid, index_type &index) const
Fetches a single link without type.
static const std::string s_seedString
Constant used to identify a seed (parent)
static const std::string s_hltSeedingNodeNameString
Constant used to identify a navigation graph node as being from the HLTSeeding.
bool copyLinkFrom(const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
Copy one named link from another object.
std::vector< sgkey_t > & linkColKeysNC()
Raw access to the persistent link labels (non-const)
static const std::string s_initialRoIString
Constant used to identify an initial ROI from L1.
bool getDetail(const std::string &name, TYPE &value) const
Get an TYPE detail from the object.
std::vector< std::string > & linkColNamesNC()
Raw access to the persistent link names (non-const)
static const std::string s_viewString
Constant used to identify a view.
bool hasObjectLinkExact(const std::string &name, const sgkey_t key, const index_type index, const uint32_t clid) const
TrigComposite_v1()
Default constructor.
const std::vector< index_type > & linkColIndices() const
Raw access to the persistent link indices.
bool typelessGetObjectCollectionLinks(const std::string &name, std::vector< sgkey_t > &keyVec, std::vector< uint32_t > &clidVec, std::vector< index_type > &indexVec) const
Fetches a collection of links without type.
bool hasObjectCollectionLinks(const std::string &collectionName, const CLID clid=CLID_NULL) const
Check if links exist to a collection of objects with given name and type. CLID_NULL to not check type...
static const std::string s_comboHypoAlgNodeNameString
Constant used to identify a navigation graph node as being from a Combo Hypo Alg.
std::vector< std::string > getObjectNames() const
Look up all links stored to objects of (container) type CONTAINER.
const std::vector< sgkey_t > & linkColKeys() const
Raw access to the persistent link labels.
ElementLink< CONTAINER > objectLink(const std::string &name) const
Get the link with the requested name.
static const std::string s_featureString
Constant used to identify a feature.
static const std::string s_summaryPassExpressNodeNameString
Constant used to identify the single express-accept graph node.
static const std::string s_initialRecRoIString
Constant used to identify an initial HLT ROI derived from L1.
const std::string & name() const
Get a human-readable name for the object.
TYPE getDetail(const std::string &name) const
Get a detail by name, missing detail will throw SG::ExcBadAuxVar.
static const std::string s_hypoAlgNodeNameString
Constant used to identify a navigation graph node as being from a Hypo Alg.
const std::vector< uint32_t > & linkColClids() const
Raw access to the persistent link CLIDs.
std::vector< std::string > getObjectCollectionNames() const
Look up all links stored to collections objects from (container) type CONTAINER.
bool copyLinkCollectionFrom(const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
Copy one named link collection from another object.
bool removeObjectCollectionLinks(const std::string &name)
Delete any stored collection of element links with the given name.
static const std::string s_summaryPassNodeNameString
Constant used to identify the single terminus graph node the end point of all chains which accept the...
static const std::string s_roiString
Constant used to identify an (explicitly) updated HLT ROI.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
Definition sgkey_t.h:32
unsigned int DecisionID
std::set< DecisionID > DecisionIDContainer
Definition index.py:1
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
setEventNumber uint32_t
MsgStream & msg
Definition testRead.cxx:32