ATLAS Offline Software
MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6 // 27.10.2007, AUTHOR: OLIVER KORTNER
7 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8 
9 #ifndef MuonCalib_CombinationH
10 #define MuonCalib_CombinationH
11 
12 //:::::::::::::::::::::::
13 //:: CLASS Combination ::
14 //:::::::::::::::::::::::
15 
23 
24 //::::::::::::::::::
25 //:: HEADER FILES ::
26 //::::::::::::::::::
27 
28 // STL //
29 #include <vector>
30 
31 namespace MuonCalib {
32 
33 class Combination {
34 
35 public:
36 // Constructors //
37  Combination(void);
39 
40  Combination(const unsigned int & n, const unsigned int & k);
44 
45 // Methods //
46 // get-methods //
47  unsigned int numberOfElements(void) const;
49  unsigned int whichClass(void) const;
51  unsigned int numberOfCombinations(void) const;
53  void currentCombination(std::vector<unsigned int> & index_array) const;
56  void nextCombination(std::vector<unsigned int> & index_array);
59 
60 // set-methods //
61  void reset(void);
63  void setNewParameters(const unsigned int & nb_elements,
64  const unsigned int & wh_class);
68 
69 private:
70  unsigned int m_n = 0U; // the n of Comb(n, k)
71  unsigned int m_k = 0U; // the k of Comb(n, k)
72  std::vector<unsigned int> m_index; // vector containing the indices of
73  // the current combination
74  std::vector<unsigned int> m_flag; // vector of flags
75 
76  void init(const unsigned int & n, const unsigned int & k);
77  // initialization method;
78  // n: number of elements;
79  // k: Class of the combination
80 
81 };
82 
83 }
84 
85 
86 #endif
MuonCalib::Combination::whichClass
unsigned int whichClass(void) const
get the class of which the combination is
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:91
MuonCalib::Combination::numberOfCombinations
unsigned int numberOfCombinations(void) const
get the number of combinations
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:103
MuonCalib::Combination
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h:33
MuonCalib::Combination::Combination
Combination(void)
Default construcor. A combination of 1 out of 1 is created.
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:20
MuonCalib::Combination::currentCombination
void currentCombination(std::vector< unsigned int > &index_array) const
get the current combination; the result is stored in the vector index_array
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:125
MuonCalib::Combination::m_k
unsigned int m_k
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h:71
beamspotman.n
n
Definition: beamspotman.py:731
MuonCalib::Combination::setNewParameters
void setNewParameters(const unsigned int &nb_elements, const unsigned int &wh_class)
set the number of elements = nb_elements; set the class of which the combination is = wh_class
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:230
MuonCalib
CscCalcPed - algorithm that finds the Cathode Strip Chamber pedestals from an RDO.
Definition: CscCalcPed.cxx:22
MuonCalib::Combination::reset
void reset(void)
go back to the first combination
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:213
MuonCalib::Combination::m_index
std::vector< unsigned int > m_index
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h:72
MuonCalib::Combination::m_flag
std::vector< unsigned int > m_flag
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h:74
MuonCalib::Combination::nextCombination
void nextCombination(std::vector< unsigned int > &index_array)
get the next combination; the results is stored in the array index_array
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:145
MuonCalib::Combination::init
void init(const unsigned int &n, const unsigned int &k)
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:44
fitman.k
k
Definition: fitman.py:528
MuonCalib::Combination::numberOfElements
unsigned int numberOfElements(void) const
get the number of elements
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/src/Combination.cxx:79
MuonCalib::Combination::m_n
unsigned int m_n
Definition: MuonSpectrometer/MuonCalib/MuonCalibUtils/MuonCalibMath/MuonCalibMath/Combination.h:70