]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////// | |
2 | // Author: Henrik Tydesjo // | |
3 | // // | |
4 | // This class is used to store Fast-OR noise values in OCDB. // | |
5 | // One value per pixel chip. // | |
6 | // The values are the probability that a pixel chip will generate // | |
7 | // a fast-OR signal independently (originating from noise). // | |
8 | // // | |
9 | ///////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #include "AliITSFONoiseSPD.h" | |
12 | ||
13 | AliITSFONoiseSPD::AliITSFONoiseSPD() : | |
14 | TObject() | |
15 | { | |
16 | // default constructor, sets all noise values to 0% | |
17 | ResetValues(); | |
18 | } | |
19 | //______________________________________________________________________ | |
20 | AliITSFONoiseSPD::AliITSFONoiseSPD(const AliITSFONoiseSPD& foNoi) : | |
21 | TObject() | |
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 | fChipNoise[eq][hs][chip] = foNoi.fChipNoise[eq][hs][chip]; | |
28 | } | |
29 | } | |
30 | } | |
31 | } | |
32 | //______________________________________________________________________ | |
33 | AliITSFONoiseSPD::~AliITSFONoiseSPD() {} | |
34 | //______________________________________________________________________ | |
35 | void AliITSFONoiseSPD::ResetValues() { | |
36 | // set all noise values to 0% | |
37 | for (UInt_t eq=0; eq<20; eq++) { | |
38 | for (UInt_t hs=0; hs<6; hs++) { | |
39 | for (UInt_t chip=0; chip<10; chip++) { | |
40 | fChipNoise[eq][hs][chip] = 0; | |
41 | } | |
42 | } | |
43 | } | |
44 | } | |
45 | //______________________________________________________________________ | |
46 | AliITSFONoiseSPD& AliITSFONoiseSPD::operator=(const AliITSFONoiseSPD& foNoi) { | |
47 | // assignment operator | |
48 | if (this!=&foNoi) { | |
49 | for (UInt_t eq=0; eq<20; eq++) { | |
50 | for (UInt_t hs=0; hs<6; hs++) { | |
51 | for (UInt_t chip=0; chip<10; chip++) { | |
52 | fChipNoise[eq][hs][chip] = foNoi.fChipNoise[eq][hs][chip]; | |
53 | } | |
54 | } | |
55 | } | |
56 | } | |
57 | return *this; | |
58 | } | |
59 | //______________________________________________________________________ | |
60 | void AliITSFONoiseSPD::SetChipNoise(UInt_t eq, UInt_t hs, UInt_t chip, Float_t value) { | |
61 | // set a chip noise value | |
62 | if (eq>=20) { | |
63 | Error("AliITSFONoiseSPD::SetChipNoise", "eq (%d) out of bounds.",eq); | |
64 | return; | |
65 | } | |
66 | if (hs>=6) { | |
67 | Error("AliITSFONoiseSPD::SetChipNoise", "hs (%d) out of bounds.",hs); | |
68 | return; | |
69 | } | |
70 | if (chip>=10) { | |
71 | Error("AliITSFONoiseSPD::SetChipNoise", "chip (%d) out of bounds.",chip); | |
72 | return; | |
73 | } | |
74 | ||
75 | fChipNoise[eq][hs][chip] = value; | |
76 | } | |
77 | //______________________________________________________________________ | |
78 | Float_t AliITSFONoiseSPD::GetChipNoise(UInt_t eq, UInt_t hs, UInt_t chip) const { | |
79 | // get a chip noise value | |
80 | if (eq>=20) { | |
81 | Error("AliITSFONoiseSPD::GetChipNoise", "eq (%d) out of bounds.",eq); | |
82 | return 0; | |
83 | } | |
84 | if (hs>=6) { | |
85 | Error("AliITSFONoiseSPD::GetChipNoise", "hs (%d) out of bounds.",hs); | |
86 | return 0; | |
87 | } | |
88 | if (chip>=10) { | |
89 | Error("AliITSFONoiseSPD::GetChipNoise", "chip (%d) out of bounds.",chip); | |
90 | return 0; | |
91 | } | |
92 | ||
93 | return fChipNoise[eq][hs][chip]; | |
94 | } | |
95 |