From dcb3d73776a37a55d1319a0c4e7ecae143758fe4 Mon Sep 17 00:00:00 2001 From: "Ryan@SOLARIS_testStation" Date: Mon, 10 Jun 2024 16:22:01 -0400 Subject: [PATCH] add prefix in RunTimeStamp.dat --- Aux/EventBuilder.cpp | 4 +++- Aux/fsuReader.h | 26 +++++++++++++++----------- FSUDAQ.cpp | 6 +++--- README.md | 1 + 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/Aux/EventBuilder.cpp b/Aux/EventBuilder.cpp index f572582..b3853b6 100644 --- a/Aux/EventBuilder.cpp +++ b/Aux/EventBuilder.cpp @@ -167,7 +167,7 @@ int main(int argc, char **argv) { } reader[i] = new FSUReader(fList, 600, debug); hitList[i] = reader[i]->ReadBatch(batchSize, debug ); - reader[i]->PrintHitListInfo(hitList[i], "hitList-" + std::to_string(reader[i]->GetSN())); + reader[i]->PrintHitListInfo(&hitList[i], "hitList-" + std::to_string(reader[i]->GetSN())); ID[i] = 0; if( debug ) { @@ -216,6 +216,7 @@ int main(int argc, char **argv) { //chekc if reached the end of hitList if( ID[ig] >= hitList[ig].size() ) { hitList[ig] = reader[ig]->ReadBatch(batchSize, debug + 1); + if( debug ) reader[ig]->PrintHitListInfo( &hitList[ig], "hitList-" + std::to_string(ig)); ID[ig] = 0; if( hitList[ig].size() == 0 ) continue; } @@ -234,6 +235,7 @@ int main(int argc, char **argv) { //check if reached the end of hitList if( ID[ig] >= hitList[ig].size() ) { hitList[ig] = reader[ig]->ReadBatch(batchSize, debug); + if( debug ) reader[ig]->PrintHitListInfo( &hitList[ig], "hitList-" + std::to_string(ig)); ID[ig] = 0; if( hitList[ig].size() == 0 ) break; } diff --git a/Aux/fsuReader.h b/Aux/fsuReader.h index a45b545..67c6e8e 100644 --- a/Aux/fsuReader.h +++ b/Aux/fsuReader.h @@ -79,13 +79,14 @@ class FSUReader{ } } - static void PrintHitListInfo(std::vector hitList, std::string name){ - size_t n = hitList.size(); + static void PrintHitListInfo(std::vector * hitList, std::string name){ + size_t n = hitList->size(); size_t s = sizeof(Hit); printf("============== %s, size : %zu | %.2f MByte\n", name.c_str(), n, n*s/1024./1024.); if( n > 0 ){ - printf("t0 : %15llu \n", hitList.at(0).timestamp); - printf("t1 : %15llu \n", hitList.back().timestamp); + printf("t0 : %15llu ns\n", hitList->front().timestamp); + printf("t1 : %15llu ns\n", hitList->back().timestamp); + printf("dt : %15.3f ms\n", (hitList->back().timestamp - hitList->front().timestamp)/1e6); } } @@ -94,8 +95,9 @@ class FSUReader{ size_t s = sizeof(Hit); printf("============== reader.hit, size : %zu | %.2f MByte\n", n, n*s/1024./1024.); if( n > 0 ){ - printf("t0 : %15llu \n", hit.at(0).timestamp); - printf("t1 : %15llu \n", hit.back().timestamp); + printf("t0 : %15llu ns\n", hit.at(0).timestamp); + printf("t1 : %15llu ns\n", hit.back().timestamp); + printf("dt : %15.3f ms\n", (hit.back().timestamp - hit.front().timestamp)/1e6); } } @@ -472,8 +474,9 @@ inline std::vector FSUReader::ReadBatch(unsigned int batchSize, bool verbos uLong t1_B = hit.back().timestamp; if( verbose ) { printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize); - printf("t0 : %15lu\n", t0_B); - printf("t1 : %15lu\n", t1_B); + printf("t0 : %15lu ns\n", t0_B); + printf("t1 : %15lu ns\n", t1_B); + printf("dt : %15.3f ms\n", (t1_B - t0_B)/1e6); } hitList_A = hit; @@ -500,6 +503,7 @@ inline std::vector FSUReader::ReadBatch(unsigned int batchSize, bool verbos printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize); printf("t0 : %15lu\n", t0_B); printf("t1 : %15lu\n", t1_B); + printf("dt : %15.3f ms\n", (t1_B - t0_B)/1e6); } uLong t0_A = hitList_A.at(0).timestamp; @@ -552,8 +556,8 @@ inline std::vector FSUReader::ReadBatch(unsigned int batchSize, bool verbos if( verbose ) { printf("----------------- ID_A : %lu, Drop\n", ID_A); printf("----------------- ID_B : %lu, Drop\n", ID_B); - PrintHitListInfo(hitList_A, "hitList_A"); - PrintHitListInfo(hitTemp, "hitTemp"); + PrintHitListInfo(&hitList_A, "hitList_A"); + PrintHitListInfo(&hitTemp, "hitTemp"); PrintHitListInfo(); printf("=========== sume of A + B + Temp : %zu \n", hitList_A.size() + hit.size() + hitTemp.size()); printf("----------------- refill hitList_A \n"); @@ -565,7 +569,7 @@ inline std::vector FSUReader::ReadBatch(unsigned int batchSize, bool verbos hitTemp.clear(); if( verbose ) { - PrintHitListInfo(hitList_A, "hitList_A"); + PrintHitListInfo(&hitList_A, "hitList_A"); PrintHitListInfo(); printf("=========== sume of A + B : %zu \n", hitList_A.size() + hit.size()); } diff --git a/FSUDAQ.cpp b/FSUDAQ.cpp index feb768b..5dd9619 100644 --- a/FSUDAQ.cpp +++ b/FSUDAQ.cpp @@ -55,7 +55,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){ cbOpenDigitizers = new RComboBox(this); cbOpenDigitizers->addItem("Open Digitizers ... ", 0); - cbOpenDigitizers->addItem("Open Digitizers via Optical", 1); + cbOpenDigitizers->addItem("Open Digitizers via Optical/USB", 1); // cbOpenDigitizers->addItem("Open Digitizers (default program)", 2); // cbOpenDigitizers->addItem("Open Digitizers + load Settings", 3); //cbOpenDigitizers->addItem("Open Digitizers via USB", 3); @@ -1679,9 +1679,9 @@ void MainWindow::WriteRunTimestamp(bool isStartRun){ if( file.open(QIODevice::Text | QIODevice::WriteOnly | QIODevice::Append) ){ if( isStartRun ){ - file.write(("Start Run | " + QString::number(runID) + " | " + dateTime + " | " + startComment + "\n").toStdString().c_str()); + file.write(("Start Run | " + QString::number(runID) + " | " + dateTime + " | " + lePrefix->text() + " | " + startComment + "\n").toStdString().c_str()); }else{ - file.write((" Stop Run | " + QString::number(runID) + " | " + dateTime + " | " + stopComment + "\n").toStdString().c_str()); + file.write((" Stop Run | " + QString::number(runID) + " | " + dateTime + " | " + lePrefix->text() + " | " + stopComment + "\n").toStdString().c_str()); } file.close(); diff --git a/README.md b/README.md index 9dd2f42..8fe1edb 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,7 @@ Ubuntu 22.04 - CAENCOmm v1.5.3 + - CAENDigitizer v2.17.1 + - CAEN A3818 Driver v1.6.8 + +- CAENUSBdrv v1.5.5 + (for V57XX digitizer with USB connection) - qt6-base-dev - libqt6charts6-dec