#include "AliTRDarrayDictionary.h"
#include "AliTRDfeeParam.h"
+#include "AliLog.h"
ClassImp(AliTRDarrayDictionary)
,fNtime(0)
,fNDdim(0)
,fDictionary(0)
- ,fFlag(kTRUE)
+ ,fFlag(kFALSE)
{
//
// AliTRDarrayDictionary default contructor
,fNtime(0)
,fNDdim(0)
,fDictionary(0)
- ,fFlag(kTRUE)
-
+ ,fFlag(kFALSE)
{
//
// AliTRDarrayDictionary contructor
// AliTRDarrayDictionary destructor
//
- if(fDictionary)
- {
- delete [] fDictionary;
- fDictionary=0;
- }
+ delete [] fDictionary;
+ fDictionary=0;
}
}
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=kFALSE; // This way it can be expanded afterwards
}
//________________________________________________________________________________
// Expand the array
//
+ if(fNDdim==0)
+ {
+ AliError("Called expand with dimension zero");
+ return;
+ }
+
+
Int_t dimexp=0;
+
+// if(WasExpandCalled())
+// 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(fNDdim==fNrow*fNumberOfChannels*fNtime)
+ return;
+
+ 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);
+ fFlag=kTRUE; // Not expand again
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))
Int_t contaexp =0;
Int_t h=0;
Int_t* bufferE = new Int_t[dimexp];
- memset(bufferE,-1,sizeof(Int_t)*dimexp);
if(bufferE)
{
-
+ memset(bufferE,-1,sizeof(Int_t)*dimexp);
for(Int_t i=0; i<dimexp; i++)
{
if(fDictionary[contaexp]>=-1)
{
delete [] longArr;
}
+ fFlag=kTRUE; // Not expand again
}
//________________________________________________________________________________