Commiting the new analysis examples
[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
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),
590d15ee 46fNrDead(0),
e56160b8 47fDeadChannels(0),
48fNrNoisy(0),
49fNoisyChannels(0){
fcf95fc7 50 // constructor
51
52 SetThresholds(fgkThreshDefault,fgkSigmaDefault);
5bfe44ce 53 SetCouplingParam(fgkCouplColDefault,fgkCouplRowDefault);
54 SetBiasVoltage(fgkBiasVoltageDefault);
fcf95fc7 55 SetNoiseParam(0.,0.);
56 SetDataType("simulated");
fcf95fc7 57}
58//_________________________________________________________________________
5bfe44ce 59
5bfe44ce 60void AliITSCalibrationSPD::AddDead(UInt_t col, UInt_t row) {
590d15ee 61 //
62 // Add a dead channel to fDeadChannel array
63 //
64 fDeadChannels.Set(fNrDead*2+2);
65 fDeadChannels.AddAt(col,fNrDead*2);
66 fDeadChannels.AddAt(row,fNrDead*2+1);
67 fNrDead++;
5bfe44ce 68}
590d15ee 69//_________________________________________________________________________
5bfe44ce 70Int_t AliITSCalibrationSPD::GetDeadColAt(UInt_t index) {
590d15ee 71 //
72 // Returns column of index-th dead channel
73 //
74 if (index<fNrDead) {
5bfe44ce 75 return fDeadChannels.At(index*2);
76 }
77 return -1;
78}
590d15ee 79//_________________________________________________________________________
5bfe44ce 80Int_t AliITSCalibrationSPD::GetDeadRowAt(UInt_t index) {
590d15ee 81 //
82 // Returns row of index-th dead channel
83 //
84 if (index<fNrDead) {
5bfe44ce 85 return fDeadChannels.At(index*2+1);
86 }
87 return -1;
88}
590d15ee 89//_________________________________________________________________________
5bfe44ce 90Bool_t AliITSCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const {
590d15ee 91 //
92 // Check if pixel (col,row) is dead
93 //
94 for (UInt_t i=0; i<fNrDead; i++) {
5bfe44ce 95 if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) {
96 return true;
97 }
98 }
99 return false;
100}
5bfe44ce 101//____________________________________________________________________________
5bfe44ce 102void AliITSCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
590d15ee 103 //
104 // add noisy pixel
105 //
106 fDeadChannels.Set(fNrNoisy*2+2);
107 fNoisyChannels.AddAt(col,fNrNoisy*2);
108 fNoisyChannels.AddAt(row,fNrNoisy*2+1);
109 fNrNoisy++;
5bfe44ce 110}
590d15ee 111//____________________________________________________________________________
5bfe44ce 112Int_t AliITSCalibrationSPD::GetNoisyColAt(UInt_t index) {
590d15ee 113 //
114 // Get column of index-th noisy pixel
115 //
116 if (index<fNrNoisy) {
5bfe44ce 117 return fNoisyChannels.At(index*2);
118 }
119 return -1;
120}
590d15ee 121//____________________________________________________________________________
5bfe44ce 122Int_t AliITSCalibrationSPD::GetNoisyRowAt(UInt_t index) {
590d15ee 123 //
124 // Get row of index-th noisy pixel
125 //
126 if (index<fNrNoisy) {
5bfe44ce 127 return fNoisyChannels.At(index*2+1);
128 }
129 return -1;
130}
590d15ee 131//____________________________________________________________________________
5bfe44ce 132Bool_t AliITSCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
590d15ee 133 //
134 // Check if pixel (col,row) is noisy
135 //
136 for (UInt_t i=0; i<fNrNoisy; i++) {
5bfe44ce 137 if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
138 return true;
139 }
140 }
141 return false;
142}