ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
FTF::SpacePointSelector< T > Class Template Reference

#include <SpacePointConversionUtils.h>

Collaboration diagram for FTF::SpacePointSelector< T >:

Public Member Functions

 SpacePointSelector (T &t)
 
 ~SpacePointSelector ()
 
void operator() (const IdentifierHash &id)
 
void operator() (const SpacePointCollection *coll)
 
int select (const SpacePointContainer &p, const std::vector< IdentifierHash > &idVec, const std::vector< short > *h2l=nullptr)
 

Private Attributes

T & m_filter
 
const std::vector< short > * m_hash2layer
 
const SpacePointContainerm_pIDC
 

Detailed Description

template<typename T>
class FTF::SpacePointSelector< T >

Definition at line 161 of file SpacePointConversionUtils.h.

Constructor & Destructor Documentation

◆ SpacePointSelector()

template<typename T >
FTF::SpacePointSelector< T >::SpacePointSelector ( T &  t)
inline

Definition at line 163 of file SpacePointConversionUtils.h.

163 : m_filter(t), m_hash2layer(nullptr), m_pIDC(nullptr) {};

◆ ~SpacePointSelector()

template<typename T >
FTF::SpacePointSelector< T >::~SpacePointSelector ( )
inline

Definition at line 164 of file SpacePointConversionUtils.h.

164 {};

Member Function Documentation

◆ operator()() [1/2]

template<typename T >
void FTF::SpacePointSelector< T >::operator() ( const IdentifierHash id)
inline

Definition at line 165 of file SpacePointConversionUtils.h.

165  {
166 
167  if (m_pIDC) {
168  auto collIt = m_pIDC->indexFindPtr(id);
169  if(collIt!=nullptr) {
170  if(m_hash2layer == nullptr) m_filter.setLayer(collIt->identify());
171  else {
172  int layerId = m_hash2layer->at((int)collIt->identifyHash());
173  if(layerId<0) return;
174  m_filter.setLayer(layerId,collIt->identify());
175  }
176  std::for_each(collIt->begin(),collIt->end(),m_filter);
177  }
178  }
179  }

◆ operator()() [2/2]

template<typename T >
void FTF::SpacePointSelector< T >::operator() ( const SpacePointCollection coll)
inline

Definition at line 180 of file SpacePointConversionUtils.h.

180  {
181  if(m_hash2layer == nullptr) m_filter.setLayer(coll->identify());
182  else m_filter.setLayer(m_hash2layer->at((int)coll->identifyHash()),coll->identify());
183  std::for_each(coll->begin(),coll->end(),m_filter);
184  }

◆ select()

template<typename T >
int FTF::SpacePointSelector< T >::select ( const SpacePointContainer p,
const std::vector< IdentifierHash > &  idVec,
const std::vector< short > *  h2l = nullptr 
)
inline

Definition at line 186 of file SpacePointConversionUtils.h.

186  {
187  m_hash2layer = h2l;
188  m_pIDC=&p;
189  int ret = m_filter.vectorSize();
190  std::for_each(idVec.begin(),idVec.end(),*this);
191  return m_filter.vectorSize()-ret;
192  }

Member Data Documentation

◆ m_filter

template<typename T >
T& FTF::SpacePointSelector< T >::m_filter
private

Definition at line 195 of file SpacePointConversionUtils.h.

◆ m_hash2layer

template<typename T >
const std::vector<short>* FTF::SpacePointSelector< T >::m_hash2layer
private

Definition at line 196 of file SpacePointConversionUtils.h.

◆ m_pIDC

template<typename T >
const SpacePointContainer* FTF::SpacePointSelector< T >::m_pIDC
private

Definition at line 197 of file SpacePointConversionUtils.h.


The documentation for this class was generated from the following file:
FTF::SpacePointSelector::m_hash2layer
const std::vector< short > * m_hash2layer
Definition: SpacePointConversionUtils.h:196
SpacePointCollection::identify
virtual Identifier identify() const override final
Definition: SpacePointCollection.cxx:36
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SpacePointCollection::identifyHash
virtual IdentifierHash identifyHash() const override final
Definition: SpacePointCollection.cxx:41
FTF::SpacePointSelector::m_pIDC
const SpacePointContainer * m_pIDC
Definition: SpacePointConversionUtils.h:197
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
FTF::SpacePointSelector::m_filter
T & m_filter
Definition: SpacePointConversionUtils.h:195
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
IdentifiableContainerMT::indexFindPtr
virtual const T * indexFindPtr(IdentifierHash hashId) const override final
return pointer on the found entry or null if out of range using hashed index - fast version,...
Definition: IdentifiableContainerMT.h:289
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.