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