]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSCalibrationSDD.h
Added script to draw calibrated raw data
[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"
c9a38d3d 10#include "AliITSsegmentationSDD.h"
f45f6658 11#include "TArrayI.h"
fcf95fc7 12
54af1add 13class AliITSCorrMapSDD;
18da6e54 14class AliITSDriftSpeedArraySDD;
253e68a0 15
fcf95fc7 16///////////////////////////////////////////////////////
17// Response for SDD //
18///////////////////////////////////////////////////////
19
20class AliITSCalibrationSDD : public AliITSCalibration {
21 public:
22 //
23 // Configuration methods
24 //
25 AliITSCalibrationSDD();
26 AliITSCalibrationSDD(const char *dataType);
028a3709 27 virtual ~AliITSCalibrationSDD();
f45f6658 28
4bfbde86 29 virtual Float_t GetBaseline(Int_t anode) const {return fBaseline[anode];}
f45f6658 30 virtual void SetBaseline(Int_t anode,Double_t bas) {fBaseline[anode]=bas;}
4bfbde86 31 virtual Float_t GetNoise(Int_t anode) const {return fNoise[anode];}
f45f6658 32 virtual void SetNoise(Int_t anode, Double_t noise) {fNoise[anode]=noise;}
fcf95fc7 33
20f3f947 34 virtual void GiveCompressParam(Int_t *x) const;
35
36 void SetZSLowThreshold(Int_t iWing, Int_t thr=25){fZSTL[iWing]=thr;}
37 void SetZSHighThreshold(Int_t iWing, Int_t thr=29){fZSTH[iWing]=thr;}
38 Int_t GetZSLowThreshold(Int_t iWing) const {return fZSTL[iWing];}
39 Int_t GetZSHighThreshold(Int_t iWing) const {return fZSTH[iWing];}
fcf95fc7 40
f45f6658 41 void SetNoiseAfterElectronics(Int_t anode,Double_t n=2.38){
fcf95fc7 42 // Noise after electronics (ADC units)
43 // 2.36 for ALICE from beam test measurements 2001
f45f6658 44 fNoiseAfterEl[anode]=n;}
4bfbde86 45 Float_t GetNoiseAfterElectronics(Int_t anode) const {
fcf95fc7 46 // Noise after electronics (ADC units)
f45f6658 47 return fNoiseAfterEl[anode];}
48 //void SetDeadChannels(Int_t nchips=0, Int_t nchannels=0);
49 void SetDeadChannels(Int_t ndead=0){fDeadChannels=ndead; fBadChannels.Set(ndead);}
fcf95fc7 50 Int_t GetDeadChips() const { return fDeadChips; }
51 Int_t GetDeadChannels() const { return fDeadChannels; }
eefec958 52 Float_t GetChannelGain(Int_t anode) const {return fGain[anode];}
53 virtual void SetGain(Int_t anode,Double_t g){fGain[anode]=g;}
54
f45f6658 55
4952f440 56 Int_t GetWing(Int_t anode) const{
57 if(anode>=fgkChips*fgkChannels) return 1;
58 else return 0;
59 }
60 Int_t GetChipChannel(Int_t anode) const {return anode%fgkChannels;}
eefec958 61 Int_t GetChip(Int_t anode) const {return anode/fgkChannels;}
62 Int_t GetAnodeNumber(Int_t iwing, Int_t ichip03, Int_t ichan) const {
63 if(iwing>=2 || ichip03>=4 || ichan>=64) return -1;
64 else return iwing*fgkChips*fgkChannels+ichip03*fgkChannels+ichan;
65 }
66 Int_t GetAnodeNumber(Int_t ichip07, Int_t ichan) const {
67 if(ichip07>=8 || ichan>=64) return -1;
68 else return ichip07*fgkChannels+ichan;
4952f440 69 }
70
fcf95fc7 71 void PrintGains() const;
72 void Print();
73 virtual void Print(ostream *os) const {AliITSCalibrationSDD::Print(os);}
74 virtual void Print(Option_t *option="") const {AliITSCalibrationSDD::Print(option);}
75 // not implemented virtual methods (devlared in the mother class
76 virtual void SetDetParam(Double_t *)
77 {NotImplemented("SetDetParam");}
78 virtual void GetDetParam(Double_t *) const
79 {NotImplemented("GetDetParam");}
80 virtual void SetNDetParam(Int_t /* n */)
81 {NotImplemented("SetNDetParam");}
82 virtual Int_t NDetParam() const
83 {NotImplemented("NDetParam"); return 0;}
84 virtual void SetSigmaSpread(Double_t, Double_t)
85 {NotImplemented("SetSigmaSpread");}
86 virtual void SigmaSpread(Double_t & /* p1 */,Double_t & /* p2 */) const
87 {NotImplemented("SigmaSpread");}
88
eefec958 89 void SetBad() {
90 fIsBad = kTRUE;
91 for(Int_t i=0;i<fgkChips*fgkWings;i++) fIsChipBad[i]=kTRUE;
92 }
93 virtual Bool_t IsBad() const { return fIsBad; }
94 void SetChipBad(Int_t nChip) {
95 fIsChipBad[nChip] = kTRUE;
96 }
97 virtual Bool_t IsChipBad(Int_t nChip) const {
98 return fIsChipBad[nChip];
99 }
fcf95fc7 100 Int_t Wings()const{return fgkWings;}//Total number of SDD wings
101 Int_t Chips() const{return fgkChips;} // Number of chips/module
102 Int_t Channels() const{ return fgkChannels;}//Number of channels/chip
75065a60 103 Int_t NOfAnodes() const {return fgkChannels*fgkChips*fgkWings;}
104
f45f6658 105 virtual void SetBadChannel(Int_t i,Int_t anode);
106 Int_t GetBadChannel(Int_t i) const {return fBadChannels[i];}
c9a38d3d 107 Bool_t IsBadChannel(Int_t anode) const{
4952f440 108 if(GetChannelGain(anode)==0) return kTRUE;
109 else return kFALSE;
110 }
028a3709 111 Float_t GetMapACell(Int_t i,Int_t j) const {
112 if(i<256) return fMapAW0->GetCellContent(i,j);
ecdd2482 113 else return fMapAW1->GetCellContent(i-256,j);
028a3709 114 }
54af1add 115 virtual void SetMapA(Int_t wing,AliITSCorrMapSDD* mapA) {
028a3709 116 if(wing==0) fMapAW0=mapA;
117 else fMapAW1=mapA;
118 }
119 Float_t GetMapTCell(Int_t i,Int_t j) const {
120 if(i<256) return fMapTW0->GetCellContent(i,j);
ecdd2482 121 else return fMapTW1->GetCellContent(i-256,j);
028a3709 122 }
54af1add 123 virtual void SetMapT(Int_t wing,AliITSCorrMapSDD* mapT) {
028a3709 124 if(wing==0) fMapTW0=mapT;
125 else fMapTW1=mapT;
126 }
18da6e54 127
128 virtual void SetDriftSpeed(Int_t wing, AliITSDriftSpeedArraySDD* arr){
129 if(wing==0) fDrSpeed0=arr;
130 else fDrSpeed1=arr;
131 }
5bfe44ce 132
4952f440 133
18da6e54 134 virtual Float_t GetDriftSpeedAtAnode(Float_t nAnode) const{
135 if(fDrSpeed0==0 || fDrSpeed1==0) AliFatal("Drift speed not set\n");
136 if(nAnode<256) return fDrSpeed0->GetDriftSpeed(0,nAnode);
137 else return fDrSpeed1->GetDriftSpeed(0,nAnode-256);
138 }
83ec5e27 139
253e68a0 140 virtual void SetZeroSupp(Bool_t opt=kTRUE) {fZeroSupp=opt;}
141 virtual Bool_t GetZeroSupp() const {return fZeroSupp;}
cd2a0045 142
b27af87f 143 virtual void SetAMAt20MHz() {fAMAt20MHz=kTRUE;}
144 virtual Bool_t IsAMAt20MHz() const {return fAMAt20MHz;}
145
c9a38d3d 146 void GetCorrections(Float_t z, Float_t x, Float_t &devz, Float_t &devx, AliITSsegmentationSDD* seg);
404c1c29 147 virtual Float_t GetThresholdAnode(Int_t anode,Int_t nsigma=3) const {
9e4d7193 148 return nsigma*fNoiseAfterEl[anode];}
404c1c29 149
83ec5e27 150
fcf95fc7 151 protected:
5bfe44ce 152
153
fcf95fc7 154 // these statis const should be move to AliITSsegmentationSDD
155 static const Int_t fgkWings = 2; // Number of wings per module
156 static const Int_t fgkChips = 4; // Number of chips/module
157 static const Int_t fgkChannels = 64; // Number of channels/chip
4bfbde86 158 static const Float_t fgkTemperatureDefault; // default for fT (Kelvin)
159 static const Float_t fgkNoiseDefault; // default for fNoise
160 static const Float_t fgkBaselineDefault; // default for fBaseline
4bfbde86 161 static const Float_t fgkGainDefault; //default for gain
c9a38d3d 162
253e68a0 163 Bool_t fZeroSupp; // zero suppression
b27af87f 164 Bool_t fAMAt20MHz; // flag for Analog memory of Pascal at 20 MHz
fcf95fc7 165 Int_t fDeadChips; // Number of dead chips
166 Int_t fDeadChannels; // Number of dead channels
eefec958 167 Float_t fGain[fgkWings*fgkChips*fgkChannels]; //Array for channel gains
4bfbde86 168 Float_t fNoise[fgkWings*fgkChips*fgkChannels]; // Noise array
169 Float_t fBaseline[fgkWings*fgkChips*fgkChannels]; // Baseline array
170 Float_t fNoiseAfterEl[fgkWings*fgkChips*fgkChannels]; // Noise after electronics
20f3f947 171
172 Int_t fZSTL[2]; // Low threshold in 2D zero-suppression (2 hybrids)
173 Int_t fZSTH[2]; // High threshold in 2D zero-suppression (2 hybrids)
fcf95fc7 174
eefec958 175 Bool_t fIsBad; // module is dead or alive ?
176 Bool_t fIsChipBad[fgkWings*fgkChips]; // chip is dead or alive ?
177 TArrayI fBadChannels; //Array with bad anodes number (0-512)
c2bd28b6 178
c2bd28b6 179
54af1add 180 AliITSCorrMapSDD* fMapAW0; //! map of residuals on anode coord. wing 0
181 AliITSCorrMapSDD* fMapAW1; //! map of residuals on anode coord. wing 1
182 AliITSCorrMapSDD* fMapTW0; //! map of residuals on time coord. wing 0
183 AliITSCorrMapSDD* fMapTW1; //! map of residuals on time coord. wing 1
18da6e54 184 AliITSDriftSpeedArraySDD* fDrSpeed0; //! drift speed for wing 0
185 AliITSDriftSpeedArraySDD* fDrSpeed1; //! drift speed for wing 1
5bfe44ce 186
fcf95fc7 187 private:
188 AliITSCalibrationSDD(const AliITSCalibrationSDD &ob); // copy constructor
189 AliITSCalibrationSDD& operator=(const AliITSCalibrationSDD & /* source */); // ass. op.
190
191
ba0a07bf 192 ClassDef(AliITSCalibrationSDD,17)
fcf95fc7 193
194 };
195#endif