]>
Commit | Line | Data |
---|---|---|
fcf95fc7 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
5bfe44ce | 15 | |
590d15ee | 16 | |
fcf95fc7 | 17 | |
18 | #include "AliITSCalibrationSPD.h" | |
19 | ||
5bfe44ce | 20 | const Double_t AliITSCalibrationSPD::fgkThreshDefault = 3000.; |
21 | const Double_t AliITSCalibrationSPD::fgkSigmaDefault = 250.; | |
22 | const Double_t AliITSCalibrationSPD::fgkCouplColDefault = 0.; | |
23 | const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.047; | |
24 | const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182; | |
fcf95fc7 | 25 | |
26 | ClassImp(AliITSCalibrationSPD) | |
590d15ee | 27 | /////////////////////////////////////////////////////////////////////////// |
28 | // Calibration class for set:ITS | |
29 | // Specific subdetector implementation for | |
30 | // Silicon pixels | |
31 | // | |
32 | // Modified by D. Elia, G.E. Bruno, H. Tydesjo | |
33 | // March-April 2006 | |
34 | // | |
35 | /////////////////////////////////////////////////////////////////////////// | |
36 | ||
fcf95fc7 | 37 | //______________________________________________________________________ |
38 | AliITSCalibrationSPD::AliITSCalibrationSPD(): | |
39 | AliITSCalibration(), | |
40 | fBaseline(0.0), | |
41 | fNoise(0.0), | |
42 | fThresh(fgkThreshDefault), | |
43 | fSigma(fgkSigmaDefault), | |
5bfe44ce | 44 | fCouplCol(fgkCouplColDefault), |
45 | fCouplRow(fgkCouplRowDefault), | |
46 | fBiasVoltage(fgkBiasVoltageDefault), | |
590d15ee | 47 | fNrDead(0), |
48 | fNrNoisy(0){ | |
fcf95fc7 | 49 | // constructor |
50 | ||
51 | SetThresholds(fgkThreshDefault,fgkSigmaDefault); | |
5bfe44ce | 52 | SetCouplingParam(fgkCouplColDefault,fgkCouplRowDefault); |
53 | SetBiasVoltage(fgkBiasVoltageDefault); | |
fcf95fc7 | 54 | SetNoiseParam(0.,0.); |
55 | SetDataType("simulated"); | |
fcf95fc7 | 56 | } |
57 | //_________________________________________________________________________ | |
5bfe44ce | 58 | |
5bfe44ce | 59 | void AliITSCalibrationSPD::AddDead(UInt_t col, UInt_t row) { |
590d15ee | 60 | // |
61 | // Add a dead channel to fDeadChannel array | |
62 | // | |
63 | fDeadChannels.Set(fNrDead*2+2); | |
64 | fDeadChannels.AddAt(col,fNrDead*2); | |
65 | fDeadChannels.AddAt(row,fNrDead*2+1); | |
66 | fNrDead++; | |
5bfe44ce | 67 | } |
590d15ee | 68 | //_________________________________________________________________________ |
5bfe44ce | 69 | Int_t AliITSCalibrationSPD::GetDeadColAt(UInt_t index) { |
590d15ee | 70 | // |
71 | // Returns column of index-th dead channel | |
72 | // | |
73 | if (index<fNrDead) { | |
5bfe44ce | 74 | return fDeadChannels.At(index*2); |
75 | } | |
76 | return -1; | |
77 | } | |
590d15ee | 78 | //_________________________________________________________________________ |
5bfe44ce | 79 | Int_t AliITSCalibrationSPD::GetDeadRowAt(UInt_t index) { |
590d15ee | 80 | // |
81 | // Returns row of index-th dead channel | |
82 | // | |
83 | if (index<fNrDead) { | |
5bfe44ce | 84 | return fDeadChannels.At(index*2+1); |
85 | } | |
86 | return -1; | |
87 | } | |
590d15ee | 88 | //_________________________________________________________________________ |
5bfe44ce | 89 | Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const { |
590d15ee | 90 | // |
91 | // Check if pixel (col,row) is dead | |
92 | // | |
93 | for (UInt_t i=0; i<fNrDead; i++) { | |
5bfe44ce | 94 | if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) { |
95 | return true; | |
96 | } | |
97 | } | |
98 | return false; | |
99 | } | |
100 | ||
101 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
102 | //___________________________________________________________________________ | |
103 | // THIS METHOD SHOULD BE DELETED AS SOON AS POSSIBLE!!!!!!!!!!!!!!!!!!!!!!!!! | |
104 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
fcf95fc7 | 105 | Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t mod,Int_t ix,Int_t iz) const { |
5bfe44ce | 106 | // Returns kTRUE if pixel is dead |
fcf95fc7 | 107 | // Inputs: |
108 | // Int_t mod module number | |
109 | // Int_t ix x pixel number | |
110 | // Int_t iz z pixel number | |
111 | // Outputs: | |
112 | // none. | |
113 | // Return: | |
114 | // kFALSE if pixel is alive, or kTRUE if pixel is dead. | |
5bfe44ce | 115 | |
116 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
117 | Double_t fDeadPixels = 0.01; // fix to keep AliITSsimulationSPDdubna alive!!! | |
118 | // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
119 | ||
fcf95fc7 | 120 | Bool_t dead = kFALSE; |
121 | Int_t seed; | |
122 | static TRandom ran; // don't use gRandom. This must not be a true randome | |
123 | // sequence. These sequence must be random one and then fully repetable. | |
124 | ||
125 | seed = mod*256*256+iz*256+ix; | |
126 | ran.SetSeed(seed); | |
127 | if(ran.Rndm(0)<fDeadPixels) dead = kTRUE; | |
128 | return dead; | |
129 | } | |
5bfe44ce | 130 | //____________________________________________________________________________ |
5bfe44ce | 131 | void AliITSCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) { |
590d15ee | 132 | // |
133 | // add noisy pixel | |
134 | // | |
135 | fDeadChannels.Set(fNrNoisy*2+2); | |
136 | fNoisyChannels.AddAt(col,fNrNoisy*2); | |
137 | fNoisyChannels.AddAt(row,fNrNoisy*2+1); | |
138 | fNrNoisy++; | |
5bfe44ce | 139 | } |
590d15ee | 140 | //____________________________________________________________________________ |
5bfe44ce | 141 | Int_t AliITSCalibrationSPD::GetNoisyColAt(UInt_t index) { |
590d15ee | 142 | // |
143 | // Get column of index-th noisy pixel | |
144 | // | |
145 | if (index<fNrNoisy) { | |
5bfe44ce | 146 | return fNoisyChannels.At(index*2); |
147 | } | |
148 | return -1; | |
149 | } | |
590d15ee | 150 | //____________________________________________________________________________ |
5bfe44ce | 151 | Int_t AliITSCalibrationSPD::GetNoisyRowAt(UInt_t index) { |
590d15ee | 152 | // |
153 | // Get row of index-th noisy pixel | |
154 | // | |
155 | if (index<fNrNoisy) { | |
5bfe44ce | 156 | return fNoisyChannels.At(index*2+1); |
157 | } | |
158 | return -1; | |
159 | } | |
590d15ee | 160 | //____________________________________________________________________________ |
5bfe44ce | 161 | Bool_t AliITSCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const { |
590d15ee | 162 | // |
163 | // Check if pixel (col,row) is noisy | |
164 | // | |
165 | for (UInt_t i=0; i<fNrNoisy; i++) { | |
5bfe44ce | 166 | if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) { |
167 | return true; | |
168 | } | |
169 | } | |
170 | return false; | |
171 | } |