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);
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;
}

View File

@ -79,13 +79,14 @@ class FSUReader{
}
}
static void PrintHitListInfo(std::vector<Hit> hitList, std::string name){
size_t n = hitList.size();
static void PrintHitListInfo(std::vector<Hit> * 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<Hit> 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<Hit> 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<Hit> 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<Hit> 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());
}

View File

@ -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();

View File

@ -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