,fNtime(0)
,fNDdim(0)
,fDictionary(0)
- ,fFlag(kTRUE)
+ ,fFlag(kFALSE)
{
//
// AliTRDarrayDictionary default contructor
,fNtime(0)
,fNDdim(0)
,fDictionary(0)
- ,fFlag(kTRUE)
+ ,fFlag(kFALSE)
{
//
}
newDim=fNDdim-counter; //Size of the compressed array
- //Set the flag if the array has no data
- if(newDim==1)
- fFlag=kFALSE;
-
//Fill the buffer of the compressed array
Int_t* buffer = new Int_t[newDim];
Int_t counterTwo=0;
delete [] longArr;
longArr=0;
-
}
+ fFlag=kTRUE; // flag to signal compression
}
//
Int_t dimexp=0;
+ if(!IsCompressed())
+ return;
- if(!HasData()) //if the array has no data (only -1's)
- {
- if(fDictionary&&fNDdim==1)
- {
- dimexp = -fDictionary[0];
- delete [] fDictionary;
- fDictionary=0;
- fDictionary = new Int_t[dimexp];
- fNDdim = dimexp;
- // Re-initialize the array
- memset(fDictionary,-1,sizeof(Int_t)*dimexp);
- }
+ if(fDictionary&&fNDdim==1)
+ {
+ dimexp = -fDictionary[0];
+ delete [] fDictionary;
+ fDictionary=0;
+ fDictionary = new Int_t[dimexp];
+ fNDdim = dimexp;
+ // Re-initialize the array
+ memset(fDictionary,-1,sizeof(Int_t)*dimexp);
return;
}
- UShort_t *longArr = new UShort_t[fNDdim];
+ Int_t *longArr = new Int_t[fNDdim];
if(longArr && fDictionary)
{
//Initialize the array
- memset(longArr,0,sizeof(UShort_t)*fNDdim);
+ memset(longArr,0,sizeof(Int_t)*fNDdim);
- UShort_t r2=0;
+ Int_t r2=0;
for(Int_t i=0; i<fNDdim;i++)
{
if((fDictionary[i]<0)&&(fDictionary[i]!=-1))
delete [] longArr;
}
+ fFlag=kFALSE; // flag to signal that is not compressed anymore
+
}
//________________________________________________________________________________
void AliTRDarrayDictionary::Reset()
Int_t GetData(Int_t nrow, Int_t ncol, Int_t ntime) const;\r
void SetData(Int_t nrow, Int_t ncol, Int_t ntime, Int_t value);\r
static void CreateLut();\r
- Bool_t HasData() const {return fFlag;}; \r
+ Bool_t IsCompressed() const {return fFlag;}; \r
\r
protected:\r
\r
Int_t fNtime; //Number of time bins\r
Int_t fNDdim; //Dimension of the Dictionary array\r
Int_t* fDictionary; //[fNDdim] //Pointer to integers array\r
- Bool_t fFlag; //Flag for data contents in the array\r
+ Bool_t fFlag; //Flag in case of compressed array\r
static Short_t *fgLutPadNumbering; // [fNcol] Look Up Table\r
\r
- ClassDef(AliTRDarrayDictionary,4) //Dictionary container class\r
+ ClassDef(AliTRDarrayDictionary,5) //Dictionary container class\r
\r
};\r
#endif\r