add prefix in RunTimeStamp.dat

This commit is contained in:
Ryan Tang 2024-06-10 16:22:01 -04:00
parent 7ad3ed4af0
commit dcb3d73776
4 changed files with 22 additions and 15 deletions

View File

@ -167,7 +167,7 @@ int main(int argc, char **argv) {
} }
reader[i] = new FSUReader(fList, 600, debug); reader[i] = new FSUReader(fList, 600, debug);
hitList[i] = reader[i]->ReadBatch(batchSize, 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; ID[i] = 0;
if( debug ) { if( debug ) {
@ -216,6 +216,7 @@ int main(int argc, char **argv) {
//chekc if reached the end of hitList //chekc if reached the end of hitList
if( ID[ig] >= hitList[ig].size() ) { if( ID[ig] >= hitList[ig].size() ) {
hitList[ig] = reader[ig]->ReadBatch(batchSize, debug + 1); hitList[ig] = reader[ig]->ReadBatch(batchSize, debug + 1);
if( debug ) reader[ig]->PrintHitListInfo( &hitList[ig], "hitList-" + std::to_string(ig));
ID[ig] = 0; ID[ig] = 0;
if( hitList[ig].size() == 0 ) continue; if( hitList[ig].size() == 0 ) continue;
} }
@ -234,6 +235,7 @@ int main(int argc, char **argv) {
//check if reached the end of hitList //check if reached the end of hitList
if( ID[ig] >= hitList[ig].size() ) { if( ID[ig] >= hitList[ig].size() ) {
hitList[ig] = reader[ig]->ReadBatch(batchSize, debug); hitList[ig] = reader[ig]->ReadBatch(batchSize, debug);
if( debug ) reader[ig]->PrintHitListInfo( &hitList[ig], "hitList-" + std::to_string(ig));
ID[ig] = 0; ID[ig] = 0;
if( hitList[ig].size() == 0 ) break; if( hitList[ig].size() == 0 ) break;
} }

View File

@ -79,13 +79,14 @@ class FSUReader{
} }
} }
static void PrintHitListInfo(std::vector<Hit> hitList, std::string name){ static void PrintHitListInfo(std::vector<Hit> * hitList, std::string name){
size_t n = hitList.size(); size_t n = hitList->size();
size_t s = sizeof(Hit); size_t s = sizeof(Hit);
printf("============== %s, size : %zu | %.2f MByte\n", name.c_str(), n, n*s/1024./1024.); printf("============== %s, size : %zu | %.2f MByte\n", name.c_str(), n, n*s/1024./1024.);
if( n > 0 ){ if( n > 0 ){
printf("t0 : %15llu \n", hitList.at(0).timestamp); printf("t0 : %15llu ns\n", hitList->front().timestamp);
printf("t1 : %15llu \n", hitList.back().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); size_t s = sizeof(Hit);
printf("============== reader.hit, size : %zu | %.2f MByte\n", n, n*s/1024./1024.); printf("============== reader.hit, size : %zu | %.2f MByte\n", n, n*s/1024./1024.);
if( n > 0 ){ if( n > 0 ){
printf("t0 : %15llu \n", hit.at(0).timestamp); printf("t0 : %15llu ns\n", hit.at(0).timestamp);
printf("t1 : %15llu \n", hit.back().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<Hit> FSUReader::ReadBatch(unsigned int batchSize, bool verbos
uLong t1_B = hit.back().timestamp; uLong t1_B = hit.back().timestamp;
if( verbose ) { if( verbose ) {
printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize); printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize);
printf("t0 : %15lu\n", t0_B); printf("t0 : %15lu ns\n", t0_B);
printf("t1 : %15lu\n", t1_B); printf("t1 : %15lu ns\n", t1_B);
printf("dt : %15.3f ms\n", (t1_B - t0_B)/1e6);
} }
hitList_A = hit; hitList_A = hit;
@ -500,6 +503,7 @@ inline std::vector<Hit> FSUReader::ReadBatch(unsigned int batchSize, bool verbos
printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize); printf(" hit in memeory : %7zu | %u | %lu \n", hit.size(), filePos, inFileSize);
printf("t0 : %15lu\n", t0_B); printf("t0 : %15lu\n", t0_B);
printf("t1 : %15lu\n", t1_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; uLong t0_A = hitList_A.at(0).timestamp;
@ -552,8 +556,8 @@ inline std::vector<Hit> FSUReader::ReadBatch(unsigned int batchSize, bool verbos
if( verbose ) { if( verbose ) {
printf("----------------- ID_A : %lu, Drop\n", ID_A); printf("----------------- ID_A : %lu, Drop\n", ID_A);
printf("----------------- ID_B : %lu, Drop\n", ID_B); printf("----------------- ID_B : %lu, Drop\n", ID_B);
PrintHitListInfo(hitList_A, "hitList_A"); PrintHitListInfo(&hitList_A, "hitList_A");
PrintHitListInfo(hitTemp, "hitTemp"); PrintHitListInfo(&hitTemp, "hitTemp");
PrintHitListInfo(); PrintHitListInfo();
printf("=========== sume of A + B + Temp : %zu \n", hitList_A.size() + hit.size() + hitTemp.size()); printf("=========== sume of A + B + Temp : %zu \n", hitList_A.size() + hit.size() + hitTemp.size());
printf("----------------- refill hitList_A \n"); printf("----------------- refill hitList_A \n");
@ -565,7 +569,7 @@ inline std::vector<Hit> FSUReader::ReadBatch(unsigned int batchSize, bool verbos
hitTemp.clear(); hitTemp.clear();
if( verbose ) { if( verbose ) {
PrintHitListInfo(hitList_A, "hitList_A"); PrintHitListInfo(&hitList_A, "hitList_A");
PrintHitListInfo(); PrintHitListInfo();
printf("=========== sume of A + B : %zu \n", hitList_A.size() + hit.size()); printf("=========== sume of A + B : %zu \n", hitList_A.size() + hit.size());
} }

View File

@ -55,7 +55,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
cbOpenDigitizers = new RComboBox(this); cbOpenDigitizers = new RComboBox(this);
cbOpenDigitizers->addItem("Open Digitizers ... ", 0); 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 (default program)", 2);
// cbOpenDigitizers->addItem("Open Digitizers + load Settings", 3); // cbOpenDigitizers->addItem("Open Digitizers + load Settings", 3);
//cbOpenDigitizers->addItem("Open Digitizers via USB", 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( file.open(QIODevice::Text | QIODevice::WriteOnly | QIODevice::Append) ){
if( isStartRun ){ 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{ }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(); file.close();

View File

@ -77,6 +77,7 @@ Ubuntu 22.04
- CAENCOmm v1.5.3 + - CAENCOmm v1.5.3 +
- CAENDigitizer v2.17.1 + - CAENDigitizer v2.17.1 +
- CAEN A3818 Driver v1.6.8 + - CAEN A3818 Driver v1.6.8 +
- CAENUSBdrv v1.5.5 + (for V57XX digitizer with USB connection)
- qt6-base-dev - qt6-base-dev
- libqt6charts6-dec - libqt6charts6-dec