4 #include "AliTRDarrayS.h"
5 #include "Cal/AliTRDCalPadStatus.h"
7 #include "AliTRDdataArrayDigits.h"
9 ClassImp(AliTRDdataArrayDigits)
11 //_____________________________________________________________________________
12 AliTRDdataArrayDigits::AliTRDdataArrayDigits(Int_t nrow, Int_t ncol, Int_t ntime): AliTRDdataArrayS(nrow, ncol, ntime)
19 //_____________________________________________________________________________
20 Short_t AliTRDdataArrayDigits::GetDataUnchecked(Int_t row, Int_t col, Int_t time) const
23 // Get the pad status without boundary checking
24 // (taking pad maskng into account)
26 Short_t value = GetDataFast(GetIdx1Unchecked(row,col),time);
27 // Be aware of Manipulations introduced by pad masking in the RawReader
28 // Only output the manipulated Value
35 //_____________________________________________________________________________
36 Short_t AliTRDdataArrayDigits::GetData(Int_t row, Int_t col, Int_t time) const
40 // (taking pad masking into account)
41 if ((row >= 0) && (col >= 0) && (time >= 0)) {
42 Int_t idx1 = GetIdx1(row,col);
43 if ((idx1 >= 0) && (time < fNdim2)) {
47 value = GetDataFast(idx1,time);
51 value = GetData1(idx1,time);
53 // Awareness of the bit masking
61 AliError(Form("time %d out of bounds (size: %d, this: 0x%08x)"
71 //_____________________________________________________________________________
72 Int_t AliTRDdataArrayDigits::GetOverThreshold(Short_t threshold)
75 // Returns the number of entries over threshold
76 // (taking pad masking into account)
79 if ((fElements == 0) || (fElements->GetSize() <= 0))
85 for (Bool_t cont = First(); cont == kTRUE; cont = Next()) {
86 if ((fCurrentIdx1 < 0) || (fCurrentIdx1 >= fNdim1)) continue;
87 if ((fCurrentIdx2 < 0) || (fCurrentIdx2 >= fNdim2)) continue;
88 value = fElements->At(fCurrentIndex);
92 if (value > threshold) over++;
99 //_____________________________________________________________________________
100 UChar_t AliTRDdataArrayDigits::GetPadStatus(Int_t row, Int_t col, Int_t time) const
103 // Returns the pad status stored in the pad signal
105 // Output is a UChar_t value
108 // Bridged Left Masking 8
109 // Bridged Right Masking 8
110 // Not Connected Masking 32
112 UChar_t padstatus = 0;
113 Short_t signal = GetDataFast(GetIdx1Unchecked(row,col),time);
114 if(signal > 0 && TESTBIT(signal, 10)){
115 if(TESTBIT(signal, 11))
116 if(TESTBIT(signal, 12))
117 padstatus = AliTRDCalPadStatus::kPadBridgedRight;
119 padstatus = AliTRDCalPadStatus::kNotConnected;
121 if(TESTBIT(signal, 12))
122 padstatus = AliTRDCalPadStatus::kPadBridgedLeft;
124 padstatus = AliTRDCalPadStatus::kMasked;
129 //_____________________________________________________________________________
130 void AliTRDdataArrayDigits::SetPadStatus(Int_t row, Int_t col, Int_t time, UChar_t status)
133 // Setting the pad status into the signal using the Bits 10 to 14
134 // (currently used: 10 to 12)
136 // Input codes (Unsigned char):
138 // Bridged Left Masking 8
139 // Bridged Right Masking 8
140 // Not Connected Masking 32
142 // Status codes: Any masking: Bit 10(1)
143 // Noisy masking: Bit 11(0), Bit 12(0)
144 // No Connection masking: Bit 11(1), Bit 12(0)
145 // Bridged Left masking: Bit 11(0), Bit 12(1)
146 // Bridged Right masking: Bit 11(1), Bit 12(1)
148 Short_t signal = GetDataFast(GetIdx1Unchecked(row, col), time);
149 // only set the Pad Status if the signal is > 0
153 case AliTRDCalPadStatus::kMasked:
158 case AliTRDCalPadStatus::kNotConnected:
163 case AliTRDCalPadStatus::kPadBridgedLeft:
168 case AliTRDCalPadStatus::kPadBridgedRight:
177 SetDataUnchecked(row, col, time, signal);
181 //_____________________________________________________________________________
182 Bool_t AliTRDdataArrayDigits::IsPadCorrupted(Int_t row, Int_t col, Int_t time)
185 // Checks if the pad has any masking as corrupted (Bit 10 in signal set)
187 Short_t signal = GetDataFast(GetIdx1Unchecked(row, col), time);
188 return (signal > 0 && TESTBIT(signal, 10)) ? kTRUE : kFALSE;