ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMatchTool Class Reference

The TrigMatchTool is an athena tool used to match reconstructed objects to trigger objects and chains. More...

#include <TrigMatchTool.h>

Inheritance diagram for TrigMatchTool:
Collaboration diagram for TrigMatchTool:

Public Member Functions

 TrigMatchTool (const std::string &type, const std::string &name, const IInterface *parent)
virtual StatusCode initialize () override
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
template<typename trigType>
std::vector< const trigType * > getTriggerObjects (const std::string &chainName, bool onlyPassedFeatures) const
 getTriggerObjects returns the objects of the specified type from the specified chain.
template<typename trigType, typename baseType>
std::vector< const trigType * > matchToTriggerObjects (const baseType *baseObject, const std::string &chainName, float maxDistance, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 matchToTriggerObjects returns the objects of type trigType from chain chainName, which match to baseObject, sorted by distance from baseObject according to metric.
template<typename trigType, typename baseType>
std::vector< const trigType * > matchToTriggerObjects (const baseType *baseObject, const std::string &chainName, float maxDistance=0.1, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
const trigType * matchToTriggerObject (const baseType *baseObject, const std::string &chainName, float maxDistance, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 matchToTriggerObject returns the object of type trigType from chain chainName, which has the lowest distance to baseObject according to metric.
template<typename trigType, typename baseType>
const trigType * matchToTriggerObject (const baseType *baseObject, const std::string &chainName, float maxDistance=0.1, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
const trigType * matchToTriggerObject (const baseType *, const std::string &, bool) const
template<typename trigType, typename baseType>
std::vector< const trigType * > matchedTriggerObjects (const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance, bool onlyBestMatch, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 matchedTriggerObjects returns a vector of trigger objects from chain chainName that match to one or more of the objects passed according to the matching criteria specified.
template<typename trigType, typename baseType>
std::vector< const trigType * > matchedTriggerObjects (const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
std::vector< const trigType * > matchedTriggerObjects (const std::vector< const baseType * > &baseObjects, const std::string &chainName, float maxDistance, bool onlyBestMatch, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
template<typename trigType, typename baseType>
std::vector< const trigType * > matchedTriggerObjects (const std::vector< const baseType * > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
std::vector< const trigType * > unmatchedTriggerObjects (const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance, bool onlyBestMatch, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 unmatchedTriggerObjects returns a vector of trigger objects from chain chainName that do not match to any of the objects passed according to the matching criteria specified.
template<typename trigType, typename baseType>
std::vector< const trigType * > unmatchedTriggerObjects (const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
std::vector< const trigType * > unmatchedTriggerObjects (const std::vector< const baseType * > &baseObjects, const std::string &chainName, float maxDistance, bool onlyBestMatch, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
template<typename trigType, typename baseType>
std::vector< const trigType * > unmatchedTriggerObjects (const std::vector< const baseType * > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
template<typename trigType, typename baseType>
bool chainPassedByObject (const baseType *baseObject, const std::string &chainName, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) const
 chainPassedByObject returns true if the supplied object matches a trigger object of type trigType in the supplied chain, associated with an active TE, and false otherwise.
template<typename trigType, typename baseType>
bool chainPassedByObject (const baseType *baseObject, const std::string &chainName, float maxDistance=0.1) const
template<typename trigType, typename baseType>
std::vector< std::string > chainsPassedByObject (const baseType *baseObject, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) const
 chainsPassedByObject returns a list of the chains which are marked as passed in the navigation, and in which the supplied recoObject matches an object of type trigType with distance, as calculated by metric, of less than maxDistance.
template<typename trigType, typename baseType>
std::vector< std::string > chainsPassedByObject (const baseType *baseObject, float maxDistance=0.1) const
template<typename trigType, typename baseType>
std::vector< const baseType * > objectsInChain (const std::vector< const baseType * > &baseObjects, const std::string &chainName, bool onlyPassedFeatures, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) const
 objectsInChain returns a container of reco objects which match to objects of type trigType in the specified chain, where a match is defined by a distance, according to the supplied metric, of less than maxDistance.
template<typename trigType, typename baseType>
std::vector< const baseType * > objectsInChain (const std::vector< const baseType * > &baseObjects, const std::string &chainName, bool onlyPassedFeatures=false, float maxDistance=0.1) const
template<typename trigType, typename baseType>
std::map< const trigType *, std::vector< std::string > > matchToAllTriggerObjects (const baseType *baseObject, float maxDistance, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 matchToAllObjects returns a map from matched objects to the chains they were found in.
template<typename trigType, typename baseType>
std::map< const trigType *, std::vector< std::string > > matchToAllTriggerObjects (const baseType *baseObject, float maxDistance=0.1, bool onlyPassedFeatures=false) const
TrigMatchToolCore::FeatureLabelHolder setFeatureLabel (const std::string &label)
 setFeatureLabel is used to set the label to be used when extracting features from the navigation.
template<typename T, typename U>
float distance (const T *t, const U *u, const DistanceFunctor< T, U > *metric) const
 distance returns the distance between the two supplied objects using metric, if available, or the default metric, if not.
template<typename T, typename U>
float distance (const T *t, const U *u) const
template<typename T, typename U>
std::vector< const T * > matchToObjects (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance, const DistanceFunctor< T, U > *metric) const
 matchToObjects returns the objects of type T from the supplied vector that match to matchObject, sorted by distance from the matchObject according to metric.
template<typename T, typename U>
std::vector< const T * > matchToObjects (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance=0.1) const
template<typename T, typename U>
std::vector< const T * > matchToObjects (const U *matchObject, const DataVector< T > &targetObjects, float maxDistance, const DistanceFunctor< T, U > *metric) const
template<typename T, typename U>
std::vector< const T * > matchToObjects (const U *matchObject, const DataVector< T > &targetObjects, float maxDistance=0.1) const
template<typename T, typename U>
bool anyMatch (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance, const DistanceFunctor< T, U > *metric) const
template<typename T, typename U>
bool anyMatch (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance) const
template<typename T, typename U>
const T * matchToObject (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance, const DistanceFunctor< T, U > *metric) const
 matchToObject returns the object of type T from the suppled vector that best matches matchObject according to the distance metric, if available, or if not, according the the default metric.
template<typename T, typename U>
const T * matchToObject (const U *matchObject, const std::vector< const T * > &targetObjects, float maxDistance=0.1) const
template<typename T, typename U>
const T * matchToObject (const U *matchObject, const DataVector< T > &targetObjects, float maxDistance, const DistanceFunctor< T, U > *metric) const
template<typename T, typename U>
const T * matchToObject (const U *matchObject, const DataVector< T > &targetObjects, float maxDistance=0.1) 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.
void setTDT (Trig::TrigDecisionToolCore *tdt)
virtual void endEvent ()
void clearChainIndex ()
template<typename T, typename U>
const DistanceFunctor< T, U > * prepareMetric () const

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

virtual void warning (const std::string &w) const override
virtual bool changedDecisionAware () const override
virtual void handle (const Incident &inc) override
virtual std::vector< std::string > getConfiguredChainNames () const override
virtual Trig::FeatureContainer getFeatureContainer (const std::string &chainName, const int condition) const override
virtual std::string lowerChainName (const std::string &chainName) const override
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>
template<typename trigType>
std::vector< const trigType * > getTriggerObjects (size_t chainIndex, bool onlyPassedFeatures) const
 Alternate version of getTriggerObjects taking a chain index.
template<typename trigType, typename baseType>
std::vector< const trigType * > matchToTriggerObjects (const baseType *baseObject, size_t chainIndex, float maxDistance, bool onlyPassedFeatures, const DistanceFunctor< trigType, baseType > *metric) const
 matchToTriggerObjects returns the objects of type trigType from chain chainName, which match to baseObject, sorted by distance from baseObject according to metric.
template<typename trigType, typename baseType>
bool chainPassedByObject (const baseType *baseObject, size_t chainIndex, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) const
template<typename trait>
std::string propagateChainNames (const std::string &chainName, const trait *) const
std::string propagateChainNames (const std::string &chainName, const TrigMatch::AncestorAttached *) const
virtual std::string propagateChainNames (const std::string &chainName) const
template<typename trigType>
void getObjects (std::vector< const trigType * > &objects, const std::string &chainName, bool onlyPassedFeatures) const
template<typename trigType>
void getObjects (std::vector< const trigType * > &objects, size_t chainIndex, bool onlyPassedFeatures) const
template<typename trigType>
void collectObjects (const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const TrigMatch::DirectAttached *) const
template<typename trigType, typename contType>
void collectObjects (const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const contType *) const
template<typename trigType>
void collectObjects (const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const TrigMatch::AncestorAttached *) const
size_t chainNameToIndex (const std::string &chainName) const
template<typename trigType>
TrigFeatureCache< trigType > & getCache (int type_key, SlotCache &slotCache, const SlotCache::lock_t &lock) const
TrigFeatureCacheBase *& getCache1 (const std::type_info *tid, int type_key, SlotCache &slotCache, const SlotCache::lock_t &lock) const
const Trig::FeatureContainergetCachedFeatureContainer (size_t chainIndex, SlotCache &cache, const SlotCache::lock_t &lock) const

Private Attributes

ToolHandle< Trig::TrigDecisionToolm_trigDecisionTool
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
ChainNameIndex m_chainNameIndex ATLAS_THREAD_SAFE
TypeMap m_typeMap ATLAS_THREAD_SAFE
SG::SlotSpecificObj< SlotCache > m_slotCache ATLAS_THREAD_SAFE
Trig::TrigDecisionToolCorem_trigDecisionToolCore

Detailed Description

The TrigMatchTool is an athena tool used to match reconstructed objects to trigger objects and chains.

Please see TrigMatchToolCore for more information.

Definition at line 31 of file TrigMatchTool.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

◆ TrigMatchTool()

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

Definition at line 21 of file TrigMatchTool.cxx.

24 : AthAlgTool(type, name, parent),
25 m_trigDecisionTool( "Trig::TrigDecisionTool/TrigDecisionTool" ) {
26
27 declareInterface<TrigMatchTool>(this);
28
29 declareProperty( "TrigDecisionTool", m_trigDecisionTool );
30}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool

Member Function Documentation

◆ anyMatch() [1/2]

template<typename T, typename U>
bool ObjectMatching::anyMatch ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance ) const
inherited

◆ anyMatch() [2/2]

template<typename T, typename U>
bool ObjectMatching::anyMatch ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance,
const DistanceFunctor< T, U > * metric ) const
inherited

◆ chainNameToIndex()

size_t TrigMatchToolCore::chainNameToIndex ( const std::string & chainName) const
privateinherited

Definition at line 62 of file TrigMatchToolCore.cxx.

63{
64 return m_chainNameIndex.chainNameToIndex (chainName);
65}

◆ chainPassedByObject() [1/3]

template<typename trigType, typename baseType>
bool TrigMatchToolCore::chainPassedByObject ( const baseType * baseObject,
const std::string & chainName,
float maxDistance,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

chainPassedByObject returns true if the supplied object matches a trigger object of type trigType in the supplied chain, associated with an active TE, and false otherwise.

Please note that this is a bit tricky with multi-object triggers. This function will return true if the object you supply passes its portion of the trigger requirements, which can happen even if the trigger as a whole was not passed.

◆ chainPassedByObject() [2/3]

template<typename trigType, typename baseType>
bool TrigMatchToolCore::chainPassedByObject ( const baseType * baseObject,
const std::string & chainName,
float maxDistance = 0.1 ) const
inherited

◆ chainPassedByObject() [3/3]

template<typename trigType, typename baseType>
bool TrigMatchToolCore::chainPassedByObject ( const baseType * baseObject,
size_t chainIndex,
float maxDistance,
const DistanceFunctor< trigType, baseType > * metric ) const
privateinherited

◆ chainsPassedByObject() [1/2]

template<typename trigType, typename baseType>
std::vector< std::string > TrigMatchToolCore::chainsPassedByObject ( const baseType * baseObject,
float maxDistance,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

chainsPassedByObject returns a list of the chains which are marked as passed in the navigation, and in which the supplied recoObject matches an object of type trigType with distance, as calculated by metric, of less than maxDistance.

Please note that this can be a bit tricky with multi-object triggers. A chain will be added to this list if the object you supply passes its portion of the trigger requirements, which can happen even if the trigger as a whole was not passed.

◆ chainsPassedByObject() [2/2]

template<typename trigType, typename baseType>
std::vector< std::string > TrigMatchToolCore::chainsPassedByObject ( const baseType * baseObject,
float maxDistance = 0.1 ) const
inherited

◆ changedDecisionAware()

virtual bool TrigMatchTool::changedDecisionAware ( ) const
inlineoverrideprivatevirtual

Reimplemented from TrigMatchToolCore.

Definition at line 55 of file TrigMatchTool.h.

55{ return true; };

◆ clearChainIndex()

void TrigMatchToolCore::clearChainIndex ( )
protectedinherited

Definition at line 40 of file TrigMatchToolCore.cxx.

41{
42 m_chainNameIndex.clear();
43}

◆ collectObjects() [1/3]

template<typename trigType, typename contType>
void TrigMatchToolCore::collectObjects ( const std::string & featureLabel,
std::vector< const trigType * > & objects,
const Trig::FeatureContainer & featureContainer,
bool onlyPassedFeatures,
const contType *  ) const
privateinherited

◆ collectObjects() [2/3]

template<typename trigType>
void TrigMatchToolCore::collectObjects ( const std::string & featureLabel,
std::vector< const trigType * > & objects,
const Trig::FeatureContainer & featureContainer,
bool onlyPassedFeatures,
const TrigMatch::AncestorAttached *  ) const
privateinherited

◆ collectObjects() [3/3]

template<typename trigType>
void TrigMatchToolCore::collectObjects ( const std::string & featureLabel,
std::vector< const trigType * > & objects,
const Trig::FeatureContainer & featureContainer,
bool onlyPassedFeatures,
const TrigMatch::DirectAttached *  ) const
privateinherited

◆ 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 }

◆ 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.

◆ distance() [1/2]

template<typename T, typename U>
float ObjectMatching::distance ( const T * t,
const U * u ) const
inherited

◆ distance() [2/2]

template<typename T, typename U>
float ObjectMatching::distance ( const T * t,
const U * u,
const DistanceFunctor< T, U > * metric ) const
inherited

distance returns the distance between the two supplied objects using metric, if available, or the default metric, if not.

◆ endEvent()

void TrigMatchToolCore::endEvent ( )
protectedvirtualinherited

Definition at line 30 of file TrigMatchToolCore.cxx.

31{
32 m_slotCache->clear();
33
34 return;
35}

◆ 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

◆ getCache()

template<typename trigType>
TrigFeatureCache< trigType > & TrigMatchToolCore::getCache ( int type_key,
SlotCache & slotCache,
const SlotCache::lock_t & lock ) const
privateinherited

◆ getCache1()

TrigMatchToolCore::TrigFeatureCacheBase *& TrigMatchToolCore::getCache1 ( const std::type_info * tid,
int type_key,
SlotCache & slotCache,
const SlotCache::lock_t & lock ) const
privateinherited

Definition at line 47 of file TrigMatchToolCore.cxx.

50{
51 if (type_key < 0) {
52 m_typeMap.key (tid);
53 }
54
55 if (static_cast<int> (slotCache.m_caches->size()) <= type_key)
56 slotCache.m_caches->resize (type_key + 1);
57 return (*slotCache.m_caches)[type_key];
58}

◆ getCachedFeatureContainer()

const Trig::FeatureContainer & TrigMatchToolCore::getCachedFeatureContainer ( size_t chainIndex,
SlotCache & cache,
const SlotCache::lock_t & lock ) const
privateinherited

Definition at line 69 of file TrigMatchToolCore.cxx.

72{
73 if (chainIndex >= slotCache.m_featureContainers.size()) {
74 if (chainIndex >= slotCache.m_nFeatureContainers)
75 slotCache.m_nFeatureContainers = chainIndex + 1;
76 slotCache.m_featureContainers.resize (slotCache.m_nFeatureContainers);
77 slotCache.m_featureContainersValid.resize (slotCache.m_nFeatureContainers);
78 }
79
80 if (!slotCache.m_featureContainersValid[chainIndex]) {
81#if 0
82 // Use this once FeatureContainer::swap is available to avoid copies.
83 Trig::FeatureContainer fc =
84 this->getFeatureContainer (m_chainNameIndex.chainName(chainIndex),
86 slotCache.m_featureContainers[chainIndex].swap (fc);
87#else
88 slotCache.m_featureContainers[chainIndex] =
89 this->getFeatureContainer (m_chainNameIndex.chainName(chainIndex),
91#endif
92 slotCache.m_featureContainersValid[chainIndex] = true;
93 }
94
95 return slotCache.m_featureContainers[chainIndex];
96}
virtual Trig::FeatureContainer getFeatureContainer(const std::string &chainName, const int condition) const =0

◆ getConfiguredChainNames()

std::vector< std::string > TrigMatchTool::getConfiguredChainNames ( ) const
overrideprivatevirtual

Implements TrigMatchToolCore.

Definition at line 62 of file TrigMatchTool.cxx.

63{
64 if (!m_trigDecisionTool) {
65 return std::vector<std::string>();
66 }
67 return m_trigDecisionTool->getListOfTriggers();
68}

◆ getFeatureContainer()

virtual Trig::FeatureContainer TrigMatchTool::getFeatureContainer ( const std::string & chainName,
const int condition ) const
inlineoverrideprivatevirtual

Implements TrigMatchToolCore.

Definition at line 66 of file TrigMatchTool.h.

66 {
67 return m_trigDecisionTool->features( chainName, condition );
68 }

◆ getObjects() [1/2]

template<typename trigType>
void TrigMatchToolCore::getObjects ( std::vector< const trigType * > & objects,
const std::string & chainName,
bool onlyPassedFeatures ) const
privateinherited

◆ getObjects() [2/2]

template<typename trigType>
void TrigMatchToolCore::getObjects ( std::vector< const trigType * > & objects,
size_t chainIndex,
bool onlyPassedFeatures ) const
privateinherited

◆ getTriggerObjects() [1/2]

template<typename trigType>
std::vector< const trigType * > TrigMatchToolCore::getTriggerObjects ( const std::string & chainName,
bool onlyPassedFeatures ) const
inherited

getTriggerObjects returns the objects of the specified type from the specified chain.

Note that if onlyPassedFeatures is true, then only features from passed chains will be returned.

◆ getTriggerObjects() [2/2]

template<typename trigType>
std::vector< const trigType * > TrigMatchToolCore::getTriggerObjects ( size_t chainIndex,
bool onlyPassedFeatures ) const
privateinherited

Alternate version of getTriggerObjects taking a chain index.

◆ handle()

void TrigMatchTool::handle ( const Incident & inc)
overrideprivatevirtual

Definition at line 81 of file TrigMatchTool.cxx.

81 {
82
83 if (inc.type() == "EndEvent") {
84 this->endEvent();
85 }
86}
virtual void endEvent()

◆ initialize()

StatusCode TrigMatchTool::initialize ( )
overridevirtual

Definition at line 38 of file TrigMatchTool.cxx.

38 {
39
40 ATH_MSG_DEBUG( "TrigMatchTool::Intialize()" );
41
42 // load the required tool(s):
43 CHECK( m_trigDecisionTool.retrieve() );
44 ATH_MSG_INFO( "Successfully retrieved the TrigDecisionTool!" );
45 this->setTDT( &( *m_trigDecisionTool ) );
46
47 // register to hear end event incidents so we can clear
48 // the cache
49 ServiceHandle<IIncidentSvc> p_incSvc("IncidentSvc", this->name());
50 p_incSvc->addListener( this, "EndEvent" );
51
52 return StatusCode::SUCCESS;
53}
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
void setTDT(Trig::TrigDecisionToolCore *tdt)

◆ 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 & TrigMatchTool::interfaceID ( )
inlinestatic

Definition at line 40 of file TrigMatchTool.h.

40 {
41 return IID_TrigMatchTool;
42 }
static const InterfaceID IID_TrigMatchTool("TrigMatchTool", 1, 0)

◆ lowerChainName()

std::string TrigMatchTool::lowerChainName ( const std::string & chainName) const
overrideprivatevirtual

Implements TrigMatchToolCore.

Definition at line 70 of file TrigMatchTool.cxx.

70 {
71
72 const TrigConf::HLTChain *hltChain = m_trigDecisionTool->ExperimentalAndExpertMethods().getChainConfigurationDetails(chainName);
73 if( hltChain ) {
74 return hltChain->lower_chain_name();
75 }
76
77 return "";
78}
const std::string & lower_chain_name() const

◆ matchedTriggerObjects() [1/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchedTriggerObjects ( const DataVector< baseType > & baseObjects,
const std::string & chainName,
float maxDistance,
bool onlyBestMatch,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

matchedTriggerObjects returns a vector of trigger objects from chain chainName that match to one or more of the objects passed according to the matching criteria specified.

If onlyBestMatch is true, then trigger objects will only be returned if they are the closest match to one of the baseObjects.

◆ matchedTriggerObjects() [2/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchedTriggerObjects ( const DataVector< baseType > & baseObjects,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyBestMatch = true,
bool onlyPassedFeatures = false ) const
inherited

◆ matchedTriggerObjects() [3/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchedTriggerObjects ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
float maxDistance,
bool onlyBestMatch,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

◆ matchedTriggerObjects() [4/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchedTriggerObjects ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyBestMatch = true,
bool onlyPassedFeatures = false ) const
inherited

◆ matchToAllTriggerObjects() [1/2]

template<typename trigType, typename baseType>
std::map< const trigType *, std::vector< std::string > > TrigMatchToolCore::matchToAllTriggerObjects ( const baseType * baseObject,
float maxDistance,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

matchToAllObjects returns a map from matched objects to the chains they were found in.

Matching is done according to criteria in matchToObjects.

◆ matchToAllTriggerObjects() [2/2]

template<typename trigType, typename baseType>
std::map< const trigType *, std::vector< std::string > > TrigMatchToolCore::matchToAllTriggerObjects ( const baseType * baseObject,
float maxDistance = 0.1,
bool onlyPassedFeatures = false ) const
inherited

◆ matchToObject() [1/4]

template<typename T, typename U>
const T * ObjectMatching::matchToObject ( const U * matchObject,
const DataVector< T > & targetObjects,
float maxDistance,
const DistanceFunctor< T, U > * metric ) const
inherited

◆ matchToObject() [2/4]

template<typename T, typename U>
const T * ObjectMatching::matchToObject ( const U * matchObject,
const DataVector< T > & targetObjects,
float maxDistance = 0.1 ) const
inherited

◆ matchToObject() [3/4]

template<typename T, typename U>
const T * ObjectMatching::matchToObject ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance,
const DistanceFunctor< T, U > * metric ) const
inherited

matchToObject returns the object of type T from the suppled vector that best matches matchObject according to the distance metric, if available, or if not, according the the default metric.

◆ matchToObject() [4/4]

template<typename T, typename U>
const T * ObjectMatching::matchToObject ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance = 0.1 ) const
inherited

◆ matchToObjects() [1/4]

template<typename T, typename U>
std::vector< const T * > ObjectMatching::matchToObjects ( const U * matchObject,
const DataVector< T > & targetObjects,
float maxDistance,
const DistanceFunctor< T, U > * metric ) const
inherited

◆ matchToObjects() [2/4]

template<typename T, typename U>
std::vector< const T * > ObjectMatching::matchToObjects ( const U * matchObject,
const DataVector< T > & targetObjects,
float maxDistance = 0.1 ) const
inherited

◆ matchToObjects() [3/4]

template<typename T, typename U>
std::vector< const T * > ObjectMatching::matchToObjects ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance,
const DistanceFunctor< T, U > * metric ) const
inherited

matchToObjects returns the objects of type T from the supplied vector that match to matchObject, sorted by distance from the matchObject according to metric.

◆ matchToObjects() [4/4]

template<typename T, typename U>
std::vector< const T * > ObjectMatching::matchToObjects ( const U * matchObject,
const std::vector< const T * > & targetObjects,
float maxDistance = 0.1 ) const
inherited

◆ matchToTriggerObject() [1/3]

template<typename trigType, typename baseType>
const trigType * TrigMatchToolCore::matchToTriggerObject ( const baseType * ,
const std::string & ,
bool  ) const
inlineinherited

Definition at line 119 of file TrigMatchToolCore.h.

121 {
122
123 this->warning( "You have called matchToTriggerObject incorrectly.");
124 this->warning( "Note that the correct use is: object to match to, "
125 "chainName, maxDistance, onlyPassedFeatures");
126 this->warning( "Your current call is of the form: object to match "
127 "to, chainName, onlyPassedFeatures");
128
129 return 0;
130 }
virtual void warning(const std::string &w) const =0

◆ matchToTriggerObject() [2/3]

template<typename trigType, typename baseType>
const trigType * TrigMatchToolCore::matchToTriggerObject ( const baseType * baseObject,
const std::string & chainName,
float maxDistance,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

matchToTriggerObject returns the object of type trigType from chain chainName, which has the lowest distance to baseObject according to metric.

◆ matchToTriggerObject() [3/3]

template<typename trigType, typename baseType>
const trigType * TrigMatchToolCore::matchToTriggerObject ( const baseType * baseObject,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyPassedFeatures = false ) const
inherited

◆ matchToTriggerObjects() [1/3]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchToTriggerObjects ( const baseType * baseObject,
const std::string & chainName,
float maxDistance,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

matchToTriggerObjects returns the objects of type trigType from chain chainName, which match to baseObject, sorted by distance from baseObject according to metric.

◆ matchToTriggerObjects() [2/3]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchToTriggerObjects ( const baseType * baseObject,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyPassedFeatures = false ) const
inherited

◆ matchToTriggerObjects() [3/3]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::matchToTriggerObjects ( const baseType * baseObject,
size_t chainIndex,
float maxDistance,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
privateinherited

matchToTriggerObjects returns the objects of type trigType from chain chainName, which match to baseObject, sorted by distance from baseObject according to metric.

◆ 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 }

◆ objectsInChain() [1/2]

template<typename trigType, typename baseType>
std::vector< const baseType * > TrigMatchToolCore::objectsInChain ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
bool onlyPassedFeatures,
float maxDistance,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

objectsInChain returns a container of reco objects which match to objects of type trigType in the specified chain, where a match is defined by a distance, according to the supplied metric, of less than maxDistance.

If onlyPassedFeatures is true then only matches with trigger objects in passed chains will be considered.

◆ objectsInChain() [2/2]

template<typename trigType, typename baseType>
std::vector< const baseType * > TrigMatchToolCore::objectsInChain ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
bool onlyPassedFeatures = false,
float maxDistance = 0.1 ) const
inherited

◆ 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.

◆ prepareMetric()

template<typename T, typename U>
const DistanceFunctor< T, U > * ObjectMatching::prepareMetric ( ) const
protectedinherited

◆ propagateChainNames() [1/3]

std::string TrigMatchToolCore::propagateChainNames ( const std::string & chainName) const
privatevirtualinherited

Definition at line 24 of file TrigMatchToolCore.cxx.

25{
26 return m_chainNameIndex.propagateChainNames (chainName);
27}

◆ propagateChainNames() [2/3]

template<typename trait>
std::string TrigMatchToolCore::propagateChainNames ( const std::string & chainName,
const trait *  ) const
inlineprivateinherited

Definition at line 467 of file TrigMatchToolCore.h.

469 {
470 return chainName;
471 }

◆ propagateChainNames() [3/3]

std::string TrigMatchToolCore::propagateChainNames ( const std::string & chainName,
const TrigMatch::AncestorAttached *  ) const
inlineprivateinherited

Definition at line 472 of file TrigMatchToolCore.h.

474 {
475 return this->propagateChainNames( chainName );
476 }
std::string propagateChainNames(const std::string &chainName, const trait *) const

◆ 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 }

◆ setFeatureLabel()

TrigMatchToolCore::FeatureLabelHolder TrigMatchToolCore::setFeatureLabel ( const std::string & label)
inlineinherited

setFeatureLabel is used to set the label to be used when extracting features from the navigation.

Note that it should only be used like:

m_matchTool->setFeatureLabel("label")->matchToTriggerObject( recoObj,
chainName );

and never on its own. Note that it will only affect the very next match.

Definition at line 342 of file TrigMatchToolCore.h.

342 {
343 SlotCache& slotCache = *m_slotCache;
344 std::unique_lock<SlotCache::mutex_t> lock (slotCache.m_mutex);
345 slotCache.m_featureLabel = label;
346 slotCache.m_caches = &slotCache.m_cacheMap[label];
347 return FeatureLabelHolder( this, slotCache, std::move(lock) );
348 }
std::string label(const std::string &format, int i)
Definition label.h:19

◆ setTDT()

void TrigMatchToolCore::setTDT ( Trig::TrigDecisionToolCore * tdt)
inlineprotectedinherited

Definition at line 387 of file TrigMatchToolCore.h.

387 {
389 }
Trig::TrigDecisionToolCore * m_trigDecisionToolCore

◆ 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.

◆ unmatchedTriggerObjects() [1/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::unmatchedTriggerObjects ( const DataVector< baseType > & baseObjects,
const std::string & chainName,
float maxDistance,
bool onlyBestMatch,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

unmatchedTriggerObjects returns a vector of trigger objects from chain chainName that do not match to any of the objects passed according to the matching criteria specified.

If onlyBestMatch is true, then trigger objects will only be considered matched if they are the closest object to the baseObject.

◆ unmatchedTriggerObjects() [2/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::unmatchedTriggerObjects ( const DataVector< baseType > & baseObjects,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyBestMatch = true,
bool onlyPassedFeatures = false ) const
inherited

◆ unmatchedTriggerObjects() [3/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::unmatchedTriggerObjects ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
float maxDistance,
bool onlyBestMatch,
bool onlyPassedFeatures,
const DistanceFunctor< trigType, baseType > * metric ) const
inherited

◆ unmatchedTriggerObjects() [4/4]

template<typename trigType, typename baseType>
std::vector< const trigType * > TrigMatchToolCore::unmatchedTriggerObjects ( const std::vector< const baseType * > & baseObjects,
const std::string & chainName,
float maxDistance = 0.1,
bool onlyBestMatch = true,
bool onlyPassedFeatures = false ) const
inherited

◆ 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

◆ warning()

virtual void TrigMatchTool::warning ( const std::string & w) const
inlineoverrideprivatevirtual

Implements TrigMatchToolCore.

Definition at line 48 of file TrigMatchTool.h.

48 {
49 ATH_MSG_ERROR( w );
50 return;
51 }
#define ATH_MSG_ERROR(x)

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

ChainNameIndex m_chainNameIndex TrigMatchToolCore::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 439 of file TrigMatchToolCore.h.

◆ ATLAS_THREAD_SAFE [2/3]

TypeMap m_typeMap TrigMatchToolCore::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 632 of file TrigMatchToolCore.h.

◆ ATLAS_THREAD_SAFE [3/3]

SG::SlotSpecificObj<SlotCache> m_slotCache TrigMatchToolCore::ATLAS_THREAD_SAFE
mutableprivateinherited

Definition at line 693 of file TrigMatchToolCore.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_trigDecisionTool

ToolHandle< Trig::TrigDecisionTool > TrigMatchTool::m_trigDecisionTool
private

Definition at line 77 of file TrigMatchTool.h.

◆ m_trigDecisionToolCore

Trig::TrigDecisionToolCore* TrigMatchToolCore::m_trigDecisionToolCore
privateinherited

Definition at line 616 of file TrigMatchToolCore.h.

◆ 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: