Changeset 11565
- Timestamp:
- 07/24/11 17:52:12 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/EventBuilderWrapper.h
r11545 r11565 407 407 } 408 408 409 int fRoiTM; 410 409 411 // -------------------------------------------------------------------------- 410 412 // … … 414 416 // 415 417 bool OpenFile(RUN_HEAD* h) 416 {418 { 417 419 //Form filename, based on runid and run-type 418 420 const string fileName = FormFileName(GetRunId(), "fits"); … … 451 453 } 452 454 455 h->NroiTM = 0; 456 453 457 vector<string> colNames; 454 458 vector<string> dataTypes; 455 AddColumnEntry(colNames, dataTypes, 1, 'J', "EventNum"); 456 AddColumnEntry(colNames, dataTypes, 1, 'I', "TriggerType"); 457 AddColumnEntry(colNames, dataTypes, 1, 'I', "NumBoards"); 458 AddColumnEntry(colNames, dataTypes, 1, 'I', "reserved"); 459 AddColumnEntry(colNames, dataTypes, 1, 'J', "SoftTrig"); 460 AddColumnEntry(colNames, dataTypes, 2, 'J', "PCTime"); 461 AddColumnEntry(colNames, dataTypes, NBOARDS, 'J', "BoardTime"); 462 AddColumnEntry(colNames, dataTypes, NPIX, 'I', "StartCell"); 463 AddColumnEntry(colNames, dataTypes, NTMARK, 'I', "StartTM"); 464 AddColumnEntry(colNames, dataTypes, NPIX*h->Nroi, 'I', "Data"); 459 AddColumnEntry(colNames, dataTypes, 1, 'J', "EventNum"); 460 AddColumnEntry(colNames, dataTypes, 1, 'I', "TriggerType"); 461 AddColumnEntry(colNames, dataTypes, 1, 'J', "NumBoards"); 462 AddColumnEntry(colNames, dataTypes, 1, 'J', "reserved"); 463 AddColumnEntry(colNames, dataTypes, 1, 'J', "SoftTrig"); 464 AddColumnEntry(colNames, dataTypes, 2, 'J', "PCTime"); 465 AddColumnEntry(colNames, dataTypes, h->NBoard, 'J', "BoardTime"); 466 AddColumnEntry(colNames, dataTypes, h->NPix, 'I', "StartCellData"); 467 AddColumnEntry(colNames, dataTypes, h->NTm, 'I', "StartCellTimeMarker"); 468 AddColumnEntry(colNames, dataTypes, h->NPix*h->Nroi, 'I', "Data"); 469 AddColumnEntry(colNames, dataTypes, h->NTm*h->NroiTM, 'I', "TimeMarker"); 465 470 466 471 // Write length of physical pipeline (1024) 467 472 473 /* 468 474 ostringstream fmt; 469 fmt << "I:1;S:1;I:1;I:1;I:1;I:2"; 470 fmt << ";I:" << NBOARDS; 471 fmt << ";S:" << NPIX; 472 fmt << ";S:" << NTMARK; 473 fmt << ";S:" << NPIX*h->Nroi; 474 475 fConv = new Converter(fmt.str()); 475 fmt << "I:1"; // uint32_t EventNum 476 fmt << ";S:1"; // uint16_t TriggerType 477 fmt << ";I:5"; // uint32_t NumBoards, reserved, SoftTrig, PCTime, PCUsec 478 fmt << ";I:" << h->NBoard; // uint32_t BoardTime[NBOARDS] 479 fmt << ";S:" << h->NPix+h->NTm; // int16_t StartPix[NPIX], StartTM[NTMARK] 480 fmt << ";S:" << h->NPix*h->Nroi + h->NTm*h->NroiTM; // int16_t Adc_Data[] 481 */ 482 fRoiTM = h->NroiTM; 483 484 cout << "==> " << Converter::ToFormat(dataTypes) << endl; 485 486 fConv = new Converter(Converter::ToFormat(dataTypes)); 476 487 477 488 //actually create the table … … 515 526 WriteKey("NTMARK", h->NTm, "Number of Time marks"); 516 527 WriteKey("NROI", h->Nroi, "Number of slices per pixels"); 528 WriteKey("NROITM", h->NroiTM, "Number of slices per time-marker"); 517 529 518 530 const Time now; … … 526 538 WriteKey("DAQ", "DRS4", ""); 527 539 528 Fatal("Write sampling frequency..."); 540 WriteKey("ADCCOUNT", 2.0f, "ADC Counts per milliVolt"); 541 542 Info("==> TODO: Write sampling frequency..."); 529 543 530 544 // Write a single key for: … … 637 651 fNumRows++; 638 652 639 const vector<char> data = fConv->ToFits(((char*)e)+2, sizeof(EVENT)+NPIX*e->Roi*2-2); 653 // FIXME: Get NPIX and NTMARK from header 654 const size_t sz = sizeof(EVENT) + sizeof(e->StartPix)*e->Roi+sizeof(e->StartTM)*fRoiTM; 655 656 const vector<char> data = fConv->ToFits(reinterpret_cast<char*>(e)+2, sz-2); 640 657 641 658 // column size pointer … … 1160 1177 catch (const exception &e) 1161 1178 { 1179 fMsg.Error("Exception trying to open file: "+string(e.what())); 1162 1180 return 0; 1163 1181 } … … 1351 1369 */ 1352 1370 1353 /*1354 1371 const FAD::EventHeader *beg = reinterpret_cast<FAD::EventHeader*>(fadhd); 1355 const FAD::EventHeader *end = reinterpret_cast<FAD::EventHeader*>(fadhd)+4 1;1372 const FAD::EventHeader *end = reinterpret_cast<FAD::EventHeader*>(fadhd)+40; 1356 1373 1357 1374 for (const FAD::EventHeader *ptr=beg; ptr!=end; ptr++) … … 1378 1395 if (ptr->fVersion != beg->fVersion) 1379 1396 return -1; 1380 } */1397 } 1381 1398 1382 1399 // check REFCLK_frequency
Note:
See TracChangeset
for help on using the changeset viewer.