KaliVeda
Toolkit for HIC analysis
KVQ2.cpp
1 //Created by KVClassFactory on Tue Jan 13 15:11:11 2015
2 //Author: ,,,
3 
4 #include "KVQ2.h"
6 
7 // BEGIN_HTML <!--
9 /* -->
10 <h2>KVQ2</h2>
11 <h4>digitized charge signal</h4>
12 <!-- */
13 // --> END_HTML
15 
17 
18 void KVQ2::init()
19 {
20  SetDefaultValues();
21  fChannel = kQ2;
22  fFPGAOutputNumbers = 1;
23  SetType("Q2");
24  LoadPSAParameters();
25 
26 }
27 
28 
29 
31 
33 {
34  init();
35 }
36 
37 
38 
39 
41 
42 KVQ2::KVQ2(const char* name) : KVFAZIASignal(name, "Charge")
43 {
44  init();
45 }
46 
47 
48 
50 
52 {
53  SetChannelWidth(10);
54  SetBaseLineLength(500);
55 }
56 
57 
58 
60 
62 {
63 
64  Double_t val = GetPSAParameter("BaseLineLength");
65  SetBaseLineLength(val);
66 
67  val = GetPSAParameter("ChannelWidth");
68  SetChannelWidth(val);
69 
70  val = GetPSAParameter("TauRC");
71  SetTauRC(val);
72 
73  Double_t rise = GetPSAParameter("ShaperRiseTime");
74  val = GetPSAParameter("ShaperFlatTop");
75  SetTrapShaperParameters(rise, val);
76 
77  val = GetPSAParameter("PZCorrection");
78  SetPoleZeroCorrection((val == 1));
79 
80  val = GetPSAParameter("MinimumAmplitude");
82 }
83 
84 
85 
86 
88 
90 {
91  if (PSAHasBeenComputed()) return;
92 
93  if (!IsLongEnough()) return;
94  if (!TestWidth())
96 
98 
102 
104 
105  SetADCData();
106  ComputeRiseTime();
107 
108  fPSAIsDone = kTRUE;
109 }
110 
111 
112 
114 
116 {
117  if (!fPSAIsDone) return;
118 
119  val.SetValue("BaseLine", fBaseLine);
120  val.SetValue("SigmaBaseLine", fSigmaBase);
121  val.SetValue("Amplitude", fAmplitude);
122  val.SetValue("RiseTime", fRiseTime);
123  val.SetValue("RawAmplitude", GetRawAmplitude());
124 }
125 
126 
127 
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.
void SetValue(const Char_t *name, value_type value)
Definition: KVQ2.h:9
void GetPSAResults(KVNameValueList &) const override
Definition: KVQ2.cpp:115
void init()
Definition: KVQ2.cpp:18
void LoadPSAParameters() override
Definition: KVQ2.cpp:61
KVQ2()
Definition: KVQ2.cpp:32
void TreateSignal() override
Definition: KVQ2.cpp:89
void SetDefaultValues() override
Definition: KVQ2.cpp:51
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
virtual void RemoveBaseLine()
Definition: KVSignal.cpp:406
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:17
Double_t fSigmaBase
base line rms
Definition: KVSignal.h:23
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 SetADCData()
Definition: KVSignal.cpp:152
void SetChannelWidth(double width)
Definition: KVSignal.h:137
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:129
Double_t fTauRC
tau_rc of the electronics. Used for pole zero cancellation.
Definition: KVSignal.h:33
Double_t ComputeRiseTime()
Definition: KVSignal.cpp:448
void FIR_ApplyTrapezoidal(double trise, double tflat)
different shapers (modify only fAdc)
Definition: KVSignal.cpp:651
Bool_t fWithPoleZeroCorrection
use or nor pole zero correction
Definition: KVSignal.h:37
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
void PoleZeroSuppression(Double_t tauRC)
Definition: KVSignal.cpp:1560
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
ClassImp(TPyArg)