ATLAS Offline Software
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 
22 public:
23 
25  LArWFParams();
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,
52  const LArTdriftComplete& tdrift);
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 
73  const LArCaliPulseParamsComplete& caliPar);
75  const LArDetCellParamsComplete& detPar);
79  const LArTdriftComplete& tdrift);
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 
94 private:
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 ;
105  bool m_isValid ;
106 public:
107 
108 };
109 
111 // Inline definitions
113 
114 inline
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 
128 inline
129 LArWFParams::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),
136  m_Tdrift(tdrift),
137  m_Omega0(omega0),
138  m_Taur(taur),
139  m_Tshaper(tshaper),
140  m_Amplitude(ampli),
141  m_Tdiff(tdiff),
142  m_isValid(true) {}
143 
144 inline
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),
153  m_Tdrift(tdrift),
154  m_Omega0(omega0),
155  m_Taur(taur),
156  m_Tshaper(tshaper),
157  m_Amplitude(ampli),
158  m_Tdiff(tdiff),
159  m_isValid(true) {}
160 
161 inline
162 LArWFParams::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),
168  m_Tdrift(tdrift),
169  m_Omega0(omega0),
170  m_Taur(taur),
171  m_Tshaper(tshaper),
172  m_Amplitude(ampli),
173  m_Tdiff(0),
174  m_isValid(true) {}
175 
176 inline
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),
184  m_Tdrift(tdrift),
185  m_Omega0(omega0),
186  m_Taur(taur),
187  m_Tshaper(tshaper),
188  m_Amplitude(ampli),
189  m_Tdiff(0),
190  m_isValid(true) {}
191 
192 inline
194  const LArCaliPulseParamsComplete& caliPar,
195  const LArDetCellParamsComplete& detPar,
196  const LArPhysCaliTdiffComplete& tdiff,
197  const LArTdriftComplete& tdrift)
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 
224 inline void LArWFParams::setFlag(unsigned flag) { m_flag = flag ; }
225 
226 inline void LArWFParams::setTcal(double tcal) { m_Tcal = tcal ; }
227 inline void LArWFParams::setFstep(double fstep) { m_Fstep = fstep ; }
228 inline void LArWFParams::setTdrift(double tdrift) { m_Tdrift = tdrift ; }
229 inline void LArWFParams::setOmega0(double omega0) { m_Omega0 = omega0 ; }
230 inline void LArWFParams::setTaur(double taur) { m_Taur = taur ; }
231 inline void LArWFParams::setTshaper(double tsh) { m_Tshaper = tsh ; }
232 inline void LArWFParams::setAmplitude(double ampli) { m_Amplitude = ampli ; }
233 inline void LArWFParams::setTdiff (double tdiff) { m_Tdiff = tdiff ; }
234 
235 inline void LArWFParams::setValid() { m_isValid = true ; }
236 inline 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) ;
242  return ( m_Tcal != ILArCaliPulseParams::ERRORCODE &&
244 }
245 
247  const LArDetCellParamsComplete& detPar) {
248  m_Omega0 = detPar.Omega0(chID, (int)gain) ;
249  m_Fstep = detPar.Taur(chID,(int)gain) ;
250  return ( m_Omega0 != ILArDetCellParams::ERRORCODE &&
252 }
253 
255  const LArPhysCaliTdiffComplete& tdiff) {
256  m_Tdiff = tdiff.Tdiff(chID, (int)gain) ;
257  return ( m_Tdiff != ILArPhysCaliTdiff::ERRORCODE ) ;
258 }
259 
261  const LArTdriftComplete& tdrift) {
262  m_Tdrift = tdrift.Tdrift(chID) ;
263  return ( m_Tdrift != ILArTdrift::ERRORCODE ) ;
264 }
265 
266 inline unsigned int LArWFParams::getFlag() const { return m_flag ; }
267 inline double LArWFParams::tcal() const { return m_Tcal; }
268 inline double LArWFParams::fstep() const { return m_Fstep; }
269 inline double LArWFParams::tdrift() const { return m_Tdrift; }
270 inline double LArWFParams::omega0() const { return m_Omega0; }
271 inline double LArWFParams::taur() const { return m_Taur; }
272 inline double LArWFParams::tshaper() const { return m_Tshaper; }
273 inline double LArWFParams::amplitude() const { return m_Amplitude; }
274 inline double LArWFParams::tdiff() const { return m_Tdiff; }
275 inline bool LArWFParams::isValid() const { return m_isValid ; }
276 
277 
278 #endif
LArWFParams::taur
double taur() const
Definition: LArWFParams.h:271
LArDetCellParamsComplete.h
LArWFParams::m_flag
unsigned int m_flag
Definition: LArWFParams.h:96
LArTdriftComplete
This class implements the ILArTdrift interface.
Definition: LArTdriftComplete.h:23
LArWFParams::m_Omega0
double m_Omega0
Definition: LArWFParams.h:100
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
LArWFParams::tshaper
double tshaper() const
Definition: LArWFParams.h:272
LArWFParams::setTcal
void setTcal(double tcal)
Definition: LArWFParams.h:226
LArWFParams::setFstep
void setFstep(double fstep)
Definition: LArWFParams.h:227
ILArTdrift::ERRORCODE
@ ERRORCODE
Definition: ILArTdrift.h:27
LArWFParams::m_Fstep
double m_Fstep
Definition: LArWFParams.h:98
LArWFParams::getFlag
unsigned int getFlag() const
Definition: LArWFParams.h:266
LArWFParams::amplitude
double amplitude() const
Definition: LArWFParams.h:273
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArWFParams::setTdrift
void setTdrift(double tdrift)
Definition: LArWFParams.h:228
LArWFParams::m_Amplitude
double m_Amplitude
Definition: LArWFParams.h:103
ILArPhysCaliTdiff::ERRORCODE
@ ERRORCODE
Definition: ILArPhysCaliTdiff.h:29
LArWFParams
Definition: LArWFParams.h:20
HWIdentifier
Definition: HWIdentifier.h:13
LArWFParams::setTshaper
void setTshaper(double tsh)
Definition: LArWFParams.h:231
LArWFParams::tcal
double tcal() const
Definition: LArWFParams.h:267
LArWFParams::fstep
double fstep() const
Definition: LArWFParams.h:268
LArWFParams::tdiff
double tdiff() const
Definition: LArWFParams.h:274
LArWFParams::m_isValid
bool m_isValid
Definition: LArWFParams.h:105
LArWFParams::setTdiff
void setTdiff(double tdiff)
Definition: LArWFParams.h:233
LArWFParams::m_Tcal
double m_Tcal
Definition: LArWFParams.h:97
ILArDetCellParams::ERRORCODE
@ ERRORCODE
Definition: ILArDetCellParams.h:29
LArWFParams::setBad
void setBad()
Definition: LArWFParams.h:236
LArDetCellParamsComplete::Omega0
virtual const float & Omega0(const HWIdentifier &CellID, int gain) const
Definition: LArDetCellParamsComplete.cxx:25
ILArCaliPulseParams::ERRORCODE
@ ERRORCODE
Definition: ILArCaliPulseParams.h:32
LArWFParams::setFlag
void setFlag(unsigned flag)
Definition: LArWFParams.h:224
LArWFParams::m_Tdiff
double m_Tdiff
Definition: LArWFParams.h:104
LArPhysCaliTdiffComplete
This class implements the ILArPhysCaliTdiff interface ` *.
Definition: LArPhysCaliTdiffComplete.h:22
LArWFParams::setTaur
void setTaur(double taur)
Definition: LArWFParams.h:230
master.flag
bool flag
Definition: master.py:29
LArWFParams::m_Tshaper
double m_Tshaper
Definition: LArWFParams.h:102
LArCaliPulseParamsComplete.h
WriteCellNoiseToCool.igain
igain
Definition: WriteCellNoiseToCool.py:338
LArDetCellParamsComplete::Taur
virtual const float & Taur(const HWIdentifier &CellID, int gain) const
Definition: LArDetCellParamsComplete.cxx:31
LArWFParams::omega0
double omega0() const
Definition: LArWFParams.h:270
LArWFParams::setAmplitude
void setAmplitude(double ampli)
Definition: LArWFParams.h:232
LArCaliPulseParamsComplete
This class implements the ILArCaliPulseParams interface.
Definition: LArCaliPulseParamsComplete.h:27
LArCaliPulseParamsComplete::Fstep
virtual const float & Fstep(const HWIdentifier &CellID, int gain) const
Definition: LArCaliPulseParamsComplete.cxx:56
LArWFParams::isValid
bool isValid() const
Definition: LArWFParams.h:275
LArWFParams::m_Taur
double m_Taur
Definition: LArWFParams.h:101
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArWFParams::tdrift
double tdrift() const
Definition: LArWFParams.h:269
LArWFParams::set
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...
Definition: LArWFParams.h:238
LArWFParams::LArWFParams
LArWFParams()
default constructor: empty, "invalid" parameters set:
Definition: LArWFParams.h:115
LArWFParams::setOmega0
void setOmega0(double omega0)
Definition: LArWFParams.h:229
LArWFParams::setValid
void setValid()
Definition: LArWFParams.h:235
LArCaliPulseParamsComplete::Tcal
virtual const float & Tcal(const HWIdentifier &CellID, int gain) const
Definition: LArCaliPulseParamsComplete.cxx:50
LArPhysCaliTdiffComplete.h
CaloGain.h
LArTdriftComplete.h
readCCLHist.float
float
Definition: readCCLHist.py:83
LArWFParams::m_Tdrift
double m_Tdrift
Definition: LArWFParams.h:99
LArOnlineID.h
LArDetCellParamsComplete
This class implements the ILArDetCellParams interface.
Definition: LArDetCellParamsComplete.h:24