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) : KVSignal(name, "Charge")
43 {
44  init();
45 }
46 
47 
48 
49 
52 
54 {
55  // Destructor
56 }
57 
58 
59 
60 
68 
69 void KVQ2::Copy(TObject& obj) const
70 {
71  // This method copies the current state of 'this' object into 'obj'
72  // You should add here any member variables, for example:
73  // (supposing a member variable KVQ2::fToto)
74  // CastedObj.fToto = fToto;
75  // or
76  // CastedObj.SetToto( GetToto() );
77 
78  KVSignal::Copy(obj);
79  //KVQ2& CastedObj = (KVQ2&)obj;
80 }
81 
82 
83 
85 
87 {
88  SetChannelWidth(10);
89  SetBaseLineLength(500);
90 }
91 
92 
93 
95 
97 {
98 
99  Double_t val = GetPSAParameter("BaseLineLength");
100  SetBaseLineLength(val);
101 
102  val = GetPSAParameter("ChannelWidth");
103  SetChannelWidth(val);
104 
105  val = GetPSAParameter("TauRC");
106  SetTauRC(val);
107 
108  Double_t rise = GetPSAParameter("ShaperRiseTime");
109  val = GetPSAParameter("ShaperFlatTop");
110  SetTrapShaperParameters(rise, val);
111 
112  val = GetPSAParameter("PZCorrection");
113  SetPoleZeroCorrection((val == 1));
114 
115  val = GetPSAParameter("MinimumAmplitude");
117 }
118 
119 
120 
121 
123 
125 {
126  if (PSAHasBeenComputed()) return;
127 
128  if (!IsLongEnough()) return;
129  if (!TestWidth())
131 
132  RemoveBaseLine();
133 
137 
139 
140  SetADCData();
141  ComputeRiseTime();
142 
143  fPSAIsDone = kTRUE;
144 }
145 
146 
147 
149 
151 {
152  if (!fPSAIsDone) return;
153 
154  val.SetValue("BaseLine", fBaseLine);
155  val.SetValue("SigmaBaseLine", fSigmaBase);
156  val.SetValue("Amplitude", fAmplitude);
157  val.SetValue("RiseTime", fRiseTime);
158  val.SetValue("RawAmplitude", GetRawAmplitude());
159 }
160 
161 
162 
double Double_t
constexpr Bool_t kTRUE
char name[80]
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:150
void init()
Definition: KVQ2.cpp:18
void Copy(TObject &obj) const override
Definition: KVQ2.cpp:69
void LoadPSAParameters() override
Definition: KVQ2.cpp:96
KVQ2()
Definition: KVQ2.cpp:32
void TreateSignal() override
Definition: KVQ2.cpp:124
void SetDefaultValues() override
Definition: KVQ2.cpp:86
virtual ~KVQ2()
Destructor.
Definition: KVQ2.cpp:53
void SetTauRC(Int_t taurc)
Definition: KVSignal.h:296
Bool_t IsLongEnough() const
Definition: KVSignal.cpp:185
void ChangeChannelWidth(Double_t newwidth)
Definition: KVSignal.cpp:473
virtual void RemoveBaseLine()
Definition: KVSignal.cpp:593
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:37
Double_t GetPSAParameter(const Char_t *parname)
DeduceFromName has to be called before.
Definition: KVSignal.cpp:340
Double_t fSigmaBase
base line rms
Definition: KVSignal.h:43
void SetPoleZeroCorrection(Bool_t with=kTRUE)
Definition: KVSignal.h:292
Double_t GetRawAmplitude() const
Definition: KVSignal.h:325
Double_t fBaseLine
base line mean value
Definition: KVSignal.h:42
void SetBaseLineLength(Int_t length, Int_t first=0)
Definition: KVSignal.h:192
Double_t ComputeAmplitude()
Compute and return the absolute value of the signal amplitude.
Definition: KVSignal.cpp:618
void SetTrapShaperParameters(Double_t rise, Double_t flat)
Definition: KVSignal.h:254
void Copy(TObject &obj) const override
Definition: KVSignal.cpp:168
void SetADCData()
Definition: KVSignal.cpp:228
void SetChannelWidth(double width)
Definition: KVSignal.h:163
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:155
Double_t fTauRC
tau_rc of the electronics. Used for pole zero cancellation.
Definition: KVSignal.h:53
Double_t ComputeRiseTime()
Definition: KVSignal.cpp:635
void FIR_ApplyTrapezoidal(double trise, double tflat)
different shapers (modify only fAdc)
Definition: KVSignal.cpp:838
Bool_t fWithPoleZeroCorrection
use or nor pole zero correction
Definition: KVSignal.h:57
Double_t fTrapFlatTop
flat top of the trapezoidal shaper
Definition: KVSignal.h:55
Double_t fRiseTime
rise time of the signal
Definition: KVSignal.h:38
Bool_t fPSAIsDone
indicate if PSA has been done
Definition: KVSignal.h:63
void PoleZeroSuppression(Double_t tauRC)
Definition: KVSignal.cpp:1747
Double_t fTrapRiseTime
rise time of the trapezoidal shaper
Definition: KVSignal.h:54
Bool_t TestWidth() const
Definition: KVSignal.cpp:457
Double_t GetChannelWidth() const
Definition: KVSignal.h:168
void SetAmplitudeTriggerValue(Double_t val)
Definition: KVSignal.h:343
ClassImp(TPyArg)