ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::TrigComposite_v1 Class Reference

Class used to describe composite objects in the HLT. More...

#include <TrigComposite_v1.h>

Inheritance diagram for xAOD::TrigComposite_v1:
Collaboration diagram for xAOD::TrigComposite_v1:

Public Types

using sgkey_t = SG::sgkey_t
using index_type = uint32_t

Public Member Functions

 TrigComposite_v1 ()
 Default constructor.
 TrigComposite_v1 (const TrigComposite_v1 &parent)
 Copy constructor.
TrigComposite_v1operator= (const TrigComposite_v1 &rhs)
 Assignment operator.
Basic properties
const std::string & name () const
 Get a human-readable name for the object.
void setName (const std::string &name)
 Set a human-readable name for the object.
const std::vector< TrigCompositeUtils::DecisionID > & decisions () const
 Get positive HLT chain decisions associated with this TrigComposite. Navigation use.
void setDecisions (const std::vector< TrigCompositeUtils::DecisionID > &decisions)
 Set positive HLT chain decisions associated with this TrigComposite. Navigation use.
Functions for accessing basic properties on the object
template<typename TYPE>
bool hasDetail (const std::string &name) const
 Check if a given type of detail is available.
template<typename TYPE>
bool setDetail (const std::string &name, const TYPE &value)
 Set an TYPE detail on the object.
template<typename TYPE>
bool getDetail (const std::string &name, TYPE &value) const
 Get an TYPE detail from the object.
template<typename TYPE>
TYPE getDetail (const std::string &name) const
 Get a detail by name, missing detail will throw SG::ExcBadAuxVar.
Functions for accessing links to component objects and object collections
template<class CONTAINER>
bool setObjectLink (const std::string &name, const ElementLink< CONTAINER > &link)
 Set the link to an object.
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.
template<class CONTAINER>
ElementLink< CONTAINER > objectLink (const std::string &name) const
 Get the link with the requested name.
template<class OBJECT>
const OBJECT * object (const std::string &name) const
 Get a bare pointer with the requested name.
template<class CONTAINER>
bool addObjectCollectionLink (const std::string &collectionName, const ElementLink< CONTAINER > &link)
 Add a link to a single object within a collection. Performs de-duplication.
template<class CONTAINER>
bool addObjectCollectionLinks (const std::string &collectionName, const std::vector< ElementLink< CONTAINER > > &links)
 Add links to multiple objects within a collection. Performs de-duplication.
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.
template<class CONTAINER>
std::vector< ElementLink< CONTAINER > > objectCollectionLinks (const std::string &collectionName) const
 Get a vector of all element links from the collection.
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.
bool typelessGetObjectLink (const std::string &name, sgkey_t &key, uint32_t &clid, index_type &index) const
 Fetches a single link without type.
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.
template<class CONTAINER>
std::vector< std::string > getObjectNames () const
 Look up all links stored to objects of (container) type CONTAINER.
template<class CONTAINER>
std::vector< std::string > getObjectCollectionNames () const
 Look up all links stored to collections objects from (container) type CONTAINER.
std::vector< std::string > getObjectNames (const CLID clid) const
 Type erased look up all links stored to objects of (container) type clid.
std::vector< std::string > getObjectCollectionNames (const CLID clid) const
 Type erased look up all links stored to collections objects from (container) type clid.
bool removeObjectLink (const std::string &name)
 Delete any stored element link with the given name.
bool removeObjectCollectionLinks (const std::string &name)
 Delete any stored collection of element links with the given name.
