Line data Source code
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 3 : TObject()
15 15 : {
16 : // default constructor, sets all noise values to 0%
17 3 : ResetValues();
18 6 : }
19 : //______________________________________________________________________
20 : AliITSFONoiseSPD::AliITSFONoiseSPD(const AliITSFONoiseSPD& foNoi) :
21 0 : TObject()
22 0 : {
23 : // copy constructor, copy the array values from input object
24 0 : for (UInt_t eq=0; eq<20; eq++) {
25 0 : for (UInt_t hs=0; hs<6; hs++) {
26 0 : for (UInt_t chip=0; chip<10; chip++) {
27 0 : fChipNoise[eq][hs][chip] = foNoi.fChipNoise[eq][hs][chip];
28 : }
29 : }
30 : }
31 0 : }
32 : //______________________________________________________________________
33 6 : AliITSFONoiseSPD::~AliITSFONoiseSPD() {}
34 : //______________________________________________________________________
35 : void AliITSFONoiseSPD::ResetValues() {
36 : // set all noise values to 0%
37 129 : for (UInt_t eq=0; eq<20; eq++) {
38 840 : for (UInt_t hs=0; hs<6; hs++) {
39 7920 : for (UInt_t chip=0; chip<10; chip++) {
40 3600 : fChipNoise[eq][hs][chip] = 0;
41 : }
42 : }
43 : }
44 3 : }
45 : //______________________________________________________________________
46 : AliITSFONoiseSPD& AliITSFONoiseSPD::operator=(const AliITSFONoiseSPD& foNoi) {
47 : // assignment operator
48 0 : if (this!=&foNoi) {
49 0 : for (UInt_t eq=0; eq<20; eq++) {
50 0 : for (UInt_t hs=0; hs<6; hs++) {
51 0 : for (UInt_t chip=0; chip<10; chip++) {
52 0 : fChipNoise[eq][hs][chip] = foNoi.fChipNoise[eq][hs][chip];
53 : }
54 : }
55 : }
56 0 : }
57 0 : 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 0 : if (eq>=20) {
63 0 : Error("AliITSFONoiseSPD::SetChipNoise", "eq (%d) out of bounds.",eq);
64 0 : return;
65 : }
66 0 : if (hs>=6) {
67 0 : Error("AliITSFONoiseSPD::SetChipNoise", "hs (%d) out of bounds.",hs);
68 0 : return;
69 : }
70 0 : if (chip>=10) {
71 0 : Error("AliITSFONoiseSPD::SetChipNoise", "chip (%d) out of bounds.",chip);
72 0 : return;
73 : }
74 :
75 0 : fChipNoise[eq][hs][chip] = value;
76 0 : }
77 : //______________________________________________________________________
78 : Float_t AliITSFONoiseSPD::GetChipNoise(UInt_t eq, UInt_t hs, UInt_t chip) const {
79 : // get a chip noise value
80 9600 : if (eq>=20) {
81 0 : Error("AliITSFONoiseSPD::GetChipNoise", "eq (%d) out of bounds.",eq);
82 0 : return 0;
83 : }
84 4800 : if (hs>=6) {
85 0 : Error("AliITSFONoiseSPD::GetChipNoise", "hs (%d) out of bounds.",hs);
86 0 : return 0;
87 : }
88 4800 : if (chip>=10) {
89 0 : Error("AliITSFONoiseSPD::GetChipNoise", "chip (%d) out of bounds.",chip);
90 0 : return 0;
91 : }
92 :
93 4800 : return fChipNoise[eq][hs][chip];
94 4800 : }
95 :
|