1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 ///////////////////////////////////////////////////////////////////////////////
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). //
23 ///////////////////////////////////////////////////////////////////////////////
25 #include <AliTOFChannelOnlineStatusArray.h>
28 ClassImp(AliTOFChannelOnlineStatusArray)
30 //________________________________________________________________
31 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray():
39 //________________________________________________________________
40 AliTOFChannelOnlineStatusArray::~AliTOFChannelOnlineStatusArray()
44 delete [] fLatencyWindow;
46 //________________________________________________________________
47 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(Int_t size):
50 fArray(new UChar_t[size]),
51 fLatencyWindow(new Int_t[size])
54 for (Int_t ich = 0; ich<size; ich ++){
55 SetStatus(ich,kTOFOnlineUnknown);
56 SetLatencyWindow(ich, 0);
59 //________________________________________________________________
60 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(const AliTOFChannelOnlineStatusArray & source):
63 fArray(source.fArray),
64 fLatencyWindow(source.fLatencyWindow)
68 //________________________________________________________________
69 AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const AliTOFChannelOnlineStatusArray & source)
71 // assignment operator
76 TObject::operator=(source);
78 fArray= source.fArray;
79 fLatencyWindow= source.fLatencyWindow;
82 //________________________________________________________________
83 void AliTOFChannelOnlineStatusArray::SetStatus(Int_t pos, UChar_t parr)
85 // setting status for channel at position = pos
86 AliDebug(2,Form("status = %d",(UInt_t)parr));
87 if (pos>-1 && pos < fSize)fArray[pos] = parr;
88 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
90 //________________________________________________________________
91 void AliTOFChannelOnlineStatusArray::SetHWStatus(Int_t pos, UChar_t parr)
93 // setting status for channel at position = pos
94 AliDebug(2,Form("HW status = %d",(UInt_t)parr));
95 if (pos>-1 && pos < fSize) {
96 fArray[pos] &= kTOFHWReset;
99 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
101 //________________________________________________________________
102 void AliTOFChannelOnlineStatusArray::SetPulserStatus(Int_t pos, UChar_t parr)
104 // setting status for channel at position = pos
105 AliDebug(2,Form("Pulser status = %d",(UInt_t)parr));
106 if (pos>-1 && pos < fSize){
107 fArray[pos] &= kTOFPulserReset;
110 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
112 //________________________________________________________________
113 void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr)
115 // setting status for channel at position = pos
116 AliDebug(2,Form("Noise status = %d",(UInt_t)parr));
117 if (pos>-1 && pos < fSize){
118 fArray[pos] &= kTOFNoiseReset;
121 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
123 //________________________________________________________________
124 void AliTOFChannelOnlineStatusArray::SetLatencyWindow(Int_t pos, Int_t parr)
126 // setting latency window for channel at position = pos
127 if (!fLatencyWindow) {
128 AliWarning("couldn't set latency window");
131 // setting latency window for channel at position = pos
132 AliDebug(2,Form("Latency window = %d",parr));
133 if (pos>-1 && pos < fSize){
134 fLatencyWindow[pos] = parr;
136 AliDebug(2,Form("fLatencyWindow[%d] = %d",pos,fLatencyWindow[pos]));
138 //________________________________________________________________
139 UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const
141 // getting the status for channel at position = pos
143 if (pos>-1 && pos < fSize)parr = fArray[pos];
146 //________________________________________________________________
147 UChar_t AliTOFChannelOnlineStatusArray::GetHWStatus(Int_t pos) const
149 // getting the HW status for channel at position = pos
151 if (pos>-1 && pos < fSize)parr = fArray[pos];
152 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
153 UChar_t hwSt = parr & kTOFHW;
154 //UChar_t hwSt = parr & 0x3;
157 //________________________________________________________________
158 UChar_t AliTOFChannelOnlineStatusArray::GetPulserStatus(Int_t pos) const
160 // getting the Pulser status for channel at position = pos
162 if (pos>-1 && pos < fSize)parr = fArray[pos];
163 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
164 UChar_t pulserSt = parr & kTOFPulser;
165 //UChar_t pulserSt = parr & 0xc;
168 //________________________________________________________________
169 UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const
171 // getting the noise status for channel at position = pos
173 if (pos>-1 && pos < fSize)parr = fArray[pos];
174 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
175 UChar_t noiseSt = parr & kTOFNoise;
176 // UChar_t noiseSt = parr & 0x30;
179 //________________________________________________________________
180 Int_t AliTOFChannelOnlineStatusArray::GetLatencyWindow(Int_t pos) const
182 // getting the latency window for channel at position = pos
184 if (!fLatencyWindow) {
185 AliWarning("cannot get latency window");
188 if (pos>-1 && pos < fSize)lw = fLatencyWindow[pos];
189 AliDebug(2,Form("lw = %d ",lw));