/*
$Log$
+Revision 1.2 2000/12/20 09:36:46 kowal2
+Improvements in algorithms to make the code faster
+
Revision 1.1 2000/11/01 15:57:13 kowal2
Moved from the TPC directory
}
fElements->Adopt(fNelems,buf);
}
+
void AliDigits::CompresBuffer1()
{
//
index.Set(fNcols);
Int_t icurrent=-1;
Int_t izero;
+ Short_t * cbuff = fElements->GetArray(); //MI change
+
for (Int_t col = 0; col<fNcols; col++){
index[col]=icurrent+1;//set collumn pointer
izero = 0; //reset zer counter at the begining of the column
for (Int_t row = 0; row< fNrows;row++){
//if under threshold
- if (GetDigitFast(row,col)<=fThreshold) izero++;
+ //if (GetDigitFast(row,col)<=fThreshold) izero++;
+ if (*cbuff<=fThreshold) izero++;
+
else{
if (izero>0) {
//if we have currently izero count under threshold
} //end of reseting izero
icurrent++;
if (icurrent>=buf.fN) buf.Expand(icurrent*2);
- buf[icurrent] = GetDigitFast(row,col);
- }//if signal bigger then threshold
+ //buf[icurrent] = GetDigitFast(row,col);
+ buf[icurrent] = *cbuff;
+ }//if signal bigger then threshold
+ cbuff++;
} //end of loop over rows
if (izero>0) {
icurrent++;
fCurrentCol = -1;
fCurrentIndex = -1;
Int_t i;
- for (i=0; (( i<fNelems) && (fElements->At(i)<=fThreshold));i++)
+ for (i=0; (( i<fNelems) && (fElements->At(i)<=fThreshold));i++); //MI1211
if (i == fNelems) return kFALSE;
fCurrentCol =i/fNrows;
fCurrentRow =i%fNrows;
AliDigits(const AliDigits &digits); //copy constructor
AliDigits &operator = (const AliDigits & digits); //assignment operator
virtual ~AliDigits();
+ Short_t * GetDigits(){return fElements->GetArray();} //return row pointer to the array digits
Short_t GetDigitFast(Int_t row, Int_t column); //return value at given row and collumn
void SetDigitFast(Short_t value,Int_t row, Int_t column); //set value at given row and collumn
Bool_t BoundsOK(const char *where, Int_t row, Int_t col) ; //Check If Bound Ok
//
//set digit
//
- if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNrows) )
+ if ( (row<0) || (row>=fNrows) || (column<0) || (column>=fNcols) )
Error("AliDigits::SetDigitFast", "row %d col %d out of bounds (size: %d x %d, this: 0x%08x)",
row, column, fNrows, fNcols, this);
(*fElements)[fIndex->At(column)+row]=value;