Utility to modify the number of slices.
More...
#include <ModifySlices.h>
|
static int | peak (int oldPeak, int oldSlices, int newSlices) |
| Return new triggered slice offset. More...
|
|
static void | data (const std::vector< int > &oldVec, std::vector< int > &newVec, int newSlices) |
| Return modified data vector<int> More...
|
|
static void | data (const std::vector< unsigned int > &oldVec, std::vector< unsigned int > &newVec, int newSlices) |
| Return modified data vector<unsigned int> More...
|
|
Utility to modify the number of slices.
- Author
- Peter Faulkner
Definition at line 17 of file ModifySlices.h.
◆ ModifySlices()
LVL1BS::ModifySlices::ModifySlices |
( |
| ) |
|
◆ ~ModifySlices()
LVL1BS::ModifySlices::~ModifySlices |
( |
| ) |
|
◆ data() [1/2]
void LVL1BS::ModifySlices::data |
( |
const std::vector< int > & |
oldVec, |
|
|
std::vector< int > & |
newVec, |
|
|
int |
newSlices |
|
) |
| |
|
static |
Return modified data vector<int>
Definition at line 20 of file ModifySlices.cxx.
23 const int oldSlices = oldVec.size();
24 const int offset = (newSlices - oldSlices)/2;
25 newVec.resize(newSlices);
26 for (
int sl = 0; sl < newSlices; ++sl) {
27 const int oldSl = sl -
offset;
28 if (oldSl < 0) newVec[sl] = oldVec[0];
29 else if (oldSl >= oldSlices) newVec[sl] = oldVec[oldSlices - 1];
30 else newVec[sl] = oldVec[oldSl];
◆ data() [2/2]
void LVL1BS::ModifySlices::data |
( |
const std::vector< unsigned int > & |
oldVec, |
|
|
std::vector< unsigned int > & |
newVec, |
|
|
int |
newSlices |
|
) |
| |
|
static |
Return modified data vector<unsigned int>
Definition at line 36 of file ModifySlices.cxx.
40 const int oldSlices = oldVec.size();
41 const int offset = (newSlices - oldSlices)/2;
42 newVec.resize(newSlices);
43 for (
int sl = 0; sl < newSlices; ++sl) {
44 const int oldSl = sl -
offset;
45 if (oldSl < 0) newVec[sl] = oldVec[0];
46 else if (oldSl >= oldSlices) newVec[sl] = oldVec[oldSlices - 1];
47 else newVec[sl] = oldVec[oldSl];
◆ peak()
int LVL1BS::ModifySlices::peak |
( |
int |
oldPeak, |
|
|
int |
oldSlices, |
|
|
int |
newSlices |
|
) |
| |
|
static |
Return new triggered slice offset.
Definition at line 12 of file ModifySlices.cxx.
15 return oldPeak + (newSlices - oldSlices)/2;
The documentation for this class was generated from the following files: