KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVQ2.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 "KVQ2.h"
5 
6 #include <KVDetector.h>
7 
9 
10 // BEGIN_HTML <!--
12 /* -->
13 <h2>KVQ2</h2>
14 <h4>digitized charge signal</h4>
15 <!-- */
16 // --> END_HTML
18 
20 
21 void KVQ2::init()
22 {
23  SetDefaultValues();
24  fChannel = kQ2;
25  fFPGAOutputNumbers = 1;
26  SetType("Q2");
27  LoadPSAParameters();
28 
29 }
30 
31 
32 
34 
36 {
37  init();
38 }
39 
40 
41 
42 
44 
45 KVQ2::KVQ2(const char* name) : KVSignal(name, "Charge")
46 {
47  init();
48 }
49 
50 
51 
52 
55 
57 {
58  // Destructor
59 }
60 
61 
62 
63 
71 
72 void KVQ2::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 KVQ2::fToto)
77  // CastedObj.fToto = fToto;
78  // or
79  // CastedObj.SetToto( GetToto() );
80 
81  KVSignal::Copy(obj);
82  //KVQ2& CastedObj = (KVQ2&)obj;
83 }
84 
85 
86 
88 
90 {
91  SetChannelWidth(10);
92  SetBaseLineLength(500);
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("TauRC");
109  SetTauRC(val);
110 
111  Double_t rise = GetPSAParameter("ShaperRiseTime");
112  val = GetPSAParameter("ShaperFlatTop");
113  SetTrapShaperParameters(rise, val);
114 
115  val = GetPSAParameter("PZCorrection");
116  SetPoleZeroCorrection((val == 1));
117 
118  val = GetPSAParameter("MinimumAmplitude");
120 }
121 
122 
123 
124 
126 
128 {
129  if (PSAHasBeenComputed()) return;
130 
131  if (!IsLongEnough()) return;
132  if (!TestWidth())
134 
135  RemoveBaseLine();
136 
140 
142 
143  SetADCData();
144  ComputeRiseTime();
145 
146  fPSAIsDone = kTRUE;
147 }
148 
149 
150 
152 
154 {
155  if (!fPSAIsDone) return;
156 
157  d->SetDetectorSignalValue(Form("%s.BaseLine", fType.Data()), fBaseLine);
158  d->SetDetectorSignalValue(Form("%s.SigmaBaseLine", fType.Data()), fSigmaBase);
159  d->SetDetectorSignalValue(Form("%s.Amplitude", fType.Data()), fAmplitude);
160  d->SetDetectorSignalValue(Form("%s.RiseTime", fType.Data()), fRiseTime);
161  d->SetDetectorSignalValue(Form("%s.RawAmplitude", fType.Data()), GetRawAmplitude());
162 }
163 
164 
165 
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: KVQ2.h:9
void init()
Definition: KVQ2.cpp:21
virtual void LoadPSAParameters()
Definition: KVQ2.cpp:99
virtual void GetPSAResult(KVDetector *) const
Definition: KVQ2.cpp:153
KVQ2()
Definition: KVQ2.cpp:35
virtual void SetDefaultValues()
To be defined in child class.
Definition: KVQ2.cpp:89
virtual void TreateSignal()
Definition: KVQ2.cpp:127
virtual ~KVQ2()
Destructor.
Definition: KVQ2.cpp:56
void Copy(TObject &obj) const
Definition: KVQ2.cpp:72
void SetTauRC(Int_t taurc)
Definition: KVSignal.h:300
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
virtual void RemoveBaseLine()
Definition: KVSignal.cpp:594
Double_t fAmplitude
results of signal treatement
Definition: KVSignal.h:38
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 SetPoleZeroCorrection(Bool_t with=kTRUE)
Definition: KVSignal.h:296
Double_t GetRawAmplitude() const
Definition: KVSignal.h:329
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
void SetTrapShaperParameters(Double_t rise, Double_t flat)
Definition: KVSignal.h:258
void SetADCData()
Definition: KVSignal.cpp:229
void SetChannelWidth(double width)
Definition: KVSignal.h:167
Bool_t PSAHasBeenComputed() const
Definition: KVSignal.h:159
Double_t fTauRC
tau_rc of the electronics. Used for pole zero cancellation.
Definition: KVSignal.h:54
Double_t ComputeRiseTime()
Definition: KVSignal.cpp:636
void FIR_ApplyTrapezoidal(double trise, double tflat)
different shapers (modify only fAdc)
Definition: KVSignal.cpp:839
Bool_t fWithPoleZeroCorrection
use or nor pole zero correction
Definition: KVSignal.h:58
Double_t fTrapFlatTop
flat top of the trapezoidal shaper
Definition: KVSignal.h:56
Double_t fRiseTime
rise time of the signal
Definition: KVSignal.h:39
Bool_t fPSAIsDone
indicate if PSA has been done
Definition: KVSignal.h:64
void PoleZeroSuppression(Double_t tauRC)
Definition: KVSignal.cpp:1748
Double_t fTrapRiseTime
rise time of the trapezoidal shaper
Definition: KVSignal.h:55
Bool_t TestWidth() const
Definition: KVSignal.cpp:458
Double_t GetChannelWidth() const
Definition: KVSignal.h:172
void SetAmplitudeTriggerValue(Double_t val)
Definition: KVSignal.h:347
const char * Data() const