]>
Commit | Line | Data |
---|---|---|
b0f5e3fc | 1 | #ifndef ALIITSRESPONSESDD_H |
2 | #define ALIITSRESPONSESDD_H | |
3 | ||
7551c5b2 | 4 | #include "TArrayF.h" |
5 | #include <TString.h> | |
6 | #include <iostream.h> | |
b0f5e3fc | 7 | #include "AliITSresponse.h" |
8 | ||
9 | // response for SDD | |
10 | ||
11 | class AliITSresponseSDD : | |
12 | public AliITSresponse { | |
13 | public: | |
14 | // | |
15 | // Configuration methods | |
16 | // | |
17 | ||
18 | AliITSresponseSDD(); | |
19 | virtual ~AliITSresponseSDD() { | |
20 | // destructor | |
21 | } | |
22 | AliITSresponseSDD(const AliITSresponseSDD &source); // copy constructor | |
23 | AliITSresponseSDD& operator=(const AliITSresponseSDD &source); // ass. op. | |
7551c5b2 | 24 | |
25 | virtual void SetElectronics(Int_t p1=1) { | |
26 | // Electronics: Pascal or OLA | |
27 | fElectronics=p1; | |
28 | } | |
29 | ||
30 | virtual Int_t Electronics() { | |
31 | // Electronics: 1 = Pascal; 2 = OLA | |
32 | return fElectronics; | |
33 | } | |
b0f5e3fc | 34 | |
7551c5b2 | 35 | virtual void SetMaxAdc(Float_t p1=1024.) { |
b0f5e3fc | 36 | // Adc-count saturation value |
37 | fMaxAdc=p1; | |
38 | } | |
39 | virtual Float_t MaxAdc() { | |
40 | // Get maximum Adc-count value | |
41 | return fMaxAdc; | |
42 | } | |
43 | ||
7551c5b2 | 44 | virtual void SetChargeLoss(Float_t p1=0.01) { |
45 | // Set Linear Charge Loss Steepness | |
46 | fChargeLoss=p1; | |
b0f5e3fc | 47 | } |
7551c5b2 | 48 | virtual Float_t ChargeLoss() { |
49 | // Get Charge Loss Coefficient | |
50 | return fChargeLoss; | |
b0f5e3fc | 51 | } |
52 | ||
7551c5b2 | 53 | virtual void SetDynamicRange(Float_t p1=132.) { |
54 | // Set Dynamic Range | |
55 | fDynamicRange=p1; | |
56 | } | |
57 | virtual Float_t DynamicRange() { | |
58 | // Get Dynamic Range | |
59 | return fDynamicRange; | |
60 | } | |
61 | ||
62 | virtual void SetDiffCoeff(Float_t p1=3.23,Float_t p2=30.) { | |
e8189707 | 63 | // Diffusion coefficients |
b0f5e3fc | 64 | fDiffCoeff=p1; |
e8189707 | 65 | fDiffCoeff1=p2; |
b0f5e3fc | 66 | } |
e8189707 | 67 | virtual void DiffCoeff(Float_t&diff,Float_t&diff1) { |
68 | // Get diffusion coefficients | |
69 | diff = fDiffCoeff; | |
70 | diff1 = fDiffCoeff1; | |
b0f5e3fc | 71 | } |
72 | ||
7551c5b2 | 73 | virtual void SetDriftSpeed(Float_t p1=7.3) { |
b0f5e3fc | 74 | // Drift velocity |
75 | fDriftSpeed=p1; | |
76 | } | |
77 | virtual Float_t DriftSpeed() { | |
78 | // drift speed | |
79 | return fDriftSpeed; | |
80 | } | |
81 | ||
82 | virtual void SetTemperature(Float_t p1=23.) { | |
83 | // Temperature | |
84 | fTemperature=p1; | |
85 | } | |
86 | virtual Float_t Temperature() { | |
87 | // Get temperature | |
88 | return fTemperature; | |
89 | } | |
90 | ||
e8189707 | 91 | virtual void SetDataType(const char *data="simulated") { |
b0f5e3fc | 92 | // Type of data - real or simulated |
93 | fDataType=data; | |
94 | } | |
e8189707 | 95 | virtual const char *DataType() const { |
b0f5e3fc | 96 | // Get data type |
e8189707 | 97 | return fDataType.Data(); |
b0f5e3fc | 98 | } |
99 | ||
e8189707 | 100 | virtual void SetParamOptions(const char *opt1="same",const char *opt2="same"){ |
b0f5e3fc | 101 | // Parameters: "same" or read from "file" |
102 | fParam1=opt1; fParam2=opt2; | |
103 | } | |
e8189707 | 104 | virtual void ParamOptions(char *opt1,char *opt2) { |
b0f5e3fc | 105 | // options |
e8189707 | 106 | strcpy(opt1,fParam1.Data()); strcpy(opt2,fParam2.Data()); |
b0f5e3fc | 107 | } |
108 | ||
7551c5b2 | 109 | virtual void SetNoiseParam(Float_t n=8.3, Float_t b=20.){ |
b0f5e3fc | 110 | // Noise and baseline |
111 | fNoise=n; fBaseline=b; | |
112 | } | |
7551c5b2 | 113 | virtual void SetNoiseAfterElectronics(Float_t n=1.6){ |
114 | // Noise after electronics (ADC units) | |
115 | fNoiseAfterEl=n; | |
116 | } | |
b0f5e3fc | 117 | virtual void GetNoiseParam(Float_t &n, Float_t &b) { |
118 | // get noise param | |
119 | n=fNoise; b=fBaseline; | |
fa1750f9 | 120 | } |
7551c5b2 | 121 | virtual Float_t GetNoiseAfterElectronics(){ |
122 | // Noise after electronics (ADC units) | |
123 | return fNoiseAfterEl; | |
124 | } | |
fa1750f9 | 125 | |
126 | virtual void SetDo10to8(Bool_t bitcomp=kTRUE) { | |
127 | // set the option for 10 to 8 bit compression | |
128 | fBitComp = bitcomp; | |
129 | } | |
130 | ||
131 | Bool_t Do10to8() { | |
132 | // get 10 to 8 compression option | |
133 | return fBitComp; | |
b0f5e3fc | 134 | } |
135 | ||
7551c5b2 | 136 | virtual void SetZeroSupp (const char *opt="1D") { |
b0f5e3fc | 137 | // Zero-suppression option - could be 1D, 2D or non-ZS |
138 | fOption=opt; | |
139 | } | |
e8189707 | 140 | virtual const char *ZeroSuppOption() const { |
b0f5e3fc | 141 | // Get zero-suppression option |
e8189707 | 142 | return fOption.Data(); |
b0f5e3fc | 143 | } |
144 | virtual void SetMinVal(Int_t mv=4) { | |
145 | // Min value used in 2D - could be used as a threshold setting | |
146 | fMinVal = mv; | |
147 | } | |
148 | virtual Int_t MinVal() { | |
149 | // min val | |
150 | return fMinVal; | |
151 | } | |
152 | ||
e8189707 | 153 | virtual void SetFilenames(const char *f1="",const char *f2="",const char *f3="") { |
b0f5e3fc | 154 | // Set filenames - input, output, parameters .... |
155 | fFileName1=f1; fFileName2=f2; fFileName3=f3; | |
156 | } | |
e8189707 | 157 | virtual void Filenames(char *input,char *baseline,char *param) { |
b0f5e3fc | 158 | // Filenames |
e8189707 | 159 | strcpy(input,fFileName1.Data()); strcpy(baseline,fFileName2.Data()); |
160 | strcpy(param,fFileName3.Data()); | |
b0f5e3fc | 161 | } |
162 | ||
163 | ||
164 | virtual void SetOutputOption(Bool_t write=kFALSE) { | |
165 | // set output option | |
166 | fWrite = write; | |
167 | } | |
168 | Bool_t OutputOption() { | |
169 | // output option | |
170 | return fWrite; | |
171 | } | |
172 | // | |
173 | // Compression parameters | |
174 | virtual void SetCompressParam(Int_t cp[8]); | |
175 | void GiveCompressParam(Int_t *x); | |
176 | ||
177 | // | |
178 | // Detector type response methods | |
7551c5b2 | 179 | virtual void SetNSigmaIntegration(Float_t p1=3.) { |
b0f5e3fc | 180 | // Set number of sigmas over which cluster disintegration is performed |
e8189707 | 181 | fNsigmas=p1; |
b0f5e3fc | 182 | } |
183 | virtual Float_t NSigmaIntegration() { | |
184 | // Get number of sigmas over which cluster disintegration is performed | |
e8189707 | 185 | return fNsigmas; |
b0f5e3fc | 186 | } |
7551c5b2 | 187 | virtual void SetNLookUp(Int_t p1=121) { |
188 | // Set number of sigmas over which cluster disintegration is performed | |
189 | fNcomps=p1; | |
190 | fGaus = new TArrayF(fNcomps+1); | |
191 | for(Int_t i=0; i<=fNcomps; i++) { | |
192 | Float_t x = -fNsigmas + (2.*i*fNsigmas)/(fNcomps-1); | |
193 | (*fGaus)[i] = exp(-((x*x)/2)); | |
194 | // cout << "fGaus[" << i << "]: " << fGaus->At(i) << endl; | |
195 | } | |
196 | } | |
197 | virtual Int_t GausNLookUp() { | |
198 | // Get number of intervals in which the gaussian lookup table is divided | |
199 | return fNcomps; | |
200 | } | |
b0f5e3fc | 201 | virtual void SetSigmaSpread(Float_t p1, Float_t p2) { |
202 | // Set sigmas of the charge spread function | |
203 | } | |
204 | virtual void SigmaSpread(Float_t &s1, Float_t &s2) { | |
205 | // Get sigmas for the charge spread | |
206 | } | |
207 | ||
208 | virtual Float_t IntPH(Float_t eloss) { | |
209 | // Pulse height from scored quantity (eloss) | |
210 | return 0.; | |
211 | } | |
212 | virtual Float_t IntXZ(AliITSsegmentation *) { | |
213 | // Charge disintegration | |
214 | return 0.; | |
215 | } | |
7551c5b2 | 216 | virtual Float_t GausLookUp(Int_t i) { |
217 | if(i<0 || i>=fNcomps) return 0.; | |
218 | return fGaus->At(i); | |
219 | } | |
220 | virtual void Print(); | |
221 | ||
b0f5e3fc | 222 | protected: |
223 | ||
224 | Int_t fCPar[8]; // Hardware compression parameters | |
b0f5e3fc | 225 | Float_t fNoise; // Noise |
226 | Float_t fBaseline; // Baseline | |
7551c5b2 | 227 | Float_t fNoiseAfterEl; // Noise after electronics |
228 | Float_t fDynamicRange; // Set Dynamic Range | |
229 | Float_t fChargeLoss; // Set Linear Coefficient for Charge Loss | |
b0f5e3fc | 230 | Float_t fTemperature; // Temperature |
231 | Float_t fDriftSpeed; // Drift velocity | |
7551c5b2 | 232 | Int_t fElectronics; // Electronics |
b0f5e3fc | 233 | |
234 | Float_t fMaxAdc; // Adc saturation value | |
e8189707 | 235 | Float_t fDiffCoeff; // Diffusion Coefficient (scaling the time) |
236 | Float_t fDiffCoeff1; // Diffusion Coefficient (constant term) | |
237 | Float_t fNsigmas; // Number of sigmas over which charge disintegration | |
238 | // is performed | |
7551c5b2 | 239 | TArrayF *fGaus; // Gaussian lookup table for signal generation |
240 | Int_t fNcomps; // Number of samplings along the gaussian | |
b0f5e3fc | 241 | |
242 | Int_t fZeroSuppFlag; // Zero-suppression flag | |
243 | Int_t fMinVal; // Min value used in 2D zero-suppression algo | |
244 | ||
245 | Bool_t fWrite; // Write option for the compression algorithms | |
fa1750f9 | 246 | Bool_t fBitComp; // 10 to 8 bit compression option |
247 | ||
e8189707 | 248 | TString fOption; // Zero-suppresion option (1D, 2D or none) |
249 | TString fParam1; // Read baselines from file option | |
250 | TString fParam2; // Read compression algo thresholds from file | |
251 | ||
252 | TString fDataType; // data type - real or simulated | |
253 | TString fFileName1; // input keys : run, module # | |
254 | TString fFileName2; // baseline & noise val or output coded // signal or monitored bgr. | |
255 | TString fFileName3; // param values or output coded signal | |
b0f5e3fc | 256 | |
257 | ClassDef(AliITSresponseSDD,1) // SDD response | |
258 | ||
259 | }; | |
260 | #endif | |
261 | ||
262 | ||
263 | ||
264 | ||
265 | ||
266 | ||
267 |