--- yoda/techmodel/PhysEndRunReader.cpp 2008/01/10 16:21:38 6.6 +++ yoda/techmodel/PhysEndRunReader.cpp 2008/02/11 11:04:27 6.7 @@ -24,7 +24,7 @@ */ std::string PhysEndRunReader::GetVersionInfo(void) const { return - "$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/PhysEndRunReader.cpp,v 6.5 2006/09/29 10:19:25 mocchiut Exp $\n"; + "$Header: /afs/ba.infn.it/user/pamela/src/CVS/yoda/techmodel/PhysEndRunReader.cpp,v 6.6 2008/01/10 16:21:38 mocchiut Exp $\n"; } /** @@ -79,21 +79,36 @@ offset = offset + 50; //CALO_BOARD_ID_HK + CALO_BOARD_STATUS_HK + 2*CALO_HKx + CRC (2Bytes) } else offset = offset + 4; //CALO_BOARD_ID_HK + CALO_BOARD_STATUS_HK + CRC (2Bytes) //subData[offset+(3+k)--->(15+k)] have a CRC(what?) in subData[offset+ 23--->24] - - // for(int k = 0; k < 7 ; k++){ - physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG = ((UINT8)(subData[offset])&0x1F); - physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG = (UINT8)(subData[offset+1]); - //subData[offset+2--->3] is a fixed word = 0x2 - physEndRun->CALO_ENDRUN[j].CALO_REG[0] = (((UINT16)(subData[offset+4]<<8))&0xFF00) + (((UINT16)subData[offset+5])&0x00FF); - physEndRun->CALO_ENDRUN[j].CALO_REG[1] = (((UINT16)(subData[offset+6]<<8))&0xFF00) + (((UINT16)subData[offset+7])&0x00FF); - physEndRun->CALO_ENDRUN[j].CALO_REG[2] = 0; - physEndRun->CALO_ENDRUN[j].CALO_REG[3] = 0; - physEndRun->CALO_ENDRUN[j].CALO_REG[4] = 0; - physEndRun->CALO_ENDRUN[j].CALO_REG[5] = 0; - physEndRun->CALO_ENDRUN[j].CALO_REG[6] = 0; - //subData[offset+ 0--->5] have a CRC(what?) in subData[offset+ 6--->7] - offset = offset + 56; //CALO_BOARD_ID_REG + CALO_BOARD_STATUS_REG + CALO_REG + CRC(2Byte) - // } + // + for(int k = 0; k < 7 ; k++){ + // + // in CALO_BOARD_ID_REG and CALO_BOARD_STATUS_REG we save only the last id and status register of the 7 and we don't save the CRC for each register. + // +// printf(" INLOPP k %i subdata %X \n",k,(UINT8)(subData[offset])); + physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG = ((UINT8)(subData[offset])&0x1F); + offset++; + physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG = (UINT8)(subData[offset]); + offset++; + offset++; + //subData[offset+2--->3] is a fixed word = 0x2 that is the data lenght + offset++; + physEndRun->CALO_ENDRUN[j].CALO_REG[k] = (((UINT16)(subData[offset]<<8))&0xFF00) + (((UINT16)subData[offset+1])&0x00FF); + offset++; + // CRC + offset++; + offset++; + // + offset++; + // physEndRun->CALO_ENDRUN[j].CALO_REG[1] = (((UINT16)(subData[offset+6]<<8))&0xFF00) + (((UINT16)subData[offset+7])&0x00FF); + // physEndRun->CALO_ENDRUN[j].CALO_REG[2] = 0; + // physEndRun->CALO_ENDRUN[j].CALO_REG[3] = 0; + // physEndRun->CALO_ENDRUN[j].CALO_REG[4] = 0; + // physEndRun->CALO_ENDRUN[j].CALO_REG[5] = 0; + // physEndRun->CALO_ENDRUN[j].CALO_REG[6] = 0; + //subData[offset+ 0--->5] have a CRC(what?) in subData[offset+ 6--->7] + // offset = offset + 56; //CALO_BOARD_ID_REG + CALO_BOARD_STATUS_REG + CALO_REG + CRC(2Byte) + }; + // j++; }