PMT combinatorics for optical module.
More...
#include <JCalibrateK40.hh>
|
static int | getSign (const int first, const int second) |
| Sign of pair of indices.
|
|
static int | getSign (const pair_type &pair) |
| Sign of pair of indices.
|
|
PMT combinatorics for optical module.
Definition at line 102 of file JCalibrateK40.hh.
◆ JCombinatorics_t() [1/2]
JCALIBRATE::JCombinatorics_t::JCombinatorics_t |
( |
| ) |
|
|
inline |
◆ JCombinatorics_t() [2/2]
JCALIBRATE::JCombinatorics_t::JCombinatorics_t |
( |
const JModule & | module | ) |
|
|
inline |
Constructor.
- Parameters
-
Definition at line 117 of file JCalibrateK40.hh.
118 {
120
121 this->
sort(JPairwiseComparator(module));
122 }
◆ getCombinatorics()
const JCombinatorics & JTOOLS::JCombinatorics::getCombinatorics |
( |
| ) |
const |
|
inlineinherited |
Get combinatorics.
- Returns
- combinatorics
Definition at line 89 of file JCombinatorics.hh.
90 {
91 return *this;
92 }
◆ configure()
void JTOOLS::JCombinatorics::configure |
( |
const int | numberOfIndices | ) |
|
|
inlineinherited |
Configure.
- Parameters
-
numberOfIndices | number of indices |
Definition at line 100 of file JCombinatorics.hh.
101 {
103
104 zbuf2D.resize(numberOfIndices);
105
106 for (int i = 0; i != numberOfIndices; ++i) {
107 zbuf2D[i].resize(numberOfIndices);
108 }
109
110 for (int i = 0; i != numberOfIndices; ++i) {
111
113
114 for (
int j = i; ++
j != numberOfIndices; ) {
115
118
120 }
121 }
122 }
JCombinatorics::pair_type pair_type
◆ getNumberOfIndices()
size_t JTOOLS::JCombinatorics::getNumberOfIndices |
( |
| ) |
const |
|
inlineinherited |
◆ getNumberOfPairs()
size_t JTOOLS::JCombinatorics::getNumberOfPairs |
( |
| ) |
const |
|
inlineinherited |
◆ getIndex() [1/2]
int JTOOLS::JCombinatorics::getIndex |
( |
const int | first, |
|
|
const int | second ) const |
|
inlineinherited |
Get index of pair of indices.
- Parameters
-
first | first address |
second | second address |
- Returns
- index (-1 if first and second address are equal)
Definition at line 154 of file JCombinatorics.hh.
155 {
156 return zbuf2D[first][second];
157 }
◆ getIndex() [2/2]
int JTOOLS::JCombinatorics::getIndex |
( |
const pair_type & | pair | ) |
const |
|
inlineinherited |
Get index of pair.
- Parameters
-
- Returns
- index (-1 if first and second address are equal)
Definition at line 166 of file JCombinatorics.hh.
167 {
168 return getIndex(pair.first, pair.second);
169 }
◆ getPair()
const pair_type & JTOOLS::JCombinatorics::getPair |
( |
const int | index | ) |
const |
|
inlineinherited |
Get pair of indices for given index.
- Parameters
-
- Returns
- pair of indices
Definition at line 178 of file JCombinatorics.hh.
◆ sort()
template<class JComparator_t >
void JTOOLS::JCombinatorics::sort |
( |
JComparator_t | comparator | ) |
|
|
inlineinherited |
Sort address pairs.
- Parameters
-
comparator | comparator for pairs |
Definition at line 190 of file JCombinatorics.hh.
191 {
192 std::stable_sort(
zbuf1D.begin(),
zbuf1D.end(), comparator);
193
194 for (
int i = 0; i != (int)
zbuf1D.size(); ++i) {
195
197
198 zbuf2D[pair.first][pair.second] = i;
199 zbuf2D[pair.second][pair.first] = i;
200 }
201
202 for (
int i = 0; i != (int)
zbuf2D.size(); ++i) {
204 }
205 }
◆ getSign() [1/2]
static int JTOOLS::JCombinatorics::getSign |
( |
const int | first, |
|
|
const int | second ) |
|
inlinestaticinherited |
Sign of pair of indices.
- Parameters
-
first | first address |
second | second address |
- Returns
- +1 if second >= first; else -1
Definition at line 215 of file JCombinatorics.hh.
216 {
217 return (second >= first ? +1 : -1);
218 }
◆ getSign() [2/2]
static int JTOOLS::JCombinatorics::getSign |
( |
const pair_type & | pair | ) |
|
|
inlinestaticinherited |
Sign of pair of indices.
- Parameters
-
- Returns
- +1 if second >= first; else -1
Definition at line 227 of file JCombinatorics.hh.
228 {
229 return getSign(pair.first, pair.second);
230 }
◆ zbuf1D
◆ zbuf2D
The documentation for this struct was generated from the following file: