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():
38 //________________________________________________________________
39 AliTOFChannelOnlineStatusArray::~AliTOFChannelOnlineStatusArray()
44 //________________________________________________________________
45 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(Int_t size):
48 fArray(new UChar_t[size])
51 for (Int_t ich = 0; ich<size; ich ++){
52 SetStatus(ich,kTOFOnlineUnknown);
55 //________________________________________________________________
56 AliTOFChannelOnlineStatusArray::AliTOFChannelOnlineStatusArray(const AliTOFChannelOnlineStatusArray & source):
63 //________________________________________________________________
64 AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const AliTOFChannelOnlineStatusArray & source)
66 // assignment operator
71 TObject::operator=(source);
73 fArray= source.fArray;
76 //________________________________________________________________
77 void AliTOFChannelOnlineStatusArray::SetStatus(Int_t pos, UChar_t parr)
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]));
84 //________________________________________________________________
85 void AliTOFChannelOnlineStatusArray::SetHWStatus(Int_t pos, UChar_t parr)
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;
93 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
95 //________________________________________________________________
96 void AliTOFChannelOnlineStatusArray::SetPulserStatus(Int_t pos, UChar_t parr)
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;
104 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
106 //________________________________________________________________
107 void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr)
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;
115 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
117 //________________________________________________________________
118 UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const
120 // getting the status for channel at position = pos
122 if (pos>-1 && pos < fSize)parr = fArray[pos];
125 //________________________________________________________________
126 UChar_t AliTOFChannelOnlineStatusArray::GetHWStatus(Int_t pos) const
128 // getting the HW status for channel at position = pos
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;
136 //________________________________________________________________
137 UChar_t AliTOFChannelOnlineStatusArray::GetPulserStatus(Int_t pos) const
139 // getting the Pulser status for channel at position = pos
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;
147 //________________________________________________________________
148 UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const
150 // getting the noise status for channel at position = pos
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;