]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSOnlineCalibrationSPD.cxx
Changing GetZv to GetZ
[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():
6727e2db 12fEqNr(0),
13fNrBad(0),
b696414b 14fBadChannels(0),
478d804c 15fActiveEq(kTRUE),
16fDeadEq(kFALSE)
b696414b 17{
18 ActivateALL();
478d804c 19 UnSetDeadALL();
b696414b 20}
b15de2d2 21//____________________________________________________________________________
6727e2db 22Int_t AliITSOnlineCalibrationSPD::GetKeyAt(UInt_t index) const {
23 // Get key of index-th bad pixel
24 if (index<fNrBad) {
25 return fBadChannels.At(index);
b15de2d2 26 }
27 return -1;
28}
b696414b 29//____________________________________________________________________________
30void AliITSOnlineCalibrationSPD::ActivateALL() {
31 // activate eq, all hs, all chips
32 ActivateEq();
33 for (UInt_t hs=0; hs<6; hs++) {
34 ActivateHS(hs);
35 for (UInt_t chip=0; chip<10; chip++) {
36 ActivateChip(hs,chip);
37 }
38 }
39}
40//____________________________________________________________________________
41void AliITSOnlineCalibrationSPD::ActivateEq(Bool_t setval) {
42 // activate this eq
43 fActiveEq = setval;
44}
45//____________________________________________________________________________
46void AliITSOnlineCalibrationSPD::ActivateHS(UInt_t hs, Bool_t setval) {
47 // activate hs on this eq
48 if (hs>=6) {
49 Error("AliITSOnlineCalibrationSPD::ActivateHS", "hs (%d) out of bounds.",hs);
50 return;
51 }
52 fActiveHS[hs] = setval;
53}
54//____________________________________________________________________________
55void AliITSOnlineCalibrationSPD::ActivateChip(UInt_t hs, UInt_t chip, Bool_t setval) {
56 // activate chip on this eq
57 if (hs>=6 || chip>=10) {
58 Error("AliITSOnlineCalibrationSPD::ActivateChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
59 return;
60 }
61 fActiveChip[hs*10+chip] = setval;
62}
63//____________________________________________________________________________
64Bool_t AliITSOnlineCalibrationSPD::IsActiveEq() const {
65 // is this eq active?
66 return fActiveEq;
67}
68//____________________________________________________________________________
69Bool_t AliITSOnlineCalibrationSPD::IsActiveHS(UInt_t hs) const {
70 // is this hs active?
71 if (hs>=6) {
72 Error("AliITSOnlineCalibrationSPD::IsActiveHS", "hs (%d) out of bounds.",hs);
73 return kFALSE;
74 }
75 return fActiveHS[hs];
76}
77//____________________________________________________________________________
78Bool_t AliITSOnlineCalibrationSPD::IsActiveChip(UInt_t hs, UInt_t chip) const {
79 // is this chip active?
80 if (hs>=6 || chip>=10) {
81 Error("AliITSOnlineCalibrationSPD::IsActiveChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
82 return kFALSE;
83 }
84 return fActiveChip[hs*10+chip];
85}
478d804c 86//____________________________________________________________________________
87void AliITSOnlineCalibrationSPD::UnSetDeadALL() {
88 // activate eq, all hs, all chips
89 SetDeadEq(kFALSE);
90 for (UInt_t hs=0; hs<6; hs++) {
91 SetDeadHS(hs,kFALSE);
92 for (UInt_t chip=0; chip<10; chip++) {
93 SetDeadChip(hs,chip,kFALSE);
94 }
95 }
96}
97//____________________________________________________________________________
98void AliITSOnlineCalibrationSPD::SetDeadEq(Bool_t setval) {
99 // set this eq dead
100 fDeadEq = setval;
101}
102//____________________________________________________________________________
103void AliITSOnlineCalibrationSPD::SetDeadHS(UInt_t hs, Bool_t setval) {
104 // set dead hs on this eq
105 if (hs>=6) {
106 Error("AliITSOnlineCalibrationSPD::SetDeadHS", "hs (%d) out of bounds.",hs);
107 return;
108 }
109 fDeadHS[hs] = setval;
110}
111//____________________________________________________________________________
112void AliITSOnlineCalibrationSPD::SetDeadChip(UInt_t hs, UInt_t chip, Bool_t setval) {
113 // set dead chip on this eq
114 if (hs>=6 || chip>=10) {
115 Error("AliITSOnlineCalibrationSPD::SetDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
116 return;
117 }
118 fDeadChip[hs*10+chip] = setval;
119}
120//____________________________________________________________________________
121Bool_t AliITSOnlineCalibrationSPD::IsDeadEq() const {
122 // is this eq dead?
123 return fDeadEq;
124}
125//____________________________________________________________________________
126Bool_t AliITSOnlineCalibrationSPD::IsDeadHS(UInt_t hs) const {
127 // is this hs dead?
128 if (hs>=6) {
129 Error("AliITSOnlineCalibrationSPD::IsDeadHS", "hs (%d) out of bounds.",hs);
130 return kFALSE;
131 }
132 return fDeadHS[hs];
133}
134//____________________________________________________________________________
135Bool_t AliITSOnlineCalibrationSPD::IsDeadChip(UInt_t hs, UInt_t chip) const {
136 // is this chip dead?
137 if (hs>=6 || chip>=10) {
138 Error("AliITSOnlineCalibrationSPD::IsDeadChip", "hs,chip (%d,%d) out of bounds.",hs,chip);
139 return kFALSE;
140 }
141 return fDeadChip[hs*10+chip];
142}