KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVQH1.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 "KVQH1.h"
5 
6 #include <KVDetector.h>
7 
9 
10 // BEGIN_HTML <!--
12 /* -->
13 <h2>KVQH1</h2>
14 <h4>digitized charge signal</h4>
15 <!-- */
16 // --> END_HTML
18 
20 
21 void KVQH1::init()
22 {
23  SetDefaultValues();
24  fChannel = kQH1;
25  SetType("QH1");
26  fFPGAOutputNumbers = 1;
27  LoadPSAParameters();
28 }
29 
30 
31 
33 
35 {
36  init();
37 }
38 
39 
40 
41 
43 
44 KVQH1::KVQH1(const char* name) : KVSignal(name, "Charge")
45 {
46  init();
47 }
48 
49 
50 
51 
54 
56 {
57  // Destructor
58 }
59 
60 
61 
62 
70 
71 void KVQH1::Copy(TObject& obj) const
72 {
73  // This method copies the current state of 'this' object into 'obj'
74  // You should add here any member variables, for example:
75  // (supposing a member variable KVQH1::fToto)
76  // CastedObj.fToto = fToto;
77  // or
78  // CastedObj.SetToto( GetToto() );
79 
80  KVSignal::Copy(obj);
81  //KVQH1& CastedObj = (KVQH1&)obj;
82 }
83 
84 
85 
87 
89 {
90  SetChannelWidth(10);
91  SetBaseLineLength(500);
92 }
93 
94 
95 
97 
99 {
100 
101  Double_t val = GetPSAParameter("BaseLineLength");
102  SetBaseLineLength(val);
103 
104  val = GetPSAParameter("ChannelWidth");
105  SetChannelWidth(val);
106 
107  val = GetPSAParameter("TauRC");
108  SetTauRC(val);
109 
110  Double_t rise = GetPSAParameter("ShaperRiseTime");
111  val = GetPSAParameter("ShaperFlatTop");
112  SetTrapShaperParameters(rise, val);
113 
114  val = GetPSAParameter("PZCorrection");
115  SetPoleZeroCorrection((val == 1));
116 
117  val = GetPSAParameter("MinimumAmplitude");
119 }
120 
121 
122 
123 
125 
127 {
128  if (PSAHasBeenComputed()) return;
129 
130  if (!IsLongEnough()) return;
131  if (!TestWidth())
133 
134  RemoveBaseLine();
135 
140 
141  SetADCData();
142  ComputeRiseTime();
143 
144  fPSAIsDone = kTRUE;
145 
146 }
147 
148 
149 
152 
154 {
155  // store results of PSA in detector signals
156 
157  if (!fPSAIsDone) return;
158 
159  d->SetDetectorSignalValue(Form("%s.BaseLine", fType.Data()), fBaseLine);
160  d->SetDetectorSignalValue(Form("%s.SigmaBaseLine", fType.Data()), fSigmaBase);
161  d->SetDetectorSignalValue(Form("%s.Amplitude", fType.Data()), fAmplitude);
162  d->SetDetectorSignalValue(Form("%s.RiseTime", fType.Data()), fRiseTime);
163  d->SetDetectorSignalValue(Form("%s.RawAmplitude", fType.Data()), GetRawAmplitude());
164 }
165 
166 
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: KVQH1.h:9
virtual void SetDefaultValues()
To be defined in child class.
Definition: KVQH1.cpp:88
virtual void TreateSignal()
Definition: KVQH1.cpp:126
void init()
Definition: KVQH1.cpp:21
virtual void GetPSAResult(KVDetector *) const
store results of PSA in detector signals
Definition: KVQH1.cpp:153
virtual ~KVQH1()
Destructor.
Definition: KVQH1.cpp:55
void Copy(TObject &obj) const
Definition: KVQH1.cpp:71
virtual void LoadPSAParameters()
Definition: KVQH1.cpp:98
KVQH1()
Definition: KVQH1.cpp:34
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