Functions for copying links between objects
bool copyLinkFrom (const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
 Copy one named link from another object.
bool copyLinkFrom (const xAOD::TrigComposite_v1 *other, const std::string &name, std::string newName="")
bool copyLinkCollectionFrom (const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
 Copy one named link collection from another object.
bool copyLinkCollectionFrom (const xAOD::TrigComposite_v1 *other, const std::string &name, std::string newName="")
bool copyAllLinksFrom (const xAOD::TrigComposite_v1 &other)
 Copy all single links and collections of links from another object.
bool copyAllLinksFrom (const xAOD::TrigComposite_v1 *other)
Functions for accessing raw data used to construct ElementLinks
const std::vector< std::string > & linkColNames () const
 Raw access to the persistent link names.
const std::vector< sgkey_t > & linkColKeys () const
 Raw access to the persistent link labels.
const std::vector< index_type > & linkColIndices () const
 Raw access to the persistent link indices.
const std::vector< uint32_t > & linkColClids () const
 Raw access to the persistent link CLIDs.
bool isRemapped () const
 Information on if linkColKeys() and linkColIndices() are able to access remapped link data Remapping happens at the end of HLT execution when EDM objects are copied out of their per-EventView containers and into the global Trigger EDM containers.
const std::vector< sgkey_t > & linkColKeysRemap () const
 Raw access to the persistent link labels. Will attempt to access remapped link data.
const std::vector< index_type > & linkColIndicesRemap () const
 Raw access to the persistent link indices. Will attempt to access remapped link data.

Static Public Attributes

static bool s_throwOnCopyError ATLAS_THREAD_SAFE
 For use in validation, when copying element links from one object to another.
static const std::string s_initialRoIString {"initialRoI"}
 Constant used to identify an initial ROI from L1.
static const std::string s_initialRecRoIString {"initialRecRoI"}
 Constant used to identify an initial HLT ROI derived from L1.
static const std::string s_roiString {"roi"}
 Constant used to identify an (explicitly) updated HLT ROI.
static const std::string s_viewString {"view"}
 Constant used to identify a view.
static const std::string s_featureString {"feature"}
 Constant used to identify a feature.
static const std::string s_seedString {"seed"}
 Constant used to identify a seed (parent).
static const std::string s_hltSeedingNodeNameString {"L1"}
 Constant used to identify a navigation graph node as being from the HLTSeeding.
static const std::string s_filterNodeNameString {"F"}
 Constant used to identify a navigation graph node as being from a Filter.
static const std::string s_inputMakerNodeNameString {"IM"}
 Constant used to identify a navigation graph node as being from a Input Maker.
static const std::string s_hypoAlgNodeNameString {"H"}
 Constant used to identify a navigation graph node as being from a Hypo Alg.
static const std::string s_comboHypoAlgNodeNameString {"CH"}
 Constant used to identify a navigation graph node as being from a Combo Hypo Alg.
static const std::string s_summaryFilterNodeNameString {"SF"}
 Constant used to identify a navigation graph node as being from a final Filter created by the DecisionSummaryMaker algorithm.
static const std::string s_summaryPassNodeNameString {"HLTPassRaw"}
 Constant used to identify the single terminus graph node the end point of all chains which accept the event.
static const std::string s_summaryPassExpressNodeNameString {"HLTPassExpress"}
 Constant used to identify the single express-accept graph node.
static const std::string s_summaryPrescaledNodeNameString {"HLTPrescaled"}
 Constant used to identify the single prescaled graph node.

Private Member Functions

std::vector< std::string > & linkColNamesNC ()
 Raw access to the persistent link names (non-const).
std::vector< sgkey_t > & linkColKeysNC ()
 Raw access to the persistent link labels (non-const).
std::vector< index_type > & linkColIndicesNC ()
 Raw access to the persistent link indices (non-const).
std::vector< uint32_t > & linkColClidsNC ()
 Raw access to the persistent link CLIDs (non-const).
bool hasObjectLinkExact (const std::string &name, const sgkey_t key, const index_type index, const uint32_t clid) const
void copyLinkInternal (const xAOD::TrigComposite_v1 &other, const size_t index, const std::string &newName)
 Helper function, copy one link into this object.
bool derivesFromIParticle (const CLID clid) const
 Helper function. Check if the requested type can be down cast to an IParticle transient interface.
template<class CONTAINER>
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.

Static Private Attributes

static const std::string s_collectionSuffix {"__COLL"}

Detailed Description

Class used to describe composite objects in the HLT.

This is a generic class for describing the output of high-level HLT algorithms that combine lower-level objects into one.

Author
Tomasz Bold Tomas.nosp@m.z.Bo.nosp@m.ld@ce.nosp@m.rn.c.nosp@m.h
Camille Belanger-Champagne Camil.nosp@m.le.B.nosp@m.elang.nosp@m.er-C.nosp@m.hampa.nosp@m.gne@.nosp@m.cern..nosp@m.ch
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h

Definition at line 49 of file TrigComposite_v1.h.

Member Typedef Documentation

◆ index_type

◆ sgkey_t

Constructor & Destructor Documentation

◆ TrigComposite_v1() [1/2]

xAOD::TrigComposite_v1::TrigComposite_v1 ( )

Default constructor.

Definition at line 77 of file TrigComposite_v1.cxx.

77 {
78 }

◆ TrigComposite_v1() [2/2]

xAOD::TrigComposite_v1::TrigComposite_v1 ( const TrigComposite_v1 & parent)

Copy constructor.

Definition at line 80 of file TrigComposite_v1.cxx.

80 : SG::AuxElement(parent) {
81 this->makePrivateStore( parent );
82 }
void makePrivateStore()
Create a new (empty) private store for this object.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.

Member Function Documentation

◆ addObjectCollectionLink()

template<class CONTAINER>
bool xAOD::TrigComposite_v1::addObjectCollectionLink ( const std::string & collectionName,
const ElementLink< CONTAINER > & link )

Add a link to a single object within a collection. Performs de-duplication.

◆ addObjectCollectionLinks()

template<class CONTAINER>
bool xAOD::TrigComposite_v1::addObjectCollectionLinks ( const std::string & collectionName,
const std::vector< ElementLink< CONTAINER > > & links )

Add links to multiple objects within a collection. Performs de-duplication.

◆ checkTypes()

template<class CONTAINER>
void xAOD::TrigComposite_v1::checkTypes ( const CLID storedCLID,
const std::string & name ) const
private

Helper function. Contains type logic check for use during actual link retrieval. Throws on error.

◆ copyAllLinksFrom() [1/2]

bool xAOD::TrigComposite_v1::copyAllLinksFrom ( const xAOD::TrigComposite_v1 & other)

Copy all single links and collections of links from another object.

Will not overwrite existing links, or link collections, or append to existing link collections.

Parameters
otherTrigComposite object to copy all links and link collections from, which do not already exist.
Returns
True on successful copy of at least one link

Definition at line 180 of file TrigComposite_v1.cxx.

180 {
181 bool didCopy = false;
182 for (const std::string& name : other.linkColNames()) {
183 // Check we don't have one (or more) entries with this raw name (raw = might be mangled).
184 if (this->hasObjectLink(name)) continue;
185 // Check if the link is for a single object or collection of objects by looking for the mangled suffix
186 if (name.ends_with(s_collectionSuffix)) {
187 // The copyLinkCollectionFrom call needs the un-mangled name as it is a public fn. It will re-mangle.
188 const std::string unmangledName = name.substr(0, name.size() - s_collectionSuffix.size());
189 copyLinkCollectionFrom(other, unmangledName);
190 } else { // not a collection
192 }
193 didCopy = true;
194 }
195 return didCopy;
196 }
static const std::string s_collectionSuffix
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.
bool copyLinkFrom(const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
Copy one named link from another object.
const std::string & name() const
Get a human-readable name for the object.
bool copyLinkCollectionFrom(const xAOD::TrigComposite_v1 &other, const std::string &name, std::string newName="")
Copy one named link collection from another object.

◆ copyAllLinksFrom() [2/2]

bool xAOD::TrigComposite_v1::copyAllLinksFrom ( const xAOD::TrigComposite_v1 * other)

Definition at line 198 of file TrigComposite_v1.cxx.

198 {
199 return copyAllLinksFrom(*other);
200 }
bool copyAllLinksFrom(const xAOD::TrigComposite_v1 &other)
Copy all single links and collections of links from another object.

◆ copyLinkCollectionFrom() [1/2]

bool xAOD::TrigComposite_v1::copyLinkCollectionFrom ( const xAOD::TrigComposite_v1 & other,
const std::string & name,
std::string newName = "" )

Copy one named link collection from another object.

Will not overwrite or append to an existing collection of links

Parameters
otherTrigComposite object to copy the link collection from
nameName of link collection
newNameOptional parameter to rename the link collection during the copy
Returns
True on successful copy

Definition at line 151 of file TrigComposite_v1.cxx.

151 {
152 bool didCopy = false;
153 // Check for the existence of a collection.
154 if (newName.empty()) {
155 newName = name;
156 }
157 const std::string mangledName = name + s_collectionSuffix;
158 const std::string mangledNewName = newName + s_collectionSuffix;
159 if (other.hasObjectLink(mangledName)) {
160 if (this->hasObjectLink(mangledNewName)) {
161 if (s_throwOnCopyError) throw std::runtime_error("Already have link collection with name " + newName);
162 } else {
163 // Copy all links in the collection. Just iterating through the source vector
164 for (size_t index = 0; index < other.linkColNames().size(); ++index) {
165 if (other.linkColNames().at(index) == mangledName) {
166 copyLinkInternal(other, index, mangledNewName);
167 }
168 }
169 didCopy = true;
170 }
171 }
172 if (!didCopy && s_throwOnCopyError) throw std::runtime_error("Could not find link with name " + name);
173 return didCopy;
174 }
size_t size() const
Number of registered mappings.
void copyLinkInternal(const xAOD::TrigComposite_v1 &other, const size_t index, const std::string &newName)
Helper function, copy one link into this object.
str index
Definition DeMoScan.py:362

◆ copyLinkCollectionFrom() [2/2]

bool xAOD::TrigComposite_v1::copyLinkCollectionFrom ( const xAOD::TrigComposite_v1 * other,
const std::string & name,
std::string newName = "" )

Definition at line 176 of file TrigComposite_v1.cxx.

176 {
177 return copyLinkCollectionFrom(*other, name, std::move(newName));
178 }

◆ copyLinkFrom() [1/2]

bool xAOD::TrigComposite_v1::copyLinkFrom ( const xAOD::TrigComposite_v1 & other,
const std::string & name,
std::string newName = "" )

Copy one named link from another object.

Will not overwrite an existing link

Parameters
otherTrigComposite object to copy the link from
nameName of link to copy
newNameOptional parameter to rename the link during the copy
Returns
True on successful copy

Definition at line 126 of file TrigComposite_v1.cxx.

126 {
127 if (newName.empty()) {
128 newName = name;
129 }
130 bool didCopy = false;
131 // Check for the existence of single link
132 std::vector<std::string>::const_iterator locationIt;
133 locationIt = std::find(other.linkColNames().begin(), other.linkColNames().end(), name);
134 if (locationIt != other.linkColNames().end()) {
135 size_t index = std::distance(other.linkColNames().begin(), locationIt);
136 if (this->hasObjectLink(newName)) {
137 if (s_throwOnCopyError) throw std::runtime_error("Already have link with name " + newName);
138 } else {
139 copyLinkInternal(other, index, newName);
140 didCopy = true;
141 }
142 }
143 if (!didCopy && s_throwOnCopyError) throw std::runtime_error("Could not find link with name " + name);
144 return didCopy;
145 }

◆ copyLinkFrom() [2/2]

bool xAOD::TrigComposite_v1::copyLinkFrom ( const xAOD::TrigComposite_v1 * other,
const std::string & name,
std::string newName = "" )

Definition at line 147 of file TrigComposite_v1.cxx.

147 {
148 return copyLinkFrom(*other, name, std::move(newName));
149 }

◆ copyLinkInternal()

setDecisions void xAOD::TrigComposite_v1::copyLinkInternal ( const xAOD::TrigComposite_v1 & other,
const size_t index,
const std::string & newName )
private

Helper function, copy one link into this object.

Definition at line 114 of file TrigComposite_v1.cxx.

114 {
115 this->linkColNamesNC().push_back( newName );
116 this->linkColClidsNC().push_back( other.linkColClids().at(index) );
117 if (other.isRemapped()) {
118 this->linkColKeysNC().push_back( other.linkColKeysRemap().at(index) );
119 this->linkColIndicesNC().push_back( other.linkColIndicesRemap().at(index) );
120 } else {
121 this->linkColKeysNC().push_back( other.linkColKeys().at(index) );
122 this->linkColIndicesNC().push_back( other.linkColIndices().at(index) );
123 }
124 }
std::vector< index_type > & linkColIndicesNC()
Raw access to the persistent link indices (non-const).
std::vector< uint32_t > & linkColClidsNC()
Raw access to the persistent link CLIDs (non-const).
std::vector< sgkey_t > & linkColKeysNC()
Raw access to the persistent link labels (non-const).
std::vector< std::string > & linkColNamesNC()
Raw access to the persistent link names (non-const).

◆ decisions()

const std::vector< TrigCompositeUtils::DecisionID > & xAOD::TrigComposite_v1::decisions ( ) const

Get positive HLT chain decisions associated with this TrigComposite. Navigation use.

◆ derivesFromIParticle()

bool xAOD::TrigComposite_v1::derivesFromIParticle ( const CLID clid) const
private

Helper function. Check if the requested type can be down cast to an IParticle transient interface.

Definition at line 293 of file TrigComposite_v1.cxx.

293 {
294 // Explicit checks (mostly for AnalysisBase). Hard code any CLIDs which may cause issues.
295 if (clid == ClassID_traits<xAOD::HIEventShapeContainer>::ID()) return false;
296 if (clid == ClassID_traits<xAOD::TrigMissingETContainer>::ID()) return false;
297 if (clid == ClassID_traits<xAOD::TrigCompositeContainer>::ID()) return false; // Used by some legs as a dummy feature
298#ifndef XAOD_STANDALONE
299 // If in an Athena build we can perform a more thorough inheritance check
300 const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (clid);
301 if (bib) {
303 }
304 // No base info available means we never called any of the macros declaring bases so it's
305 // likely that the clid doesn't inherit from IParticle...
306 return false;
307#endif
308 return true;
309 }
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:570
bool is_base(CLID clid) const
Return true if clid is the ID of a class that is known to be a base of T.
Definition BaseInfo.cxx:344

◆ getDetail() [1/2]

template<typename TYPE>
TYPE xAOD::TrigComposite_v1::getDetail ( const std::string & name) const

Get a detail by name, missing detail will throw SG::ExcBadAuxVar.

◆ getDetail() [2/2]

template<typename TYPE>
bool xAOD::TrigComposite_v1::getDetail ( const std::string & name,
TYPE & value ) const

Get an TYPE detail from the object.

◆ getObjectCollectionNames() [1/2]

template<class CONTAINER>
std::vector< std::string > xAOD::TrigComposite_v1::getObjectCollectionNames ( ) const

Look up all links stored to collections objects from (container) type CONTAINER.

Returns
Vector of names to all collections of links to objects

◆ getObjectCollectionNames() [2/2]

std::vector< std::string > xAOD::TrigComposite_v1::getObjectCollectionNames ( const CLID clid) const

Type erased look up all links stored to collections objects from (container) type clid.

Returns
Vector of names to all collections of links to objects

Definition at line 495 of file TrigComposite_v1.cxx.

495 {
496
497 std::vector< std::string > returnVec;
498 const std::vector< std::string >& names = linkColNames();
499 const std::vector< uint32_t >& clids = linkColClids();
500
501 for( size_t i = 0; i < names.size(); ++i ) {
502 if (names[i].find(s_collectionSuffix) == std::string::npos) { // Note: ==
503 continue; // ARE interested in collection links here
504 }
505 bool clidMatch = false;
507 clidMatch = derivesFromIParticle(clids[i]);
508 } else if (clid == clids[i]) {
509 clidMatch = true;
510 }
511 if (clidMatch) {
512 // Unlike with single links, we expect to find multiple links here. Only add the name once.
513 // Name is mangled in storage, need to un-mangle it before returning it to the user.
514 const std::string unmangledName = names[i].substr(0, names[i].size() - s_collectionSuffix.size());
515 if ( std::none_of(returnVec.begin(), returnVec.end(), [&](const auto& s) {return unmangledName == s;}) ) {
516 returnVec.push_back( std::move(unmangledName) );
517 }
518 }
519 }
520 return returnVec;
521 }
bool derivesFromIParticle(const CLID clid) const
Helper function. Check if the requested type can be down cast to an IParticle transient interface.
const std::vector< std::string > & linkColNames() const
Raw access to the persistent link names.
const std::vector< uint32_t > & linkColClids() const
Raw access to the persistent link CLIDs.
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140
static const EventInfo_v1::Accessor< std::vector< std::string > > names("streamTagNames")

◆ getObjectNames() [1/2]

template<class CONTAINER>
std::vector< std::string > xAOD::TrigComposite_v1::getObjectNames ( ) const

Look up all links stored to objects of (container) type CONTAINER.

Returns
Vector of names to all links to objects

◆ getObjectNames() [2/2]

std::vector< std::string > xAOD::TrigComposite_v1::getObjectNames ( const CLID clid) const

Type erased look up all links stored to objects of (container) type clid.

Returns
Vector of names to all links to objects

Definition at line 472 of file TrigComposite_v1.cxx.

472 {
473
474 std::vector< std::string > returnVec;
475 const std::vector< std::string >& names = linkColNames();
476 const std::vector< uint32_t >& clids = linkColClids();
477
478 for( size_t i = 0; i < names.size(); ++i ) {
479 if (names[i].find(s_collectionSuffix) != std::string::npos) { //Note: !=
480 continue; // ARE *NOT* interested in collection links here
481 }
482 bool clidMatch = false;
484 clidMatch = derivesFromIParticle(clids[i]);
485 } else if (clid == clids[i]) {
486 clidMatch = true;
487 }
488 if (clidMatch) {
489 returnVec.push_back( names[i] );
490 }
491 }
492 return returnVec;
493 }

◆ hasDetail()

template<typename TYPE>
bool xAOD::TrigComposite_v1::hasDetail ( const std::string & name) const

Check if a given type of detail is available.

◆ hasObjectCollectionLinks()

bool xAOD::TrigComposite_v1::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.

Definition at line 276 of file TrigComposite_v1.cxx.

276 {
277 const std::string mangledName = collectionName + s_collectionSuffix;
278 return hasObjectLink( mangledName, clid );
279 }

◆ hasObjectLink()

bool xAOD::TrigComposite_v1::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.

Definition at line 247 of file TrigComposite_v1.cxx.

247 {
248
249 // Since this function shouldn't throw exceptions too easily,
250 // let's be super careful here...
251 if( ! (acc_linkColNames.isAvailable( *this ) || acc_linkColClids.isAvailable( *this) ) ) {
252 return false;
253 }
254
255 // The check itself is pretty simple:
256 const std::vector< std::string >& names = acc_linkColNames( *this );
257 const std::vector< uint32_t >& clids = acc_linkColClids( *this );
258
259 std::vector<std::string>::const_iterator vecIt = std::find( names.begin(), names.end(), name );
260 if (vecIt == names.end()) {
261 return false; // Could not find name
262 }
263
264 if (clid != CLID_NULL) { // Also check against clid
265 const uint32_t storedCLID = clids.at( std::distance( names.begin(), vecIt ) );
267 return derivesFromIParticle(storedCLID);
268 } else if (storedCLID != clid) { // Otherwise we require the ID to match
269 return false; // Type missmatch
270 }
271 }
272
273 return true; // Satisfied
274 }
static const SG::Accessor< std::vector< uint32_t > > acc_linkColClids("linkColClids")
static const SG::Accessor< std::vector< std::string > > acc_linkColNames("linkColNames")
setEventNumber uint32_t

◆ hasObjectLinkExact()

bool xAOD::TrigComposite_v1::hasObjectLinkExact ( const std::string & name,
const sgkey_t key,
const index_type index,
const uint32_t clid ) const
private

Definition at line 282 of file TrigComposite_v1.cxx.

282 {
283 for (size_t i = 0; i < this->linkColNames().size(); ++i) {
284 if (this->linkColNames().at(i) != name) continue;
285 if (!SG::sgkeyEqual (this->linkColKeys().at(i), key)) continue;
286 if (this->linkColIndices().at(i) != index) continue;
287 if (this->linkColClids().at(i) != clid) continue;
288 return true;
289 }
290 return false;
291 }
const std::vector< index_type > & linkColIndices() const
Raw access to the persistent link indices.
const std::vector< sgkey_t > & linkColKeys() const
Raw access to the persistent link labels.
mapped_type at(key_type key) const
Look up an element in the map.
constexpr bool sgkeyEqual(const sgkey_t a, const sgkey_t b)
Compare two sgkeys for equality.
Definition sgkey_t.h:39

◆ isRemapped()

bool xAOD::TrigComposite_v1::isRemapped ( ) const

Information on if linkColKeys() and linkColIndices() are able to access remapped link data Remapping happens at the end of HLT execution when EDM objects are copied out of their per-EventView containers and into the global Trigger EDM containers.

Definition at line 460 of file TrigComposite_v1.cxx.

460 {
461 size_t nDecorations = 0;
462 if (acc_remap_linkColKeys.isAvailable( *this )) ++nDecorations;
463 if (acc_remap_linkColIndices.isAvailable( *this )) ++nDecorations;
464 if (nDecorations == 1) {
465 throw std::runtime_error("TrigComposite_v1::isRemapped Only one of the 'remap_linkColKeys' and 'remap_linkColIndices' "
466 "decorations were found on this object. This should never happen, a remapped element link must have both of these collections.");
467 }
468 return static_cast<bool>(nDecorations); //0=False, 2=True
469 }
static const SG::Accessor< std::vector< TrigComposite_v1::index_type > > acc_remap_linkColIndices("remap_linkColIndices")
static const SG::Accessor< std::vector< TrigComposite_v1::sgkey_t > > acc_remap_linkColKeys("remap_linkColKeys")

◆ linkColClids()

const std::vector< uint32_t > & xAOD::TrigComposite_v1::linkColClids ( ) const

Raw access to the persistent link CLIDs.

◆ linkColClidsNC()

std::vector< uint32_t > & xAOD::TrigComposite_v1::linkColClidsNC ( )
private

Raw access to the persistent link CLIDs (non-const).

Definition at line 346 of file TrigComposite_v1.cxx.

346 {
347 return acc_linkColClids( *this );
348 }

◆ linkColIndices()

const std::vector< TrigComposite_v1::index_type > & xAOD::TrigComposite_v1::linkColIndices ( ) const

Raw access to the persistent link indices.

Definition at line 320 of file TrigComposite_v1.cxx.

320 {
321 return acc_linkColIndices( *this );
322 }
static const SG::Accessor< std::vector< TrigComposite_v1::index_type > > acc_linkColIndices("linkColIndices")

◆ linkColIndicesNC()

std::vector< TrigComposite_v1::index_type > & xAOD::TrigComposite_v1::linkColIndicesNC ( )
private

Raw access to the persistent link indices (non-const).

Definition at line 342 of file TrigComposite_v1.cxx.

342 {
343 return acc_linkColIndices( *this );
344 }

◆ linkColIndicesRemap()

const std::vector< TrigComposite_v1::index_type > & xAOD::TrigComposite_v1::linkColIndicesRemap ( ) const

Raw access to the persistent link indices. Will attempt to access remapped link data.

Definition at line 328 of file TrigComposite_v1.cxx.

328 {
329 return acc_remap_linkColIndices( *this );
330 }

◆ linkColKeys()

linkColClids const std::vector< SG::sgkey_t > & xAOD::TrigComposite_v1::linkColKeys ( ) const

