FACT++  1.0
bool procEvt ( const shared_ptr< EVT_CTRL2 > &  evt)

Definition at line 903 of file EventBuilder.cc.

References eventCheck(), if(), kExt1, kExt2, kLPext, kLPint, kPedestal, kRequestEventCheckFailed, NBOARDS, Queue< T, List >::post(), primaryQueue, run, and RUN_CTRL2::triggerCounter.

904 {
905  RUN_CTRL2 &run = *evt->runCtrl;
906 
907  bool check = true;
908  if (evt->valid())
909  {
910  EVENT *event = evt->fEvent;
911 
912  // This is already done in initMemory()
913  //event->Roi = evt->runCtrl->roi0;
914  //event->RoiTM = evt->runCtrl->roi8;
915  //event->EventNum = evt->evNum;
916  //event->TriggerNum = evt->trgNum;
917  //event->TriggerType = evt->trgTyp;
918 
919  event->NumBoards = evt->nBoard;
920 
921  event->PCTime = evt->time.tv_sec;
922  event->PCUsec = evt->time.tv_usec;
923 
924  for (int ib=0; ib<NBOARDS; ib++)
925  event->BoardTime[ib] = evt->FADhead[ib].time;
926 
927  check = eventCheck(*evt);
928 
929  // If the event is valid, increase the trigger counter accordingly
930  if (check)
931  {
932  // Physics trigger
933  if (evt->trgTyp && !(evt->trgTyp & FAD::EventHeader::kAll))
934  run.triggerCounter[0]++;
935  // Pure pedestal trigger
936  else if ((evt->trgTyp&FAD::EventHeader::kPedestal) && !(evt->trgTyp&FAD::EventHeader::kTIM))
937  run.triggerCounter[1]++;
938  // external light pulser trigger
939  else if (evt->trgTyp & FAD::EventHeader::kLPext)
940  run.triggerCounter[2]++;
941  // time calibration triggers
942  else if (evt->trgTyp & (FAD::EventHeader::kTIM|FAD::EventHeader::kPedestal))
943  run.triggerCounter[3]++;
944  // internal light pulser trigger
945  else if (evt->trgTyp & FAD::EventHeader::kLPint)
946  run.triggerCounter[4]++;
947  // external trigger input 1
948  else if (evt->trgTyp & FAD::EventHeader::kExt1)
949  run.triggerCounter[5]++;
950  // external trigger input 2
951  else if (evt->trgTyp & FAD::EventHeader::kExt2)
952  run.triggerCounter[6]++;
953  // other triggers
954  else
955  run.triggerCounter[7]++;
956  }
957  }
958 
959  // If this is an invalid event, the current triggerCounter needs to be copied
960  // because runClose will use that one to update the TRIGGER_COUNTER.
961  // When closing the file, the trigger counter of the last successfully
962  // written event is used.
963  evt->triggerCounter = run.triggerCounter;
964 
965  // If event check has failed, skip the event and post a close request instead.
966  // Otherwise, if file is open post the event for being written
967  if (!check)
968  secondaryQueue.emplace(new EVT_CTRL2(kRequestEventCheckFailed, evt->runCtrl));
969  else
970  secondaryQueue.post(evt);
971 
972  return true;
973 }
Queue< shared_ptr< EVT_CTRL2 > > secondaryQueue(bind(&writeEvt, placeholders::_1))
External trigger signal 2.
Definition: HeadersFTM.h:210
Pedestal trigger (artifical)
Definition: HeadersFTM.h:207
Enable artificial trigger after light pulse (LP2)
Definition: HeadersFTM.h:208
std::array< uint32_t, 8 > triggerCounter
Definition: EventBuilder.h:76
static int run
Definition: dim_fork.cxx:9
bool eventCheck(const EVT_CTRL2 &evt)
#define NBOARDS
Definition: BasicGlCamera.h:4
External trigger signal 1.
Definition: HeadersFTM.h:211
if(extraDns) new Dns
Enable trigger decision after light pulse (CalibrationTrigger, LP1)
Definition: HeadersFTM.h:209

+ Here is the call graph for this function: