// and then comes the ADC-values on that pad. When a serie of zeros occure, a zero
// is written followed by the number of zeros. If the number of zeros is more than
// 255 (8 bit), another 8 bit word is written for the remaining. At the end of one
-// pad, 2 zeros are written.
-//
-// Example:
+// pad, 2 zeros are written. Example:
//
// ROW PAD 0 NZEROS ADC ADC ADC ADC 0 NZEROS ADC ADC 0 0
//
charge = fBitTransformer->Get0to1(charge); //Transform 10 to 8 bit.
//Check for saturation:
- if(charge>=255)
+ if(charge>255)
{
LOG(AliL3Log::kWarning,"AliL3DataHandler::Memory2CompMemory","Digit")
<<"ADC-value saturated : "<<charge<<ENDLOG;
AliL3DigitRowData *rowPt = data;
UInt_t index=0;
-
+
UShort_t pad,time,charge;
for(UInt_t i=0; i<nrow; i++)
{
//Read the row:
rowPt->fRow = Read(comp,index);
-
+
//Read the number of pads:
UShort_t npads = Read(comp,index);
- cout<<"Read npads "<<npads<<endl;
+
for(UShort_t p=0; p<npads; p++)
{
//Read the current pad:
pad = Read(comp,index);
time = 0;
+
+ //Check for zeros:
if(Test(comp,index) == 0) //Zeros
{
//Read the first zero
UInt_t index=0;
Int_t outsize=0;
-
+
for(UInt_t i=0; i<nrow; i++)
{
UInt_t ndigit=0;//Digits on this row.
Read(comp,index);
UShort_t npad = Read(comp,index);
+
for(UShort_t pad=0; pad<npad; pad++)
{
//Read the pad number:
Read(comp,index); //This was the end of pad.
continue;
}
- if(Read(comp,index)==255) //There can be up to 3 bytes with zero coding.
- if(Read(comp,index)==255)
+ if(Read(comp,index) == 255) //There can be up to 3 bytes with zero coding.
+ if(Read(comp,index) == 255)
Read(comp,index);
+ }
+
+ while(1)
+ {
+ while(Read(comp,index) != 0) ndigit++;
- while(1)
+ if(Test(comp,index) == 0)
{
- while(Read(comp,index) != 0) ndigit++;
-
- if(Test(comp,index) == 0)
- {
- Read(comp,index); //2 zeros = end of pad.
- break;
- }
- if(Read(comp,index)==255) //There can be up to 3 bytes with zero coding.
- if(Read(comp,index)==255)
- Read(comp,index);
+ Read(comp,index); //2 zeros = end of pad.
+ break;
}
+ if(Read(comp,index) == 255) //There can be up to 3 bytes with zero coding.
+ if(Read(comp,index) == 255)
+ Read(comp,index);
+
}
+
}
Int_t size = sizeof(AliL3DigitData)*ndigit + sizeof(AliL3DigitRowData);
outsize += size;