![]() |
ATLAS Offline Software
|
The TrigMatchToolCore defines the core functionality of the TrigMatchTool and is used for matching trigger and reconstructed objects. More...
#include <TrigMatchToolCore.h>
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::FeatureContainer & | getCachedFeatureContainer (size_t chainIndex, SlotCache &cache, const SlotCache::lock_t &lock) const |
Private Attributes | |
ChainNameIndex m_chainNameIndex | ATLAS_THREAD_SAFE |
Trig::TrigDecisionToolCore * | m_trigDecisionToolCore |
TypeMap m_typeMap | ATLAS_THREAD_SAFE |
SG::SlotSpecificObj< SlotCache > m_slotCache | ATLAS_THREAD_SAFE |
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.
TrigMatchToolCore::TrigMatchToolCore | ( | ) |
Definition at line 13 of file TrigMatchToolCore.cxx.
|
virtual |
Definition at line 19 of file TrigMatchToolCore.cxx.
|
inherited |
|
inherited |
|
private |
Definition at line 62 of file TrigMatchToolCore.cxx.
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.
bool TrigMatchToolCore::chainPassedByObject | ( | const baseType * | baseObject, |
const std::string & | chainName, | ||
float | maxDistance = 0.1 |
||
) | const |
|
private |
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.
std::vector< std::string > TrigMatchToolCore::chainsPassedByObject | ( | const baseType * | baseObject, |
float | maxDistance = 0.1 |
||
) | const |
|
inlineprivatevirtual |
Reimplemented in TrigMatchTool.
Definition at line 451 of file TrigMatchToolCore.h.
|
protected |
Definition at line 40 of file TrigMatchToolCore.cxx.
|
private |
|
private |
|
private |
|
inherited |
|
inherited |
distance returns the distance between the two supplied objects using metric, if available, or the default metric, if not.
|
protectedvirtual |
Definition at line 30 of file TrigMatchToolCore.cxx.
|
private |
|
private |
Definition at line 47 of file TrigMatchToolCore.cxx.
|
private |
Definition at line 69 of file TrigMatchToolCore.cxx.
|
privatepure virtual |
Implemented in TrigMatchTool.
|
privatepure virtual |
Implemented in TrigMatchTool.
|
private |
|
private |
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.
|
private |
Alternate version of getTriggerObjects
taking a chain index.
|
privatepure virtual |
Implemented in TrigMatchTool.
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.
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 |
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 |
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 |
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.
std::map< const trigType*, std::vector< std::string > > TrigMatchToolCore::matchToAllTriggerObjects | ( | const baseType * | baseObject, |
float | maxDistance = 0.1 , |
||
bool | onlyPassedFeatures = false |
||
) | const |
|
inherited |
|
inherited |
|
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.
|
inherited |
|
inherited |
|
inherited |
|
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.
|
inherited |
|
inline |
Definition at line 119 of file TrigMatchToolCore.h.
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.
const trigType* TrigMatchToolCore::matchToTriggerObject | ( | const baseType * | baseObject, |
const std::string & | chainName, | ||
float | maxDistance = 0.1 , |
||
bool | onlyPassedFeatures = false |
||
) | const |
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.
std::vector< const trigType* > TrigMatchToolCore::matchToTriggerObjects | ( | const baseType * | baseObject, |
const std::string & | chainName, | ||
float | maxDistance = 0.1 , |
||
bool | onlyPassedFeatures = false |
||
) | const |
|
private |
matchToTriggerObjects returns the objects of type trigType from chain chainName, which match to baseObject, sorted by distance from baseObject according to metric.
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.
std::vector< const baseType* > TrigMatchToolCore::objectsInChain | ( | const std::vector< const baseType * > & | baseObjects, |
const std::string & | chainName, | ||
bool | onlyPassedFeatures = false , |
||
float | maxDistance = 0.1 |
||
) | const |
|
protectedinherited |
|
privatevirtual |
Definition at line 24 of file TrigMatchToolCore.cxx.
|
inlineprivate |
Definition at line 467 of file TrigMatchToolCore.h.
|
inlineprivate |
Definition at line 472 of file TrigMatchToolCore.h.
|
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.
|
inlineprotected |
Definition at line 387 of file TrigMatchToolCore.h.
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.
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 |
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 |
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 |
|
privatepure virtual |
Implemented in TrigMatchTool.
|
mutableprivate |
Definition at line 439 of file TrigMatchToolCore.h.
|
mutableprivate |
Definition at line 632 of file TrigMatchToolCore.h.
|
mutableprivate |
Definition at line 693 of file TrigMatchToolCore.h.
|
private |
Definition at line 616 of file TrigMatchToolCore.h.