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 625 of file TrigNavigationThinningSvc.cxx.

625 {
626
627 // return the id the RoI node
628 if(!te) {
629 m_id = 0;
630 m_RoI = 0;
631 }
632 else {
633 m_id = te->getId();
634
635 const TriggerElement *mother = te;
636 m_RoI = te;
637 while( mother->getRelated(TriggerElement::seededByRelation).size() > 0 ) {
638 m_RoI = mother;
639 mother = m_RoI->getRelated(TriggerElement::seededByRelation)[0];
640 }
641 }
642}
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 644 of file TrigNavigationThinningSvc.cxx.

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