ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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 }

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;
666  mother = RoI->getRelated(TriggerElement::seededByRelation)[0];
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 }

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:
HLT::TriggerElement::getId
te_id_type getId() const
reset internals.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:43
HLT::TriggerElement::FeatureAccessHelper::getCLID
class_id_type getCLID() const
Class ID of object.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:208
HLT::TriggerElement::getRelated
const std::vector< TriggerElement * > & getRelated(Relation rel) const
returns reference to the likns to other TriggerElements related by relation r
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:127
HLT::TriggerElement::ObjectIndex::subTypeIndex
sub_index_type subTypeIndex() const
to get collection index
Definition: TrigNavStructure/Root/TriggerElement.cxx:247
HLT::TriggerElement::ObjectIndex::objectsBegin
index_type objectsBegin() const
to get object number in th ecollection
Definition: TrigNavStructure/Root/TriggerElement.cxx:256
lumiFormat.i
int i
Definition: lumiFormat.py:85
HLT::TriggerElement
TriggerElement is the basic ingreedient of the interface between HLT algorithms and the navigation It...
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:27
TrigNavigationThinningSvc::TriggerElementFind::m_RoI
const HLT::TriggerElement * m_RoI
Definition: TrigNavigationThinningSvc.h:203
TrigNavigationThinningSvc::TriggerElementFind::m_id
unsigned int m_id
Definition: TrigNavigationThinningSvc.h:202
HLT::TriggerElement::ObjectIndex::objectsEnd
index_type objectsEnd() const
to get object number in th ecollection
Definition: TrigNavStructure/Root/TriggerElement.cxx:260
HLT::TriggerElement::FeatureAccessHelper::getIndex
const ObjectIndex & getIndex() const
index in the external ojects array
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:209
HLT::TriggerElement::FeatureAccessHelper
the FeatureAccessHelper is a class used to keep track of features attached to this TE.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:192
HLT::TriggerElement::getFeatureAccessHelpers
const std::vector< FeatureAccessHelper > & getFeatureAccessHelpers() const
returns all features which ara attached to this TE
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:238