ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
src
LAr2DWaveBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
// $Id$
12
13
#include "
LArRawConditions/LAr2DWaveBase.h
"
14
#include "
LArRawConditions/LArCompactSubset.h
"
15
#include <cassert>
16
17
25
LAr2DWaveBase::LAr2DWaveBase
(
float
timeOffset
,
26
float
timeBinWidth
,
27
const
std::vector<std::vector<float> >& wave0,
28
const
std::vector<std::vector<float> >& wave1)
29
:
m_timeOffset
(
timeOffset
),
30
m_timeBinWidth
(
timeBinWidth
)
31
{
32
m_waves
[0] = wave0;
33
m_waves
[1] = wave1;
34
}
35
36
50
LAr2DWaveBase::LAr2DWaveBase
(
float
timeOffset
,
51
float
timeBinWidth
,
52
unsigned
int
nPhases,
53
unsigned
int
nSamples,
54
const
std::vector<float>& wave0,
55
const
std::vector<float>& wave1,
56
unsigned
int
index
)
57
:
m_timeOffset
(
timeOffset
),
58
m_timeBinWidth
(
timeBinWidth
)
59
{
60
assert (
index
+ nPhases*nSamples <= wave0.size());
61
assert (
index
+ nPhases*nSamples <= wave1.size());
62
63
m_waves
[0].resize (nPhases);
64
m_waves
[1].resize (nPhases);
65
66
for
(
unsigned
int
i = 0; i < nPhases; i++) {
67
m_waves
[0][i].assign (wave0.begin() +
index
,
68
wave0.begin() +
index
+ nSamples);
69
m_waves
[1][i].assign (wave1.begin() +
index
,
70
wave1.begin() +
index
+ nSamples);
71
index
+= nSamples;
72
}
73
}
74
75
80
LAr2DWaveBase::LAr2DWaveBase
(
const
LArCompactSubsetConstChannelProxy
& other)
81
{
82
if
(!other.isValid()) {
83
// Invalid source --- do the same as the default ctor.
84
m_timeOffset
= 0;
85
m_timeBinWidth
= 25./24.;
86
}
87
else
{
88
m_timeOffset
= other.timeOffset();
89
m_timeBinWidth
= other.timeBinWidth();
90
size_t
chanSize = other.getSize();
91
for
(
unsigned
int
which = 0; which <
nWaves
; ++which) {
92
m_waves
[which].resize (chanSize);
93
for
(
unsigned
int
i = 0; i < chanSize; i++) {
94
LArVectorProxy
wave
= other.getData (which, i);
95
m_waves
[which][i].assign (
wave
.begin(),
wave
.end());
96
}
97
}
98
}
99
}
100
101
109
void
LAr2DWaveBase::setFrom
(
LAr2DWaveBase
& other)
110
{
111
m_timeOffset
= other.m_timeOffset;
112
m_timeBinWidth
= other.m_timeBinWidth;
113
for
(
unsigned
int
which = 0; which <
nWaves
; ++which)
114
m_waves
[which].
swap
(other.m_waves[which]);
115
}
116
117
swap
void swap(DataVector< T > &a, DataVector< T > &b)
See DataVector<T, BASE>::swap().
LAr2DWaveBase.h
Per-channel class holding wave information in time bins.
LArCompactSubset.h
A more compact way of storing shape/ofc data.
LAr2DWaveBase::nWaves
static const unsigned int nWaves
The number of different types of waves we store.
Definition
LAr2DWaveBase.h:52
LAr2DWaveBase::timeBinWidth
float timeBinWidth() const
Return the time bin width for this channel.
LAr2DWaveBase::LAr2DWaveBase
LAr2DWaveBase()
Default constructor.
LAr2DWaveBase::m_timeOffset
float m_timeOffset
The time offset for this channel.
Definition
LAr2DWaveBase.h:147
LAr2DWaveBase::setFrom
void setFrom(LAr2DWaveBase &other)
Assign from another wave object.
Definition
LAr2DWaveBase.cxx:109
LAr2DWaveBase::m_waves
std::vector< std::vector< float > > m_waves[nWaves]
The wave data.
Definition
LAr2DWaveBase.h:153
LAr2DWaveBase::wave
LArVectorProxy wave(unsigned int which, size_t tbin) const
Return wave data.
LAr2DWaveBase::timeOffset
float timeOffset() const
Return the time offset for this channel.
LAr2DWaveBase::m_timeBinWidth
float m_timeBinWidth
The time bin width for this channel.
Definition
LAr2DWaveBase.h:150
LArCompactSubsetConstChannelProxy
Definition
LArCompactSubset.h:100
LArVectorProxy
Proxy for accessing a range of float values like a vector.
Definition
LArVectorProxy.h:38
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0