Raw access to the persistent link labels.

Definition at line 316 of file TrigComposite_v1.cxx.

316 {
317 return acc_linkColKeys( *this );
318 }
static const SG::Accessor< std::vector< TrigComposite_v1::sgkey_t > > acc_linkColKeys("linkColKeys")

◆ linkColKeysNC()

std::vector< SG::sgkey_t > & xAOD::TrigComposite_v1::linkColKeysNC ( )
private

Raw access to the persistent link labels (non-const).

Definition at line 338 of file TrigComposite_v1.cxx.

338 {
339 return acc_linkColKeys( *this );
340 }

◆ linkColKeysRemap()

const std::vector< SG::sgkey_t > & xAOD::TrigComposite_v1::linkColKeysRemap ( ) const

Raw access to the persistent link labels. Will attempt to access remapped link data.

Definition at line 324 of file TrigComposite_v1.cxx.

324 {
325 return acc_remap_linkColKeys( *this );
326 }

◆ linkColNames()

const std::vector< std::string > & xAOD::TrigComposite_v1::linkColNames ( ) const

Raw access to the persistent link names.

◆ linkColNamesNC()

std::vector< std::string > & xAOD::TrigComposite_v1::linkColNamesNC ( )
private

Raw access to the persistent link names (non-const).

Definition at line 334 of file TrigComposite_v1.cxx.

334 {
335 return acc_linkColNames( *this );
336 }

◆ name()

const std::string & xAOD::TrigComposite_v1::name ( ) const

Get a human-readable name for the object.

◆ object()

template<class OBJECT>
const OBJECT * xAOD::TrigComposite_v1::object ( const std::string & name) const

Get a bare pointer with the requested name.

◆ objectCollectionLinks()

template<class CONTAINER>
std::vector< ElementLink< CONTAINER > > xAOD::TrigComposite_v1::objectCollectionLinks ( const std::string & collectionName) const

Get a vector of all element links from the collection.

◆ objectLink()

template<class CONTAINER>
ElementLink< CONTAINER > xAOD::TrigComposite_v1::objectLink ( const std::string & name) const

Get the link with the requested name.

◆ operator=()

TrigComposite_v1 & xAOD::TrigComposite_v1::operator= ( const TrigComposite_v1 & rhs)

Assignment operator.

Definition at line 84 of file TrigComposite_v1.cxx.

84 {
85 if(this == &rhs) return *this;
86 if( ( ! hasStore() ) && ( ! container() ) ) this->makePrivateStore();
87
88 // Copy the auxiliary variables:
89 SG::AuxElement::operator=( rhs );
90
91 // Return this object:
92 return *this;
93 }
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.

◆ removeObjectCollectionLinks()

bool xAOD::TrigComposite_v1::removeObjectCollectionLinks ( const std::string & name)

Delete any stored collection of element links with the given name.

Parameters
[in]nameName of the stored link collection
Returns
True if a collection of links of the given name was found and deleted

Definition at line 228 of file TrigComposite_v1.cxx.

228 {
229 bool removed = false;
230 const std::vector< std::string >& names = linkColNames();
231 const std::string mangledName = name + s_collectionSuffix;
232 for( size_t i = 0; i < names.size(); /*noop*/ ) {
233 if( names.at(i) == mangledName ) {
234 // Remove
235 linkColNamesNC().erase( linkColNamesNC().begin() + i );
236 linkColKeysNC().erase( linkColKeysNC().begin() + i );
237 linkColIndicesNC().erase( linkColIndicesNC().begin() + i );
238 linkColClidsNC().erase( linkColClidsNC().begin() + i );
239 removed = true;
240 } else {
241 ++i;
242 }
243 }
244 return removed;
245 }

◆ removeObjectLink()

bool xAOD::TrigComposite_v1::removeObjectLink ( const std::string & name)

Delete any stored element link with the given name.

Parameters
[in]nameName of the stored link
Returns
True if a link of the given name was found and deleted

Definition at line 211 of file TrigComposite_v1.cxx.

211 {
212 bool removed = false;
213 const std::vector< std::string >& names = linkColNames();
214 for( size_t i = 0; i < names.size(); ++i ) {
215 if( names.at(i) != name ) continue;
216 // Remove
217 linkColNamesNC().erase( linkColNamesNC().begin() + i );
218 linkColKeysNC().erase( linkColKeysNC().begin() + i );
219 linkColIndicesNC().erase( linkColIndicesNC().begin() + i );
220 linkColClidsNC().erase( linkColClidsNC().begin() + i );
221 removed = true;
222 break;
223 }
224 return removed;
225 }

◆ setDecisions()

void xAOD::TrigComposite_v1::setDecisions ( const std::vector< TrigCompositeUtils::DecisionID > & decisions)

