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