24#ifndef XAOD_STANDALONE
75 bool TrigComposite_v1::s_throwOnCopyError =
false;
85 if(
this == &rhs)
return *
this;
117 if (
other.isRemapped()) {
127 if (newName.empty()) {
130 bool didCopy =
false;
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);
137 if (s_throwOnCopyError)
throw std::runtime_error(
"Already have link with name " + newName);
143 if (!didCopy && s_throwOnCopyError)
throw std::runtime_error(
"Could not find link with name " +
name);
152 bool didCopy =
false;
154 if (newName.empty()) {
159 if (
other.hasObjectLink(mangledName)) {
161 if (s_throwOnCopyError)
throw std::runtime_error(
"Already have link collection with name " + newName);
165 if (
other.linkColNames().at(
index) == mangledName) {
172 if (!didCopy && s_throwOnCopyError)
throw std::runtime_error(
"Could not find link with name " +
name);
181 bool didCopy =
false;
182 for (
const std::string&
name :
other.linkColNames()) {
212 bool removed =
false;
214 for(
size_t i = 0; i <
names.size(); ++i ) {
229 bool removed =
false;
232 for(
size_t i = 0; i <
names.size(); ) {
233 if(
names.at(i) == mangledName ) {
259 std::vector<std::string>::const_iterator vecIt = std::find(
names.begin(),
names.end(),
name );
260 if (vecIt ==
names.end()) {
264 if (clid != CLID_NULL) {
265 const uint32_t storedCLID = clids.at( std::distance(
names.begin(), vecIt ) );
268 }
else if (storedCLID != clid) {
283 for (
size_t i = 0; i < this->
linkColNames().size(); ++i) {
298#ifndef XAOD_STANDALONE
353 if ( int32_t(endIndex) - int32_t(beginIndex) > 1 ) {
360 for(
size_t nameIndex = 0; nameIndex <
names.size(); ++nameIndex ) {
363 if(
names[ nameIndex ] == mangledName ) {
364 oldEnd = nameIndex + 1;
365 if ( oldStart == -1 ) oldStart = nameIndex;
367 else if ( oldStart != -1 ) {
374 if ( oldStart != -1 ) {
403 for(
size_t nameIndex = 0; nameIndex <
names.size(); ++nameIndex ) {
422 const size_t location = std::distance(
linkColNames().begin(), it);
437 std::vector<sgkey_t>& keyVec, std::vector<uint32_t>& clidVec, std::vector<TrigComposite_v1::index_type>& indexVec )
const
441 for (
size_t i = 0; i < this->
linkColNames().size(); ++i) {
461 size_t nDecorations = 0;
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.");
468 return static_cast<bool>(nDecorations);
474 std::vector< std::string > returnVec;
478 for(
size_t i = 0; i <
names.size(); ++i ) {
482 bool clidMatch =
false;
485 }
else if (clid == clids[i]) {
489 returnVec.push_back(
names[i] );
497 std::vector< std::string > returnVec;
501 for(
size_t i = 0; i <
names.size(); ++i ) {
505 bool clidMatch =
false;
508 }
else if (clid == clids[i]) {
515 if ( std::none_of(returnVec.begin(), returnVec.end(), [&](
const auto& s) {return unmangledName == s;}) ) {
516 returnVec.push_back( std::move(unmangledName) );
528 os <<
"TrigComposite_v1 name:'" <<
tc.name() <<
"'" << std::endl;
529 const bool isRemapped =
tc.isRemapped();
530 os <<
" N Links:" <<
tc.linkColNames().size() <<
", isRemapped:" << (isRemapped ?
"YES" :
"NO");
531 for (
size_t i=0; i<
tc.linkColNames().size(); ++i){
532 if (!i) os << std::endl;
533 os <<
" Link Name:" <<
tc.linkColNames()[i];
534 os <<
", Key:" <<
tc.linkColKeys()[i];
535 if (isRemapped) os <<
", RemappedKey:" <<
tc.linkColKeysRemap()[i];
536 os <<
", Index:" <<
tc.linkColIndices()[i];
537 if (isRemapped) os <<
", RemappedIndex:" <<
tc.linkColIndicesRemap()[i];
538 os <<
", CLID:" <<
tc.linkColClids()[i];
539 if (i !=
tc.linkColNames().size() - 1) os << std::endl;
541 if (!
tc.decisions().empty()) {
542 os << std::endl <<
" N Decisions:" <<
tc.decisions().size() << std::endl <<
" ";
#define AUXSTORE_OBJECT_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a complex auxiliary property.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
Provide an interface for finding inheritance information at run time.
uint32_t CLID
The Class ID type.
Helper class to provide type-safe access to aux data.
void makePrivateStore()
Create a new (empty) private store for this object.
AuxElement & operator=(const AuxElement &other)
Assignment.
bool hasStore() const
Return true if this object has an associated store.
const SG::AuxVectorData * container() const
Return the container holding this element.
AuxElement()
Default constructor.
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
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.
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 isRemapped() const
Information on if linkColKeys() and linkColIndices() are able to access remapped link data Remapping ...
std::vector< index_type > & linkColIndicesNC()
Raw access to the persistent link indices (non-const)
const std::vector< sgkey_t > & linkColKeysRemap() const
Raw access to the persistent link labels. Will attempt to access remapped link data.
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.
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.
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.
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.
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.
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.
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.
std::string find(const std::string &s)
return a remapped string
constexpr bool sgkeyEqual(const sgkey_t a, const sgkey_t b)
Compare two sgkeys for equality.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static const SG::Accessor< std::vector< TrigComposite_v1::index_type > > acc_linkColIndices("linkColIndices")
static const SG::Accessor< std::vector< uint32_t > > acc_linkColClids("linkColClids")
static const SG::AuxElement::Accessor< std::vector< std::string > > names("thrNames")
Accessor for the names of the passed thresholds.
static const SG::Accessor< std::vector< std::string > > acc_linkColNames("linkColNames")
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_linkColKeys("linkColKeys")
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
static const SG::Accessor< std::vector< TrigComposite_v1::sgkey_t > > acc_remap_linkColKeys("remap_linkColKeys")
static constexpr CLID ID()