file access optimized (thanks to Laurent)
[u/mrichter/AliRoot.git] / ITS / AliITSresponseSDD.h
CommitLineData
b0f5e3fc 1#ifndef ALIITSRESPONSESDD_H
2#define ALIITSRESPONSESDD_H
48058160 3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/*
8 $Id$
9*/
88cb7938 10
7551c5b2 11#include "TArrayF.h"
b0f5e3fc 12#include "AliITSresponse.h"
13
14// response for SDD
15
48058160 16class AliITSresponseSDD : public AliITSresponse {
aacedc3e 17 public:
18 //
19 // Configuration methods
20 //
48058160 21 AliITSresponseSDD();
22 AliITSresponseSDD(const char *dataType);
23 virtual ~AliITSresponseSDD();
7551c5b2 24
aacedc3e 25 // Implementation of virtual member functions declared in AliITSresponse
703a4e51 26 virtual void SetElectronics(Int_t p1=1)
27 {fElectronics=p1; /* Electronics: Pascal (1) or OLA (2) */ }
28 virtual Int_t Electronics() const {// Electronics: 1 = Pascal; 2 = OLA
48058160 29 return fElectronics;}
aacedc3e 30 virtual void SetMaxAdc(Double_t p1) {// Adc-count saturation value
48058160 31 fMaxAdc=p1;}
aacedc3e 32 virtual Double_t MaxAdc() const {// Get maximum Adc-count value
48058160 33 return fMaxAdc;}
aacedc3e 34 virtual void SetChargeLoss(Double_t p1) {
48058160 35 // Set Linear Charge Loss Steepness // 0.01 for 20%
36 fChargeLoss=p1;}
aacedc3e 37 Double_t ChargeLoss() const {// Get Charge Loss Coefficient
48058160 38 return fChargeLoss;}
aacedc3e 39 virtual void SetDynamicRange(Double_t p1) {// Set Dynamic Range
703a4e51 40 fDynamicRange = p1;}
aacedc3e 41 virtual Double_t DynamicRange() const {// Get Dynamic Range
48058160 42 return fDynamicRange;}
703a4e51 43 // Diffusion coefficients
aacedc3e 44 virtual void SetDiffCoeff(Double_t p1, Double_t p2)
703a4e51 45 {fDiffCoeff=p1;fDiffCoeff1=p2;}
46 // Get diffusion coefficients
aacedc3e 47 virtual void DiffCoeff(Double_t&diff,Double_t&diff1) const
703a4e51 48 {diff = fDiffCoeff;diff1 = fDiffCoeff1;}
aacedc3e 49 virtual void SetDriftSpeed(Double_t p1) {// Drift velocity
48058160 50 fDriftSpeed=p1;}
aacedc3e 51 virtual Double_t DriftSpeed() const {// drift speed
48058160 52 return fDriftSpeed;}
703a4e51 53 virtual void SetParamOptions(const char *opt1,const char *opt2){
48058160 54 // Parameters: "same" or read from "file"
55 fParam1=opt1; fParam2=opt2;}
703a4e51 56 virtual void ParamOptions(char *opt1,char *opt2) const {// options
48058160 57 strcpy(opt1,fParam1.Data()); strcpy(opt2,fParam2.Data());}
aacedc3e 58 virtual void SetNoiseParam(Double_t n, Double_t b){
48058160 59 // Noise and baseline // 10 for ALICE with beam test measurements 2001
60 fNoise=n; fBaseline=b;}
aacedc3e 61 // get noise param
62 virtual void GetNoiseParam(Double_t &n, Double_t &b) const
63 {n=fNoise; b=fBaseline;}
703a4e51 64 virtual Bool_t Do10to8() const {// get 10 to 8 compression option
65 return fBitComp;}
66 void SetZeroSupp (const char *opt) {
67 // Zero-suppression option - could be 1D, 2D or non-ZS
68 fOption=opt;}
69 const char *ZeroSuppOption() const {// Get zero-suppression option
70 return fOption.Data();}
aacedc3e 71 virtual void SetThresholds(Double_t mv, Double_t /* b */){
703a4e51 72 // Min value used in 2D - could be used as a threshold setting
73 fMinVal = mv;}
aacedc3e 74 virtual void Thresholds(Double_t & mv, Double_t & /* b */) const
703a4e51 75 {mv = fMinVal;}
76 virtual void GiveCompressParam(Int_t *x) const;
77 // Detector type response methods
aacedc3e 78 virtual void SetNSigmaIntegration(Double_t p1) {
703a4e51 79 // Set number of sigmas over which cluster disintegration is performed
80 fNsigmas=p1;}
aacedc3e 81 virtual Double_t NSigmaIntegration() const {
703a4e51 82 // Get number of sigmas over which cluster disintegration is performed
83 return fNsigmas;}
84 virtual void SetNLookUp(Int_t p1);
85 // Get number of intervals in which the gaussian lookup table is divided
86 virtual Int_t GausNLookUp() const {return fNcomps;}
aacedc3e 87 virtual Double_t GausLookUp(Int_t i) const {
703a4e51 88 if(i<0 || i>=fNcomps) return 0.;return fGaus->At(i);}
89
90//Declaration of member functions peculiar to this class
7f1a504b 91 Int_t Convert8to10(Int_t signal) const; //undo 10 to 8 bit SDD compresion
aacedc3e 92 void SetNoiseAfterElectronics(Double_t n=2.38){
48058160 93 // Noise after electronics (ADC units)
94 // 2.36 for ALICE from beam test measurements 2001
95 fNoiseAfterEl=n;}
aacedc3e 96 Double_t GetNoiseAfterElectronics() const {
48058160 97 // Noise after electronics (ADC units)
98 return fNoiseAfterEl;}
aacedc3e 99 void SetJitterError(Double_t jitter=20) {
48058160 100 // set Jitter error (20 um for ALICE from beam test measurements 2001)
101 fJitterError=jitter;}
aacedc3e 102 Double_t JitterError() const {// set Jitter error
48058160 103 return fJitterError;}
104 void SetDo10to8(Bool_t bitcomp=kTRUE) {
105 // set the option for 10 to 8 bit compression
106 fBitComp = bitcomp;}
48058160 107 // Compression parameters
108 void SetCompressParam(Int_t cp[8]);
48058160 109 void SetDeadChannels(Int_t nmodules=0, Int_t nchips=0, Int_t nchannels=0);
703a4e51 110 Int_t GetDeadModules() const { return fDeadModules; }
111 Int_t GetDeadChips() const { return fDeadChips; }
112 Int_t GetDeadChannels() const { return fDeadChannels; }
aacedc3e 113 Double_t Gain(Int_t mod,Int_t chip,Int_t ch)const
114 {return fGain[mod][chip][ch]; }
48058160 115 // these functions should be move to AliITSsegmentationSDD
17323043 116 Int_t Modules()const{return fgkModules;}//Total number of SDD modules
117 Int_t Chips() const{return fgkChips;} // Number of chips/module
118 Int_t Channels() const{ return fgkChannels;}//Number of channels/chip
48058160 119 //********
120 void PrintGains();
121 void Print();
d2f55a22 122 virtual void Print(ostream *os) const {AliITSresponseSDD::Print(os);}
123 virtual void Print(Option_t *option="") const {AliITSresponseSDD::Print(option);}
703a4e51 124 // not implemented virtual methods (devlared in the mother class
aacedc3e 125 virtual void SetDetParam(Double_t *)
703a4e51 126 {NotImplemented("SetDetParam");}
aacedc3e 127 virtual void GetDetParam(Double_t *) const
703a4e51 128 {NotImplemented("GetDetParam");}
129 virtual void SetNDetParam(Int_t /* n */)
130 {NotImplemented("SetNDetParam");}
131 virtual Int_t NDetParam() const
132 {NotImplemented("NDetParam"); return 0;}
aacedc3e 133 virtual void SetSigmaSpread(Double_t, Double_t)
703a4e51 134 {NotImplemented("SetSigmaSpread");}
aacedc3e 135 virtual void SigmaSpread(Double_t & /* p1 */,Double_t & /* p2 */) const
703a4e51 136 {NotImplemented("SigmaSpread");}
2aea926d 137
48058160 138 protected:
139 // these statis const should be move to AliITSsegmentationSDD
703a4e51 140 static const Int_t fgkModules = 520; // Total number of SDD modules
141 static const Int_t fgkChips = 4; // Number of chips/module
142 static const Int_t fgkChannels = 64; // Number of channels/chip
48058160 143 //*******
703a4e51 144 static const Int_t fgkMaxAdcDefault; // default for fMaxAdc
aacedc3e 145 static const Double_t fgkDynamicRangeDefault; // default for fDynamicRange
146 static const Double_t fgkfChargeLossDefault; // default for fChargeLoss
147 static const Double_t fgkDiffCoeffDefault; // default for fDiffCoeff
148 static const Double_t fgkDiffCoeff1Default; // default for fDiffCoeff1
149 static const Double_t fgkTemperatureDefault; // default for fT (Kelvin)
703a4e51 150 static const TString fgkParam1Default; // default for fParam1
151 static const TString fgkParam2Default; // default for fParam2
aacedc3e 152 static const Double_t fgkNoiseDefault; // default for fNoise
153 static const Double_t fgkBaselineDefault; // default for fBaseline
703a4e51 154 static const TString fgkOptionDefault; // default for fOption
aacedc3e 155 static const Double_t fgkMinValDefault; // default for fMinVal
156 static const Double_t fgkDriftSpeedDefault; // default for fDriftSpeed
157 static const Double_t fgkNsigmasDefault; //default for fNsigmas
703a4e51 158 static const Int_t fgkNcompsDefault; //default for fNcomps
159 //
160
48058160 161 Int_t fDeadModules; // Total number of dead SDD modules
162 Int_t fDeadChips; // Number of dead chips
163 Int_t fDeadChannels; // Number of dead channels
aacedc3e 164 Double_t fGain[fgkModules][fgkChips][fgkChannels];//Array for channel gains
48058160 165 Int_t fCPar[8]; // Hardware compression parameters
aacedc3e 166 Double_t fNoise; // Noise
167 Double_t fBaseline; // Baseline
168 Double_t fNoiseAfterEl; // Noise after electronics
169 Double_t fJitterError; // jitter error
170 Double_t fDynamicRange; // Set Dynamic Range
171 Double_t fChargeLoss; // Set Linear Coefficient for Charge Loss
172 Double_t fDriftSpeed; // Drift velocity
48058160 173 Int_t fElectronics; // Electronics
aacedc3e 174 Double_t fMaxAdc; // Adc saturation value
175 Double_t fDiffCoeff; // Diffusion Coefficient (scaling the time)
176 Double_t fDiffCoeff1; // Diffusion Coefficient (constant term)
177 Double_t fNsigmas; // Number of sigmas over which charge disintegration
48058160 178 // is performed
179 TArrayF *fGaus; // Gaussian lookup table for signal generation
180 Int_t fNcomps; // Number of samplings along the gaussian
aacedc3e 181 Double_t fMinVal; // Min value used in 2D zero-suppression algo
48058160 182 Bool_t fBitComp; // 10 to 8 bit compression option
183 TString fOption; // Zero-suppresion option (1D, 2D or none)
184 TString fParam1; // Read baselines from file option
185 TString fParam2; // Read compression algo thresholds from file
703a4e51 186
187 private:
188 AliITSresponseSDD(const AliITSresponseSDD &ob); // copy constructor
189 AliITSresponseSDD& operator=(const AliITSresponseSDD & /* source */); // ass. op.
190
fa1750f9 191
73967338 192 ClassDef(AliITSresponseSDD,4) // SDD response
50d05d7b 193
194 };
b0f5e3fc 195#endif