FACT++  1.0
void copyData ( const READ_STRUCT rBuf,
EVT_CTRL2 evt 
)

Definition at line 710 of file EventBuilder.cc.

References EVT_CTRL2::FADhead, EVT_CTRL2::fEvent, READ_STRUCT::H, i, NPIX, READ_STRUCT::S, and READ_STRUCT::sockId.

Referenced by mainloop().

711 {
712  const int i = rBuf.sockId;
713 
714  memcpy(evt->FADhead+i, &rBuf.H, sizeof(PEVNT_HEADER));
715 
716  int src = sizeof(PEVNT_HEADER) / 2; // Header is 72 byte = 36 shorts
717 
718  // consistency of ROIs have been checked already (is it all correct?)
719  const uint16_t &roi = rBuf.S[src+2];
720 
721  // different sort in FAD board.....
722  EVENT *event = evt->fEvent;
723  for (int px = 0; px < 9; px++)
724  {
725  for (int drs = 0; drs < 4; drs++)
726  {
727  const int16_t pixC = rBuf.S[src+1]; // start-cell
728  const int16_t pixR = rBuf.S[src+2]; // roi
729  //here we should check if pixH is correct ....
730 
731  const int pixS = i*36 + drs*9 + px;
732 
733  event->StartPix[pixS] = pixC;
734 
735  memcpy(event->Adc_Data + pixS*roi, &rBuf.S[src+4], roi * 2);
736 
737  src += 4+pixR;
738 
739  // Treatment for ch 9 (TM channel)
740  if (px != 8)
741  continue;
742 
743  const int tmS = i*4 + drs;
744 
745  //and we have additional TM info
746  if (pixR > roi)
747  {
748  event->StartTM[tmS] = (pixC + pixR - roi) % 1024;
749 
750  memcpy(event->Adc_Data + tmS*roi + NPIX*roi, &rBuf.S[src - roi], roi * 2);
751  }
752  else
753  {
754  event->StartTM[tmS] = -1;
755  }
756  }
757  }
758 }
PEVNT_HEADER * FADhead
Definition: EventBuilder.h:131
EVENT * fEvent
Definition: EventBuilder.h:132
int i
Definition: db_dim_client.c:21
PEVNT_HEADER H
uint16_t S[MAX_LEN/2]
#define NPIX
Definition: BasicGlCamera.h:5

+ Here is the caller graph for this function: