KaliVeda
Toolkit for HIC analysis
KVQ3.cpp
1 //Created by KVClassFactory on Tue Jan 13 15:11:11 2015
2 //Author: ,,,
3 
4 #include "KVQ3.h"
5 #include "KVDBParameterList.h"
6 
8 
9 // BEGIN_HTML <!--
11 /* -->
12 <h2>KVQ3</h2>
13 <h4>digitized charge signal</h4>
14 <!-- */
15 // --> END_HTML
17 
19 
20 void KVQ3::init()
21 {
22  SetDefaultValues();
23  fChannel = kQ3;
24  SetType("Q3");
25  fFPGAOutputNumbers = 2;
26  LoadPSAParameters();
27 
28 }
29 
30 
31 
33 
35 {
36  init();
37 }
38 
39 
40 
41 
43 
44 KVQ3::KVQ3(const char* name) : KVFAZIASignal(name, "Charge")
45 {
46  init();
47 }
48 
49 
50 
52 
54 {
55  SetChannelWidth(10);
56  SetBaseLineLength(250);
57 }
58 
59 
60 
62 
64 {
65 
66  Double_t val = GetPSAParameter("BaseLineLength");
67  SetBaseLineLength(val);
68 
69  val = GetPSAParameter("ChannelWidth");
70  SetChannelWidth(val);
71 
72  val = GetPSAParameter("TauRC");
73  SetTauRC(val);
74 
75  Double_t rise = GetPSAParameter("ShaperRiseTime");
76  val = GetPSAParameter("ShaperFlatTop");
77  SetTrapShaperParameters(rise, val);
78 
79  val = GetPSAParameter("PZCorrection");
80  SetPoleZeroCorrection((val == 1));
81 
82  rise = GetPSAParameter("FastShaperRiseTime");
83  val = GetPSAParameter("FastShaperFlatTop");
84  SetFastTrapShaperParameters(rise, val);
85 
86  val = GetPSAParameter("MinimumAmplitude");
88 
89 }
90 
91 
92 
94 
96 {
97  for (Int_t ii = 0; ii < par->GetNpar(); ii += 1) {
98  TString nameat(par->GetNameAt(ii));
99  if (nameat == "BaseLineLength") SetBaseLineLength(par->GetDoubleValue(ii));
100  else if (nameat == "ChannelWidth") SetChannelWidth(par->GetDoubleValue(ii));
101  else if (nameat == "ShaperRiseTime") SetShaperRiseTime(par->GetDoubleValue(ii));
102  else if (nameat == "ShaperFlatTop") SetShaperFlatTop(par->GetDoubleValue(ii));
103  else if (nameat == "FastShaperRiseTime") SetFastShaperRiseTime(par->GetDoubleValue(ii));
104  else if (nameat == "FastShaperFlatTop") SetFastShaperFlatTop(par->GetDoubleValue(ii));
105  else if (nameat == "TauRC") SetTauRC(par->GetDoubleValue(ii));
106  else if (nameat == "MinimumAmplitude") SetAmplitudeTriggerValue(par->GetDoubleValue(ii));
107  else if (nameat == "InterpolatedChannelWidth") SetInterpolatedChannelWidth(par->GetDoubleValue(ii));
108  else if (nameat == "Interpolation") SetInterpolation((par->GetDoubleValue(ii) == 1));
109  else if (nameat == "PZCorrection") SetPoleZeroCorrection((par->GetDoubleValue(ii) == 1));
110  else {
111  if (nameat == "Detector" || nameat == "Signal" || nameat == "RunRange") {
112 
113  }
114  else {
115  Warning("UpdatePSAParameter", "Not supported PSA parameter : %d %s\n", ii, nameat.Data());
116  }
117  }
118  }
119 }
120 
121 
122 
123 
125 
127 {
128  if (PSAHasBeenComputed()) return;
129 
130  if (!IsLongEnough()) return;
131  if (!TestWidth())
133 
134  RemoveBaseLine();
135 
139 
140 
141 
142  SetADCData();
143 
146  fAmplitude = GetAmplitude();// - (sQ3fast[fMtot-1])*0.5;
147 
148  ComputeRiseTime();
149 
150  fPSAIsDone = kTRUE;
151 
152 }
153 
154 
155 
157 
159 {
160  if (!fPSAIsDone) return;
161 
162  val.SetValue("BaseLine", fBaseLine);
163  val.SetValue("SigmaBaseLine", fSigmaBase);
164  val.SetValue("Amplitude", fAmplitude);
165  val.SetValue("FastAmplitude", fFastAmplitude);
166  val.SetValue("RiseTime", fRiseTime);
167  val.SetValue("RawAmplitude", GetRawAmplitude());
168 }
169 
170 
int Int_t
double Double_t
constexpr Bool_t kTRUE
char name[80]
Double_t GetPSAParameter(const Char_t *parname) override
routines to read/change PSA parameters from configuration file or database
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
const Char_t * GetNameAt(Int_t idx) const
Int_t GetNpar() const
return the number of stored parameters
Definition: KVQ3.h:9
KVQ3()
Definition: KVQ3.cpp:34
void init()
Definition: KVQ3.cpp:20
void GetPSAResults(KVNameValueList &val) const override
Definition: KVQ3.cpp:158
void TreateSignal() override
Definition: KVQ3.cpp:126
Double_t fFastAmplitude
fast amplitude for CsI
Definition: KVQ3.h:15
void SetDefaultValues() override
Definition: KVQ3.cpp:53
void SetFastShaperRiseTime(Double_t rise)
Definition: KVQ3.h:36
Double_t fFastTrapRiseTime
rise time of the trapezoidal shaper for fast componment
Definition: KVQ3.h:13
void LoadPSAParameters() override
Definition: KVQ3.cpp:63
void UpdatePSAParameter(KVNameValueList *par) override
Definition: KVQ3.cpp:95
void SetFastTrapShaperParameters(Double_t rise, Double_t flat)
Definition: KVQ3.h:31
void SetFastShaperFlatTop(Double_t flat)
Definition: KVQ3.h:40
Double_t fFastTrapFlatTop
flat top of the trapezoidal shaper for fast componment
Definition: KVQ3.h:14
void SetTauRC(Int_t taurc)
Definition: KVSignal.h:270
Bool_t IsLongEnough() const
Definition: KVSignal.cpp:109
void ChangeChannelWidth(Double_t newwidth)
Definition: KVSignal.cpp:286
void SetInterpolation(Bool_t with=kTRUE)
Definition: KVSignal.h:282
virtual void RemoveBaseLine()
Definition: KVSignal.cpp:406
void SetShaperRiseTime(Double_t rise)
Definition: KVSignal.h:233
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:17
Double_t fSigmaBase
base line rms
Definition: KVSignal.h:23
void SetInterpolatedChannelWidth(double width)
Definition: KVSignal.h:286
Double_t GetAmplitude() const
Definition: KVSignal.h:220
void SetPoleZeroCorrection(Bool_t with=kTRUE)
Definition: KVSignal.h:266
Double_t GetRawAmplitude() const
Definition: KVSignal.h:299
Double_t fBaseLine
base line mean value
Definition: KVSignal.h:22
void SetBaseLineLength(Int_t length, Int_t first=0)
Definition: KVSignal.h:166
Double_t ComputeAmplitude()
Compute and return the absolute value of the signal amplitude.
Definition: KVSignal.cpp:431
void SetTrapShaperParameters(Double_t rise, Double_t flat)
Definition: KVSignal.h:228
void SetShaperFlatTop(Double_t flat)
Definition: KVSignal.h:237
void SetADCData()
Definition: KVSignal.cpp:152
void SetChannelWidth(double width)
Definition: KVSignal.h:137
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:129
Double_t ComputeRiseTime()
Definition: KVSignal.cpp:448
void FIR_ApplyTrapezoidal(double trise, double tflat)
different shapers (modify only fAdc)
Definition: KVSignal.cpp:651
Double_t fTrapFlatTop
flat top of the trapezoidal shaper
Definition: KVSignal.h:35
Double_t fRiseTime
rise time of the signal
Definition: KVSignal.h:18
Bool_t fPSAIsDone
indicate if PSA has been done
Definition: KVSignal.h:45
Double_t fTrapRiseTime
rise time of the trapezoidal shaper
Definition: KVSignal.h:34
Bool_t TestWidth() const
Definition: KVSignal.cpp:270
Double_t GetChannelWidth() const
Definition: KVSignal.h:142
void SetAmplitudeTriggerValue(Double_t val)
Definition: KVSignal.h:317
virtual void Warning(const char *method, const char *msgfmt,...) const
const char * Data() const
ClassImp(TPyArg)