]>
Commit | Line | Data |
---|---|---|
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 in this base class (if per column // | |
6 | // accuracy is needed, use AliITSFOEfficiencySPDColumn class). // | |
7 | // The values are the probability that a pixel hit will generate a // | |
8 | // fast-OR signal. // | |
9 | // // | |
10 | ///////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #include "AliITSFOEfficiencySPD.h" | |
13 | ||
14 | AliITSFOEfficiencySPD::AliITSFOEfficiencySPD() : | |
15 | TObject() | |
16 | { | |
17 | // default constructor, puts all efficiency values to 100% | |
18 | ResetValues(); | |
19 | } | |
20 | //______________________________________________________________________ | |
21 | AliITSFOEfficiencySPD::AliITSFOEfficiencySPD(const AliITSFOEfficiencySPD& foEff) : | |
22 | TObject() | |
23 | { | |
24 | // copy constructor, copy the array values from input object | |
25 | for (UInt_t eq=0; eq<20; eq++) { | |
26 | for (UInt_t hs=0; hs<6; hs++) { | |
27 | for (UInt_t chip=0; chip<10; chip++) { | |
28 | fChipEfficiency[eq][hs][chip] = foEff.fChipEfficiency[eq][hs][chip]; | |
29 | } | |
30 | } | |
31 | } | |
32 | } | |
33 | //______________________________________________________________________ | |
34 | AliITSFOEfficiencySPD::~AliITSFOEfficiencySPD() {} | |
35 | //______________________________________________________________________ | |
36 | void AliITSFOEfficiencySPD::ResetValues() { | |
37 | // Set all efficiency values to 100% | |
38 | for (UInt_t eq=0; eq<20; eq++) { | |
39 | for (UInt_t hs=0; hs<6; hs++) { | |
40 | for (UInt_t chip=0; chip<10; chip++) { | |
41 | fChipEfficiency[eq][hs][chip] = 1; | |
42 | } | |
43 | } | |
44 | } | |
45 | } | |
46 | //______________________________________________________________________ | |
47 | AliITSFOEfficiencySPD& AliITSFOEfficiencySPD::operator=(const AliITSFOEfficiencySPD& foEff) { | |
48 | // assignment operator | |
49 | if (this!=&foEff) { | |
50 | for (UInt_t eq=0; eq<20; eq++) { | |
51 | for (UInt_t hs=0; hs<6; hs++) { | |
52 | for (UInt_t chip=0; chip<10; chip++) { | |
53 | fChipEfficiency[eq][hs][chip] = foEff.fChipEfficiency[eq][hs][chip]; | |
54 | } | |
55 | } | |
56 | } | |
57 | } | |
58 | return *this; | |
59 | } | |
60 | //______________________________________________________________________ | |
61 | void AliITSFOEfficiencySPD::SetChipEfficiency(UInt_t eq, UInt_t hs, UInt_t chip, Float_t value) { | |
62 | // set a chip efficiency value | |
63 | if (eq>=20) { | |
64 | Error("AliITSFOEfficiencySPD::SetChipEfficiency", "eq (%d) out of bounds.",eq); | |
65 | return; | |
66 | } | |
67 | if (hs>=6) { | |
68 | Error("AliITSFOEfficiencySPD::SetChipEfficiency", "hs (%d) out of bounds.",hs); | |
69 | return; | |
70 | } | |
71 | if (chip>=10) { | |
72 | Error("AliITSFOEfficiencySPD::SetChipEfficiency", "chip (%d) out of bounds.",chip); | |
73 | return; | |
74 | } | |
75 | ||
76 | fChipEfficiency[eq][hs][chip] = value; | |
77 | } | |
78 | //______________________________________________________________________ | |
79 | Float_t AliITSFOEfficiencySPD::GetChipEfficiency(UInt_t eq, UInt_t hs, UInt_t chip) const { | |
80 | // get a chip efficiency value | |
81 | if (eq>=20) { | |
82 | Error("AliITSFOEfficiencySPD::GetChipEfficiency", "eq (%d) out of bounds.",eq); | |
83 | return 0; | |
84 | } | |
85 | if (hs>=6) { | |
86 | Error("AliITSFOEfficiencySPD::GetChipEfficiency", "hs (%d) out of bounds.",hs); | |
87 | return 0; | |
88 | } | |
89 | if (chip>=10) { | |
90 | Error("AliITSFOEfficiencySPD::GetChipEfficiency", "chip (%d) out of bounds.",chip); | |
91 | return 0; | |
92 | } | |
93 | ||
94 | return fChipEfficiency[eq][hs][chip]; | |
95 | } | |
96 |