]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSCalibrationSPD.cxx
Changes needed by the following commit: coding convention for type (_t) and access...
[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
6727e2db 24// Last mod: H. Tydesjo Oct 2007
06017659 25// September 2007: CouplingRowDefault = 0.055 (was 0.047)
590d15ee 26//
27///////////////////////////////////////////////////////////////////////////
b15de2d2 28const Double_t AliITSCalibrationSPD::fgkThreshDefault = 3000.;
29const Double_t AliITSCalibrationSPD::fgkSigmaDefault = 250.;
30const Double_t AliITSCalibrationSPD::fgkCouplColDefault = 0.;
06017659 31const Double_t AliITSCalibrationSPD::fgkCouplRowDefault = 0.055;
b15de2d2 32const Double_t AliITSCalibrationSPD::fgkBiasVoltageDefault = 18.182;
33
34ClassImp(AliITSCalibrationSPD)
590d15ee 35
fcf95fc7 36//______________________________________________________________________
37AliITSCalibrationSPD::AliITSCalibrationSPD():
38AliITSCalibration(),
39fBaseline(0.0),
40fNoise(0.0),
41fThresh(fgkThreshDefault),
42fSigma(fgkSigmaDefault),
5bfe44ce 43fCouplCol(fgkCouplColDefault),
44fCouplRow(fgkCouplRowDefault),
45fBiasVoltage(fgkBiasVoltageDefault),
6727e2db 46fNrBad(0),
47fBadChannels(0){
fcf95fc7 48 // constructor
49
50 SetThresholds(fgkThreshDefault,fgkSigmaDefault);
5bfe44ce 51 SetCouplingParam(fgkCouplColDefault,fgkCouplRowDefault);
52 SetBiasVoltage(fgkBiasVoltageDefault);
fcf95fc7 53 SetNoiseParam(0.,0.);
54 SetDataType("simulated");
fcf95fc7 55}
5bfe44ce 56//____________________________________________________________________________
6727e2db 57void AliITSCalibrationSPD::AddBad(UInt_t col, UInt_t row) {
590d15ee 58 //
6727e2db 59 // add bad pixel
590d15ee 60 //
6727e2db 61 fBadChannels.Set(fNrBad*2+2);
62 fBadChannels.AddAt(col,fNrBad*2);
63 fBadChannels.AddAt(row,fNrBad*2+1);
64 fNrBad++;
5bfe44ce 65}
590d15ee 66//____________________________________________________________________________
6727e2db 67Int_t AliITSCalibrationSPD::GetBadColAt(UInt_t index) {
590d15ee 68 //
6727e2db 69 // Get column of index-th bad pixel
590d15ee 70 //
6727e2db 71 if (index<fNrBad) {
72 return fBadChannels.At(index*2);
5bfe44ce 73 }
74 return -1;
75}
590d15ee 76//____________________________________________________________________________
6727e2db 77Int_t AliITSCalibrationSPD::GetBadRowAt(UInt_t index) {
590d15ee 78 //
6727e2db 79 // Get row of index-th bad pixel
590d15ee 80 //
6727e2db 81 if (index<fNrBad) {
82 return fBadChannels.At(index*2+1);
5bfe44ce 83 }
84 return -1;
85}
590d15ee 86//____________________________________________________________________________
6727e2db 87Bool_t AliITSCalibrationSPD::IsPixelBad(Int_t col, Int_t row) const {
590d15ee 88 //
6727e2db 89 // Check if pixel (col,row) is bad
590d15ee 90 //
6727e2db 91 for (UInt_t i=0; i<fNrBad; i++) {
92 if (fBadChannels.At(i*2)==col && fBadChannels.At(i*2+1)==row) {
5bfe44ce 93 return true;
94 }
95 }
96 return false;
97}
1bdd39a1 98//___________________________________________________________________________
99Int_t AliITSCalibrationSPD::GetNrBadInColumn(Int_t col) const {
100 //
101 // Count n. of bad in a given column: col. range [0,159]
102 //
103 if(col<0 || col>159) {AliWarning("GetNrBadInColumn: wrong column number"); return -1;}
104 Int_t bad=0;
105 for (UInt_t i=0; i<fNrBad; i++) if (fBadChannels.At(i*2)==col) bad++;
106 return bad;
107}
108//___________________________________________________________________________
109Int_t AliITSCalibrationSPD::GetNrBadInChip(Int_t chip) const {
110 //
111 // Count n. of bad in a given chip: chip range [0,4]
112 //
113 if(chip<0 || chip>4) {AliWarning("GetNrBadInChip: wrong chip number"); return -1;}
114 Int_t bad=0;
115 for (Int_t col=32*chip; col<32*(chip+1); col++) bad+=GetNrBadInColumn(col);
116 return bad;
117}