64 LOG(INFO) <<
"SciFiUnpack : Unpacking frame... size/bytes = " << size ;
67 switch (df->header.frameTime) {
68 case SoS: LOG(INFO) <<
"SciFiUnpack: SoS frame." ;
return kTRUE;
69 case EoS: LOG(INFO) <<
"SciFiUnpack: EoS frame." ;
return kTRUE;
75 assert(df->header.size == size);
76 auto nhits = df->getHitCount();
77 LOG(INFO) << nhits <<
" hits." ;
78 std::vector<HitData> hits(df->hits, df->hits + nhits);
80 for (
auto &&hitData : hits) {
81 auto triggerFlag = (hitData.ch >= 16000) ? 1 : 0;
82 auto board = (triggerFlag == 1) ? (hitData.ch - 15999) : (hitData.ch / 512 + 1);
83 auto layer = (board-1) / 3 + 1;
84 if (layer==1) layerID=111;
85 else if (layer==2) layerID=112;
86 else if (layer==3) layerID=121;
87 else if (layer==4) layerID=122;
88 else if (layer==5) layerID=131;
89 else if (layer==6) layerID=132;
90 else if (layer==7) layerID=141;
94 auto detectorId = board * pow(10, 5) + hitData.ch;
95 bool trigflag = triggerFlag;
97 new ((*fRawData)[
fNHits]) SciFiHit(detectorId, layerID, hitData.ch, board, hitData.time, hitData.finetime, hitData.flags, trigflag);