From 86ac37d89862ea33a95f1c87e277832e060c4a90 Mon Sep 17 00:00:00 2001 From: "carina@hades" Date: Fri, 26 Jan 2024 15:11:20 -0500 Subject: [PATCH] seperate FileInfo and GroupInfo struct --- Aux/CustomStruct.h | 49 +++++++++++++++++++++++++++++++++++++ Aux/EventBuilder.cpp | 2 ++ Aux/EventBuilderNoTrace.cpp | 1 + Aux/fsuReader.h | 41 ------------------------------- 4 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 Aux/CustomStruct.h diff --git a/Aux/CustomStruct.h b/Aux/CustomStruct.h new file mode 100644 index 0000000..2e13594 --- /dev/null +++ b/Aux/CustomStruct.h @@ -0,0 +1,49 @@ +#ifndef CustomStruct_H +#define CustomStruct_H + +#include +#include +#include + +#define ORDERSHIFT 100000 + +struct FileInfo { + std::string fileName; + unsigned int fileSize; + unsigned int SN; + unsigned long hitCount; + unsigned short DPPType; + unsigned short tick2ns; + unsigned short order; + unsigned short readerID; + + unsigned long long t0; + + unsigned long ID; // sn + 100000 * order + + void CalOrder(){ ID = ORDERSHIFT * SN + order; } + + void Print(){ + printf(" %10lu | %3d | %60s | %2d | %6lu | %10u Bytes = %.2f MB\n", + ID, DPPType, fileName.c_str(), tick2ns, hitCount, fileSize, fileSize/1024./1024.); + } +}; + +struct GroupInfo{ + + std::vector fileIDList; + unsigned int usedHitCount ; + + std::vector readerIDList; + unsigned long hitID ; // this is the ID for the reader->GetHit(hitID); + + unsigned short currentID ; // the ID of the readerIDList; + unsigned long hitCount ; // this is the hitCount for the currentID; + unsigned int sn; + bool finished; + + unsigned long long timeShift; + +}; + +#endif \ No newline at end of file diff --git a/Aux/EventBuilder.cpp b/Aux/EventBuilder.cpp index da80132..35856b6 100644 --- a/Aux/EventBuilder.cpp +++ b/Aux/EventBuilder.cpp @@ -8,6 +8,8 @@ #include "TFile.h" #include "TTree.h" +#include "CustomStruct.h" + #define MAX_MULTI 1000 //^############################################################# diff --git a/Aux/EventBuilderNoTrace.cpp b/Aux/EventBuilderNoTrace.cpp index c7ab8f9..f2b8aa5 100644 --- a/Aux/EventBuilderNoTrace.cpp +++ b/Aux/EventBuilderNoTrace.cpp @@ -1,4 +1,5 @@ #include "fsuReader.h" +#include "CustomStruct.h" #include "TROOT.h" #include "TSystem.h" diff --git a/Aux/fsuReader.h b/Aux/fsuReader.h index 60cb086..bbeb97e 100644 --- a/Aux/fsuReader.h +++ b/Aux/fsuReader.h @@ -3,47 +3,6 @@ #include #include -#define ORDERSHIFT 100000 - -struct FileInfo { - std::string fileName; - unsigned int fileSize; - unsigned int SN; - unsigned long hitCount; - unsigned short DPPType; - unsigned short tick2ns; - unsigned short order; - unsigned short readerID; - - unsigned long long t0; - - unsigned long ID; // sn + 100000 * order - - void CalOrder(){ ID = ORDERSHIFT * SN + order; } - - void Print(){ - printf(" %10lu | %3d | %60s | %2d | %6lu | %10u Bytes = %.2f MB\n", - ID, DPPType, fileName.c_str(), tick2ns, hitCount, fileSize, fileSize/1024./1024.); - } -}; - -struct GroupInfo{ - - std::vector fileIDList; - uInt usedHitCount ; - - std::vector readerIDList; - ulong hitID ; // this is the ID for the reader->GetHit(hitID); - - unsigned short currentID ; // the ID of the readerIDList; - ulong hitCount ; // this is the hitCount for the currentID; - uInt sn; - bool finished; - - unsigned long long timeShift; - -}; - class FSUReader{ public: