ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMatchToolCore.h
Go to the documentation of this file.
1// Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
5*/
6
7// $Id$
8#ifndef TRIGOBJECTMATCHING_TRIGMATCHTOOLCORE_H
9#define TRIGOBJECTMATCHING_TRIGMATCHTOOLCORE_H
10
11#define TRIG_OBJECT_MATCHING_VERSION_1
12
13// STL include(s):
14#include <vector>
15#include <unordered_map>
16#include <mutex>
17
18// includes for trigger matching framework
23
24// includes for navigation access
26
29
30namespace Trig {
31 class FeatureContainer;
32}
33
39
41
42private:
43 struct SlotCache;
44
45
46public:
47 // Default constructor and destructor
49 virtual ~TrigMatchToolCore();
50
51 /**************************************************
52 * Trigger Access Functions *
53 **************************************************/
54
61 template< typename trigType >
62 std::vector< const trigType* >
63 getTriggerObjects( const std::string& chainName,
64 bool onlyPassedFeatures ) const;
65
66 /**************************************************
67 * Offline -> Trigger Object matching *
68 **************************************************/
69
75 template< typename trigType, typename baseType >
76 std::vector< const trigType* >
77 matchToTriggerObjects( const baseType* baseObject,
78 const std::string& chainName,
79 float maxDistance,
80 bool onlyPassedFeatures,
81 const DistanceFunctor< trigType, baseType >* metric ) const;
82
83 // matching using the default metric - same as above except
84 // will match using deltaR, so no metric is needed
85 template< typename trigType, typename baseType >
86 std::vector< const trigType* >
87 matchToTriggerObjects( const baseType *baseObject,
88 const std::string& chainName,
89 float maxDistance = 0.1,
90 bool onlyPassedFeatures = false ) const;
91
97 template< typename trigType, typename baseType >
98 const trigType*
99 matchToTriggerObject( const baseType* baseObject,
100 const std::string& chainName,
101 float maxDistance,
102 bool onlyPassedFeatures,
103 const DistanceFunctor< trigType, baseType >* metric ) const;
104
105 // matching using the default metric - same as above except
106 // will use match using deltaR, so no metric is needed
107 template< typename trigType, typename baseType >
108 const trigType*
109 matchToTriggerObject( const baseType* baseObject,
110 const std::string& chainName,
111 float maxDistance = 0.1,
112 bool onlyPassedFeatures = false ) const;
113
114 // C++ will happily cast a bool to a float, which means you can
115 // call the above like matchToTriggerObject(object, chain, false)
116 // which is clearly not intended. This will warn people
117 template< typename trigType, typename baseType >
118 const trigType*
119 matchToTriggerObject( const baseType * /*baseObject*/,
120 const std::string& /*chainName*/,
121 bool /*onlyPassedFeatures*/ ) const {
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 }
131
140 template< typename trigType, typename baseType >
141 std::vector< const trigType* >
143 const std::string& chainName,
144 float maxDistance,
145 bool onlyBestMatch,
146 bool onlyPassedFeatures,
147 const DistanceFunctor< trigType, baseType >* metric ) const;
148
149 // matching using the default metric - same as above except
150 // will use match using deltaR, so no metric is needed
151 template< typename trigType, typename baseType >
152 std::vector< const trigType* >
154 const std::string& chainName,
155 float maxDistance = 0.1,
156 bool onlyBestMatch = true,
157 bool onlyPassedFeatures = false ) const;
158
159 // Versions with std::vector instead of DataVector
160 template< typename trigType, typename baseType >
161 std::vector< const trigType* >
162 matchedTriggerObjects( const std::vector< const baseType* >& baseObjects,
163 const std::string& chainName,
164 float maxDistance,
165 bool onlyBestMatch,
166 bool onlyPassedFeatures,
167 const DistanceFunctor< trigType, baseType > *metric ) const;
168
169 template< typename trigType, typename baseType >
170 std::vector< const trigType* >
171 matchedTriggerObjects( const std::vector< const baseType* >& baseObjects,
172 const std::string& chainName,
173 float maxDistance = 0.1,
174 bool onlyBestMatch = true,
175 bool onlyPassedFeatures = false ) const;
176
185 template< typename trigType, typename baseType >
186 std::vector< const trigType* >
188 const std::string& chainName,
189 float maxDistance,
190 bool onlyBestMatch,
191 bool onlyPassedFeatures,
192 const DistanceFunctor< trigType, baseType >* metric ) const;
193
194 // matching using the default metric - same as above except
195 // will use match using deltaR, so no metric is needed
196 template< typename trigType, typename baseType >
197 std::vector< const trigType* >
199 const std::string& chainName,
200 float maxDistance = 0.1,
201 bool onlyBestMatch = true,
202 bool onlyPassedFeatures = false ) const;
203
204 // versions with std::vectors instead of DataVectors
205 template< typename trigType, typename baseType >
206 std::vector< const trigType* >
207 unmatchedTriggerObjects( const std::vector<const baseType*>& baseObjects,
208 const std::string& chainName,
209 float maxDistance,
210 bool onlyBestMatch,
211 bool onlyPassedFeatures,
212 const DistanceFunctor< trigType, baseType >* metric ) const;
213
214 template< typename trigType, typename baseType >
215 std::vector< const trigType* >
216 unmatchedTriggerObjects( const std::vector< const baseType* >& baseObjects,
217 const std::string& chainName,
218 float maxDistance = 0.1,
219 bool onlyBestMatch = true,
220 bool onlyPassedFeatures = false ) const;
221
222 /**************************************************
223 * Offline -> Trigger Chain matching *
224 **************************************************/
225
236 template< typename trigType, typename baseType >
237 bool
238 chainPassedByObject( const baseType* baseObject,
239 const std::string& chainName,
240 float maxDistance,
241 const DistanceFunctor< trigType, baseType > *metric ) const;
242
243 // default metric version - matching will be done via deltaR,
244 // so it is not necessary to supply a metric
245 template< typename trigType, typename baseType >
246 bool
247 chainPassedByObject( const baseType *baseObject,
248 const std::string &chainName,
249 float maxDistance = 0.1 ) const;
250
261 template< typename trigType, typename baseType >
262 std::vector< std::string >
263 chainsPassedByObject( const baseType* baseObject,
264 float maxDistance,
265 const DistanceFunctor< trigType, baseType >* metric ) const;
266
267 // default metric version - matching will be done via
268 // deltaR, so a metric is not required
269 template< typename trigType, typename baseType >
270 std::vector< std::string >
271 chainsPassedByObject( const baseType *baseObject,
272 float maxDistance = 0.1 ) const;
273
274 /**************************************************
275 * Trigger Chain -> Offline matching *
276 **************************************************/
277
286 template< typename trigType, typename baseType >
287 std::vector< const baseType* >
288 objectsInChain( const std::vector< const baseType* >& baseObjects,
289 const std::string& chainName,
290 bool onlyPassedFeatures,
291 float maxDistance,
292 const DistanceFunctor< trigType, baseType >* metric ) const;
293
294 // default metric version - matching will be done via deltaR,
295 // and so it is not necessary to supply a metric
296 template< typename trigType, typename baseType >
297 std::vector< const baseType* >
298 objectsInChain( const std::vector< const baseType* >& baseObjects,
299 const std::string& chainName,
300 bool onlyPassedFeatures = false,
301 float maxDistance = 0.1 ) const;
302
308 template< typename trigType, typename baseType >
309 std::map< const trigType*, std::vector< std::string > >
310 matchToAllTriggerObjects( const baseType* baseObject,
311 float maxDistance,
312 bool onlyPassedFeatures,
313 const DistanceFunctor< trigType, baseType >* metric ) const;
314
315 // default metric version - matching will be done via deltaR,
316 // and so it is not necessary to supply a metric
317 template< typename trigType, typename baseType >
318 std::map< const trigType*, std::vector< std::string > >
319 matchToAllTriggerObjects( const baseType* baseObject,
320 float maxDistance = 0.1,
321 bool onlyPassedFeatures = false ) const;
322
323 /**********************************************************/
324 /* Setting running parameters */
325 /**********************************************************/
326 class FeatureLabelHolder;
327
342 setFeatureLabel( const std::string& label ) {
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 }
349
350 // This class does two things for us
351 // (1) It remembers when it was created, so that it can reset the feature label
352 // after it goes out of scope. This prevents users from accidentally setting
353 // the label and then not resetting it properly.
354 // (2) It allows us to overload the operators to make access to the trig match tool
355 // uniform
357
358 public:
360 SlotCache& slotCache,
361 std::unique_lock<std::recursive_mutex>&& lock)
363 m_slotCache( slotCache ),
364 m_lock( std::move (lock) )
365 {}
366
368 m_slotCache.resetFeatureLabel();
369 }
370
372 return m_matchTool;
373 }
374
376 return m_matchTool;
377 }
378
379 private:
382 std::unique_lock<std::recursive_mutex> m_lock;
383 }; // class FeatureLabelHolder
384
385
386protected:
390
391 // called on end event if we're able to get access to such information
392 virtual void endEvent();
393
394
395 // Clear saved chain name -> index mapping and rebuild from current
396 // configuration.
397 void clearChainIndex();
398
399
400private:
401 // Associate from chain name to integer index, and l1l2map.
402 // Methods of this class are thread-safe.
404 {
405 public:
407 size_t chainNameToIndex (const std::string& chainName);
408 std::vector<std::string> configuredChainNames();
409 std::string chainName (size_t index);
410 void clear();
411 std::string propagateChainNames (const std::string& chainName);
412
413
414 private:
416
417 typedef std::mutex mutex_t;
418 typedef std::lock_guard<mutex_t> lock_t;
419
421
423
424 // List of chain names.
425 // The first m_nConfiguredChainNames are those that come from
426 // the configuration. The remainder are those added for user
427 // queries (they could be regexps).
428 std::vector< std::string > m_chainNames;
430
431 // Map from chain names to indices.
432 typedef std::unordered_map<std::string, size_t> chainIndexMap_t ;
434
435 // cache the map from l1 items to the combined l2
436 // string for access in the tdt
437 std::map< std::string, std::string > m_l1l2Map;
438 };
439 mutable ChainNameIndex m_chainNameIndex ATLAS_THREAD_SAFE;
440
441
442 // function for printing warnings - note that this depends on whether
443 // you are in ARA or not
444 virtual void warning( const std::string& w ) const = 0;
445
446 // status functions for determining what information we have access to
447 // This allows the correct caching to take place based upon whether or
448 // not the tool is running in athena. In athena, we can register with
449 // store gate to get call backs when the trig decision changes, but
450 // we cannot get this info in ARA.
451 virtual bool changedDecisionAware() const { return false; };
452
453 // return configured chain names. Note that
454 // this is different for ARA and athena versions of the tool.
455 virtual std::vector<std::string> getConfiguredChainNames() const = 0;
456
457 // Functionality for loading the trigger objects from the navigation
458
459 // Getting a container from the trig decision tool. Note that this is
460 // an abstract function, as the exact method is different for
461 // ARA and Athena.
463 getFeatureContainer( const std::string &chainName, const int condition ) const = 0;
464
465 // determine how to propagate L1 chain names to L2 chain names
466 template< typename trait >
467 std::string propagateChainNames( const std::string& chainName,
468 const trait* ) const
469 {
470 return chainName;
471 }
472 std::string propagateChainNames( const std::string& chainName,
473 const TrigMatch::AncestorAttached* ) const
474 {
475 return this->propagateChainNames( chainName );
476 }
477 virtual std::string propagateChainNames( const std::string& chainName ) const;
478 virtual std::string lowerChainName( const std::string& chainName ) const = 0;
479
480 // fills objects with the trigger objects from the chain name
481 // with only passed features as desired. Queries cache first
482 // if possible
483 template< typename trigType >
484 void getObjects( std::vector< const trigType* >& objects,
485 const std::string& chainName,
486 bool onlyPassedFeatures ) const;
487
488 template< typename trigType >
489 void getObjects( std::vector< const trigType* >& objects,
490 size_t chainIndex,
491 bool onlyPassedFeatures ) const;
492
493 // function for loading objects that are attached directly
494 // to the navigation
495 template< typename trigType >
496 void collectObjects( const std::string& featureLabel,
497 std::vector< const trigType* >& objects,
498 const Trig::FeatureContainer &featureContainer,
499 bool onlyPassedFeatures,
500 const TrigMatch::DirectAttached* ) const;
501
502 // function for loading objects that are attached as
503 // containers to the navigation
504 template< typename trigType, typename contType >
505 void collectObjects( const std::string& featureLabel,
506 std::vector< const trigType* >& objects,
507 const Trig::FeatureContainer& featureContainer,
508 bool onlyPassedFeatures,
509 const contType* ) const;
510
511 // function for loading l1 objects from the navigation
512 template<typename trigType>
513 void collectObjects( const std::string& featureLabel,
514 std::vector< const trigType* >& objects,
515 const Trig::FeatureContainer& featureContainer,
516 bool onlyPassedFeatures,
517 const TrigMatch::AncestorAttached* ) const;
518
519 size_t chainNameToIndex (const std::string& chainName) const;
520
524 template< typename trigType >
525 std::vector< const trigType* >
526 getTriggerObjects( size_t chainIndex,
527 bool onlyPassedFeatures ) const;
528
534 template< typename trigType, typename baseType >
535 std::vector< const trigType* >
536 matchToTriggerObjects( const baseType* baseObject,
537 size_t chainIndex,
538 float maxDistance,
539 bool onlyPassedFeatures,
540 const DistanceFunctor< trigType, baseType >* metric ) const;
541
542 template< typename trigType, typename baseType >
543 bool
544 chainPassedByObject( const baseType* baseObject,
545 size_t chainIndex,
546 float maxDistance,
547 const DistanceFunctor< trigType, baseType > *metric ) const;
548
549 // cache from chainName and onlyPassedFeatures to std::vector<Trig::Feature<trigType> >
551 public:
553 virtual void clear() = 0;
554 }; // class TrigFeatureCacheBase
555
556 template<typename trigType>
558 public:
560 {
561 m_size[0] = m_size[1] = 0;
562 }
563
564 virtual void clear()
565 {
566 for (int i = 0; i < 2; i++) {
567 cacheDatavec_t().swap (m_data[i]);
568 }
569 }
570
571 bool get (size_t chainIndex,
572 bool onlyPassedFeatures,
573 std::vector< const trigType* >& objects)
574 {
575 cacheDatavec_t& v = m_data[onlyPassedFeatures];
576 if (chainIndex < v.size() && v[chainIndex].valid) {
577 objects = v[chainIndex].data;
578 return true;
579 }
580 return false;
581
582 }
583
584 void add( size_t chainIndex,
585 bool onlyPassedFeatures,
586 const std::vector< const trigType* >& data)
587 {
588 cacheDatavec_t& v = m_data[onlyPassedFeatures];
589 if (chainIndex >= v.size()) {
590 size_t& sz = m_size[onlyPassedFeatures];
591 if (chainIndex >= sz)
592 sz = chainIndex + 1;
593 v.resize (sz);
594 }
595 v[chainIndex].valid = true;
596 v[chainIndex].data = data;
597 }
598
599 private:
600 struct cacheData_t {
601 bool valid;
602 std::vector<const trigType*> data;
603 cacheData_t() : valid(false) {}
604 void clear()
605 {
606 valid = false;
607 std::vector<const trigType*>().swap (data);
608 }
609 };
610 typedef std::vector<cacheData_t> cacheDatavec_t;
612 size_t m_size[2];
613 }; // class TrigFeatureCache
614
615 // TDT access
617
618
620 {
621 public:
622 int key (const std::type_info* tid);
623
624 private:
625 typedef std::mutex mutex_t;
626 typedef std::lock_guard<mutex_t> lock_t;
627
628 typedef std::unordered_map<const std::type_info*, int> typeMap_t;
631 };
632 mutable TypeMap m_typeMap ATLAS_THREAD_SAFE;
633
634
636 {
638 {
639 m_caches = &m_cacheMap[""];
640 }
641
643 {
644 for (const cacheMap_t::value_type& p : m_cacheMap) {
645 for (TrigFeatureCacheBase* cache : p.second) {
646 delete cache;
647 }
648 }
649 }
650
651 void clear()
652 {
653 lock_t lock (m_mutex);
654 for (const cacheMap_t::value_type& p : m_cacheMap) {
655 for (TrigFeatureCacheBase* cache : p.second) {
656 cache->clear();
657 }
658 }
659 std::vector<Trig::FeatureContainer>().swap (m_featureContainers);
660 std::vector<bool>().swap (m_featureContainersValid);
661 }
662
670 {
671 m_featureLabel = "";
672 m_caches = &m_cacheMap[""];
673 }
674
675 std::string m_featureLabel;
676
677 typedef std::vector<TrigFeatureCacheBase*> cacheVec_t;
678
679 // Current cache vector.
681
682 typedef std::unordered_map<std::string, cacheVec_t> cacheMap_t;
684
685 std::vector<Trig::FeatureContainer> m_featureContainers;
686 std::vector<bool> m_featureContainersValid;
688
689 typedef std::recursive_mutex mutex_t;
690 typedef std::lock_guard<mutex_t> lock_t;
692 };
694
695 template <typename trigType>
697 SlotCache& slotCache,
698 const SlotCache::lock_t& lock) const;
699
700 TrigFeatureCacheBase*& getCache1 (const std::type_info* tid, int type_key,
701 SlotCache& slotCache,
702 const SlotCache::lock_t& lock) const;
703
705 getCachedFeatureContainer (size_t chainIndex,
706 SlotCache& cache,
707 const SlotCache::lock_t& lock) const;
708
709}; // end TrigMatchToolCore declaration
710
711// Include the implementation:
713
714#endif // TRIGOBJECTMATCHING_TRIGMATCHTOOLCORE_H
Maintain a set of objects, one per slot.
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t sz
Define macros for attributes used to control the static checker.
Derived DataVector<T>.
Definition DataVector.h:795
Maintain a set of objects, one per slot.
std::string chainName(size_t index)
std::vector< std::string > m_chainNames
size_t chainNameToIndex(const std::string &chainName)
std::vector< std::string > configuredChainNames()
std::lock_guard< mutex_t > lock_t
std::map< std::string, std::string > m_l1l2Map
std::unordered_map< std::string, size_t > chainIndexMap_t
std::string propagateChainNames(const std::string &chainName)
ChainNameIndex(TrigMatchToolCore *core)
FeatureLabelHolder(TrigMatchToolCore *matchTool, SlotCache &slotCache, std::unique_lock< std::recursive_mutex > &&lock)
TrigMatchToolCore * matchTool() const
TrigMatchToolCore * operator->() const
std::unique_lock< std::recursive_mutex > m_lock
bool get(size_t chainIndex, bool onlyPassedFeatures, std::vector< const trigType * > &objects)
void add(size_t chainIndex, bool onlyPassedFeatures, const std::vector< const trigType * > &data)
std::vector< cacheData_t > cacheDatavec_t
int key(const std::type_info *tid)
std::unordered_map< const std::type_info *, int > typeMap_t
std::lock_guard< mutex_t > lock_t
virtual std::vector< std::string > getConfiguredChainNames() const =0
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 baseO...
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 m...
bool chainPassedByObject(const baseType *baseObject, size_t chainIndex, float maxDistance, const DistanceFunctor< trigType, baseType > *metric) const
std::vector< const trigType * > getTriggerObjects(const std::string &chainName, bool onlyPassedFeatures) const
getTriggerObjects returns the objects of the specified type from the specified chain.
TrigMatchToolCore::FeatureLabelHolder setFeatureLabel(const std::string &label)
setFeatureLabel is used to set the label to be used when extracting features from the navigation.
void setTDT(Trig::TrigDecisionToolCore *tdt)
virtual std::string lowerChainName(const std::string &chainName) const =0
void collectObjects(const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const contType *) const
virtual void warning(const std::string &w) const =0
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
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 spe...
std::vector< const trigType * > matchedTriggerObjects(const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
std::vector< const baseType * > objectsInChain(const std::vector< const baseType * > &baseObjects, const std::string &chainName, bool onlyPassedFeatures=false, float maxDistance=0.1) const
std::string propagateChainNames(const std::string &chainName, const trait *) const
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...
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
Trig::TrigDecisionToolCore * m_trigDecisionToolCore
std::map< const trigType *, std::vector< std::string > > matchToAllTriggerObjects(const baseType *baseObject, float maxDistance=0.1, bool onlyPassedFeatures=false) const
TrigFeatureCache< trigType > & getCache(int type_key, SlotCache &slotCache, const SlotCache::lock_t &lock) const
const trigType * matchToTriggerObject(const baseType *, const std::string &, bool) const
size_t chainNameToIndex(const std::string &chainName) const
std::vector< const trigType * > matchToTriggerObjects(const baseType *baseObject, const std::string &chainName, float maxDistance=0.1, bool onlyPassedFeatures=false) const
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 ...
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,...
std::vector< const trigType * > getTriggerObjects(size_t chainIndex, bool onlyPassedFeatures) const
Alternate version of getTriggerObjects taking a chain index.
std::string propagateChainNames(const std::string &chainName, const TrigMatch::AncestorAttached *) const
TrigFeatureCacheBase *& getCache1(const std::type_info *tid, int type_key, SlotCache &slotCache, const SlotCache::lock_t &lock) const
ChainNameIndex m_chainNameIndex ATLAS_THREAD_SAFE
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.
bool chainPassedByObject(const baseType *baseObject, const std::string &chainName, float maxDistance=0.1) const
const Trig::FeatureContainer & getCachedFeatureContainer(size_t chainIndex, SlotCache &cache, const SlotCache::lock_t &lock) const
void collectObjects(const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const TrigMatch::AncestorAttached *) const
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 d...
virtual Trig::FeatureContainer getFeatureContainer(const std::string &chainName, const int condition) const =0
void getObjects(std::vector< const trigType * > &objects, const std::string &chainName, bool onlyPassedFeatures) const
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 baseO...
void collectObjects(const std::string &featureLabel, std::vector< const trigType * > &objects, const Trig::FeatureContainer &featureContainer, bool onlyPassedFeatures, const TrigMatch::DirectAttached *) const
std::vector< const trigType * > unmatchedTriggerObjects(const DataVector< baseType > &baseObjects, const std::string &chainName, float maxDistance=0.1, bool onlyBestMatch=true, bool onlyPassedFeatures=false) const
void getObjects(std::vector< const trigType * > &objects, size_t chainIndex, bool onlyPassedFeatures) const
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
const trigType * matchToTriggerObject(const baseType *baseObject, const std::string &chainName, float maxDistance=0.1, bool onlyPassedFeatures=false) const
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
virtual void endEvent()
std::vector< std::string > chainsPassedByObject(const baseType *baseObject, float maxDistance=0.1) const
virtual bool changedDecisionAware() const
std::string label(const std::string &format, int i)
Definition label.h:19
The common trigger namespace for trigger analysis tools.
Definition index.py:1
STL namespace.
std::vector< bool > m_featureContainersValid
std::unordered_map< std::string, cacheVec_t > cacheMap_t
std::vector< Trig::FeatureContainer > m_featureContainers
std::lock_guard< mutex_t > lock_t
void resetFeatureLabel()
resetFeatureLabel is used to reset the label to be used when extracting features from the navigation.
std::vector< TrigFeatureCacheBase * > cacheVec_t