]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSOnlineCalibrationSPD.cxx
Add the possibiloity to save cut settings in the ROOT file
[u/mrichter/AliRoot.git] / ITS / AliITSOnlineCalibrationSPD.cxx
CommitLineData
b15de2d2 1#include "AliITSOnlineCalibrationSPD.h"
2
3///////////////////////////////////////////////////////////////////////
4// Author: Henrik Tydesjo //
5// Implementation of the online container for dead and noisy pixels. //
6// //
7///////////////////////////////////////////////////////////////////////
8
9ClassImp(AliITSOnlineCalibrationSPD)
10
11AliITSOnlineCalibrationSPD::AliITSOnlineCalibrationSPD():
12fModuleNr(0),
13fNrDead(0),
14fDeadChannels(0),
15fNrNoisy(0),
16fNoisyChannels(0)
17{}
18//_________________________________________________________________________
19void AliITSOnlineCalibrationSPD::AddDead(UInt_t col, UInt_t row) {
20 //
21 // Add a dead channel to fDeadChannel array
22 //
23 fDeadChannels.Set(fNrDead*2+2);
24 fDeadChannels.AddAt(col,fNrDead*2);
25 fDeadChannels.AddAt(row,fNrDead*2+1);
26 fNrDead++;
27}
28//_________________________________________________________________________
29Int_t AliITSOnlineCalibrationSPD::GetDeadColAt(UInt_t index) const {
30 //
31 // Returns column of index-th dead channel
32 //
33 if (index<fNrDead) {
34 return fDeadChannels.At(index*2);
35 }
36 return -1;
37}
38//_________________________________________________________________________
39Int_t AliITSOnlineCalibrationSPD::GetDeadRowAt(UInt_t index) const {
40 //
41 // Returns row of index-th dead channel
42 //
43 if (index<fNrDead) {
44 return fDeadChannels.At(index*2+1);
45 }
46 return -1;
47}
48//_________________________________________________________________________
49Bool_t AliITSOnlineCalibrationSPD::IsPixelDead(Int_t col, Int_t row) const {
50 //
51 // Check if pixel (col,row) is dead
52 //
53 for (UInt_t i=0; i<fNrDead; i++) {
54 if (fDeadChannels.At(i*2)==col && fDeadChannels.At(i*2+1)==row) {
55 return kTRUE;
56 }
57 }
58 return kFALSE;
59}
60//____________________________________________________________________________
61void AliITSOnlineCalibrationSPD::AddNoisy(UInt_t col, UInt_t row) {
62 //
63 // add noisy pixel
64 //
65 fDeadChannels.Set(fNrNoisy*2+2);
66 fNoisyChannels.AddAt(col,fNrNoisy*2);
67 fNoisyChannels.AddAt(row,fNrNoisy*2+1);
68 fNrNoisy++;
69}
70//____________________________________________________________________________
71Int_t AliITSOnlineCalibrationSPD::GetNoisyColAt(UInt_t index) const {
72 //
73 // Get column of index-th noisy pixel
74 //
75 if (index<fNrNoisy) {
76 return fNoisyChannels.At(index*2);
77 }
78 return -1;
79}
80//____________________________________________________________________________
81Int_t AliITSOnlineCalibrationSPD::GetNoisyRowAt(UInt_t index) const {
82 //
83 // Get row of index-th noisy pixel
84 //
85 if (index<fNrNoisy) {
86 return fNoisyChannels.At(index*2+1);
87 }
88 return -1;
89}
90//____________________________________________________________________________
91Bool_t AliITSOnlineCalibrationSPD::IsPixelNoisy(Int_t col, Int_t row) const {
92 //
93 // Check if pixel (col,row) is noisy
94 //
95 for (UInt_t i=0; i<fNrNoisy; i++) {
96 if (fNoisyChannels.At(i*2)==col && fNoisyChannels.At(i*2+1)==row) {
97 return kTRUE;
98 }
99 }
100 return kFALSE;
101}