]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSFOEfficiencySPDColumn.cxx
Stupid bug fix in new superlight mode (from Zurich airport)
[u/mrichter/AliRoot.git] / ITS / AliITSFOEfficiencySPDColumn.cxx
CommitLineData
ad7f2bfa 1/////////////////////////////////////////////////////////////////////
2// Author: Henrik Tydesjo //
3// //
4// This class is used to store Fast-OR efficiency values in OCDB. //
5// One value per pixel chip column in this daughter class. //
6// The values are the probability that a pixel hit will generate a //
7// fast-OR signal. //
8// //
9/////////////////////////////////////////////////////////////////////
10
11#include "AliITSFOEfficiencySPDColumn.h"
12
13AliITSFOEfficiencySPDColumn::AliITSFOEfficiencySPDColumn() :
14 AliITSFOEfficiencySPD()
15{
16 // default constructor, sets all efficiency values to 100%
17 ResetValues();
18}
19//______________________________________________________________________
20AliITSFOEfficiencySPDColumn::AliITSFOEfficiencySPDColumn(const AliITSFOEfficiencySPDColumn& foEff) :
21 AliITSFOEfficiencySPD()
22{
23 // copy constructor, copy the array values from input object
24 for (UInt_t eq=0; eq<20; eq++) {
25 for (UInt_t hs=0; hs<6; hs++) {
26 for (UInt_t chip=0; chip<10; chip++) {
27 for (UInt_t col=0; col<32; col++) {
28 fColumnEfficiency[eq][hs][chip][col] = foEff.fColumnEfficiency[eq][hs][chip][col];
29 }
30 }
31 }
32 }
33}
34//______________________________________________________________________
35AliITSFOEfficiencySPDColumn::~AliITSFOEfficiencySPDColumn() {}
36//______________________________________________________________________
37AliITSFOEfficiencySPDColumn& AliITSFOEfficiencySPDColumn::operator=(const AliITSFOEfficiencySPDColumn& foEff) {
38 // assignment operator
39 if (this!=&foEff) {
40 for (UInt_t eq=0; eq<20; eq++) {
41 for (UInt_t hs=0; hs<6; hs++) {
42 for (UInt_t chip=0; chip<10; chip++) {
43 for (UInt_t col=0; col<32; col++) {
44 fColumnEfficiency[eq][hs][chip][col] = foEff.fColumnEfficiency[eq][hs][chip][col];
45 }
46 }
47 }
48 }
49 }
50 return *this;
51}
52//______________________________________________________________________
53void AliITSFOEfficiencySPDColumn::ResetValues() {
54 // set all efficiency values to 100%
55 for (UInt_t eq=0; eq<20; eq++) {
56 for (UInt_t hs=0; hs<6; hs++) {
57 for (UInt_t chip=0; chip<10; chip++) {
58 for (UInt_t col=0; col<32; col++) {
59 fColumnEfficiency[eq][hs][chip][col] = 1;
60 }
61 }
62 }
63 }
64}
65//______________________________________________________________________
66void AliITSFOEfficiencySPDColumn::SetColumnEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, Float_t value) {
67 // set a column efficiency value
68 if (eq>=20) {
69 Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "eq (%d) out of bounds.",eq);
70 return;
71 }
72 if (hs>=6) {
73 Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "hs (%d) out of bounds.",hs);
74 return;
75 }
76 if (chip>=10) {
77 Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "chip (%d) out of bounds.",chip);
78 return;
79 }
80 if (col>=32) {
81 Error("AliITSFOEfficiencySPDColumn::SetColumnEfficiency", "col (%d) out of bounds.",col);
82 return;
83 }
84
85 fColumnEfficiency[eq][hs][chip][col] = value;
86}
87//______________________________________________________________________
88Float_t AliITSFOEfficiencySPDColumn::GetColumnEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col) const {
89 // get a column efficiency value
90 if (eq>=20) {
91 Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "eq (%d) out of bounds.",eq);
92 return 0;
93 }
94 if (hs>=6) {
95 Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "hs (%d) out of bounds.",hs);
96 return 0;
97 }
98 if (chip>=10) {
99 Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "chip (%d) out of bounds.",chip);
100 return 0;
101 }
102 if (col>=32) {
103 Error("AliITSFOEfficiencySPDColumn::GetEfficiency", "col (%d) out of bounds.",col);
104 return 0;
105 }
106
107 return fColumnEfficiency[eq][hs][chip][col];
108}
109