/[PAMELA software]/chewbacca/PamOffLineSW/techmodel/PhysEndRunReader.cpp
ViewVC logotype

Diff of /chewbacca/PamOffLineSW/techmodel/PhysEndRunReader.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mocchiut, Wed Sep 24 08:47:53 2008 UTC revision 1.3 by mocchiut, Wed Sep 24 15:17:23 2008 UTC
# Line 61  void PhysEndRunReader::PKT_RunEvent(char Line 61  void PhysEndRunReader::PKT_RunEvent(char
61          int j = 0;          int j = 0;
62          //physEndRun->CALO_ENDRUN.          //physEndRun->CALO_ENDRUN.
63          while(offset < tbInitPos){          while(offset < tbInitPos){
64            physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_HK     = (((UINT8)subData[offset])&0x1F);            physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_HK     = (((UINT8)subData[offset])&0xFF);
65            physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK = ((UINT8)subData[offset+1]);            physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK = ((UINT8)subData[offset+1]);
66            //subData[offset+2--->3] is a fixed word = 0x23            //subData[offset+2--->3] is a fixed word = 0x23
67            //If this bit is ? the subsequent CALO_HK are not valid            //If this bit is ? the subsequent CALO_HK are not valid
68            printf(" j %i calo_board_id_hk %X \n",j,physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_HK);            //      printf(" j %i calo_board_id_hk %X \n",j,physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_HK);
69            printf(" j %i calo_board_status_hk %X \n",j,physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK);            //      printf(" j %i calo_board_status_hk %X \n",j,physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK);
70            if (!(physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK & 0x02)) {            if (!(physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_HK & 0x02)) {
71              UInt_t kk = 0;              UInt_t kk = 0;
72              for(int k = 0; k < 11 ; k++){              for(int k = 0; k < 11 ; k++){
73                //              physEndRun->CALO_ENDRUN[j].CALO_HK0[k] = (UINT8)(subData[offset+4+kk])+ 255 + (UINT8)(subData[offset+5+kk]);                //              physEndRun->CALO_ENDRUN[j].CALO_HK0[k] = (UINT8)(subData[offset+4+kk])+ 255 + (UINT8)(subData[offset+5+kk]);
74                physEndRun->CALO_ENDRUN[j].CALO_HK0[k] = (((UINT16)(subData[offset+4+kk]<<8))&0xFF00) + (((UINT16)subData[offset+5+kk])&0x00FF);                physEndRun->CALO_ENDRUN[j].CALO_HK0[k] = (((UINT16)(subData[offset+4+kk]<<8))&0xFF00) + (((UINT16)subData[offset+5+kk])&0x00FF);
75                physEndRun->CALO_ENDRUN[j].CALO_HK1[k] = (((UINT16)(subData[offset+26+kk]<<8))&0xFF00) + (((UINT16)subData[offset+27+kk])&0x00FF);                physEndRun->CALO_ENDRUN[j].CALO_HK1[k] = (((UINT16)(subData[offset+26+kk]<<8))&0xFF00) + (((UINT16)subData[offset+27+kk])&0x00FF);
76                printf(" j %i k %i calo_hk0 %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_HK0[k]);                //              printf(" j %i k %i calo_hk0 %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_HK0[k]);
77                printf(" j %i k %i calo_hk1 %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_HK1[k]);                //              printf(" j %i k %i calo_hk1 %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_HK1[k]);
78                kk += 2;                kk += 2;
79              }                    }      
80              offset = offset + 50; //CALO_BOARD_ID_HK + CALO_BOARD_STATUS_HK + 2*CALO_HKx + CRC (2Bytes)              offset = offset + 50; //CALO_BOARD_ID_HK + CALO_BOARD_STATUS_HK + 2*CALO_HKx + CRC (2Bytes)
# Line 86  void PhysEndRunReader::PKT_RunEvent(char Line 86  void PhysEndRunReader::PKT_RunEvent(char
86              // 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.              // 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.
87              //              //
88              //    printf(" INLOPP k %i subdata %X \n",k,(UINT8)(subData[offset]));              //    printf(" INLOPP k %i subdata %X \n",k,(UINT8)(subData[offset]));
89              physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG[k]     = ((UINT8)(subData[offset])&0x1F);              physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG[k]     = ((UINT8)(subData[offset])&0xFF);
90              offset++;              offset++;
91              physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG[k] = (UINT8)(subData[offset]);              physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG[k] = (UINT8)(subData[offset]);
92              offset++;              offset++;
93              printf(" j %i k %i calo_board_id_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG[k]);              //      printf(" j %i k %i calo_board_id_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_BOARD_ID_REG[k]);
94              printf(" j %i k %i calo_board_status_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG[k]);              //      printf(" j %i k %i calo_board_status_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_BOARD_STATUS_REG[k]);
95              offset++;              offset++;
96              //subData[offset+2--->3] is a fixed word = 0x2 that is the data lenght              //subData[offset+2--->3] is a fixed word = 0x2 that is the data lenght
97              offset++;              offset++;
98              physEndRun->CALO_ENDRUN[j].CALO_REG[k] = (((UINT16)(subData[offset]<<8))&0xFF00) + (((UINT16)subData[offset+1])&0x00FF);              physEndRun->CALO_ENDRUN[j].CALO_REG[k] = (((UINT16)(subData[offset]<<8))&0xFF00) + (((UINT16)subData[offset+1])&0x00FF);
99              printf(" j %i k %i calo_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_REG[k]);              //      printf(" j %i k %i calo_reg %X \n",j,k,physEndRun->CALO_ENDRUN[j].CALO_REG[k]);
100              offset++;              offset++;
101              // CRC              // CRC
102              offset++;              offset++;
# Line 155  void PhysEndRunReader::PKT_RunEvent(char Line 155  void PhysEndRunReader::PKT_RunEvent(char
155  //     }  //     }
156                    
157          //--------------- TB SECTION------------------------------------          //--------------- TB SECTION------------------------------------
158          printf(" subdata[%u]  %X \n",offset,subData[offset]);          //      for (Int_t pi=-8; pi<40; pi++){
159          physEndRun->TB_ENDRUN.TB_ALARM_MASK   = (((UINT16)(subData[offset]<<8))&0xFF00) + (((UINT16)subData[offset + 1])&0x00FF);          //        printf(" subdata[%u]  %X \n",offset+pi,(UINT8)subData[offset+pi]);
160          //subData[offset+ 0--->1] have a CRC(what?) in subData[offset+2]          //      };
161          physEndRun->TB_ENDRUN.TB_PMT_MASK_S3  = ((((UINT16)(subData[offset+2]))<<4)&0x0FF0) + (((UINT16)subData[offset + 3]>>4)&0x000F);  
162          physEndRun->TB_ENDRUN.TB_PMT_MASK_S2  = ((((UINT8)(subData[offset+3]))<<4)&0xF0) + (((UINT8)subData[offset + 4]>>4)&0x0F);  //     UINT32  TB_ALARM_MASK;
163          physEndRun->TB_ENDRUN.TB_PMT_MASK_S12 = ((((UINT16)(subData[offset+4]))<<8)&0x0F00) + (((UINT16)subData[offset + 5])&0x00FF);  //     UINT32  TB_PMT_MASK_S3S2S12;
164          physEndRun->TB_ENDRUN.TB_PMT_MASK_S11 = ((((UINT16)(subData[offset+6]))<<8)&0xFF00) + (((UINT16)subData[offset + 7])&0x00FF);  //     UINT32  TB_PMT_MASK_S11CRC;
165          //subData[offset+ 3--->8] have a CRC(what?) in subData[offset+9]  //     UINT16  TB_S4_CAL_MASK;
166          physEndRun->TB_ENDRUN.TB_CALO_MASK    = ((UINT8)subData[offset+10])>>5;  //     UINT32  TB_BUSY_MASK;
167          physEndRun->TB_ENDRUN.TB_S4_MASK      = (((UINT8)subData[offset+10])>>1)&0x0F;  //     UINT32  TB_TRIG_CONF;        
168          //subData[tbInitPos+9] have a CRC(what?) in subData[tbInitPos+11]  
169          physEndRun->TB_ENDRUN.TB_BUSY_MASK    = (((UINT32)subData[offset+12]<<16)&0x00FF0000) +  (((UINT32)subData[offset+13]<<8)&0x0000FF00) + (((UINT32)subData[offset+14])&0x000000FF);          physEndRun->TB_ENDRUN.TB_ALARM_MASK   = (((UINT32)(subData[offset]<<16))&0x00FF0000) + (((UINT32)(subData[offset + 1]<<8))&0x0000FF00) + (((UINT32)(subData[offset + 2]))&0x000000FF);
170          //subData[tbInitPos+ 12--->14] have a CRC(what?) in subData[tbInitPos+15]          offset += 3;
171          physEndRun->TB_ENDRUN.TB_CALIB_FLAG   = ((UINT8)subData[offset+16])>>7;          //
172          physEndRun->TB_ENDRUN.TB_CALO_TRIG    = ((UINT8)subData[offset+16])>>6;          physEndRun->TB_ENDRUN.TB_PMT_MASK_S3S2S12 = (((UINT32)(subData[offset]<<24))&0xFF000000) + (((UINT32)(subData[offset + 1]<<16))&0x00FF0000) + (((UINT32)(subData[offset + 2]<<8))&0x0000FF00)  + (((UINT32)(subData[offset + 3]))&0x000000FF);
173          physEndRun->TB_ENDRUN.TB_S4_TRIG      = ((UINT8)subData[offset+16])>>5;          offset += 4;
174          physEndRun->TB_ENDRUN.TB_TOF_TRIG     = (UINT8)(subData[offset+16]<<3) + (UINT8)(subData[offset+17]>>6);          //
175          //subData[tbInitPos+ 16--->17] have a CRC(what?) in subData[tbInitPos+18]          physEndRun->TB_ENDRUN.TB_PMT_MASK_S11CRC = (((UINT32)(subData[offset]<<16))&0x00FF0000) + (((UINT32)(subData[offset + 1]<<8))&0x0000FF00) + (((UINT32)(subData[offset + 2]))&0x000000FF);
176                    offset += 3;
177            //
178            physEndRun->TB_ENDRUN.TB_S4_CAL_MASK = (((UINT16)(subData[offset]<<8))&0xFF00) + (((UINT16)(subData[offset + 1]))&0x00FF);
179            offset += 2;
180            //
181            physEndRun->TB_ENDRUN.TB_BUSY_MASK = (((UINT32)(subData[offset]<<24))&0xFF000000) + (((UINT32)(subData[offset + 1]<<16))&0x00FF0000) + (((UINT32)(subData[offset + 2]<<8))&0x0000FF00)  + (((UINT32)(subData[offset + 3]))&0x000000FF);
182            offset += 4;
183            //
184            physEndRun->TB_ENDRUN.TB_TRIG_CONF = (((UINT32)(subData[offset]<<16))&0x00FF0000) + (((UINT32)(subData[offset + 1]<<8))&0x0000FF00) + (((UINT32)(subData[offset + 2]))&0x000000FF);
185            offset += 3;
186            //
187    
188            //      printf(" physEndRun->TB_ENDRUN.TB_ALARM_MASK %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_ALARM_MASK);
189            //      printf(" physEndRun->TB_ENDRUN.TB_PMT_MASK_S3S2S12 %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_PMT_MASK_S3S2S12);
190            //      printf(" physEndRun->TB_ENDRUN.TB_PMT_MASK_S11CRC %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_PMT_MASK_S11CRC);
191            //      printf(" physEndRun->TB_ENDRUN.TB_S4_CAL_MASK %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_S4_CAL_MASK);
192            //      printf(" physEndRun->TB_ENDRUN.TB_BUSY_MASK %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_BUSY_MASK);
193            //      printf(" physEndRun->TB_ENDRUN.TB_TRIG_CONF %X \n",(UInt_t)physEndRun->TB_ENDRUN.TB_TRIG_CONF);
194    
195          // I want to use the packet so the exception is thrown here after all ..          // I want to use the packet so the exception is thrown here after all ..
196          if (subCRC != readCRC)          if (subCRC != readCRC)
197            {            {
# Line 191  void PhysEndRunReader::PKT_RunEvent(char Line 209  void PhysEndRunReader::PKT_RunEvent(char
209   */   */
210  std::string PhysEndRunReader::GetVersionInfo(void) const {  std::string PhysEndRunReader::GetVersionInfo(void) const {
211    return    return
212      "$Header: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/PhysEndRunReader.cpp,v 1.1.1.1 2008/09/23 07:20:24 mocchiut Exp $\n";      "$Header: /afs/ba.infn.it/user/pamela/src/CVS/chewbacca/PamOffLineSW/techmodel/PhysEndRunReader.cpp,v 1.2 2008/09/24 08:47:53 mocchiut Exp $\n";
213  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23