ATLAS Offline Software
Public Member Functions | List of all members
Trig::FeatureContainer::ordering_by_objects_attached Class Reference

helper class to support ordered set of features More...

Collaboration diagram for Trig::FeatureContainer::ordering_by_objects_attached:

Public Member Functions

template<class T >
bool operator() (const Feature< T > &a, const Feature< T > &b) const
 
bool weakOrder (const HLT::TriggerElement *te_a, const HLT::TriggerElement *te_b, const void *obj_a, const void *obj_b) const
 

Detailed Description

helper class to support ordered set of features

Definition at line 155 of file FeatureContainer.h.

Member Function Documentation

◆ operator()()

template<class T >
bool Trig::FeatureContainer::ordering_by_objects_attached::operator() ( const Feature< T > &  a,
const Feature< T > &  b 
) const

Definition at line 146 of file FeatureContainer.h.

146  {
147  return weakOrder(a.te(), b.te(), a.cptr(), b.cptr());
148 }

◆ weakOrder()

bool Trig::FeatureContainer::ordering_by_objects_attached::weakOrder ( const HLT::TriggerElement te_a,
const HLT::TriggerElement te_b,
const void *  obj_a,
const void *  obj_b 
) const

Definition at line 44 of file FeatureContainer.cxx.

45  {
46  // returning False -> no insertion into set
47  // returning True -> insertion into set
48  // each pair of candidates is tested twice (if test returns False twice, then no insertion into set)
49 
50  using namespace HLT;
51  if (a==b && obj_a==obj_b) {
52  return false; // if TE and object pointers are the same, then we don't insert the second cand at all
53  }
54 
55  if(a==b && obj_a!=obj_b) {
56  // if different objects but the same TE, then we always insert, so the order in the set is the insertion order
57  // this guaranties reproducibility only if the order of the objects in the TE is reproducible
58  return true;
59  }
60 
61  // if the TEs are different we follow the old procedure which does guaranty reproducibily (the order of features is always the same)
62  const TriggerElement::FeatureVec& a_features = a->getFeatureAccessHelpers();
63  const TriggerElement::FeatureVec& b_features = b->getFeatureAccessHelpers();
64 
65  if ( a_features.size() != b_features.size() )
66  return a_features.size() < b_features.size();
67 
68  for ( unsigned f = 0, sz = a_features.size(); f < sz; ++f ) {
69  const TriggerElement::FeatureAccessHelper& a_f = a_features[f];
70  const TriggerElement::FeatureAccessHelper& b_f = b_features[f];
71  if ( a_f.getCLID() == b_f.getCLID()) {
72  if ( a_f.getIndex() == b_f.getIndex()) continue;
73  return a_f.getIndex() < b_f.getIndex();
74  }
75  return a_f.getCLID() < b_f.getCLID();
76  }
77  return false;
78 }

The documentation for this class was generated from the following files:
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
fitman.sz
sz
Definition: fitman.py:527
Trig::FeatureContainer::ordering_by_objects_attached::weakOrder
bool weakOrder(const HLT::TriggerElement *te_a, const HLT::TriggerElement *te_b, const void *obj_a, const void *obj_b) const
Definition: FeatureContainer.cxx:44
HLT::TriggerElement::FeatureVec
std::vector< FeatureAccessHelper > FeatureVec
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:233
HLT::TriggerElement::FeatureAccessHelper::getCLID
class_id_type getCLID() const
Class ID of object.
Definition: TrigNavStructure/TrigNavStructure/TriggerElement.h:208
HLT
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
Definition: HLTResultReader.h:26
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
a
TList * a
Definition: liststreamerinfos.cxx:10
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