ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
NSWL1::TrigIsSubsetOf Struct Reference

whether all pad indices of one trigger are a subset of another one A functor used to remove redundancies 3/4 from 4/4 More...

Collaboration diagram for NSWL1::TrigIsSubsetOf:

Public Member Functions

 TrigIsSubsetOf (const SingleWedgePadTrigger &tr)
 
bool operator() (const SingleWedgePadTrigger &tr) const
 

Public Attributes

std::vector< size_t > indices
 

Detailed Description

whether all pad indices of one trigger are a subset of another one A functor used to remove redundancies 3/4 from 4/4

Definition at line 319 of file L1TdrStgcTriggerLogic.cxx.

Constructor & Destructor Documentation

◆ TrigIsSubsetOf()

NSWL1::TrigIsSubsetOf::TrigIsSubsetOf ( const SingleWedgePadTrigger tr)
inline

Definition at line 321 of file L1TdrStgcTriggerLogic.cxx.

321  : indices(tr.padIndices()) {
322  assert(indices.size() ==4); // we want to use it with the 4 out of 4 triggers
323  sort(indices.begin(), indices.end());
324  }

Member Function Documentation

◆ operator()()

bool NSWL1::TrigIsSubsetOf::operator() ( const SingleWedgePadTrigger tr) const
inline

Definition at line 325 of file L1TdrStgcTriggerLogic.cxx.

325  {
326  std::vector< size_t > idxes(tr.padIndices());
327  sort(idxes.begin(),idxes.end()); // need to be sorted for set_intersection to work
328  std::vector< size_t > commonIndices(indices.size() > idxes.size() ? indices.size(): idxes.size());
329  bool allIdsPresent(
330  std::distance(commonIndices.begin(),std::set_intersection(indices.begin(), indices.end(),idxes.begin(), idxes.end(),commonIndices.begin())) ==static_cast<int>(idxes.size())
331  );
332  return allIdsPresent;
333  }

Member Data Documentation

◆ indices

std::vector< size_t > NSWL1::TrigIsSubsetOf::indices

Definition at line 320 of file L1TdrStgcTriggerLogic.cxx.


The documentation for this struct was generated from the following file:
std::sort
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:554
NSWL1::TrigIsSubsetOf::indices
std::vector< size_t > indices
Definition: L1TdrStgcTriggerLogic.cxx:320
set_intersection
Set * set_intersection(Set *set1, Set *set2)
Perform an intersection of two sets.
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54