ATLAS Offline Software
Loading...
Searching...
No Matches
SPCountHypoAlg.cxx File Reference
Include dependency graph for SPCountHypoAlg.cxx:

Go to the source code of this file.

Classes

struct  LinkInfo< T >
 Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGroup) linked together (for convenience) More...

Typedefs

typedef xAOD::TrigCompositeAuxContainer DecisionAuxContainer
typedef xAOD::TrigCompositeContainer DecisionContainer
typedef std::set< DecisionIDDecisionIDContainer

Functions

SG::WriteHandle< DecisionContainercreateAndStore (const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
 Creates and right away records the DecisionContainer with the key.
void decisionIDs (const Decision *d, DecisionIDContainer &id)
 Extracts DecisionIDs stored in the Decision object.
const std::string & featureString ()
template<typename T>
LinkInfo< T > findLink (const Decision *start, const std::string &linkName, const bool suppressMultipleLinksWarning=false)
 Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision object 'start' For the case of multiple links, this function only returns the first one found.
void linkToPrevious (Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
 Links to the previous object, location of previous 'seed' decision supplied by hand.
DecisionnewDecisionIn (DecisionContainer *dc, const std::string &name="")
 Helper method to create a Decision object, place it in the container and return a pointer to it.
const std::string & viewString ()
const std::string & hypoAlgNodeName ()

Typedef Documentation

◆ DecisionAuxContainer

◆ DecisionContainer

◆ DecisionIDContainer

Definition at line 28 of file TrigComposite_v1.h.

Function Documentation

◆ createAndStore()

SG::WriteHandle< DecisionContainer > TrigCompositeUtils::createAndStore ( const SG::WriteHandleKey< DecisionContainer > & key,
const EventContext & ctx )

Creates and right away records the DecisionContainer with the key.

Returns the WriteHandle.

Definition at line 28 of file TrigCompositeUtilsRoot.cxx.

28 {
29 SG::WriteHandle<DecisionContainer> handle( key, ctx );
30 auto data = std::make_unique<DecisionContainer>() ;
31 auto aux = std::make_unique<DecisionAuxContainer>() ;
32 data->setStore( aux.get() );
33 handle.record( std::move( data ), std::move( aux ) ).ignore();
34 return handle;
35 }
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11

◆ decisionIDs()

void TrigCompositeUtils::decisionIDs ( const Decision * d,
DecisionIDContainer & destination )

Extracts DecisionIDs stored in the Decision object.

Definition at line 65 of file TrigCompositeUtilsRoot.cxx.

65 {
66 const std::vector<DecisionID>& decisions = readOnlyAccessor( *d );
67 destination.insert( decisions.begin(), decisions.end() );
68 }
static const SG::AuxElement::ConstAccessor< std::vector< TrigCompositeUtils::DecisionID > > readOnlyAccessor("decisions")

◆ featureString()

const std::string & TrigCompositeUtils::featureString ( )
inline

Definition at line 421 of file TrigCompositeUtils.h.

static const std::string s_featureString
Constant used to identify a feature.

◆ findLink()

template<typename T>
LinkInfo< T > TrigCompositeUtils::findLink ( const Decision * start,
const std::string & linkName,
const bool suppressMultipleLinksWarning = false )

Perform a recursive search for ElementLinks of type T and name 'linkName', starting from Decision object 'start' For the case of multiple links, this function only returns the first one found.

See also
findLinks
Parameters
[in]startthe Decision Object from where recursive search should begin
[in]linkNamethe name of the ElementLink stored inside one or more DecisionObjects.
[in]suppressMultipleLinksWarningfindLink will print a warning if more than one ElementLink is found, this can be silenced here.
Returns
LinkInfo A wrapper around an ElementLink and the location in the graph

◆ hypoAlgNodeName()

const std::string & TrigCompositeUtils::hypoAlgNodeName ( )
inline

Definition at line 427 of file TrigCompositeUtils.h.

static const std::string s_hypoAlgNodeNameString
Constant used to identify a navigation graph node as being from a Hypo Alg.

◆ linkToPrevious()

void TrigCompositeUtils::linkToPrevious ( Decision * d,
const std::string & previousCollectionKey,
size_t previousIndex )

Links to the previous object, location of previous 'seed' decision supplied by hand.

Definition at line 140 of file TrigCompositeUtilsRoot.cxx.

140 {
141 ElementLink<DecisionContainer> seed = ElementLink<DecisionContainer>( previousCollectionKey, previousIndex );
142 if (!seed.isValid()) {
143 throw std::runtime_error("TrigCompositeUtils::linkToPrevious Invalid Decision Link key or index provided");
144 } else {
145 d->addObjectCollectionLink(seedString(), seed);
146 }
147 }
const std::string & seedString()

◆ newDecisionIn()

Decision * TrigCompositeUtils::newDecisionIn ( DecisionContainer * dc,
const std::string & name = "" )

Helper method to create a Decision object, place it in the container and return a pointer to it.

This is to make this: auto d = newDecisionIn(output); instead of: auto d = new Decision; output->push_back(d); If provided, the name is assigned to the TC object Note that the supplied DecisionContainer must have been recorded in the event store.

Definition at line 44 of file TrigCompositeUtilsRoot.cxx.

44 {
45 Decision * x = new Decision;
46 dc->push_back( x );
47 if ( ! name.empty() ) {
48 x->setName( name );
49 }
50 return x;
51 }
#define x
value_type push_back(value_type pElem)
Add an element to the end of the collection.

◆ viewString()

const std::string & TrigCompositeUtils::viewString ( )
inline

Definition at line 420 of file TrigCompositeUtils.h.

420{ return Decision::s_viewString; }
static const std::string s_viewString
Constant used to identify a view.