ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TrigMatchToolCore Class Referenceabstract

The TrigMatchToolCore defines the core functionality of the TrigMatchTool and is used for matching trigger and reconstructed objects. More...

#include <TrigMatchToolCore.h>

Inheritance diagram for TrigMatchToolCore:
Collaboration diagram for TrigMatchToolCore:

Classes

class  ChainNameIndex
 
class  FeatureLabelHolder
 
struct  SlotCache
 
class  TrigFeatureCache
 
class  TrigFeatureCacheBase
 
class  TypeMap
 

Public Member Functions

 TrigMatchToolCore ()
 
virtual ~TrigMatchToolCore ()
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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
 

Protected Member Functions

void setTDT (Trig::TrigDecisionToolCore *tdt)
 
virtual void endEvent ()
 
void clearChainIndex ()
 
template<typename T , typename U >
const DistanceFunctor< T, U > * prepareMetric () const
 

Private Member Functions

virtual void warning (const std::string &w) const =0
 
virtual bool changedDecisionAware () const
 
virtual std::vector< std::string > getConfiguredChainNames () const =0
 
virtual Trig::FeatureContainer getFeatureContainer (const std::string &chainName, const int condition) const =0
 
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
 
virtual std::string lowerChainName (const std::string &chainName) const =0
 
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 >
std::vector< const trigType * > getTriggerObjects (size_t chainIndex, bool onlyPassedFeatures) const
 Alternate version of getTriggerObjects taking a chain index. More...
 
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. More...
 
template<typename trigType , typename baseType >
bool chainPassedByObject (const baseType *baseObject, size_t chainIndex, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) 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

ChainNameIndex m_chainNameIndex ATLAS_THREAD_SAFE
 
Trig::TrigDecisionToolCorem_trigDecisionToolCore
 
TypeMap m_typeMap ATLAS_THREAD_SAFE
 
SG::SlotSpecificObj< SlotCache > m_slotCache ATLAS_THREAD_SAFE
 

Detailed Description

The TrigMatchToolCore defines the core functionality of the TrigMatchTool and is used for matching trigger and reconstructed objects.

Definition at line 40 of file TrigMatchToolCore.h.

Constructor & Destructor Documentation

◆ TrigMatchToolCore()

TrigMatchToolCore::TrigMatchToolCore ( )

Definition at line 13 of file TrigMatchToolCore.cxx.

14  : m_chainNameIndex (this),
16 {
17 }

◆ ~TrigMatchToolCore()

TrigMatchToolCore::~TrigMatchToolCore ( )
virtual

Definition at line 19 of file TrigMatchToolCore.cxx.

20 {
21 }

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
private

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

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

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

◆ 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

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

◆ changedDecisionAware()

virtual bool TrigMatchToolCore::changedDecisionAware ( ) const
inlineprivatevirtual

Reimplemented in TrigMatchTool.

Definition at line 451 of file TrigMatchToolCore.h.

451 { return false; };

◆ clearChainIndex()

void TrigMatchToolCore::clearChainIndex ( )
protected

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
private

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

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

◆ 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 ( )
protectedvirtual

Definition at line 30 of file TrigMatchToolCore.cxx.

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

◆ getCache()

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

◆ getCache1()

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

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
private

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.
84  this->getFeatureContainer (m_chainNameIndex.chainName(chainIndex),
85  TrigDefs::alsoDeactivateTEs);
86  slotCache.m_featureContainers[chainIndex].swap (fc);
87 #else
88  slotCache.m_featureContainers[chainIndex] =
89  this->getFeatureContainer (m_chainNameIndex.chainName(chainIndex),
90  TrigDefs::alsoDeactivateTEs);
91 #endif
92  slotCache.m_featureContainersValid[chainIndex] = true;
93  }
94 
95  return slotCache.m_featureContainers[chainIndex];
96 }

◆ getConfiguredChainNames()

virtual std::vector<std::string> TrigMatchToolCore::getConfiguredChainNames ( ) const
privatepure virtual

Implemented in TrigMatchTool.

◆ getFeatureContainer()

virtual Trig::FeatureContainer TrigMatchToolCore::getFeatureContainer ( const std::string &  chainName,
const int  condition 
) const
privatepure virtual

Implemented in TrigMatchTool.

◆ getObjects() [1/2]

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

◆ getObjects() [2/2]

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

◆ getTriggerObjects() [1/2]

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

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
private

Alternate version of getTriggerObjects taking a chain index.

◆ lowerChainName()

virtual std::string TrigMatchToolCore::lowerChainName ( const std::string &  chainName) const
privatepure virtual

Implemented in TrigMatchTool.

◆ 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

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

◆ 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

◆ 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

◆ 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

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

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

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  }

◆ 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

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

◆ 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

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

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

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

◆ 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

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

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

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
inlineprivate

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
inlineprivate

Definition at line 472 of file TrigMatchToolCore.h.

474  {
475  return this->propagateChainNames( chainName );
476  }

◆ setFeatureLabel()

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

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  }

◆ setTDT()

void TrigMatchToolCore::setTDT ( Trig::TrigDecisionToolCore tdt)
inlineprotected

Definition at line 387 of file TrigMatchToolCore.h.

387  {
389  }

◆ 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

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

◆ 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

◆ 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

◆ warning()

virtual void TrigMatchToolCore::warning ( const std::string &  w) const
privatepure virtual

Implemented in TrigMatchTool.

Member Data Documentation

◆ ATLAS_THREAD_SAFE [1/3]

ChainNameIndex m_chainNameIndex TrigMatchToolCore::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 439 of file TrigMatchToolCore.h.

◆ ATLAS_THREAD_SAFE [2/3]

TypeMap m_typeMap TrigMatchToolCore::ATLAS_THREAD_SAFE
mutableprivate

Definition at line 632 of file TrigMatchToolCore.h.

◆ ATLAS_THREAD_SAFE [3/3]

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

Definition at line 693 of file TrigMatchToolCore.h.

◆ m_trigDecisionToolCore

Trig::TrigDecisionToolCore* TrigMatchToolCore::m_trigDecisionToolCore
private

Definition at line 616 of file TrigMatchToolCore.h.


The documentation for this class was generated from the following files:
PlotCalibFromCool.label
label
Definition: PlotCalibFromCool.py:78
LArDigits2NtupleDumper.tdt
tdt
Definition: LArDigits2NtupleDumper.py:121
TrigMatchToolCore::getFeatureContainer
virtual Trig::FeatureContainer getFeatureContainer(const std::string &chainName, const int condition) const =0
Trig::FeatureContainer
Definition: FeatureContainer.h:54
TrigMatchToolCore::m_trigDecisionToolCore
Trig::TrigDecisionToolCore * m_trigDecisionToolCore
Definition: TrigMatchToolCore.h:616
TrigMatchToolCore::propagateChainNames
std::string propagateChainNames(const std::string &chainName, const trait *) const
Definition: TrigMatchToolCore.h:467
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
TrigMatchToolCore::warning
virtual void warning(const std::string &w) const =0