- // Look over rows
- for(Int_t iRow = 1; iRow <= kNRows; iRow++) {
-
- UInt_t rowMarker = GetNextWord(); // Read row marker
-
- Int_t numRows= rowMarker >> 16 & 0xffffff;
-
- if ((rowMarker >> 0 & 0xffff) != 0x32a8) {
- fRawReader->AddMajorErrorLog(kRowMarkerErr);
- AliWarning(Form("Wrong row marker %x for row %d, expected 0x32a8!",rowMarker,iRow));
- return kTRUE;
- }//check for row marker
- UInt_t dilogic = 0, row = 0;
- UInt_t cntData=0;
- UInt_t cntEoE=0;
- //molnarl: lets read how many rows we have from the marker; 10 dilogic EoE so we can get the number of data words they should be in order
- for(Int_t iWordInRow=0; iWordInRow<numRows;iWordInRow++) //loop over words
- {
- UInt_t tmpword=GetNextWord();
- UInt_t eOfEvent = tmpword; // always assume that it is an EoE. If bit
- if (!((eOfEvent >> 27) & 0x1)) { // if it is not EoE then data!
- UInt_t data=tmpword;
- row = (data >> 22) & 0x1f; //row information in raw word is between bits: 22...26
- if (row < 1 || row > kNRows) { //select bits from 22 and with 0x1f ask for the next 5 bits
- fRawReader->AddMajorErrorLog(kWrongRowErr,Form("row %d",row));
- AliWarning(Form("Wrong row index: %d, expected (1 -> %d)!",row,kNRows));
- // row = iRow;
- }
- dilogic = (data >> 18) & 0xf; //dilogic info in raw word is between bits: 18...21
- if (dilogic < 1 || dilogic > kNDILOGICAdd) {
- fRawReader->AddMajorErrorLog(kWrongDilogicErr,Form("dil %d",dilogic));
- AliWarning(Form("Wrong DILOGIC index: %d, expected (1 -> %d)!",dilogic,kNDILOGICAdd));
- //dilogic = iDILOGIC;
- }
- UInt_t pad = (data >> 12) & 0x3f; //pad info in raw word is between bits: 12...17
- if (pad >= kNPadAdd) {
- fRawReader->AddMajorErrorLog(kWrongPadErr,Form("pad %d",pad));
- AliWarning(Form("Wrong pad index: %d, expected (0 -> %d)!",pad,kNPadAdd));
- //pad = iPad;
- }
- fCharge[fDDLNumber][row][dilogic][pad] = data & 0xfff; cntData++;
-
- }//not EoE but data!
- //if it is EoE
- else{
- //Printf("EoE word");
- if (!((eOfEvent >> 27) & 0x1)) { //check 27th bit in EoE. It must be 1!
- fRawReader->AddMajorErrorLog(kEoEFlagErr);
- AliWarning(Form("Missing end-of-event flag! (%x)",eOfEvent));
- return kTRUE;
- }
- UInt_t wc = eOfEvent & 0x7f;
- if (wc != cntData) {
- fRawReader->AddMajorErrorLog(kEoESizeErr,Form("eoe size=%d",wc));
- AliWarning(Form("Wrong end-of-event word-count:%d, expected 48!",wc));
- return kTRUE;
- }
- UInt_t da = (eOfEvent >> 18) & 0xf;
- if (cntData!=0 && da != dilogic) {
- fRawReader->AddMajorErrorLog(kEoEDILOGICErr,Form("eoe dil %d != %d",da,dilogic));
- AliWarning(Form("Wrong DILOGIC address found in end-of-event: %d, expected %d!",da,dilogic));
- return kTRUE;
- }
- UInt_t ca = (eOfEvent >> 22) & 0x1f;
- if (cntData!=0 && ca != row) {
- fRawReader->AddMajorErrorLog(kEoERowErr,Form("eoe row %d != %d",ca,row));
- AliWarning(Form("Wrong row index found in end-of-event: %d, expected %d!",ca,row));
- return kTRUE;
- }
- cntData=0; cntEoE++;//zero it and wait for new data words
- } //EoE word
-
- } //loop over rows within two markers
-
-
-
- // Read the segment marker
- // One maker per 8 rows
-
- if (iRow%8 == 0) {
- UInt_t segWord = GetNextWord();
- if ((segWord >> 8) != 0xab0f58) {
- fRawReader->AddMajorErrorLog(kBadSegWordErr);
- AliWarning(Form("Wrong segment word signature: %x, expected 0xab0f58!",(segWord >> 8)));
- return kTRUE;
- }
-
- if ((segWord & 0xff) != (((UInt_t)iRow + 7) / 8)) {
- fRawReader->AddMajorErrorLog(kWrongSegErr,Form("seg %d != %d",segWord & 0xff,(iRow + 7) / 8));
- AliWarning(Form("Segment index (%d) does not correspond to the one expected from row index (%d)!",segWord & 0xff,(iRow + 7) / 8));
- return kTRUE;
- }
- }
- }//loop of Row
- }//REal data files selected by data lenght
-
- AliDebug(1,"Stop.");
+ if(charge==0)
+ {
+ AliDebug(1,Form("If PEDESTAL run -> WARNING: ZERO charge is read from DDL: %d row: %d dil: %d pad: %d",fDDLNumber,row,dilogic,pad));
+ fNumOfErr[fDDLNumber][kPedQZero]++;
+ }
+
+ }//iDil
+
+ cntDilogic -= cnt;
+ return kTRUE;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Bool_t AliHMPIDRawStream::CheckSegment()
+{
+ // Check the segment marker
+ //It returns: kFALSE if any error occurs
+ // kTRUE if all OK
+
+ UInt_t markSegment = 0xAB0;
+ /*
+ if (iRow%8 == 0) {
+ UInt_t segWord = GetWord();
+ if ((segWord >> 20) != statusSegWord) {
+ fRawReader->AddMajorErrorLog(kBadSegWordErr);
+ AliDebug(1,Form("Wrong segment word signature: %x, expected 0xab0!",(segWord >> 20)));
+ fNumOfErr[kBadSegWordErr]++;
+ return kTRUE;
+ }
+*/
+ UInt_t segMarker = (fWord >> kbit20) & 0xfff;
+ if (segMarker != markSegment ) {
+ //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment marker %0X wrong (expected %0X) at %i in word %0X!",segMarker,markSegment,fPosition,fWord));
+ AliDebug(1,Form("Segment marker %X wrong (expected %0X)! at %i in word %0X!",segMarker,markSegment,fPosition,fWord));
+ fNumOfErr[fDDLNumber][kWrongSegErr]++;
+ return kFALSE;
+ }
+
+ UInt_t segAddress = fWord & 0xff;
+ if (segAddress<1 ||segAddress>3) {
+ //fRawReader->AddMajorErrorLog(kWrongSegErr,Form("Segment address %d not in the valid range [1-3] at %i in word %0X",segAddress,fPosition,fWord));
+ AliDebug(1,Form("Segment address %d not in the valid range [1-3]",segAddress));
+ fNumOfErr[fDDLNumber][kWrongSegErr]++;
+ return kFALSE;
+ }
+// Printf("Segment Marker found at %i! Number of segment is %i",fPosition,segAddress);