KaliVeda
Toolkit for HIC analysis
KVI1.cpp
1 //Created by KVClassFactory on Tue Jan 13 15:11:11 2015
2 //Author: ,,,
3 
4 #include "KVI1.h"
5 #include "TMath.h"
6 
8 
9 // BEGIN_HTML <!--
11 /* -->
12 <h2>KVI1</h2>
13 <h4>digitized current signal</h4>
14 <!-- */
15 // --> END_HTML
17 
19 
20 void KVI1::init()
21 {
22  SetDefaultValues();
23  fChannel = kI1;
24  SetType("I1");
25  LoadPSAParameters();
26 
27 }
28 
29 
30 
32 
34 {
35  init();
36 }
37 
38 
39 
40 
42 
43 KVI1::KVI1(const char* name) : KVFAZIASignal(name, "Current")
44 {
45  init();
46 }
47 
48 
49 
51 
53 {
54  SetChannelWidth(4);
56 }
57 
58 
59 
61 
63 {
64 
65  Double_t val = GetPSAParameter("BaseLineLength");
66  SetBaseLineLength(val);
67 
68  val = GetPSAParameter("ChannelWidth");
69  SetChannelWidth(val);
70 
71  val = GetPSAParameter("InterpolatedChannelWidth");
73 
74  val = GetPSAParameter("Interpolation");
75  SetInterpolation((val == 1));
76 
77 }
78 
79 
80 
85 
87 {
88  // special case for current signal
89  // in case the pulse start to early,
90  // base line is calculated at the end of the signal
91 
94 
95  if (fBaseLine <= fEndLine) {
96  //do nothing baseline is kept as calculated by default KVSignal method
97  }
98  else {
99  //compute the base line at the end of the signal
100  //baseline length is taken as for the standard base line calculation
101  //
102  ComputeEndLine();
105  }
106 
107  return fBaseLine;
108 }
109 
110 
111 
112 
114 
116 {
117  if (PSAHasBeenComputed()) return;
118 
119  if (!IsLongEnough()) return;
120 
121  if (!TestWidth())
123 
124 // FIR_ApplyMovingAverage(4);
125  Add(-1.*ComputeBaseLine());
126 // ApplyModifications();
127 
128  if (fWithInterpolation) {
130  SetNSamples(GetNSamples() - 5 * (fChannelWidth / fInterpolatedChannelWidth)); // because we use a 3th order interpolation...
131  }
132 
134  fPSAIsDone = kTRUE;
135 
136 }
137 
138 
139 
141 
143 {
144  if (!fPSAIsDone) return;
145 
146  val.SetValue("BaseLine", fBaseLine);
147  val.SetValue("SigmaBaseLine", fSigmaBase);
148  val.SetValue("Amplitude", fAmplitude);
149  val.SetValue("RawAmplitude", GetRawAmplitude());
150 }
151 
152 
153 
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
Definition: KVI1.h:9
KVI1()
Definition: KVI1.cpp:33
void SetDefaultValues() override
Definition: KVI1.cpp:52
void init()
Definition: KVI1.cpp:20
void TreateSignal() override
Definition: KVI1.cpp:115
void GetPSAResults(KVNameValueList &) const override
Definition: KVI1.cpp:142
void LoadPSAParameters() override
Definition: KVI1.cpp:62
Double_t ComputeBaseLine() override
Definition: KVI1.cpp:86
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
Double_t fInterpolatedChannelWidth
channel width used to produced the interpolated signal
Definition: KVSignal.h:31
void Add(Double_t fact)
Definition: KVSignal.cpp:1602
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
Double_t fEndLine
mean value of the signal line at the end
Definition: KVSignal.h:24
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:17
virtual Double_t ComputeBaseLine()
Definition: KVSignal.cpp:303
Double_t fSigmaBase
base line rms
Definition: KVSignal.h:23
void SetInterpolatedChannelWidth(double width)
Definition: KVSignal.h:286
Int_t GetNSamples() const
Definition: KVSignal.h:158
Bool_t fWithInterpolation
use of interpolation or not
Definition: KVSignal.h:38
Double_t fChannelWidth
channel width in ns
Definition: KVSignal.h:30
Double_t GetRawAmplitude() const
Definition: KVSignal.h:299
Double_t fSigmaEnd
rms value of the signal line at the end
Definition: KVSignal.h:25
void SetNSamples(int nn)
Definition: KVSignal.h:154
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
virtual void BuildSmoothingSplineSignal()
Definition: KVSignal.cpp:1236
void SetChannelWidth(double width)
Definition: KVSignal.h:137
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:129
Bool_t fPSAIsDone
indicate if PSA has been done
Definition: KVSignal.h:45
Bool_t TestWidth() const
Definition: KVSignal.cpp:270
virtual Double_t ComputeEndLine()
Definition: KVSignal.cpp:376
Double_t GetChannelWidth() const
Definition: KVSignal.h:142
ClassImp(TPyArg)