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):
62 this->fSize= source.fSize;
63 this->fArray= source.fArray;
65 //________________________________________________________________
66 AliTOFChannelOnlineStatusArray &AliTOFChannelOnlineStatusArray::operator=(const AliTOFChannelOnlineStatusArray & source)
68 // assignment operator
69 this->fSize= source.fSize;
70 this->fArray= source.fArray;
73 //________________________________________________________________
74 void AliTOFChannelOnlineStatusArray::SetStatus(Int_t pos, UChar_t parr)
76 // setting status for channel at position = pos
77 AliDebug(2,Form("status = %d",(UInt_t)parr));
78 if (pos>-1 && pos < fSize)fArray[pos] = parr;
79 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
81 //________________________________________________________________
82 void AliTOFChannelOnlineStatusArray::SetHWStatus(Int_t pos, UChar_t parr)
84 // setting status for channel at position = pos
85 AliDebug(2,Form("HW status = %d",(UInt_t)parr));
86 if (pos>-1 && pos < fSize) {
87 fArray[pos] &= kTOFHWReset;
90 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
92 //________________________________________________________________
93 void AliTOFChannelOnlineStatusArray::SetPulserStatus(Int_t pos, UChar_t parr)
95 // setting status for channel at position = pos
96 AliDebug(2,Form("Pulser status = %d",(UInt_t)parr));
97 if (pos>-1 && pos < fSize){
98 fArray[pos] &= kTOFPulserReset;
101 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
103 //________________________________________________________________
104 void AliTOFChannelOnlineStatusArray::SetNoiseStatus(Int_t pos, UChar_t parr)
106 // setting status for channel at position = pos
107 AliDebug(2,Form("Noise status = %d",(UInt_t)parr));
108 if (pos>-1 && pos < fSize){
109 fArray[pos] &= kTOFNoiseReset;
112 AliDebug(2,Form("fArray[%d] = %d",pos,(UInt_t)fArray[pos]));
114 //________________________________________________________________
115 UChar_t AliTOFChannelOnlineStatusArray::GetStatus(Int_t pos) const
117 // getting the status for channel at position = pos
119 if (pos>-1 && pos < fSize)parr = fArray[pos];
122 //________________________________________________________________
123 UChar_t AliTOFChannelOnlineStatusArray::GetHWStatus(Int_t pos) const
125 // getting the HW status for channel at position = pos
127 if (pos>-1 && pos < fSize)parr = fArray[pos];
128 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
129 UChar_t hwSt = parr & kTOFHW;
130 //UChar_t hwSt = parr & 0x3;
133 //________________________________________________________________
134 UChar_t AliTOFChannelOnlineStatusArray::GetPulserStatus(Int_t pos) const
136 // getting the Pulser status for channel at position = pos
138 if (pos>-1 && pos < fSize)parr = fArray[pos];
139 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
140 UChar_t pulserSt = parr & kTOFPulser;
141 //UChar_t pulserSt = parr & 0xc;
144 //________________________________________________________________
145 UChar_t AliTOFChannelOnlineStatusArray::GetNoiseStatus(Int_t pos) const
147 // getting the noise status for channel at position = pos
149 if (pos>-1 && pos < fSize)parr = fArray[pos];
150 AliDebug(2,Form("parr = %d ",(UInt_t)parr));
151 UChar_t noiseSt = parr & kTOFNoise;
152 // UChar_t noiseSt = parr & 0x30;