KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVI1.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Tue Jan 13 15:11:11 2015
2 //Author: ,,,
3 
4 #include "KVI1.h"
5 #include "TMath.h"
6 
7 #include <KVDetector.h>
8 
10 
11 // BEGIN_HTML <!--
13 /* -->
14 <h2>KVI1</h2>
15 <h4>digitized current signal</h4>
16 <!-- */
17 // --> END_HTML
19 
21 
22 void KVI1::init()
23 {
24  SetDefaultValues();
25  fChannel = kI1;
26  SetType("I1");
27  LoadPSAParameters();
28 
29 }
30 
31 
32 
34 
36 {
37  init();
38 }
39 
40 
41 
42 
44 
45 KVI1::KVI1(const char* name) : KVSignal(name, "Current")
46 {
47  init();
48 }
49 
50 
51 
52 
55 
57 {
58  // Destructor
59 }
60 
61 
62 
63 
71 
72 void KVI1::Copy(TObject& obj) const
73 {
74  // This method copies the current state of 'this' object into 'obj'
75  // You should add here any member variables, for example:
76  // (supposing a member variable KVI1::fToto)
77  // CastedObj.fToto = fToto;
78  // or
79  // CastedObj.SetToto( GetToto() );
80 
81  KVSignal::Copy(obj);
82  //KVI1& CastedObj = (KVI1&)obj;
83 }
84 
85 
86 
88 
90 {
91  SetChannelWidth(4);
93 }
94 
95 
96 
98 
100 {
101 
102  Double_t val = GetPSAParameter("BaseLineLength");
103  SetBaseLineLength(val);
104 
105  val = GetPSAParameter("ChannelWidth");
106  SetChannelWidth(val);
107 
108  val = GetPSAParameter("InterpolatedChannelWidth");
110 
111  val = GetPSAParameter("Interpolation");
112  SetInterpolation((val == 1));
113 
114 }
115 
116 
117 
122 
124 {
125  // special case for current signal
126  // in case the pulse start to early,
127  // base line is calculated at the end of the signal
128 
131 
132  if (fBaseLine <= fEndLine) {
133  //do nothing baseline is kept as calculated by default KVSignal method
134  }
135  else {
136  //compute the base line at the end of the signal
137  //baseline length is taken as for the standard base line calculation
138  //
139  ComputeEndLine();
142  }
143 
144  return fBaseLine;
145 }
146 
147 
148 
149 
151 
153 {
154  if (PSAHasBeenComputed()) return;
155 
156  if (!IsLongEnough()) return;
157 
158  if (!TestWidth())
160 
161 // FIR_ApplyMovingAverage(4);
162  Add(-1.*ComputeBaseLine());
163 // ApplyModifications();
164 
165  if (fWithInterpolation) {
167  SetNSamples(GetNSamples() - 5 * (fChannelWidth / fInterpolatedChannelWidth)); // because we use a 3th order interpolation...
168  }
169 
171  fPSAIsDone = kTRUE;
172 
173 }
174 
175 
176 
177 
179 
181 {
182  if (!fPSAIsDone) return;
183 
184  d->SetDetectorSignalValue(Form("%s.BaseLine", fType.Data()), fBaseLine);
185  d->SetDetectorSignalValue(Form("%s.SigmaBaseLine", fType.Data()), fSigmaBase);
186  d->SetDetectorSignalValue(Form("%s.Amplitude", fType.Data()), fAmplitude);
187  d->SetDetectorSignalValue(Form("%s.RawAmplitude", fType.Data()), GetRawAmplitude());
188 }
189 
190 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
#define d(i)
double Double_t
const Bool_t kTRUE
char * Form(const char *fmt,...)
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:121
Definition: KVI1.h:9
KVI1()
Definition: KVI1.cpp:35
virtual void LoadPSAParameters()
Definition: KVI1.cpp:99
virtual void SetDefaultValues()
To be defined in child class.
Definition: KVI1.cpp:89
void Copy(TObject &obj) const
Definition: KVI1.cpp:72
virtual ~KVI1()
Destructor.
Definition: KVI1.cpp:56
void init()
Definition: KVI1.cpp:22
virtual void TreateSignal()
Definition: KVI1.cpp:152
virtual Double_t ComputeBaseLine()
Definition: KVI1.cpp:123
virtual void GetPSAResult(KVDetector *) const
Definition: KVI1.cpp:180
Double_t fInterpolatedChannelWidth
channel width used to produced the interpolated signal
Definition: KVSignal.h:52
void Add(Double_t fact)
Definition: KVSignal.cpp:1790
Bool_t IsLongEnough() const
Definition: KVSignal.cpp:186
TString fType
string to identify the signal type : "QH1", "I2" etc ...
Definition: KVSignal.h:32
void Copy(TObject &obj) const
Definition: KVSignal.cpp:169
void ChangeChannelWidth(Double_t newwidth)
Definition: KVSignal.cpp:474
void SetInterpolation(Bool_t with=kTRUE)
Definition: KVSignal.h:312
Double_t fEndLine
mean value of the signal line at the end
Definition: KVSignal.h:45
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:38
virtual Double_t ComputeBaseLine()
Definition: KVSignal.cpp:491
Double_t GetPSAParameter(const Char_t *parname)
DeduceFromName has to be called before.
Definition: KVSignal.cpp:341
Double_t fSigmaBase
base line rms
Definition: KVSignal.h:44
void SetInterpolatedChannelWidth(double width)
Definition: KVSignal.h:316
Int_t GetNSamples() const
Definition: KVSignal.h:188
Bool_t fWithInterpolation
use of interpolation or not
Definition: KVSignal.h:59
Double_t fChannelWidth
channel width in ns
Definition: KVSignal.h:51
Double_t GetRawAmplitude() const
Definition: KVSignal.h:329
Double_t fSigmaEnd
rms value of the signal line at the end
Definition: KVSignal.h:46
void SetNSamples(int nn)
Definition: KVSignal.h:184
Double_t fBaseLine
base line mean value
Definition: KVSignal.h:43
void SetBaseLineLength(Int_t length, Int_t first=0)
Definition: KVSignal.h:196
Double_t ComputeAmplitude()
Compute and return the absolute value of the signal amplitude.
Definition: KVSignal.cpp:619
virtual void BuildSmoothingSplineSignal()
Definition: KVSignal.cpp:1424
void SetChannelWidth(double width)
Definition: KVSignal.h:167
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:159
Bool_t fPSAIsDone
indicate if PSA has been done
Definition: KVSignal.h:64
Bool_t TestWidth() const
Definition: KVSignal.cpp:458
virtual Double_t ComputeEndLine()
Definition: KVSignal.cpp:564
Double_t GetChannelWidth() const
Definition: KVSignal.h:172
const char * Data() const