]>
Commit | Line | Data |
---|---|---|
17149e6b | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | /////////////////////////////////////////////////////////////////////////////// | |
17 | // // | |
18 | // class for TOF Online calibration: defining channel status // | |
19 | // New object created, to use an array instead of a TObjArray. // | |
20 | // Storing all the info coming from HW FEE map, pulser runs, and noise // | |
21 | // runs in a single object (char). // | |
22 | // // | |
23 | /////////////////////////////////////////////////////////////////////////////// | |
24 | ||
25 | #include <AliTOFChannelOnlineStatusArray.h> | |
26 | #include <AliLog.h> | |
27 | ||
28 | ClassImp(AliTOFChannelOnlineStatusArray) | |
29 | ||
30 | //________________________________________________________________ | |
31 | AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(): | |
32 | TObject(), | |
33 | fSize(0), | |
34 | fArray(0x0) | |
35 | { | |
36 | //default constructor | |
37 | } | |
38 | //________________________________________________________________ | |
39 | AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(Int_t size): | |
40 | TObject(), | |
41 | fSize(size), | |
42 | fArray(new UChar_t[size]) | |
43 | { | |
44 | // ctor with size | |
45 | for (Int_t ich = 0; ich<size; ich ++){ | |
46 | SetStatus(ich,kTOFOnlineUnknown); | |
47 | } | |
48 | } | |
49 | //________________________________________________________________ | |
50 | AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(const AliTOFChannelOnlineStatusArray & source): | |
51 | TObject(), | |
52 | fSize(0), | |
53 | fArray(0x0) | |
54 | { | |
55 | // copy constructor | |
56 | this->fSize= source.fSize; | |
57 | this->fArray= source.fArray; | |
58 | } | |
59 | //________________________________________________________________ | |
60 | AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const AliTOFChannelOnlineStatusArray & source) | |
61 | { | |
62 | // assignment operator | |
63 | this->fSize= source.fSize; | |
64 | this->fArray= source.fArray; | |
65 | return *this; | |
66 | } | |
67 | //________________________________________________________________ | |
68 | void AliTOFChannelOnlineStatusArray::SetStatus(Int_t pos, UChar_t parr) | |
69 | { | |
70 | // setting status for channel at position = pos | |
71 | AliDebug(2,Form("status = %d",(UInt_t)parr)); | |
72 | if (pos>-1 && pos < fSize)fArray[pos] = parr; | |
73 | AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos])); | |
74 | } | |
75 | //________________________________________________________________ | |
76 | void AliTOFChannelOnlineStatusArray::SetHWStatus(Int_t pos, UChar_t parr) | |
77 | { | |
78 | // setting status for channel at position = pos | |
79 | AliDebug(2,Form("HW status = %d",(UInt_t)parr)); | |
80 | if (pos>-1 && pos < fSize) { | |
81 | fArray[pos] &= kTOFHWReset; | |
82 | fArray[pos] |= parr; | |
83 | } | |
84 | AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos])); | |
85 | } | |
86 | //________________________________________________________________ | |
87 | void AliTOFChannelOnlineStatusArray::SetPulserStatus(Int_t pos, UChar_t parr) | |
88 | { | |
89 | // setting status for channel at position = pos | |
90 | AliDebug(2,Form("Pulser status = %d",(UInt_t)parr)); | |
91 | if (pos>-1 && pos < fSize){ | |
92 | fArray[pos] &= kTOFPulserReset; | |
93 | fArray[pos] |= parr; | |
94 | } | |
95 | AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos])); | |
96 | } | |
97 | //________________________________________________________________ | |
98 | void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr) | |
99 | { | |
100 | // setting status for channel at position = pos | |
101 | AliDebug(2,Form("Noise status = %d",(UInt_t)parr)); | |
102 | if (pos>-1 && pos < fSize){ | |
103 | fArray[pos] &= kTOFNoiseReset; | |
104 | fArray[pos] |= parr; | |
105 | } | |
106 | AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos])); | |
107 | } | |
108 | //________________________________________________________________ | |
109 | UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const | |
110 | { | |
111 | // getting the status for channel at position = pos | |
112 | UChar_t parr = 0x0; | |
113 | if (pos>-1 && pos < fSize)parr = fArray[pos]; | |
114 | return parr; | |
115 | } | |
116 | //________________________________________________________________ | |
117 | UChar_t AliTOFChannelOnlineStatusArray::GetHWStatus(Int_t pos) const | |
118 | { | |
119 | // getting the HW status for channel at position = pos | |
120 | UChar_t parr = 0x0; | |
121 | if (pos>-1 && pos < fSize)parr = fArray[pos]; | |
122 | AliDebug(2,Form("parr = %d ",(UInt_t)parr)); | |
123 | UChar_t hwSt = parr & kTOFHW; | |
124 | //UChar_t hwSt = parr & 0x3; | |
125 | return hwSt; | |
126 | } | |
127 | //________________________________________________________________ | |
128 | UChar_t AliTOFChannelOnlineStatusArray::GetPulserStatus(Int_t pos) const | |
129 | { | |
130 | // getting the Pulser status for channel at position = pos | |
131 | UChar_t parr = 0x0; | |
132 | if (pos>-1 && pos < fSize)parr = fArray[pos]; | |
133 | AliDebug(2,Form("parr = %d ",(UInt_t)parr)); | |
134 | UChar_t pulserSt = parr & kTOFPulser; | |
135 | //UChar_t pulserSt = parr & 0xc; | |
136 | return pulserSt; | |
137 | } | |
138 | //________________________________________________________________ | |
139 | UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const | |
140 | { | |
141 | // getting the noise status for channel at position = pos | |
142 | UChar_t parr = 0x0; | |
143 | if (pos>-1 && pos < fSize)parr = fArray[pos]; | |
144 | AliDebug(2,Form("parr = %d ",(UInt_t)parr)); | |
145 | UChar_t noiseSt = parr & kTOFNoise; | |
146 | // UChar_t noiseSt = parr & 0x30; | |
147 | return noiseSt; | |
148 | } |