Eliminate warning on macosx
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSPD.cxx
CommitLineData
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
16///////////////////////////////////////////////////////////////////////////
17// Calibration class for set:ITS
18// Specific subdetector implementation for
19// Silicon pixels
20//
21// Modified by D. Elia, G.E. Bruno, H. Tydesjo
22// March-April 2006
23//
24///////////////////////////////////////////////////////////////////////////
fcf95fc7 25
26#include "AliITSCalibrationSPD.h"
27
5bfe44ce 28const Double_t AliITSCalibrationSPD::fgkThreshDefault = 3000.;
29const Double_t AliITSCalibrationSPD::fgkSigmaDefault = 250.;
30const Double_t AliITSCalibrationSPD::fgkCouplColDefault = 0.;
31const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.047;
32const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182;
fcf95fc7 33
34ClassImp(AliITSCalibrationSPD)
35//______________________________________________________________________
36AliITSCalibrationSPD::AliITSCalibrationSPD():
37AliITSCalibration(),
38fBaseline(0.0),
39fNoise(0.0),
40fThresh(fgkThreshDefault),
41fSigma(fgkSigmaDefault),
5bfe44ce 42fCouplCol(fgkCouplColDefault),
43fCouplRow(fgkCouplRowDefault),
44fBiasVoltage(fgkBiasVoltageDefault),
45nrDead(0),
46nrNoisy(0){
fcf95fc7 47 // constructor
48
49 SetThresholds(fgkThreshDefault,fgkSigmaDefault);
5bfe44ce 50 SetCouplingParam(fgkCouplColDefault,fgkCouplRowDefault);
51 SetBiasVoltage(fgkBiasVoltageDefault);
fcf95fc7 52 SetNoiseParam(0.,0.);
53 SetDataType("simulated");
fcf95fc7 54}
55//_________________________________________________________________________
5bfe44ce 56
57
58void AliITSCalibrationSPD::AddDead(UInt_t col, UInt_t row) {
59 fDeadChannels.Set(nrDead*2+2);
60 fDeadChannels.AddAt(col,nrDead*2);
61 fDeadChannels.AddAt(row,nrDead*2+1);
62 nrDead++;
63}
64Int_t AliITSCalibrationSPD::GetDeadColAt(UInt_t index) {
65 if (index<nrDead) {
66 return fDeadChannels.At(index*2);
67 }
68 return -1;
69}
70Int_t AliITSCalibrationSPD::GetDeadRowAt(UInt_t index) {
71 if (index<nrDead) {
72 return fDeadChannels.At(index*2+1);
73 }
74 return -1;
75}
76Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const {
77 for (UInt_t i=0; i<nrDead; i++) {
78 if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) {
79 return true;
80 }
81 }
82 return false;
83}
84
85// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
86//___________________________________________________________________________
87// THIS METHOD SHOULD BE DELETED AS SOON AS POSSIBLE!!!!!!!!!!!!!!!!!!!!!!!!!
88// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
fcf95fc7 89Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t mod,Int_t ix,Int_t iz) const {
5bfe44ce 90 // Returns kTRUE if pixel is dead
fcf95fc7 91 // Inputs:
92 // Int_t mod module number
93 // Int_t ix x pixel number
94 // Int_t iz z pixel number
95 // Outputs:
96 // none.
97 // Return:
98 // kFALSE if pixel is alive, or kTRUE if pixel is dead.
5bfe44ce 99
100 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
101 Double_t fDeadPixels = 0.01; // fix to keep AliITSsimulationSPDdubna alive!!!
102 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
103
fcf95fc7 104 Bool_t dead = kFALSE;
105 Int_t seed;
106 static TRandom ran; // don't use gRandom. This must not be a true randome
107 // sequence. These sequence must be random one and then fully repetable.
108
109 seed = mod*256*256+iz*256+ix;
110 ran.SetSeed(seed);
111 if(ran.Rndm(0)<fDeadPixels) dead = kTRUE;
112 return dead;
113}
5bfe44ce 114//____________________________________________________________________________
115
116void AliITSCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
117 fDeadChannels.Set(nrNoisy*2+2);
118 fNoisyChannels.AddAt(col,nrNoisy*2);
119 fNoisyChannels.AddAt(row,nrNoisy*2+1);
120 nrNoisy++;
121}
122Int_t AliITSCalibrationSPD::GetNoisyColAt(UInt_t index) {
123 if (index<nrNoisy) {
124 return fNoisyChannels.At(index*2);
125 }
126 return -1;
127}
128Int_t AliITSCalibrationSPD::GetNoisyRowAt(UInt_t index) {
129 if (index<nrNoisy) {
130 return fNoisyChannels.At(index*2+1);
131 }
132 return -1;
133}
134Bool_t AliITSCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
135 for (UInt_t i=0; i<nrNoisy; i++) {
136 if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
137 return true;
138 }
139 }
140 return false;
141}