HLT build system fix
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSDD.h
CommitLineData
fcf95fc7 1#ifndef ALIITSCALIBRATIONSDD_H
2#define ALIITSCALIBRATIONSDD_H
3
c2bd28b6 4/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
fcf95fc7 5 * See cxx source for full Copyright notice */
6
c2bd28b6 7/* $Id$ */
fcf95fc7 8
9#include "AliITSCalibration.h"
10#include "AliITSresponseSDD.h"
f45f6658 11#include "TArrayI.h"
fcf95fc7 12
028a3709 13class AliITSMapSDD;
fcf95fc7 14class AliITSresponseSDD;
15///////////////////////////////////////////////////////
16// Response for SDD //
17///////////////////////////////////////////////////////
18
19class AliITSCalibrationSDD : public AliITSCalibration {
20 public:
21 //
22 // Configuration methods
23 //
24 AliITSCalibrationSDD();
25 AliITSCalibrationSDD(const char *dataType);
028a3709 26 virtual ~AliITSCalibrationSDD();
f45f6658 27 virtual void SetNoiseParam(Double_t /*n*/, Double_t /*b*/){
28 NotImplemented("SetNoiseParam");}
fcf95fc7 29
f45f6658 30 virtual void GetNoiseParam(Double_t &/*n*/, Double_t &/*b*/) const {
31 NotImplemented("GetNoiseParam");}
32
4bfbde86 33 virtual Float_t GetBaseline(Int_t anode) const {return fBaseline[anode];}
f45f6658 34 virtual void SetBaseline(Int_t anode,Double_t bas) {fBaseline[anode]=bas;}
4bfbde86 35 virtual Float_t GetNoise(Int_t anode) const {return fNoise[anode];}
f45f6658 36 virtual void SetNoise(Int_t anode, Double_t noise) {fNoise[anode]=noise;}
fcf95fc7 37
38 virtual void SetThresholds(Double_t mv, Double_t /* b */){
39 // Min value used in 2D - could be used as a threshold setting
40 fMinVal = mv;}
41 virtual void Thresholds(Double_t & mv, Double_t & /* b */) const
42 {mv = fMinVal;}
f45f6658 43 virtual void GiveCompressParam(Int_t *x,Int_t ian) const;
fcf95fc7 44
f45f6658 45 void SetNoiseAfterElectronics(Int_t anode,Double_t n=2.38){
fcf95fc7 46 // Noise after electronics (ADC units)
47 // 2.36 for ALICE from beam test measurements 2001
f45f6658 48 fNoiseAfterEl[anode]=n;}
4bfbde86 49 Float_t GetNoiseAfterElectronics(Int_t anode) const {
fcf95fc7 50 // Noise after electronics (ADC units)
f45f6658 51 return fNoiseAfterEl[anode];}
52 //void SetDeadChannels(Int_t nchips=0, Int_t nchannels=0);
53 void SetDeadChannels(Int_t ndead=0){fDeadChannels=ndead; fBadChannels.Set(ndead);}
fcf95fc7 54 Int_t GetDeadChips() const { return fDeadChips; }
55 Int_t GetDeadChannels() const { return fDeadChannels; }
4bfbde86 56 Float_t Gain(Int_t wing,Int_t chip,Int_t ch)const
fcf95fc7 57 {return fGain[wing][chip][ch]; }
f45f6658 58 virtual void SetGain(Double_t g,Int_t wing,Int_t chip, Int_t ch)
59 {fGain[wing][chip][ch]=g;}
60
fcf95fc7 61 void PrintGains() const;
62 void Print();
63 virtual void Print(ostream *os) const {AliITSCalibrationSDD::Print(os);}
64 virtual void Print(Option_t *option="") const {AliITSCalibrationSDD::Print(option);}
65 // not implemented virtual methods (devlared in the mother class
66 virtual void SetDetParam(Double_t *)
67 {NotImplemented("SetDetParam");}
68 virtual void GetDetParam(Double_t *) const
69 {NotImplemented("GetDetParam");}
70 virtual void SetNDetParam(Int_t /* n */)
71 {NotImplemented("SetNDetParam");}
72 virtual Int_t NDetParam() const
73 {NotImplemented("NDetParam"); return 0;}
74 virtual void SetSigmaSpread(Double_t, Double_t)
75 {NotImplemented("SetSigmaSpread");}
76 virtual void SigmaSpread(Double_t & /* p1 */,Double_t & /* p2 */) const
77 {NotImplemented("SigmaSpread");}
78
79 void SetDead() { fIsDead = kTRUE; };
80 Bool_t IsDead() const { return fIsDead; };
81 Int_t Wings()const{return fgkWings;}//Total number of SDD wings
82 Int_t Chips() const{return fgkChips;} // Number of chips/module
83 Int_t Channels() const{ return fgkChannels;}//Number of channels/chip
f45f6658 84
85 virtual void SetBadChannel(Int_t i,Int_t anode);
86 Int_t GetBadChannel(Int_t i) const {return fBadChannels[i];}
87 Bool_t IsBadChannel(Int_t anode);
fcf95fc7 88
028a3709 89 Float_t GetMapACell(Int_t i,Int_t j) const {
90 if(i<256) return fMapAW0->GetCellContent(i,j);
91 else return fMapAW1->GetCellContent(i,j);
92 }
93 virtual void SetMapA(Int_t wing,AliITSMapSDD* mapA) {
94 if(wing==0) fMapAW0=mapA;
95 else fMapAW1=mapA;
96 }
97 Float_t GetMapTCell(Int_t i,Int_t j) const {
98 if(i<256) return fMapTW0->GetCellContent(i,j);
99 else return fMapTW1->GetCellContent(i,j);
100 }
101 virtual void SetMapT(Int_t wing,AliITSMapSDD* mapT) {
102 if(wing==0) fMapTW0=mapT;
103 else fMapTW1=mapT;
104 }
03ecfe88 105 static Int_t GetMapTimeNBin() {return fgkMapTimeNBin;}
5bfe44ce 106
fcf95fc7 107 virtual void SetElectronics(Int_t p1=1) {((AliITSresponseSDD*)fResponse)->SetElectronics(p1);}
108 virtual Int_t GetElectronics() const {return ((AliITSresponseSDD*)fResponse)->Electronics();}
109 virtual void SetMaxAdc(Double_t p1) {((AliITSresponseSDD*)fResponse)->SetMaxAdc(p1);}
4bfbde86 110 virtual Float_t GetMaxAdc() const {return ((AliITSresponseSDD*)fResponse)->MaxAdc();}
fcf95fc7 111 virtual void SetChargeLoss(Double_t p1) {((AliITSresponseSDD*)fResponse)->SetChargeLoss(p1);}
4bfbde86 112 virtual Float_t GetChargeLoss() const {return ((AliITSresponseSDD*)fResponse)->ChargeLoss();}
fcf95fc7 113 virtual void SetDynamicRange(Double_t p1) {((AliITSresponseSDD*)fResponse)->SetDynamicRange(p1);}
4bfbde86 114 virtual Float_t GetDynamicRange() const {return ((AliITSresponseSDD*)fResponse)->DynamicRange();}
fcf95fc7 115 virtual void SetDriftSpeed(Double_t p1) {((AliITSresponseSDD*)fResponse)->SetDriftSpeed(p1);}
c2bd28b6 116 virtual void SetDriftSpeedParam(Int_t iWing, Float_t* p);
a66a0eb6 117 virtual Float_t GetTimeOffset() const {return ((AliITSresponseSDD*)fResponse)->TimeOffset();}
118 virtual Float_t GetADC2keV() const {return ((AliITSresponseSDD*)fResponse)->ADC2keV();}
4bfbde86 119 virtual Float_t GetDriftSpeed() const {return ((AliITSresponseSDD*)fResponse)->DriftSpeed();}
c2bd28b6 120 virtual Float_t GetDriftSpeedAtAnode(Float_t nAnode) const {
121 if(nAnode<256){
122 return fDriftVelParW0[0]+fDriftVelParW0[1]*nAnode+fDriftVelParW0[2]*nAnode*nAnode+fDriftVelParW0[3]*nAnode*nAnode*nAnode;
123 }else{
124 nAnode-=256;
125 return fDriftVelParW1[0]+fDriftVelParW1[1]*nAnode+fDriftVelParW1[2]*nAnode*nAnode+fDriftVelParW1[3]*nAnode*nAnode*nAnode;
126 }
127 }
fcf95fc7 128 virtual void SetParamOptions(const char *opt1,const char *opt2) {((AliITSresponseSDD*)fResponse)->SetParamOptions(opt1,opt2);}
129 virtual void GetParamOptions(char *opt1,char *opt2) const {((AliITSresponseSDD*)fResponse)->ParamOptions(opt1,opt2);}
130 virtual Bool_t Do10to8() const {return ((AliITSresponseSDD*)fResponse)->Do10to8();}
131 virtual void SetZeroSupp (const char *opt) {((AliITSresponseSDD*)fResponse)->SetZeroSupp(opt);}
132 virtual const char *GetZeroSuppOption() const {return ((AliITSresponseSDD*)fResponse)->ZeroSuppOption();}
133 virtual void SetNSigmaIntegration(Double_t p1) {((AliITSresponseSDD*)fResponse)->SetNSigmaIntegration(p1);}
4bfbde86 134 virtual Float_t GetNSigmaIntegration() const {return ((AliITSresponseSDD*)fResponse)->NSigmaIntegration();}
fcf95fc7 135 virtual void SetNLookUp(Int_t p1) {((AliITSresponseSDD*)fResponse)->SetNLookUp(p1);}
136 virtual Int_t GetGausNLookUp() const {return ((AliITSresponseSDD*)fResponse)->GausNLookUp();}
4bfbde86 137 virtual Float_t GetGausLookUp(Int_t i) const {return ((AliITSresponseSDD*)fResponse)->GausLookUp(i);}
fcf95fc7 138 virtual Int_t Convert8to10(Int_t signal) const {return ((AliITSresponseSDD*)fResponse)->Convert8to10(signal);}
139 virtual void SetJitterError(Double_t jitter=20) {((AliITSresponseSDD*)fResponse)->SetJitterError(jitter);}
4bfbde86 140 virtual Float_t GetJitterError() const {return ((AliITSresponseSDD*)fResponse)->JitterError();}
404c1c29 141 virtual Float_t GetDriftPath(Float_t time,Float_t /*anodecoord*/) const {return time*GetDriftSpeed();}
142 virtual Float_t GetThresholdAnode(Int_t anode,Int_t nsigma=3) const {
9e4d7193 143 return nsigma*fNoiseAfterEl[anode];}
404c1c29 144
fcf95fc7 145 virtual void SetDo10to8(Bool_t bitcomp=kTRUE) {((AliITSresponseSDD*)fResponse)->SetDo10to8(bitcomp);}
146 protected:
5bfe44ce 147
148
fcf95fc7 149 // these statis const should be move to AliITSsegmentationSDD
150 static const Int_t fgkWings = 2; // Number of wings per module
151 static const Int_t fgkChips = 4; // Number of chips/module
152 static const Int_t fgkChannels = 64; // Number of channels/chip
4bfbde86 153 static const Float_t fgkTemperatureDefault; // default for fT (Kelvin)
154 static const Float_t fgkNoiseDefault; // default for fNoise
155 static const Float_t fgkBaselineDefault; // default for fBaseline
156 static const Float_t fgkMinValDefault; // default for fMinVal
157 static const Float_t fgkGainDefault; //default for gain
5bfe44ce 158 static const Int_t fgkMapTimeNBin = 72; //map granularity along drift direction
fcf95fc7 159 Int_t fDeadChips; // Number of dead chips
160 Int_t fDeadChannels; // Number of dead channels
4bfbde86 161 Float_t fGain[fgkWings][fgkChips][fgkChannels];//Array for channel gains
162 Float_t fNoise[fgkWings*fgkChips*fgkChannels]; // Noise array
163 Float_t fBaseline[fgkWings*fgkChips*fgkChannels]; // Baseline array
164 Float_t fNoiseAfterEl[fgkWings*fgkChips*fgkChannels]; // Noise after electronics
165 Float_t fMinVal; // Min value used in 2D zero-suppression algo
fcf95fc7 166
f45f6658 167 Bool_t fIsDead; // module is dead or alive ?
168 TArrayI fBadChannels; //Array with bad anodes number (0-512)
c2bd28b6 169
170 Float_t fDriftVelParW0[4]; // Coeff. of pol3 fit to drift speed vs. anode (wing0)
171 Float_t fDriftVelParW1[4]; // Coeff. of pol3 fit to drift speed vs. anode (wing1)
172
028a3709 173 AliITSMapSDD* fMapAW0; //! map of residuals on anode coord. wing 0
174 AliITSMapSDD* fMapAW1; //! map of residuals on anode coord. wing 1
175 AliITSMapSDD* fMapTW0; //! map of residuals on time coord. wing 0
176 AliITSMapSDD* fMapTW1; //! map of residuals on time coord. wing 1
177
5bfe44ce 178
fcf95fc7 179 private:
180 AliITSCalibrationSDD(const AliITSCalibrationSDD &ob); // copy constructor
181 AliITSCalibrationSDD& operator=(const AliITSCalibrationSDD & /* source */); // ass. op.
182
183
c2bd28b6 184 ClassDef(AliITSCalibrationSDD,7) // SDD response
fcf95fc7 185
186 };
187#endif