+//____________________________________________________________________________
+Int_t AliPHOSGetter::ReadRaw(AliRawReader *rawReader)
+{
+ // reads the raw format data, converts it into digits format and store digits in Digits()
+ // container.
+
+ AliPHOSRawStream in(rawReader);
+
+ TClonesArray * digits = Digits() ;
+ digits->Clear() ;
+ Int_t idigit = 0 ;
+
+ while ( in.Next() ) { // PHOS entries loop
+
+ Int_t amp = in.GetSignal() ;
+ Double_t time = in.GetTime() ;
+ Int_t relId[4], id ;
+
+ relId[0] = in.GetModule() ;
+ if ( relId[0] >= PHOS()->GetRawFormatLowGainOffset() ) {
+ relId[0] -= PHOS()->GetRawFormatLowGainOffset() ;
+ }
+ relId[1] = 0 ;
+ relId[2] = in.GetRow() ;
+ relId[3] = in.GetColumn() ;
+ PHOSGeometry()->RelToAbsNumbering(relId, id) ;
+
+ if (amp > 0 && id >=0 ) {
+ new((*digits)[idigit]) AliPHOSDigit( -1, id, amp, time) ;
+ idigit++ ;
+ }
+
+ } // PHOS entries loop
+
+ digits->Sort() ;
+
+ return digits->GetEntriesFast() ;
+}