ATLAS Offline Software
Loading...
Searching...
No Matches
TrigNavigationThinningSvc::TriggerElementFind Class Reference

Used to compare pointers of TriggerElements. More...

Collaboration diagram for TrigNavigationThinningSvc::TriggerElementFind:

Public Member Functions

 TriggerElementFind (const HLT::TriggerElement *te)
bool operator() (const HLT::TriggerElement *te)

Private Attributes

unsigned int m_id
const HLT::TriggerElementm_RoI

Detailed Description

Used to compare pointers of TriggerElements.

To establish equality of trigger elements, we check (a) that their id's match and (b) that they come from the same RoI. To check that the RoI is the same, we check check the RoI features, as these will never be slimmed (unless the whole branch is removed).

Definition at line 196 of file TrigNavigationThinningSvc.h.

Constructor & Destructor Documentation

◆ TriggerElementFind()

TrigNavigationThinningSvc::TriggerElementFind::TriggerElementFind ( const HLT::TriggerElement * te)

Definition at line 624 of file TrigNavigationThinningSvc.cxx.

624 {
625
626 // return the id the RoI node
627 if(!te) {
628 m_id = 0;
629 m_RoI = 0;
630 }
631 else {
632 m_id = te->getId();
633
634 const TriggerElement *mother = te;
635 m_RoI = te;
636 while( mother->getRelated(TriggerElement::seededByRelation).size() > 0 ) {
637 m_RoI = mother;
638 mother = m_RoI->getRelated(TriggerElement::seededByRelation)[0];
639 }
640 }
641}
const std::vector< TriggerElement * > & getRelated(Relation rel) const
returns reference to the likns to other TriggerElements related by relation r

Member Function Documentation

◆ operator()()

bool TrigNavigationThinningSvc::TriggerElementFind::operator() ( const HLT::TriggerElement * te)

Definition at line 643 of file TrigNavigationThinningSvc.cxx.

643 {
644
645 if(!te)
646 return 0;
647
648 // if we didn't initialize the RoI, then we can't match
649 if(!m_RoI)
650 return false;
651
652 // check that the id's match
653 if(te->getId() != m_id)
654 return 0;
655
656 // Note that we can have elements with the same id as long as they are in difference RoI's
657 // Thus, we must ensure that the RoI's are the same
658
659 // Find the RoI
660 const TriggerElement *mother = te;
661 const TriggerElement *RoI = te;
662
663 while( mother->getRelated(TriggerElement::seededByRelation).size() > 0 ) {
664 RoI = mother;
666 }
667
668 // now, RoI equality is defined by all the features that match, where a feature
669 // match is given by a matching CLID, subtypeIndex, and objectIndex
670
671 const std::vector< TriggerElement::FeatureAccessHelper > firstFeatures = m_RoI->getFeatureAccessHelpers();
672 const std::vector< TriggerElement::FeatureAccessHelper > secondFeatures = m_RoI->getFeatureAccessHelpers();
673
674 if(firstFeatures.size() != secondFeatures.size())
675 return false;
676
677 for(unsigned int i = 0; i < firstFeatures.size(); i++) {
678 TriggerElement::FeatureAccessHelper firstFeature = firstFeatures[i];
679 TriggerElement::FeatureAccessHelper secondFeature = secondFeatures[i];
680
681 if(firstFeature.getCLID() != secondFeature.getCLID())
682 return false;
683 if(firstFeature.getIndex().subTypeIndex() != secondFeature.getIndex().subTypeIndex())
684 return false;
685 if(firstFeature.getIndex().objectsBegin() != secondFeature.getIndex().objectsBegin())
686 return false;
687 if(firstFeature.getIndex().objectsEnd() != secondFeature.getIndex().objectsEnd())
688 return false;
689
690 }
691
692 // if we've made it this far, all the features match (what should we do if there
693 // are no features?), so we have found a match!
694
695 return true;
696
697}
const ObjectIndex & getIndex() const
index in the external ojects array
sub_index_type subTypeIndex() const
to get collection index
index_type objectsEnd() const
to get object number in th ecollection
index_type objectsBegin() const
to get object number in th ecollection

Member Data Documentation

◆ m_id

unsigned int TrigNavigationThinningSvc::TriggerElementFind::m_id
private

Definition at line 202 of file TrigNavigationThinningSvc.h.

◆ m_RoI

const HLT::TriggerElement* TrigNavigationThinningSvc::TriggerElementFind::m_RoI
private

Definition at line 203 of file TrigNavigationThinningSvc.h.


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