Set positive HLT chain decisions associated with this TrigComposite. Navigation use.

◆ setDetail()

template<typename TYPE>
bool xAOD::TrigComposite_v1::setDetail ( const std::string & name,
const TYPE & value )

Set an TYPE detail on the object.

◆ setName()

void xAOD::TrigComposite_v1::setName ( const std::string & name)

Set a human-readable name for the object.

◆ setObjectLink()

template<class CONTAINER>
bool xAOD::TrigComposite_v1::setObjectLink ( const std::string & name,
const ElementLink< CONTAINER > & link )

Set the link to an object.

◆ typelessGetObjectCollectionLinks()

bool xAOD::TrigComposite_v1::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.

Parameters
[in]nameName of the stored link
[out]keyVecStoregte key of the link-objects will be pushed on to this vector
[out]clidVecType of the objects will be pushed on to this vector
[out]indexVecIndex of the objects within their collections will be pushed on to this vector
Returns
True if at least one link was found

Definition at line 436 of file TrigComposite_v1.cxx.

438 {
439 bool found = false;
440 const std::string mangledName = name + s_collectionSuffix;
441 for (size_t i = 0; i < this->linkColNames().size(); ++i) {
442 if (linkColNames().at(i) != mangledName) {
443 continue;
444 }
445 if (isRemapped()) {
446 keyVec.push_back( linkColKeysRemap().at(i) );
447 clidVec.push_back( linkColClids().at(i) );
448 indexVec.push_back( linkColIndicesRemap().at(i) );
449 } else {
450 keyVec.push_back( linkColKeys().at(i) );
451 clidVec.push_back( linkColClids().at(i) );
452 indexVec.push_back( linkColIndices().at(i) );
453 }
454 found = true;
455 }
456 return found;
457 }
bool isRemapped() const
Information on if linkColKeys() and linkColIndices() are able to access remapped link data Remapping ...
const std::vector< sgkey_t > & linkColKeysRemap() const
Raw access to the persistent link labels. Will attempt to access remapped link data.
const std::vector< index_type > & linkColIndicesRemap() const
Raw access to the persistent link indices. Will attempt to access remapped link data.

◆ typelessGetObjectLink()

bool xAOD::TrigComposite_v1::typelessGetObjectLink ( const std::string & name,
sgkey_t & key,
uint32_t & clid,
TrigComposite_v1::index_type & index ) const

Fetches a single link without type.

Note: Will not work for collections of links, use typelessGetObjectCollectionLinks

Parameters
[in]nameName of the stored link
[out]keyStoregate key of the link-object's collection
[out]clidType of the object's collection
[out]indexIndex within the collection of the link-object
Returns
True if a link was found

Definition at line 417 of file TrigComposite_v1.cxx.

417 {
418 std::vector<std::string>::const_iterator it = std::find(linkColNames().begin(), linkColNames().end(), name);
419 if (it == linkColNames().end()) {
420 return false;
421 }
422 const size_t location = std::distance(linkColNames().begin(), it);
423 if (isRemapped()) {
424 key = linkColKeysRemap().at(location);
425 clid = linkColClids().at(location);
426 index = linkColIndicesRemap().at(location);
427 } else {
428 key = linkColKeys().at(location);
429 clid = linkColClids().at(location);
430 index = linkColIndices().at(location);
431 }
432 return true;
433 }

◆ typelessSetObjectLink()

void xAOD::TrigComposite_v1::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.

Definition at line 350 of file TrigComposite_v1.cxx.

350 {
351
352 // Loop over collections
353 if ( int32_t(endIndex) - int32_t(beginIndex) > 1 ) { // Adding a *collection* of links, this needs to be a signed check as a difference <= 0 implies that endIndex is less than or equal to beginIndex
354
355 // Check uniqueness
356 const std::string mangledName = name + s_collectionSuffix;
357 const std::vector< std::string >& names = linkColNames();
358 int oldStart = -1;
359 int oldEnd = -1;
360 for( size_t nameIndex = 0; nameIndex < names.size(); ++nameIndex ) {
361
362 // Look for an existing collection with the same name
363 if( names[ nameIndex ] == mangledName ) {
364 oldEnd = nameIndex + 1;
365 if ( oldStart == -1 ) oldStart = nameIndex;
366 }
367 else if ( oldStart != -1 ) {
368 // If the start has been found, we must now be past the ned
369 break;
370 }
371 }
372
373 // Erase the old collection, if there was one
374 if ( oldStart != -1 ) {
375 this->linkColNamesNC().erase( this->linkColNamesNC().begin() + oldStart, this->linkColNamesNC().begin() + oldEnd );
376 this->linkColKeysNC().erase( this->linkColKeysNC().begin() + oldStart, this->linkColKeysNC().begin() + oldEnd );
377 this->linkColIndicesNC().erase( this->linkColIndicesNC().begin() + oldStart, this->linkColIndicesNC().begin() + oldEnd );
378 this->linkColClidsNC().erase( this->linkColClidsNC().begin() + oldStart, this->linkColClidsNC().begin() + oldEnd );
379 }
380
381 // Append the new collection
382 for ( TrigComposite_v1::index_type index = beginIndex; index < endIndex; ++index ) {
383 this->linkColNamesNC().push_back( mangledName );
384 this->linkColKeysNC().push_back( key );
385 this->linkColIndicesNC().push_back( index );
386 this->linkColClidsNC().push_back( clid );
387 }
388
389 } else { // Adding a *single* link
390
391 // Check uniqueness
392 if ( std::find( linkColNamesNC().begin(), linkColNamesNC().end(), name ) == linkColNamesNC().end() ) {
393
394 this->linkColNamesNC().push_back( name );
395 this->linkColKeysNC().push_back( key );
396 this->linkColIndicesNC().push_back( beginIndex );
397 this->linkColClidsNC().push_back( clid );
398
399 } else {
400
401 // Over-write an existing object
402 const std::vector< std::string >& names = linkColNames();
403 for( size_t nameIndex = 0; nameIndex < names.size(); ++nameIndex ) {
404 if( names[ nameIndex ] == name ) {
405 this->linkColKeysNC()[ nameIndex ] = key;
406 this->linkColIndicesNC()[ nameIndex ] = beginIndex;
407 this->linkColClidsNC()[ nameIndex ] = clid;
408 break; // Names are unique, so stop once found
409 } // Check of names
410 } // Loop over names
411
412 } // Check of uniqueness of adding single link
413
414 } // Check of adding single link vs link collection
415 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

bool s_throwOnCopyError xAOD::TrigComposite_v1::ATLAS_THREAD_SAFE
static

For use in validation, when copying element links from one object to another.

Definition at line 248 of file TrigComposite_v1.h.

◆ s_collectionSuffix

const std::string xAOD::TrigComposite_v1::s_collectionSuffix {"__COLL"}
staticprivate

Definition at line 310 of file TrigComposite_v1.h.

◆ s_comboHypoAlgNodeNameString

const std::string xAOD::TrigComposite_v1::s_comboHypoAlgNodeNameString {"CH"}
static

Constant used to identify a navigation graph node as being from a Combo Hypo Alg.

Definition at line 272 of file TrigComposite_v1.h.

◆ s_featureString

const std::string xAOD::TrigComposite_v1::s_featureString {"feature"}
static

Constant used to identify a feature.

Definition at line 259 of file TrigComposite_v1.h.

◆ s_filterNodeNameString

const std::string xAOD::TrigComposite_v1::s_filterNodeNameString {"F"}
static

Constant used to identify a navigation graph node as being from a Filter.

Definition at line 266 of file TrigComposite_v1.h.

◆ s_hltSeedingNodeNameString

const std::string xAOD::TrigComposite_v1::s_hltSeedingNodeNameString {"L1"}
static

Constant used to identify a navigation graph node as being from the HLTSeeding.

Definition at line 264 of file TrigComposite_v1.h.

◆ s_hypoAlgNodeNameString

const std::string xAOD::TrigComposite_v1::s_hypoAlgNodeNameString {"H"}
static

Constant used to identify a navigation graph node as being from a Hypo Alg.

Definition at line 270 of file TrigComposite_v1.h.

◆ s_initialRecRoIString

const std::string xAOD::TrigComposite_v1::s_initialRecRoIString {"initialRecRoI"}
static

Constant used to identify an initial HLT ROI derived from L1.

Definition at line 253 of file TrigComposite_v1.h.

◆ s_initialRoIString

const std::string xAOD::TrigComposite_v1::s_initialRoIString {"initialRoI"}
static

Constant used to identify an initial ROI from L1.

Definition at line 251 of file TrigComposite_v1.h.

◆ s_inputMakerNodeNameString

const std::string xAOD::TrigComposite_v1::s_inputMakerNodeNameString {"IM"}
static

Constant used to identify a navigation graph node as being from a Input Maker.

Definition at line 268 of file TrigComposite_v1.h.

◆ s_roiString

const std::string xAOD::TrigComposite_v1::s_roiString {"roi"}
static

Constant used to identify an (explicitly) updated HLT ROI.

Definition at line 255 of file TrigComposite_v1.h.

◆ s_seedString

const std::string xAOD::TrigComposite_v1::s_seedString {"seed"}
static

Constant used to identify a seed (parent).

Definition at line 261 of file TrigComposite_v1.h.

◆ s_summaryFilterNodeNameString

const std::string xAOD::TrigComposite_v1::s_summaryFilterNodeNameString {"SF"}
static

Constant used to identify a navigation graph node as being from a final Filter created by the DecisionSummaryMaker algorithm.

Definition at line 275 of file TrigComposite_v1.h.

◆ s_summaryPassExpressNodeNameString

const std::string xAOD::TrigComposite_v1::s_summaryPassExpressNodeNameString {"HLTPassExpress"}
static

Constant used to identify the single express-accept graph node.

A record of all chains which triggered express streaming.

Definition at line 281 of file TrigComposite_v1.h.

◆ s_summaryPassNodeNameString

const std::string xAOD::TrigComposite_v1::s_summaryPassNodeNameString {"HLTPassRaw"}
static

Constant used to identify the single terminus graph node the end point of all chains which accept the event.

Definition at line 278 of file TrigComposite_v1.h.

◆ s_summaryPrescaledNodeNameString

const std::string xAOD::TrigComposite_v1::s_summaryPrescaledNodeNameString {"HLTPrescaled"}
static

Constant used to identify the single prescaled graph node.

A record of all chains which did not execute due to HLT prescale.

Definition at line 284 of file TrigComposite_v1.h.

◆ s_viewString

const std::string xAOD::TrigComposite_v1::s_viewString {"view"}
static

Constant used to identify a view.

Definition at line 257 of file TrigComposite_v1.h.


The documentation for this class was generated from the following files: