AliTPCTransform.h - removing warning visible in
[u/mrichter/AliRoot.git] / TOF / AliTOFChannelOnlineStatusArray.cxx
CommitLineData
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
28ClassImp(AliTOFChannelOnlineStatusArray)
29
30//________________________________________________________________
31AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray():
32 TObject(),
33 fSize(0),
34 fArray(0x0)
35{
36 //default constructor
37}
38//________________________________________________________________
e88f3330 39AliTOFChannelOnlineStatusArray::~AliTOFChannelOnlineStatusArray()
40{
41 //distructor
42 delete [] fArray;
43}
44//________________________________________________________________
17149e6b 45AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(Int_t size):
46 TObject(),
47 fSize(size),
48 fArray(new UChar_t[size])
49{
50 // ctor with size
51 for (Int_t ich = 0; ich<size; ich ++){
52 SetStatus(ich,kTOFOnlineUnknown);
53 }
54}
55//________________________________________________________________
56AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(const AliTOFChannelOnlineStatusArray & source):
57 TObject(),
8a190ba2 58 fSize(source.fSize),
59 fArray(source.fArray)
17149e6b 60{
61 // copy constructor
17149e6b 62}
63//________________________________________________________________
64AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const AliTOFChannelOnlineStatusArray & source)
65{
66 // assignment operator
8a190ba2 67
68 if (this == &source)
69 return *this;
70
71 TObject::operator=(source);
72 fSize= source.fSize;
73 fArray= source.fArray;
74 return *this;
17149e6b 75}
76//________________________________________________________________
77void AliTOFChannelOnlineStatusArray::SetStatus(Int_t pos, UChar_t parr)
78{
79 // setting status for channel at position = pos
80 AliDebug(2,Form("status = %d",(UInt_t)parr));
81 if (pos>-1 && pos < fSize)fArray[pos] = parr;
82 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
83}
84//________________________________________________________________
85void AliTOFChannelOnlineStatusArray::SetHWStatus(Int_t pos, UChar_t parr)
86{
87 // setting status for channel at position = pos
88 AliDebug(2,Form("HW status = %d",(UInt_t)parr));
89 if (pos>-1 && pos < fSize) {
90 fArray[pos] &= kTOFHWReset;
91 fArray[pos] |= parr;
92 }
93 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
94}
95//________________________________________________________________
96void AliTOFChannelOnlineStatusArray::SetPulserStatus(Int_t pos, UChar_t parr)
97{
98 // setting status for channel at position = pos
99 AliDebug(2,Form("Pulser status = %d",(UInt_t)parr));
100 if (pos>-1 && pos < fSize){
101 fArray[pos] &= kTOFPulserReset;
102 fArray[pos] |= parr;
103 }
104 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
105}
106//________________________________________________________________
107void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr)
108{
109 // setting status for channel at position = pos
110 AliDebug(2,Form("Noise status = %d",(UInt_t)parr));
111 if (pos>-1 && pos < fSize){
112 fArray[pos] &= kTOFNoiseReset;
113 fArray[pos] |= parr;
114 }
115 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
116}
117//________________________________________________________________
118UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const
119{
120 // getting the status for channel at position = pos
121 UChar_t parr = 0x0;
122 if (pos>-1 && pos < fSize)parr = fArray[pos];
123 return parr;
124}
125//________________________________________________________________
126UChar_t AliTOFChannelOnlineStatusArray::GetHWStatus(Int_t pos) const
127{
128 // getting the HW status for channel at position = pos
129 UChar_t parr = 0x0;
130 if (pos>-1 && pos < fSize)parr = fArray[pos];
131 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
132 UChar_t hwSt = parr & kTOFHW;
133 //UChar_t hwSt = parr & 0x3;
134 return hwSt;
135}
136//________________________________________________________________
137UChar_t AliTOFChannelOnlineStatusArray::GetPulserStatus(Int_t pos) const
138{
139 // getting the Pulser status for channel at position = pos
140 UChar_t parr = 0x0;
141 if (pos>-1 && pos < fSize)parr = fArray[pos];
142 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
143 UChar_t pulserSt = parr & kTOFPulser;
144 //UChar_t pulserSt = parr & 0xc;
145 return pulserSt;
146 }
147//________________________________________________________________
148UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const
149{
150 // getting the noise status for channel at position = pos
151 UChar_t parr = 0x0;
152 if (pos>-1 && pos < fSize)parr = fArray[pos];
153 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
154 UChar_t noiseSt = parr & kTOFNoise;
155 // UChar_t noiseSt = parr & 0x30;
156 return noiseSt;
157}