ATLAS Offline Software
Loading...
Searching...
No Matches
LArWave Class Reference

#include <LArWave.h>

Inheritance diagram for LArWave:
Collaboration diagram for LArWave:

Public Member Functions

structors
 LArWave ()
 LArWave (const unsigned nSamples, const double dt, const unsigned flag=0)
 LArWave (const std::vector< double > &theVector, const double dt, const unsigned flag=0)
virtual ~LArWave ()=default
accumulation accessors
const std::vector< double > & getWave () const
 Wave parameters.
const double & getDt () const
 delta time
const double & getSample (const unsigned int i) const
 Amplitude per time bin.
const double & operator[] (const unsigned int i) const
 Amplitude per time bin.
double getTime (const unsigned i) const
 time
size_t getSize () const
 number of time samples
unsigned getIndex (double aTime) const
 index for a time value
unsigned getFlag () const
 flag: ...
bool isEmpty () const
 is LArWave uninitialized?
accumulation setters
double & operator[] (const unsigned int i)
 Amplitude per time bin - NOT const.
void setSize (const unsigned nSize)
 resize the number of time bin samples
void setDt (const double dt)
 set the delta time
void setSample (const unsigned i, const double aVal)
 set the amplitude for time bin i
void setFlag (const unsigned flag)
 set flag

accumulation alegebra operations

enum  {
  meas = 01 , mwf = 02 , mwfN = 03 , dac0 = 04 ,
  xtalkcorr = 05 , pred = 10 , predCali = 11 , predFitPhys = 12 ,
  predMeasPar = 13 , model = 20 , patch = 30 , unknown = 0
}
double m_dt
std::vector< double > m_amplitudes
unsigned m_flag
LArWave operator+ (const LArWave &bWave) const
LArWave operator- (const LArWave &bWave) const
LArWave operator* (const LArWave &bWave) const
LArWave operator/ (const LArWave &bWave) const
LArWave operator% (const LArWave &bWave) const
LArWave operator+ (const double aBias) const
LArWave operator* (const double aScale) const
LArWaveoperator+= (const LArWave &bWave)
LArWaveoperator-= (const LArWave &bWave)
LArWaveoperator*= (const double aScale)
 LArWave (const LArWave &theWave1, const LArWave &theWave2)

Detailed Description

Definition at line 31 of file LArWave.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
meas 
mwf 
mwfN 
dac0 
xtalkcorr 
pred 
predCali 
predFitPhys 
predMeasPar 
model 
patch 
unknown 

Definition at line 121 of file LArWave.h.

121 {
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 };
@ unknown
Definition LArWave.h:137
@ predCali
Definition LArWave.h:129
@ model
Definition LArWave.h:133
@ patch
Definition LArWave.h:135
@ xtalkcorr
Definition LArWave.h:126
@ predMeasPar
Definition LArWave.h:131
@ predFitPhys
Definition LArWave.h:130

Constructor & Destructor Documentation

◆ LArWave() [1/4]

LArWave::LArWave ( )
inline

Definition at line 147 of file LArWave.h.

147 : m_dt(0), m_flag(0)
148{}
unsigned m_flag
Definition LArWave.h:113
double m_dt
Definition LArWave.h:111

◆ LArWave() [2/4]

LArWave::LArWave ( const unsigned nSamples,
const double dt,
const unsigned flag = 0 )
inline

Definition at line 152 of file LArWave.h.

153 :
154 m_dt(dt) , m_flag(flag)
155{ m_amplitudes.resize(nSamples) ; }
std::vector< double > m_amplitudes
Definition LArWave.h:112

◆ LArWave() [3/4]

LArWave::LArWave ( const std::vector< double > & theVector,
const double dt,
const unsigned flag = 0 )
inline

Definition at line 159 of file LArWave.h.

160 :
161 m_dt(dt) , m_amplitudes(theVector) , m_flag(flag)
162{}

◆ ~LArWave()

virtual LArWave::~LArWave ( )
virtualdefault

◆ LArWave() [4/4]

LArWave::LArWave ( const LArWave & theWave1,
const LArWave & theWave2 )
protected

Definition at line 9 of file LArWave.cxx.

