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