Changeset 16531
- Timestamp:
- 05/31/13 14:32:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilder.cc
r16382 r16531 58 58 bool runWrite(const EVT_CTRL2 &evt); 59 59 void runClose(); 60 void applyCalib(const shared_ptr<EVT_CTRL2> &evt);60 void applyCalib(const EVT_CTRL2 &evt, const size_t &size); 61 61 void factOut(int severity, const char *message); 62 62 void factReportIncomplete (uint64_t rep); 63 63 void gotNewRun(RUN_CTRL2 &run); 64 64 void runFinished(); 65 void factStat( GUI_STATgj);65 void factStat(const GUI_STAT &gj); 66 66 bool eventCheck(const EVT_CTRL2 &evt); 67 67 void debugHead(void *buf); … … 702 702 703 703 // different sort in FAD board..... 704 EVENT *event = evt->fEvent; 704 705 for (int px = 0; px < 9; px++) 705 706 { … … 712 713 const int pixS = i*36 + drs*9 + px; 713 714 714 ev t->fEvent->StartPix[pixS] = pixC;715 716 memcpy(ev t->fEvent->Adc_Data + pixS*roi, &rBuf.S[src+4], roi * 2);715 event->StartPix[pixS] = pixC; 716 717 memcpy(event->Adc_Data + pixS*roi, &rBuf.S[src+4], roi * 2); 717 718 718 719 src += 4+pixR; … … 727 728 if (pixR > roi) 728 729 { 729 ev t->fEvent->StartTM[tmS] = (pixC + pixR - roi) % 1024;730 731 memcpy(ev t->fEvent->Adc_Data + tmS*roi + NPIX*roi, &rBuf.S[src - roi], roi * 2);730 event->StartTM[tmS] = (pixC + pixR - roi) % 1024; 731 732 memcpy(event->Adc_Data + tmS*roi + NPIX*roi, &rBuf.S[src - roi], roi * 2); 732 733 } 733 734 else 734 735 { 735 ev t->fEvent->StartTM[tmS] = -1;736 event->StartTM[tmS] = -1; 736 737 } 737 738 } … … 788 789 // ========================================================================== 789 790 790 Queue<shared_ptr<EVT_CTRL2>> processingQueue1(bind(&applyCalib, placeholders::_1)); 791 void proc1(const shared_ptr<EVT_CTRL2> &); 792 793 Queue<shared_ptr<EVT_CTRL2>> processingQueue1(bind(&proc1, placeholders::_1)); 794 795 void proc1(const shared_ptr<EVT_CTRL2> &evt) 796 { 797 applyCalib(*evt, processingQueue1.size()); 798 } 791 799 792 800 // If this is not convenient anymore, it could be replaced by … … 873 881 if (evt->valid()) 874 882 { 875 evt->fEvent->Errors[0] = evt->Errors[0]; 876 evt->fEvent->Errors[1] = evt->Errors[1]; 877 evt->fEvent->Errors[2] = evt->Errors[2]; 878 evt->fEvent->Errors[3] = evt->Errors[3]; 879 880 evt->fEvent->PCTime = evt->time.tv_sec; 881 evt->fEvent->PCUsec = evt->time.tv_usec; 882 883 evt->fEvent->NumBoards = evt->nBoard; 883 EVENT *event = evt->fEvent; 884 885 // This is already done in initMemory() 886 //event->Roi = evt->runCtrl->roi0; 887 //event->RoiTM = evt->runCtrl->roi8; 888 //event->EventNum = evt->evNum; 889 //event->TriggerNum = evt->trgNum; 890 //event->TriggerType = evt->trgTyp; 891 892 event->NumBoards = evt->nBoard; 893 894 event->Errors[0] = evt->Errors[0]; 895 event->Errors[1] = evt->Errors[1]; 896 event->Errors[2] = evt->Errors[2]; 897 event->Errors[3] = evt->Errors[3]; 898 899 event->PCTime = evt->time.tv_sec; 900 event->PCUsec = evt->time.tv_usec; 884 901 885 902 for (int ib=0; ib<NBOARDS; ib++) 886 ev t->fEvent->BoardTime[ib] = evt->FADhead[ib].time;903 event->BoardTime[ib] = evt->FADhead[ib].time; 887 904 888 905 if (!eventCheck(*evt)) … … 1300 1317 // ================================================================== 1301 1318 1302 gj.bufNew = evtCtrl.size(); //# incomplete events in buffer1303 gj.bufEvt = primaryQueue.size(); //# complete events in buffer1304 gj.bufTot = gj.bufNew+gj.bufEvt; //# total events currently in buffer1305 if (gj.bufNew>gj.maxEvt) //# maximum events in buffer past cycle1306 gj.maxEvt = gj.bufNew;1307 1308 // ==================================================================1309 1310 1319 const time_t actTime = time(NULL); 1311 1320 if (actTime == gi_SecTime) … … 1347 1356 // ================================================================= 1348 1357 1349 gj.bufTot = Memory::max_inuse/MAX_TOT_MEM; 1350 gj.usdMem = Memory::max_inuse; 1351 gj.totMem = Memory::allocated; 1358 gj.bufNew = evtCtrl.size(); //# incomplete events in buffer 1359 gj.bufEvt = primaryQueue.size(); //# complete events in buffer 1360 gj.bufWrite = secondaryQueue.size(); //# complete events in buffer 1361 gj.bufProc = processingQueue1.size(); //# complete events in buffer 1362 gj.bufTot = Memory::max_inuse/MAX_TOT_MEM; 1363 gj.usdMem = Memory::max_inuse; 1364 gj.totMem = Memory::allocated; 1365 gj.maxMem = g_maxMem; 1352 1366 1353 1367 gj.deltaT = 1000; // temporary, must be improved … … 1370 1384 1371 1385 Memory::max_inuse = 0; 1372 gj.maxEvt = 0;1373 1386 1374 1387 for (int ib=0; ib<NBOARDS; ib++) … … 1433 1446 1434 1447 memset(gi_NumConnect, 0, NBOARDS*sizeof(*gi_NumConnect)); 1435 memset(gj.numConn, 0, NBOARDS*sizeof(*gj.numConn)); 1436 memset(gj.totBytes, 0, NBOARDS*sizeof(*gj.totBytes)); 1437 1438 gj.bufTot = gj.maxEvt = gj.xxxEvt = 0; 1439 gj.maxMem = gj.xxxMem = 0; 1448 1449 memset(&gj, 0, sizeof(GUI_STAT)); 1440 1450 1441 1451 gj.usdMem = Memory::inuse; 1442 1452 gj.totMem = Memory::allocated; 1443 1444 gj.bufNew = gj.bufEvt = 0; 1445 gj.evtSkip = gj.evtWrite = gj.evtErr = 0; 1446 gj.readStat = gj.procStat = gj.writStat = 0; 1447 1453 gj.maxMem = g_maxMem; 1448 1454 1449 1455
Note:
See TracChangeset
for help on using the changeset viewer.