ATLAS Offline Software
Loading...
Searching...
No Matches
LArWFParams.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7
8#ifndef LARWFPARAMS_H
9#define LARWFPARAMS_H
10
13
18
20{
21
22public:
23
26
28
29 LArWFParams(double tcal, double fstep, double tdrift, double omega0,
30 double taur, double tshaper, double ampli, double tdiff);
31 LArWFParams(unsigned flag,
32 double tcal, double fstep, double tdrift, double omega0,
33 double taur, double tshaper, double ampli, double tdiff);
34
37
38 LArWFParams(double tcal, double fstep, double tdrift, double omega0, double taur,
39 double tshaper, double ampli);
40 LArWFParams(unsigned flag,
41 double tcal, double fstep, double tdrift, double omega0,
42 double taur, double tshaper, double ampli);
43
47
49 const LArCaliPulseParamsComplete& caliPar,
50 const LArDetCellParamsComplete& detPar,
53 // set methods
54
55 void setFlag(unsigned flag);
56
57 void setTcal(double tcal);
58 void setFstep(double fstep);
59 void setTdrift(double tdrift); // change of Tdrift value
60 void setOmega0(double omega0);
61 void setTaur(double taur);
62 void setTshaper(double tsh);
63 void setAmplitude(double ampli);
64 void setTdiff (double tdiff);
65
66 void setValid();
67 void setBad();
68
71
72 bool set(HWIdentifier chID, CaloGain::CaloGain gain,
73 const LArCaliPulseParamsComplete& caliPar);
74 bool set(HWIdentifier chID, CaloGain::CaloGain gain,
75 const LArDetCellParamsComplete& detPar);
76 bool set(HWIdentifier chID, CaloGain::CaloGain gain,
78 bool set(HWIdentifier chID, CaloGain::CaloGain gain,
80
81 // get methods
82
83 unsigned int getFlag() const;
84 double tcal() const; // exp time constant in calib pulse
85 double fstep() const; // asymptotic value of calib pulse (fraction of peak)
86 double tdrift() const; // drift time
87 double omega0() const; // resonance angular frequency ( = 1/sqrt(LC) )
88 double taur() const; // resonance damping factor ( = rC )
89 double tshaper() const; // shaper time constant
90 double amplitude() const; // usable for Mphys/Mcal
91 double tdiff() const; // time difference between phys and calib pulses
92 bool isValid() const;
93
94private:
95 //Parameters needed for Physics prediction:
96 unsigned int m_flag ; /* tell method used for parameters extraction */
97 double m_Tcal ;
98 double m_Fstep ;
99 double m_Tdrift ;
100 double m_Omega0 ;
101 double m_Taur ;
102 double m_Tshaper ;
103 double m_Amplitude ;
104 double m_Tdiff ;
106public:
107
108};
109
111// Inline definitions
113
114inline
116 :
117 m_flag(0),
118 m_Tcal(0),
119 m_Fstep(0),
120 m_Tdrift(0),
121 m_Omega0(0),
122 m_Taur(0),
123 m_Tshaper(0),
124 m_Amplitude(0),
125 m_Tdiff(0),
126 m_isValid(false) {}
127
128inline
129LArWFParams::LArWFParams(double tcal, double fstep, double tdrift, double omega0,
130 double taur, double tshaper, double ampli,
131 double tdiff)
132 :
133 m_flag(0),
134 m_Tcal(tcal),
135 m_Fstep(fstep),
138 m_Taur(taur),
140 m_Amplitude(ampli),
141 m_Tdiff(tdiff),
142 m_isValid(true) {}
143
144inline
146 double tcal, double fstep, double tdrift, double omega0,
147 double taur, double tshaper, double ampli,
148 double tdiff)
149 :
150 m_flag(flag),
151 m_Tcal(tcal),
152 m_Fstep(fstep),
155 m_Taur(taur),
157 m_Amplitude(ampli),
158 m_Tdiff(tdiff),
159 m_isValid(true) {}
160
161inline
162LArWFParams::LArWFParams(double tcal, double fstep, double tdrift, double omega0,
163 double taur, double tshaper, double ampli)
164 :
165 m_flag(0),
166 m_Tcal(tcal),
167 m_Fstep(fstep),
170 m_Taur(taur),
172 m_Amplitude(ampli),
173 m_Tdiff(0),
174 m_isValid(true) {}
175
176inline
178 double tcal, double fstep, double tdrift, double omega0,
179 double taur, double tshaper, double ampli)
180 :
181 m_flag(flag),
182 m_Tcal(tcal),
183 m_Fstep(fstep),
186 m_Taur(taur),
188 m_Amplitude(ampli),
189 m_Tdiff(0),
190 m_isValid(true) {}
191
192inline
194 const LArCaliPulseParamsComplete& caliPar,
195 const LArDetCellParamsComplete& detPar,
198{
199 m_flag = 0;
200 m_Amplitude = 0;
201 m_isValid = true ;
202 int igain = (int)gain ;
203
204 m_Tshaper = 15 ;
205
206 if ( (m_Tcal=caliPar.Tcal(chID,igain)) == (float)ILArCaliPulseParams::ERRORCODE )
207 m_isValid = false ;
208 if ( (m_Fstep=caliPar.Fstep(chID,igain)) == (float)ILArCaliPulseParams::ERRORCODE )
209 m_isValid = false ;
210
211 if ( (m_Omega0=detPar.Omega0(chID,igain)) == (float)ILArDetCellParams::ERRORCODE )
212 m_isValid = false ;
213 if ( (m_Taur=detPar.Taur(chID,igain)) == (float)ILArDetCellParams::ERRORCODE )
214 m_isValid = false ;
215
216 if ( (m_Tdiff=tdiff.Tdiff(chID,igain)) == (float)ILArPhysCaliTdiff::ERRORCODE )
217 m_isValid = false ;
218
219 if ( (m_Tdrift=tdrift.Tdrift(chID)) == (float)ILArTdrift::ERRORCODE )
220 m_isValid = false ;
221
222}
223
224inline void LArWFParams::setFlag(unsigned flag) { m_flag = flag ; }
225
226inline void LArWFParams::setTcal(double tcal) { m_Tcal = tcal ; }
227inline void LArWFParams::setFstep(double fstep) { m_Fstep = fstep ; }
228inline void LArWFParams::setTdrift(double tdrift) { m_Tdrift = tdrift ; }
229inline void LArWFParams::setOmega0(double omega0) { m_Omega0 = omega0 ; }
230inline void LArWFParams::setTaur(double taur) { m_Taur = taur ; }
231inline void LArWFParams::setTshaper(double tsh) { m_Tshaper = tsh ; }
232inline void LArWFParams::setAmplitude(double ampli) { m_Amplitude = ampli ; }
233inline void LArWFParams::setTdiff (double tdiff) { m_Tdiff = tdiff ; }
234
235inline void LArWFParams::setValid() { m_isValid = true ; }
236inline void LArWFParams::setBad() { m_isValid = false ; }
237
239 const LArCaliPulseParamsComplete& caliPar) {
240 m_Tcal = caliPar.Tcal(chID, (int)gain) ;
241 m_Fstep = caliPar.Fstep(chID,(int)gain) ;
244}
245
247 const LArDetCellParamsComplete& detPar) {
248 m_Omega0 = detPar.Omega0(chID, (int)gain) ;
249 m_Fstep = detPar.Taur(chID,(int)gain) ;
252}
253
256 m_Tdiff = tdiff.Tdiff(chID, (int)gain) ;
258}
259
261 const LArTdriftComplete& tdrift) {
262 m_Tdrift = tdrift.Tdrift(chID) ;
263 return ( m_Tdrift != ILArTdrift::ERRORCODE ) ;
264}
265
266inline unsigned int LArWFParams::getFlag() const { return m_flag ; }
267inline double LArWFParams::tcal() const { return m_Tcal; }
268inline double LArWFParams::fstep() const { return m_Fstep; }
269inline double LArWFParams::tdrift() const { return m_Tdrift; }
270inline double LArWFParams::omega0() const { return m_Omega0; }
271inline double LArWFParams::taur() const { return m_Taur; }
272inline double LArWFParams::tshaper() const { return m_Tshaper; }
273inline double LArWFParams::amplitude() const { return m_Amplitude; }
274inline double LArWFParams::tdiff() const { return m_Tdiff; }
275inline bool LArWFParams::isValid() const { return m_isValid ; }
276
277
278#endif
This class implements the ILArCaliPulseParams interface.
virtual const float & Tcal(const HWIdentifier &CellID, int gain) const
virtual const float & Fstep(const HWIdentifier &CellID, int gain) const
This class implements the ILArDetCellParams interface.
virtual const float & Omega0(const HWIdentifier &CellID, int gain) const
virtual const float & Taur(const HWIdentifier &CellID, int gain) const
This class implements the ILArPhysCaliTdiff interface ` *.
This class implements the ILArTdrift interface.
double amplitude() const
LArWFParams()
default constructor: empty, "invalid" parameters set:
void setTaur(double taur)
void setBad()
double omega0() const
double m_Amplitude
double m_Tdrift
Definition LArWFParams.h:99
void setFstep(double fstep)
double m_Tdiff
unsigned int getFlag() const
double tdiff() const
double m_Fstep
Definition LArWFParams.h:98
void setValid()
double tdrift() const
double tshaper() const
void setTdrift(double tdrift)
void setTcal(double tcal)
void setOmega0(double omega0)
double fstep() const
double m_Tcal
Definition LArWFParams.h:97
unsigned int m_flag
Definition LArWFParams.h:96
void setFlag(unsigned flag)
void setTshaper(double tsh)
double tcal() const
void setTdiff(double tdiff)
double m_Taur
void setAmplitude(double ampli)
double taur() const
double m_Tshaper
bool set(HWIdentifier chID, CaloGain::CaloGain gain, const LArCaliPulseParamsComplete &caliPar)
the followings pick up values from smaller Complete structures, return value is false if parameters w...
double m_Omega0
bool isValid() const