This acts like a vector of FEB ID / channel vector pairs.
More...
#include <LArCompactSubset.h>
|
| typedef unsigned int | FebId |
| | Type for FEB IDs. Would be better to get this from somewhere common...
|
|
| static const unsigned int | nWaves = 2 |
| | Number of wave types we store.
|
|
| unsigned int | m_chanSize |
| | Number of time bins per channels. 0 before any waves have been added.
|
| unsigned int | m_nSamples |
| | Number of samples per wave. 0 before any waves have been added.
|
| float | m_timeOffset |
| | Time parameters.
|
| float | m_timeBinWidth |
| std::vector< FebId > | m_febids |
| | Vector of stored FebIds.
|
| std::vector< unsigned int > | m_indices |
| | Map from FEB indices to channel indices.
|
| std::vector< int > | m_slots |
| | Map from channel indices to wave slots.
|
| std::vector< float > | m_data |
| | The wave data.
|
This acts like a vector of FEB ID / channel vector pairs.
This is also the class which contains all the data.
Definition at line 529 of file LArCompactSubset.h.
◆ FebId
◆ LArCompactSubsetVector()
| LArCompactSubsetVector::LArCompactSubsetVector |
( |
size_t | nfeb = 0 | ) |
|
Constructor.
- Parameters
-
| nfeb | Initial number of FEBs to allocate. |
Definition at line 47 of file LArCompactSubset.cxx.
54{
55}
float m_timeOffset
Time parameters.
unsigned int m_chanSize
Number of time bins per channels. 0 before any waves have been added.
std::vector< FebId > m_febids
Vector of stored FebIds.
std::vector< unsigned int > m_indices
Map from FEB indices to channel indices.
unsigned int m_nSamples
Number of samples per wave. 0 before any waves have been added.
◆ begin() [1/2]
| iterator LArCompactSubsetVector::begin |
( |
| ) |
|
◆ begin() [2/2]
◆ chanIndex()
| unsigned int LArCompactSubsetVector::chanIndex |
( |
unsigned int | febIndex | ) |
const |
Return the index of the first channel for a FEB index.
- Parameters
-
| febIndex | The index of the FEB to query. |
If febIndex is the number of FEBs, then this returns the total number of channels.
◆ copySubset()
template<class T, class OTHERIT, class COPIER>
| void LArCompactSubsetVector::copySubset |
( |
OTHERIT | otherBeg, |
|
|
OTHERIT | otherEnd, |
|
|
LArCompactSubsetVector & | to, |
|
|
COPIER | copier ) |
|
static |
Helper used by LArConditionsSubset::assign.
- Parameters
-
| otherBeg | Start of the range to copy. |
| otherEnd | End of the range to copy. |
| to | The subset to which to copy. |
| copier | Helper to copy a single payload object. |
◆ end() [1/2]
| iterator LArCompactSubsetVector::end |
( |
| ) |
|
◆ end() [2/2]
◆ febIdRef() [1/2]
| FebId & LArCompactSubsetVector::febIdRef |
( |
size_t | febIndex | ) |
|
Return a reference to a FEB ID variable.
- Parameters
-
| febIndex | Index of the desired FEB ID. |
◆ febIdRef() [2/2]
| const FebId & LArCompactSubsetVector::febIdRef |
( |
size_t | febIndex | ) |
const |
Return a reference to a FEB ID variable.
- Parameters
-
| febIndex | Index of the desired FEB ID. |
◆ febSize()
| size_t LArCompactSubsetVector::febSize |
( |
unsigned int | febIndex | ) |
const |
Return the number of channels for a given FEB index.
- Parameters
-
| febIndex | The index of the FEB to query. |
◆ getChanSize()
| size_t LArCompactSubsetVector::getChanSize |
( |
| ) |
const |
Return the number of time bins used in this subset.
◆ getData()
| LArVectorProxy LArCompactSubsetVector::getData |
( |
unsigned int | which, |
|
|
unsigned int | chan, |
|
|
size_t | tbin ) const |
Retrieve wave data.
- Parameters
-
| which | The wave type to retrieve. |
| chan | The index of the channel to retrieve. |
| tbin | The time bin index to retrieve. |
Definition at line 122 of file LArCompactSubset.cxx.
125{
128 const float*
beg =
nullptr;
129 const float*
end =
nullptr;
130 if (slot >= 0) {
132 const float* chanstart = &
m_data[slot *
nWaves * nsamp];
135 }
136 return LArVectorProxy (beg,
end);
137}
std::vector< int > m_slots
Map from channel indices to wave slots.
std::vector< float > m_data
The wave data.
iterator end()
End iterator.
static const unsigned int nWaves
Number of wave types we store.
◆ getSize()
| size_t LArCompactSubsetVector::getSize |
( |
unsigned int | chan | ) |
const |
Return the number of time bins for channel index CHAN.
- Parameters
-
| chan | The channel index to query. |
This is either the same as getChanSize(), or 0 if this channel is empty.
◆ operator[]() [1/2]
Vector indexing.
- Parameters
-
◆ operator[]() [2/2]
Vector indexing.
- Parameters
-
◆ resize()
| void LArCompactSubsetVector::resize |
( |
size_t | sz | ) |
|
Change the size of the vector.
- Parameters
-
Restriction: The size can only be increased.
Definition at line 64 of file LArCompactSubset.cxx.
65{
69
71 for (
size_t j = oldsz+1; j <
sz+1; j++)
73 }
74 else {
75 abort();
76
77 }
78}
◆ resizeChanVec()
| void LArCompactSubsetVector::resizeChanVec |
( |
size_t | febIndex, |
|
|
size_t | sz ) |
Resize one channel vector.
- Parameters
-
| febIndex | The index of the vector to resize. |
| sz | The new size of the vector. |
Restriction: Only the last index may be resized.
Definition at line 102 of file LArCompactSubset.cxx.
103{
106 if (
sz == cursz)
return;
108 for (
size_t j = febIndex+1; j <
m_indices.size(); j++)
111}
◆ setData()
| void LArCompactSubsetVector::setData |
( |
unsigned int | which, |
|
|
unsigned int | chan, |
|
|
size_t | tbin, |
|
|
size_t | chanSize, |
|
|
const LArVectorProxy & | from ) |
Set wave data for a channel.
- Parameters
-
| which | Wave type to set. |
| chan | Channel index to set. |
| tbin | Time bin index to set. |
| chanSize | Number of time bins for this channel. |
| from | Wave data. |
We currently assume that all non-empty channels within a subset have the same number of time bins and samples. We'll trip an assertion if that's not the case.
Definition at line 177 of file LArCompactSubset.cxx.
182{
184
187 {
191 }
192 else {
195 }
196
198 if (slot < 0) {
202 }
203
204 std::copy (from.begin(), from.end(),
206}
◆ setTimings()
| void LArCompactSubsetVector::setTimings |
( |
unsigned int | chan, |
|
|
float | timeOffset, |
|
|
float | timeBinWidth ) |
Set timing information for a channel.
- Parameters
-
| chan | Channel index to set. |
| timeOffset | Time offset to set. |
| timeBinWidth | Time bin width to set. |
We currently assume that all non-empty channels within a subset have the same values for these parameters. We'll trip an assertion if that's not the case.
Definition at line 150 of file LArCompactSubset.cxx.
153{
157 }
158 else {
161 }
162}
float timeBinWidth(unsigned int chan) const
Return the time bin width for channel index CHAN.
float timeOffset(unsigned int chan) const
Return the time offset for channel index CHAN.
◆ shrink_to_fit()
| void LArCompactSubsetVector::shrink_to_fit |
( |
| ) |
|
Release any allocated but unused storage.
Called by the P->T converter after conversion is complete.
Definition at line 85 of file LArCompactSubset.cxx.
86{
87 std::vector<float> tmp_data (
m_data);
89
90 std::vector<int> tmp_slots (
m_slots);
92}
◆ size()
| size_t LArCompactSubsetVector::size |
( |
| ) |
const |
Return the size of this vector.
◆ timeBinWidth()
| float LArCompactSubsetVector::timeBinWidth |
( |
unsigned int | chan | ) |
const |
Return the time bin width for channel index CHAN.
- Parameters
-
| chan | The channel index to query. |
We currently assume that this is the same for all channels, so CHAN is ignored.
◆ timeOffset()
| float LArCompactSubsetVector::timeOffset |
( |
unsigned int | chan | ) |
const |
Return the time offset for channel index CHAN.
- Parameters
-
| chan | The channel index to query. |
We currently assume that this is the same for all channels, so CHAN is ignored.
◆ m_chanSize
| unsigned int LArCompactSubsetVector::m_chanSize |
|
private |
Number of time bins per channels. 0 before any waves have been added.
Definition at line 881 of file LArCompactSubset.h.
◆ m_data
| std::vector<float> LArCompactSubsetVector::m_data |
|
private |
◆ m_febids
| std::vector<FebId> LArCompactSubsetVector::m_febids |
|
private |
◆ m_indices
| std::vector<unsigned int> LArCompactSubsetVector::m_indices |
|
private |
◆ m_nSamples
| unsigned int LArCompactSubsetVector::m_nSamples |
|
private |
Number of samples per wave. 0 before any waves have been added.
Definition at line 884 of file LArCompactSubset.h.
◆ m_slots
| std::vector<int> LArCompactSubsetVector::m_slots |
|
private |
◆ m_timeBinWidth
| float LArCompactSubsetVector::m_timeBinWidth |
|
private |
◆ m_timeOffset
| float LArCompactSubsetVector::m_timeOffset |
|
private |
Time parameters.
We assume that these are the same for all non-empty channels within a subset.
Definition at line 888 of file LArCompactSubset.h.
◆ nWaves
| const unsigned int LArCompactSubsetVector::nWaves = 2 |
|
static |
The documentation for this class was generated from the following files: