KaliVeda
Toolkit for HIC analysis
KVQH1.cpp
1 //Created by KVClassFactory on Tue Jan 13 15:11:11 2015
2 //Author: ,,,
3 
4 #include "KVQH1.h"
5 
7 
8 // BEGIN_HTML <!--
10 /* -->
11 <h2>KVQH1</h2>
12 <h4>digitized charge signal</h4>
13 <!-- */
14 // --> END_HTML
16 
18 
19 void KVQH1::init()
20 {
21  SetDefaultValues();
22  fChannel = kQH1;
23  SetType("QH1");
24  fFPGAOutputNumbers = 1;
25  LoadPSAParameters();
26 }
27 
28 
29 
31 
33 {
34  init();
35 }
36 
37 
38 
39 
41 
42 KVQH1::KVQH1(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 KVQH1::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 KVQH1::fToto)
74  // CastedObj.fToto = fToto;
75  // or
76  // CastedObj.SetToto( GetToto() );
77 
78  KVSignal::Copy(obj);
79  //KVQH1& CastedObj = (KVQH1&)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 
138 
139  SetADCData();
140  ComputeRiseTime();
141 
142  fPSAIsDone = kTRUE;
143 
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 
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: KVQH1.h:9
void LoadPSAParameters() override
Definition: KVQH1.cpp:96
void init()
Definition: KVQH1.cpp:19
void Copy(TObject &obj) const override
Definition: KVQH1.cpp:69
void GetPSAResults(KVNameValueList &) const override
Definition: KVQH1.cpp:150
void SetDefaultValues() override
Definition: KVQH1.cpp:86
virtual ~KVQH1()
Destructor.
Definition: KVQH1.cpp:53
void TreateSignal() override
Definition: KVQH1.cpp:124
KVQH1()
Definition: KVQH1.cpp:32
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)