ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArRawConditions
LArRawConditions
LArWave.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//Dear emacs, this is -*-c++-*-
6
17
18
#ifndef LARRAWCONDITIONS_LARWAVE_H
19
#define LARRAWCONDITIONS_LARWAVE_H
27
28
#include <vector>
29
#include <cstddef>
30
31
class
LArWave
{
32
33
public
:
34
36
37
LArWave
();
38
LArWave
(
const
unsigned
nSamples,
const
double
dt,
const
unsigned
flag=0);
39
LArWave
(
const
std::vector<double>& theVector,
const
double
dt,
const
unsigned
flag=0);
40
virtual
~LArWave
() =
default
;
41
43
45
46
47
const
std::vector<double>&
getWave
()
const
;
48
50
const
double
&
getDt
()
const
{
return
m_dt
; }
51
53
inline
const
double
&
getSample
(
const
unsigned
int
i)
const
{
return
m_amplitudes
[i];}
54
56
inline
const
double
&
operator[]
(
const
unsigned
int
i)
const
{
return
m_amplitudes
[i];}
57
59
double
getTime
(
const
unsigned
i)
const
;
60
62
inline
size_t
getSize
()
const
{
return
m_amplitudes
.size() ; }
63
65
unsigned
getIndex
(
double
aTime)
const
;
66
68
unsigned
getFlag
()
const
;
69
71
bool
isEmpty
()
const
;
73
74
76
77
78
inline
double
&
operator[]
(
const
unsigned
int
i) {
return
m_amplitudes
[i];}
79
81
void
setSize
(
const
unsigned
nSize);
82
84
void
setDt
(
const
double
dt);
85
87
void
setSample
(
const
unsigned
i,
const
double
aVal) {
m_amplitudes
[i] = aVal ; }
88
90
void
setFlag
(
const
unsigned
flag);
92
93
95
96
LArWave
operator+
(
const
LArWave
& bWave)
const
;
// point-to-point +
97
LArWave
operator-
(
const
LArWave
& bWave)
const
;
// point-to-point -
98
LArWave
operator*
(
const
LArWave
& bWave)
const
;
// point-to-point *
99
LArWave
operator/
(
const
LArWave
& bWave)
const
;
// point-to-point /
100
LArWave
operator%
(
const
LArWave
& bWave)
const
;
// convolution
101
LArWave
operator+
(
const
double
aBias)
const
;
// add a constant
102
LArWave
operator*
(
const
double
aScale)
const
;
// multiply by a constant
103
104
LArWave
&
operator+=
(
const
LArWave
& bWave);
105
LArWave
&
operator-=
(
const
LArWave
& bWave);
106
LArWave
&
operator*=
(
const
double
aScale);
108
109
protected
:
110
111
double
m_dt
;
112
std::vector<double>
m_amplitudes
;
113
unsigned
m_flag
;
114
115
// construct wave with m_dt from two waves and long as the shortest wave
116
LArWave
(
const
LArWave
& theWave1 ,
const
LArWave
& theWave2) ;
117
118
public
:
119
120
// definition of flags for different kinds of waveforms:
121
enum
{
122
meas
= 01 ,
// measured (cumulated from several triggers)
123
mwf
= 02 ,
// calibration master waveform
124
mwfN
= 03 ,
// as mwf, but normalized to have peak=1
125
dac0
= 04 ,
// dac0 wave
126
xtalkcorr
= 05 ,
// cross-talk corrected wave (Strips)
127
128
pred
= 10 ,
// predicted from observed calibration (generic)
129
predCali
= 11 ,
// as pred, parameters calibration only (a` la Milano)
130
predFitPhys
= 12 ,
// as pred, parameters from fit to observed phys (a` la Annecy)
131
predMeasPar
= 13 ,
// as pred, parameters from independent measurements
132
133
model
= 20 ,
// from some model (generic)
134
135
patch
= 30 ,
// patched from another channel
136
137
unknown
= 0
138
};
139
140
private
:
141
142
};
143
144
145
146
inline
147
LArWave::LArWave
() :
m_dt
(0),
m_flag
(0)
148
{}
149
150
151
inline
152
LArWave::LArWave
(
const
unsigned
nSamples,
const
double
dt,
const
unsigned
flag)
153
:
154
m_dt
(dt) ,
m_flag
(flag)
155
{
m_amplitudes
.resize(nSamples) ; }
156
157
158
inline
159
LArWave::LArWave
(
const
std::vector<double>& theVector,
const
double
dt,
const
unsigned
flag)
160
:
161
m_dt
(dt) ,
m_amplitudes
(theVector) ,
m_flag
(flag)
162
{}
163
164
165
inline
166
const
std::vector<double>&
167
LArWave::getWave
()
const
168
{
return
m_amplitudes
; }
169
170
inline
171
double
172
LArWave::getTime
(
const
unsigned
i)
const
173
{
return
i *
m_dt
; }
174
175
176
inline
177
unsigned
178
LArWave::getFlag
()
const
179
{
return
m_flag
; }
180
181
inline
182
bool
183
LArWave::isEmpty
()
const
184
{
return
(
m_amplitudes
.size() == 0); }
185
186
inline
187
void
188
LArWave::setSize
(
const
unsigned
nSize)
189
{
m_amplitudes
.resize(nSize,0) ; }
190
191
inline
192
void
193
LArWave::setDt
(
const
double
dt)
194
{
m_dt
= dt ; }
195
196
197
inline
198
void
199
LArWave::setFlag
(
const
unsigned
flag)
200
{
m_flag
= flag ; }
201
202
203
204
#endif
// LARRAWCONDITIONS_LARWAVE_H
205
operator*
ElementConstReference operator*() const
Return a reference to the referenced element.
LArWave
Definition
LArWave.h:31
LArWave::getTime
double getTime(const unsigned i) const
time
Definition
LArWave.h:172
LArWave::m_amplitudes
std::vector< double > m_amplitudes
Definition
LArWave.h:112
LArWave::setSample
void setSample(const unsigned i, const double aVal)
set the amplitude for time bin i
Definition
LArWave.h:87
LArWave::operator[]
const double & operator[](const unsigned int i) const
Amplitude per time bin.
Definition
LArWave.h:56
LArWave::operator+=
LArWave & operator+=(const LArWave &bWave)
Definition
LArWave.cxx:35
LArWave::getSize
size_t getSize() const
number of time samples
Definition
LArWave.h:62
LArWave::unknown
@ unknown
Definition
LArWave.h:137
LArWave::predCali
@ predCali
Definition
LArWave.h:129
LArWave::model
@ model
Definition
LArWave.h:133
LArWave::pred
@ pred
Definition
LArWave.h:128
LArWave::mwf
@ mwf
Definition
LArWave.h:123
LArWave::mwfN
@ mwfN
Definition
LArWave.h:124
LArWave::patch
@ patch
Definition
LArWave.h:135
LArWave::meas
@ meas
Definition
LArWave.h:122
LArWave::dac0
@ dac0
Definition
LArWave.h:125
LArWave::xtalkcorr
@ xtalkcorr
Definition
LArWave.h:126
LArWave::predMeasPar
@ predMeasPar
Definition
LArWave.h:131
LArWave::predFitPhys
@ predFitPhys
Definition
LArWave.h:130
LArWave::operator%
LArWave operator%(const LArWave &bWave) const
Definition
LArWave.cxx:91
LArWave::operator/
LArWave operator/(const LArWave &bWave) const
Definition
LArWave.cxx:80
LArWave::operator*=
LArWave & operator*=(const double aScale)
Definition
LArWave.cxx:137
LArWave::operator-=
LArWave & operator-=(const LArWave &bWave)
Definition
LArWave.cxx:58
LArWave::LArWave
LArWave()
Definition
LArWave.h:147
LArWave::isEmpty
bool isEmpty() const
is LArWave uninitialized?
Definition
LArWave.h:183
LArWave::operator-
LArWave operator-(const LArWave &bWave) const
Definition
LArWave.cxx:46
LArWave::getSample
const double & getSample(const unsigned int i) const
Amplitude per time bin.
Definition
LArWave.h:53
LArWave::operator[]
double & operator[](const unsigned int i)
Amplitude per time bin - NOT const.
Definition
LArWave.h:78
LArWave::setDt
void setDt(const double dt)
set the delta time
Definition
LArWave.h:193
LArWave::setSize
void setSize(const unsigned nSize)
resize the number of time bin samples
Definition
LArWave.h:188
LArWave::~LArWave
virtual ~LArWave()=default
LArWave::m_flag
unsigned m_flag
Definition
LArWave.h:113
LArWave::getWave
const std::vector< double > & getWave() const
Wave parameters.
Definition
LArWave.h:167
LArWave::getIndex
unsigned getIndex(double aTime) const
index for a time value
Definition
LArWave.cxx:146
LArWave::operator+
LArWave operator+(const LArWave &bWave) const
Definition
LArWave.cxx:24
LArWave::getDt
const double & getDt() const
delta time
Definition
LArWave.h:50
LArWave::getFlag
unsigned getFlag() const
flag: ...
Definition
LArWave.h:178
LArWave::setFlag
void setFlag(const unsigned flag)
set flag
Definition
LArWave.h:199
LArWave::m_dt
double m_dt
Definition
LArWave.h:111
Generated on
for ATLAS Offline Software by
1.17.0