updated as required to create proper calibration file using the macro AliITSStoreDead...
[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
fcf95fc7 16#include "AliITSCalibrationSPD.h"
590d15ee 17///////////////////////////////////////////////////////////////////////////
18// Calibration class for set:ITS
19// Specific subdetector implementation for
20// Silicon pixels
21//
22// Modified by D. Elia, G.E. Bruno, H. Tydesjo
23// March-April 2006
b15de2d2 24// Last mod: H. Tydesjo January 2007
590d15ee 25//
26///////////////////////////////////////////////////////////////////////////
b15de2d2 27const Double_t AliITSCalibrationSPD::fgkThreshDefault = 3000.;
28const Double_t AliITSCalibrationSPD::fgkSigmaDefault = 250.;
29const Double_t AliITSCalibrationSPD::fgkCouplColDefault = 0.;
30const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.047;
31const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182;
32
33ClassImp(AliITSCalibrationSPD)
590d15ee 34
fcf95fc7 35//______________________________________________________________________
36AliITSCalibrationSPD::AliITSCalibrationSPD():
37AliITSCalibration(),
38fBaseline(0.0),
39fNoise(0.0),
40fThresh(fgkThreshDefault),
41fSigma(fgkSigmaDefault),
5bfe44ce 42fCouplCol(fgkCouplColDefault),
43fCouplRow(fgkCouplRowDefault),
44fBiasVoltage(fgkBiasVoltageDefault),
590d15ee 45fNrDead(0),
e56160b8 46fDeadChannels(0),
47fNrNoisy(0),
48fNoisyChannels(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 59void 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 69Int_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 79Int_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 89Bool_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}
5bfe44ce 100//____________________________________________________________________________
5bfe44ce 101void AliITSCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
590d15ee 102 //
103 // add noisy pixel
104 //
105 fDeadChannels.Set(fNrNoisy*2+2);
106 fNoisyChannels.AddAt(col,fNrNoisy*2);
107 fNoisyChannels.AddAt(row,fNrNoisy*2+1);
108 fNrNoisy++;
5bfe44ce 109}
590d15ee 110//____________________________________________________________________________
5bfe44ce 111Int_t AliITSCalibrationSPD::GetNoisyColAt(UInt_t index) {
590d15ee 112 //
113 // Get column of index-th noisy pixel
114 //
115 if (index<fNrNoisy) {
5bfe44ce 116 return fNoisyChannels.At(index*2);
117 }
118 return -1;
119}
590d15ee 120//____________________________________________________________________________
5bfe44ce 121Int_t AliITSCalibrationSPD::GetNoisyRowAt(UInt_t index) {
590d15ee 122 //
123 // Get row of index-th noisy pixel
124 //
125 if (index<fNrNoisy) {
5bfe44ce 126 return fNoisyChannels.At(index*2+1);
127 }
128 return -1;
129}
590d15ee 130//____________________________________________________________________________
5bfe44ce 131Bool_t AliITSCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
590d15ee 132 //
133 // Check if pixel (col,row) is noisy
134 //
135 for (UInt_t i=0; i<fNrNoisy; i++) {
5bfe44ce 136 if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
137 return true;
138 }
139 }
140 return false;
141}