10 : m_flag(0)
11{
12 if ( theWave1.m_dt == theWave2.m_dt ) {
13 m_dt = theWave1.m_dt ;
14 m_amplitudes.resize( std::min( theWave1.getSize(),
15 theWave2.getSize() )) ;
16 } else {
17 m_amplitudes.resize(0);
18 m_dt = 0. ;
19 }
20}
size_t getSize() const
number of time samples
Definition LArWave.h:62

Member Function Documentation

◆ getDt()

const double & LArWave::getDt ( ) const
inline

delta time

Definition at line 50 of file LArWave.h.

50{ return m_dt; }

◆ getFlag()

unsigned LArWave::getFlag ( ) const
inline

flag: ...

Definition at line 178 of file LArWave.h.

179{ return m_flag ; }

◆ getIndex()

unsigned LArWave::getIndex ( double aTime) const

index for a time value

Definition at line 146 of file LArWave.cxx.

147{ return (aTime>=0 && m_dt>0) ? (unsigned)(aTime/m_dt) : getSize()+1 ; }

◆ getSample()

const double & LArWave::getSample ( const unsigned int i) const
inline

Amplitude per time bin.

Definition at line 53 of file LArWave.h.

53{return m_amplitudes[i];}

◆ getSize()

size_t LArWave::getSize ( ) const
inline

number of time samples

Definition at line 62 of file LArWave.h.

62{ return m_amplitudes.size() ; }

◆ getTime()

double LArWave::getTime ( const unsigned i) const
inline

time

Definition at line 172 of file LArWave.h.

173{ return i * m_dt ; }

◆ getWave()

const std::vector< double > & LArWave::getWave ( ) const
inline

Wave parameters.

Definition at line 167 of file LArWave.h.

168{ return m_amplitudes ; }

◆ isEmpty()

bool LArWave::isEmpty ( ) const
inline

is LArWave uninitialized?

Definition at line 183 of file LArWave.h.

184{ return (m_amplitudes.size() == 0); }

◆ operator%()

LArWave LArWave::operator% ( const LArWave & bWave) const

Definition at line 91 of file LArWave.cxx.

92{
93 //W.L., 2-Sept-09: Speed-up:
94 //This method is called several million times
95 //aggressive optimization pays off.
96
97 const double* amplPtrA=&(this->m_amplitudes.front());
98 const double* amplPtrB=&(bWave.m_amplitudes.front());
99
100 LArWave result(*this,bWave) ;
101 const size_t s=result.getSize();
102 for (size_t i=0 ; i<s ; ++i ) {
103 //double& resSample=result.m_amplitudes[i];
104 double sum2 = 0.5 * ( (*this).m_amplitudes[0] * bWave.m_amplitudes[i] +
105 (*this).m_amplitudes[i] * bWave.m_amplitudes[0] ) ;
106 for (size_t k=1 ; k<i ; ++k ) {
107 sum2 += amplPtrA[k] * amplPtrB[i-k] ;
108 }
109 result.m_amplitudes[i] = sum2*result.m_dt ;
110 }
111 return result ;
112}
LArWave()
Definition LArWave.h:147

◆ operator*() [1/2]

LArWave LArWave::operator* ( const double aScale) const

Definition at line 126 of file LArWave.cxx.

126 {
127 LArWave result(*this) ;
128 std::vector<double>::iterator it=result.m_amplitudes.begin();
129 std::vector<double>::iterator it_e=result.m_amplitudes.end();
130 for (;it!=it_e;++it) {
131 (*it)*=aScale;
132 }
133 return result ;
134}

◆ operator*() [2/2]

LArWave LArWave::operator* ( const LArWave & bWave) const

Definition at line 69 of file LArWave.cxx.

70{
71 LArWave result(*this,bWave) ;
72 const size_t s=result.getSize();
73 for ( size_t i=0 ; i<s ; ++i ) {
74 result.m_amplitudes[i] =
75 (*this).m_amplitudes[i] * bWave.m_amplitudes[i] ;
76 }
77 return result ;
78}

◆ operator*=()

LArWave & LArWave::operator*= ( const double aScale)

Definition at line 137 of file LArWave.cxx.

137 {
138 for (double& a : m_amplitudes) {
139 a*=aScale;
140 }
141 return *this ;
142}
static Double_t a

◆ operator+() [1/2]

LArWave LArWave::operator+ ( const double aBias) const

Definition at line 115 of file LArWave.cxx.

115 {
116 LArWave result(*this) ;
117 std::vector<double>::iterator it=result.m_amplitudes.begin();
118 std::vector<double>::iterator it_e=result.m_amplitudes.end();
119 for (;it!=it_e;++it) {
120 (*it)+=aBias;
121 }
122 return result ;
123}

◆ operator+() [2/2]

LArWave LArWave::operator+ ( const LArWave & bWave) const

Definition at line 24 of file LArWave.cxx.

25{
26 LArWave result(*this,bWave) ;
27 const size_t s=result.getSize();
28 for ( size_t i=0 ; i<s ; ++i ) {
29 result.m_amplitudes[i] =
30 (*this).m_amplitudes[i] + bWave.m_amplitudes[i] ;
31 }
32 return result ;
33}

◆ operator+=()

LArWave & LArWave::operator+= ( const LArWave & bWave)

Definition at line 35 of file LArWave.cxx.

36{
37 const size_t s=std::min(m_amplitudes.size(), bWave.getSize());
38 for ( size_t i=0 ; i<s ; ++i ) {
39 m_amplitudes[i] += bWave.m_amplitudes[i] ;
40 }
41 return *this;
42}

◆ operator-()

LArWave LArWave::operator- ( const LArWave & bWave) const

Definition at line 46 of file LArWave.cxx.

47{
48 LArWave result(*this,bWave) ;
49 const size_t s=result.getSize();
50 for ( size_t i=0 ; i<s ; ++i ) {
51 result.m_amplitudes[i] =
52 (*this).m_amplitudes[i] - bWave.m_amplitudes[i] ;
53 }
54 return result ;
55}

◆ operator-=()

LArWave & LArWave::operator-= ( const LArWave & bWave)

Definition at line 58 of file LArWave.cxx.

59{
60 const size_t s=std::min(m_amplitudes.size(), bWave.getSize());
61 for ( size_t i=0 ; i<s ; ++i ) {
62 m_amplitudes[i] -= bWave.m_amplitudes[i] ;
63 }
64 return *this;
65}

◆ operator/()

LArWave LArWave::operator/ ( const LArWave & bWave) const

Definition at line 80 of file LArWave.cxx.

81{
82 LArWave result(*this,bWave) ;
83 const size_t s=result.getSize();
84 for ( size_t i=0 ; i<s ; ++i ) {
85 result.m_amplitudes[i] =
86 (*this).m_amplitudes[i] / bWave.m_amplitudes[i] ;
87 }
88 return result ;
89}

◆ operator[]() [1/2]

double & LArWave::operator[] ( const unsigned int i)
inline

Amplitude per time bin - NOT const.

Definition at line 78 of file LArWave.h.

78{return m_amplitudes[i];}

◆ operator[]() [2/2]

const double & LArWave::operator[] ( const unsigned int i) const
inline

Amplitude per time bin.

Definition at line 56 of file LArWave.h.

56{return m_amplitudes[i];}

◆ setDt()

void LArWave::setDt ( const double dt)
inline

set the delta time

Definition at line 193 of file LArWave.h.

◆ setFlag()

void LArWave::setFlag ( const unsigned flag)
inline

set flag

Definition at line 199 of file LArWave.h.

200{ m_flag = flag ; }
bool flag
Definition master.py:29

◆ setSample()

void LArWave::setSample ( const unsigned i,
const double aVal )
inline

set the amplitude for time bin i

Definition at line 87 of file LArWave.h.

87{ m_amplitudes[i] = aVal ; }

◆ setSize()

void LArWave::setSize ( const unsigned nSize)
inline

resize the number of time bin samples

Definition at line 188 of file LArWave.h.

189{ m_amplitudes.resize(nSize,0) ; }

Member Data Documentation

◆ m_amplitudes

std::vector<double> LArWave::m_amplitudes
protected

Definition at line 112 of file LArWave.h.

◆ m_dt

double LArWave::m_dt
protected

Definition at line 111 of file LArWave.h.

◆ m_flag

unsigned LArWave::m_flag
protected

Definition at line 113 of file LArWave.h.


The documentation for this class was generated from the following files: