ATLAS Offline Software
Loading...
Searching...
No Matches
HLTTest::TestHypoTool Class Reference

Tool taking the decision for inclusive selection (one decision per object) More...

#include <TestHypoTool.h>

Inheritance diagram for HLTTest::TestHypoTool:
Collaboration diagram for HLTTest::TestHypoTool:

Public Member Functions

 TestHypoTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual ~TestHypoTool ()
StatusCode initialize () override
StatusCode finalize () override
StatusCode decide (DecisionContainer *decisions) const override
 method invoked to work out the decisions per object
HLT::Identifier decisionId () const
 returns decision ID for this hypo tool
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

HLT::Identifier m_decisionId

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< float > m_threshold { this, "Threshold", 0, "Threshold to apply" }
StringProperty m_property { this, "Property", "Et", "Propery to use to test hypothesis (Et, pt)" }
StringProperty m_linkName {this, "LinkName", "initialRoI", "name of the link to the features in the decision, e.g. 'feature', 'initialRoI'"}
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool taking the decision for inclusive selection (one decision per object)

Definition at line 24 of file TestHypoTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TestHypoTool()

HLTTest::TestHypoTool::TestHypoTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 12 of file TestHypoTool.cxx.

14 :
15 ITestHypoTool( name ),
16 AthAlgTool( type, name, parent )
17 {
19 }
AthAlgTool()
Default constructor:
ITestHypoTool(const std::string &name)
HLT::Identifier m_decisionId
static HLT::Identifier fromToolName(const std::string &tname)

◆ ~TestHypoTool()

HLTTest::TestHypoTool::~TestHypoTool ( )
virtual

Definition at line 21 of file TestHypoTool.cxx.

21{}

Member Function Documentation

◆ decide()

StatusCode HLTTest::TestHypoTool::decide ( DecisionContainer * decisions) const
overridevirtual

method invoked to work out the decisions per object

Warning
it is up to the tool implementation to store correct identifiers The object passed to the tool have to have actual object linked via EL named "feature" This is by no means suggested interface, in fact it involved constructing a link etc.

Implements HLTTest::ITestHypoTool.

Definition at line 33 of file TestHypoTool.cxx.

33 {
34 ATH_MSG_DEBUG( "Add decisionIDs to " << decisions->size() <<" output decisions" );
35 size_t counter = 0;
36 for ( const auto d: *decisions ) {
37 //get previous decisions
38 std::vector<ElementLink<DecisionContainer>> inputLinks = getLinkToPrevious(d);
39 ATH_MSG_DEBUG("Decision "<< counter <<": Got "<<inputLinks.size()<<" input decisions");
40 for (const auto& previousDecisions: inputLinks){
41
43 TrigCompositeUtils::decisionIDs( *previousDecisions, objDecisions );
44
45 ATH_MSG_DEBUG("Number of decision-IDs for input "<< counter <<" is: " << objDecisions.size() );
46
47 if ( TrigCompositeUtils::passed( m_decisionId.numeric(), objDecisions ) ) {
48 const auto feature = d->objectLink<xAOD::TrigCompositeContainer>( "feature" );
49 if ( not feature.isValid() ) {
50 ATH_MSG_ERROR( " Can not find reference to the object from the decision" );
51 return StatusCode::FAILURE;
52 }
53 const float v = (*feature)->getDetail<float>( m_property );
54 if ( v > m_threshold ) { // actual cut will be more complex of course
55 ATH_MSG_DEBUG( m_threshold << " passed by value: " << v << ". Adding "<< m_decisionId <<" to output" );
57 } else {
58 ATH_MSG_DEBUG( m_threshold << " not passed by value " << v );
59 }
60
61 } else {
62 ATH_MSG_DEBUG("No Input decisions matched");
63 }
64 counter++;
65 }
66 }
67 return StatusCode::SUCCESS;
68 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Gaudi::Property< float > m_threshold
StringProperty m_property
const std::vector< ElementLink< DecisionContainer > > getLinkToPrevious(const Decision *d)
returns links to previous decision object 'seed'
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
std::set< DecisionID > DecisionIDContainer
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
TrigCompositeContainer_v1 TrigCompositeContainer
Declare the latest version of the container.

◆ decisionId()

HLT::Identifier HLTTest::ITestHypoTool::decisionId ( ) const
inlineinherited

returns decision ID for this hypo tool

Definition at line 43 of file ITestHypoTool.h.

43{ return m_decisionId; }

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode HLTTest::TestHypoTool::finalize ( )
override

Definition at line 71 of file TestHypoTool.cxx.

71 {
72 ATH_MSG_INFO( "Finalizing " << name() << "..." );
73 return StatusCode::SUCCESS;
74 }
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode HLTTest::TestHypoTool::initialize ( )
override

Definition at line 23 of file TestHypoTool.cxx.

23 {
24 ATH_MSG_INFO( "Initializing " << name() << "..." );
25
26 ATH_MSG_DEBUG("Configured to require chain " << m_decisionId );
27 ATH_MSG_DEBUG("Link name is "<<m_linkName.value());
28 ATH_MSG_DEBUG("threshold="<<m_threshold);
29 ATH_MSG_DEBUG("property="<<m_property);
30 return StatusCode::SUCCESS;
31 }
StringProperty m_linkName

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & HLTTest::ITestHypoTool::interfaceID ( )
inlinestaticinherited

Definition at line 49 of file ITestHypoTool.h.

50 {
51 return IID_ITestHypoTool;
52 }
static const InterfaceID IID_ITestHypoTool("ITestHypoTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_decisionId

HLT::Identifier HLTTest::ITestHypoTool::m_decisionId
protectedinherited

Definition at line 45 of file ITestHypoTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_linkName

StringProperty HLTTest::TestHypoTool::m_linkName {this, "LinkName", "initialRoI", "name of the link to the features in the decision, e.g. 'feature', 'initialRoI'"}
private

Definition at line 49 of file TestHypoTool.h.

49{this, "LinkName", "initialRoI", "name of the link to the features in the decision, e.g. 'feature', 'initialRoI'"};

◆ m_property

StringProperty HLTTest::TestHypoTool::m_property { this, "Property", "Et", "Propery to use to test hypothesis (Et, pt)" }
private

Definition at line 44 of file TestHypoTool.h.

44{ this, "Property", "Et", "Propery to use to test hypothesis (Et, pt)" };

◆ m_threshold

Gaudi::Property<float> HLTTest::TestHypoTool::m_threshold { this, "Threshold", 0, "Threshold to apply" }
private

Definition at line 43 of file TestHypoTool.h.

43{ this, "Threshold", 0, "Threshold to apply" };

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


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