ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
TrigCompositeUtils::Combinations Class Reference

#include <Combinations.h>

Collaboration diagram for TrigCompositeUtils::Combinations:

Public Types

using VecLInfo_t = std::vector< LinkInfo< xAOD::IParticleContainer > >
 

Public Member Functions

 Combinations (const std::vector< std::size_t > &legMultiplicities, const std::vector< VecLInfo_t > &legFeatures, const std::function< bool(const VecLInfo_t &)> &filter)
 
 Combinations (const std::vector< std::size_t > &legMultiplicities, const std::vector< VecLInfo_t > &legFeatures, FilterType filter=FilterType::UniqueObjects)
 
 Combinations (const std::function< bool(const VecLInfo_t &)> &filter)
 
 Combinations (FilterType filter=FilterType::UniqueObjects)
 
void reserve (std::size_t capacity)
 
bool empty () const
 
std::size_t size () const
 
void addLeg (std::size_t multiplicity, const VecLInfo_t &features)
 
void addLeg (std::size_t multiplicity, VecLInfo_t &&features)
 
void addLeg (const VecLInfo_t &features)
 
void addLeg (VecLInfo_t &&features)
 
IPartCombItr begin () const
 
IPartCombItr end () const
 

Private Attributes

std::function< bool(const VecLInfo_t &)> m_filter
 
std::vector< std::size_t > m_legMultiplicities
 
std::vector< VecLInfo_tm_legFeatures
 

Detailed Description

Definition at line 17 of file Combinations.h.

Member Typedef Documentation

◆ VecLInfo_t

Definition at line 20 of file Combinations.h.

Constructor & Destructor Documentation

◆ Combinations() [1/4]

TrigCompositeUtils::Combinations::Combinations ( const std::vector< std::size_t > &  legMultiplicities,
const std::vector< VecLInfo_t > &  legFeatures,
const std::function< bool(const VecLInfo_t &)> &  filter 
)

Definition at line 12 of file Combinations.cxx.

16  : m_filter(filter),
17  m_legMultiplicities(legMultiplicities),
18  m_legFeatures(legFeatures)
19  {
20  if (legMultiplicities.size() != legFeatures.size())
21  throw std::invalid_argument("Different numbers of multiplicities and features provided");
22  }

◆ Combinations() [2/4]

TrigCompositeUtils::Combinations::Combinations ( const std::vector< std::size_t > &  legMultiplicities,
const std::vector< VecLInfo_t > &  legFeatures,
FilterType  filter = FilterType::UniqueObjects 
)

Definition at line 24 of file Combinations.cxx.

28  : Combinations(legMultiplicities, legFeatures, getFilter(filter))
29  {
30  }

◆ Combinations() [3/4]

TrigCompositeUtils::Combinations::Combinations ( const std::function< bool(const VecLInfo_t &)> &  filter)

Definition at line 32 of file Combinations.cxx.

33  : Combinations(std::vector<std::size_t>{}, std::vector<VecLInfo_t>{}, filter)
34  {
35  }

◆ Combinations() [4/4]

TrigCompositeUtils::Combinations::Combinations ( FilterType  filter = FilterType::UniqueObjects)

Definition at line 37 of file Combinations.cxx.

Member Function Documentation

◆ addLeg() [1/4]

void TrigCompositeUtils::Combinations::addLeg ( const VecLInfo_t features)

Definition at line 67 of file Combinations.cxx.

68  {
69  addLeg(1, features);
70  }

◆ addLeg() [2/4]

void TrigCompositeUtils::Combinations::addLeg ( std::size_t  multiplicity,
const VecLInfo_t features 
)

Definition at line 55 of file Combinations.cxx.

56  {
57  m_legMultiplicities.push_back(multiplicity);
58  m_legFeatures.push_back(features);
59  }

◆ addLeg() [3/4]

void TrigCompositeUtils::Combinations::addLeg ( std::size_t  multiplicity,
VecLInfo_t &&  features 
)

Definition at line 61 of file Combinations.cxx.

62  {
63  m_legMultiplicities.push_back(multiplicity);
64  m_legFeatures.push_back(std::move(features));
65  }

◆ addLeg() [4/4]

void TrigCompositeUtils::Combinations::addLeg ( VecLInfo_t &&  features)

Definition at line 72 of file Combinations.cxx.

73  {
74  addLeg(1, std::move(features));
75  }

◆ begin()

IPartCombItr TrigCompositeUtils::Combinations::begin ( ) const

Definition at line 77 of file Combinations.cxx.

78  {
79  // Build up the constructor arguments
80  std::vector<std::tuple<std::size_t, VecLInfo_t::const_iterator, VecLInfo_t::const_iterator>> args;
81  for (std::size_t ii = 0; ii < m_legFeatures.size(); ++ii)
82  args.push_back(std::make_tuple(
83  m_legMultiplicities.at(ii),
84  m_legFeatures.at(ii).begin(),
85  m_legFeatures.at(ii).end()));
86  return IPartCombItr(args, m_filter);
87  }

◆ empty()

bool TrigCompositeUtils::Combinations::empty ( ) const

Definition at line 45 of file Combinations.cxx.

46  {
47  return begin() == end();
48  }

◆ end()

IPartCombItr TrigCompositeUtils::Combinations::end ( ) const

Definition at line 89 of file Combinations.cxx.

90  {
91  return IPartCombItr();
92  }

◆ reserve()

void TrigCompositeUtils::Combinations::reserve ( std::size_t  capacity)

Definition at line 39 of file Combinations.cxx.

40  {
41  m_legMultiplicities.reserve(capacity);
42  m_legFeatures.reserve(capacity);
43  }

◆ size()

std::size_t TrigCompositeUtils::Combinations::size ( ) const

Definition at line 50 of file Combinations.cxx.

51  {
52  return std::accumulate(m_legMultiplicities.begin(), m_legMultiplicities.end(), std::size_t(0));
53  }

Member Data Documentation

◆ m_filter

std::function<bool(const VecLInfo_t &)> TrigCompositeUtils::Combinations::m_filter
private

Definition at line 50 of file Combinations.h.

◆ m_legFeatures

std::vector<VecLInfo_t> TrigCompositeUtils::Combinations::m_legFeatures
private

Definition at line 52 of file Combinations.h.

◆ m_legMultiplicities

std::vector<std::size_t> TrigCompositeUtils::Combinations::m_legMultiplicities
private

Definition at line 51 of file Combinations.h.


The documentation for this class was generated from the following files:
TrigCompositeUtils::Combinations::m_legFeatures
std::vector< VecLInfo_t > m_legFeatures
Definition: Combinations.h:52
accumulate
bool accumulate(AccumulateMap &map, std::vector< module_t > const &modules, FPGATrackSimMatrixAccumulator const &acc)
Accumulates an accumulator (e.g.
Definition: FPGATrackSimMatrixAccumulator.cxx:22
TrigCompositeUtils::Combinations::m_filter
std::function< bool(const VecLInfo_t &)> m_filter
Definition: Combinations.h:50
TrigCompositeUtils::Combinations::addLeg
void addLeg(std::size_t multiplicity, const VecLInfo_t &features)
Definition: Combinations.cxx:55
covarianceTool.filter
filter
Definition: covarianceTool.py:514
TrigCompositeUtils::Combinations::end
IPartCombItr end() const
Definition: Combinations.cxx:89
TrigCompositeUtils::Combinations::Combinations
Combinations(const std::vector< std::size_t > &legMultiplicities, const std::vector< VecLInfo_t > &legFeatures, const std::function< bool(const VecLInfo_t &)> &filter)
Definition: Combinations.cxx:12
TrigCompositeUtils::getFilter
std::function< bool(const std::vector< LinkInfo< xAOD::IParticleContainer >> &)> getFilter(FilterType filter)
Get a lambda corresponding to the specified FilterType enum.
Definition: IPartCombItr.cxx:69
TrigCompositeUtils::Combinations::m_legMultiplicities
std::vector< std::size_t > m_legMultiplicities
Definition: Combinations.h:51
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
TrigCompositeUtils::Combinations::begin
IPartCombItr begin() const
Definition: Combinations.cxx:77