diff --git a/Aux/EventBuilder.cpp b/Aux/EventBuilder.cpp index 583a195..b382aec 100644 --- a/Aux/EventBuilder.cpp +++ b/Aux/EventBuilder.cpp @@ -1,5 +1,4 @@ #include "fsuReader.h" -#include "fsutsReader.h" #include "TROOT.h" #include "TSystem.h" @@ -9,9 +8,8 @@ #include "TTree.h" #include "TMacro.h" -//#include "CustomStruct.h" -#define MAX_MULTI 1000 +#define MAX_MULTI 2000 struct FileInfo{ diff --git a/Aux/Makefile b/Aux/Makefile index 0edacfe..aea801c 100644 --- a/Aux/Makefile +++ b/Aux/Makefile @@ -14,7 +14,7 @@ ROOTLIBS = `root-config --cflags --glibs` OBJS = ClassDigitizer.o MultiBuilder.o ClassInfluxDB.o -ALL = test test_indep EventBuilder EventBuilderNoTrace DataReader DumpFSU2ROOT SettingsExplorer +ALL = test EventBuilder DataReader DumpFSU2ROOT SettingsExplorer ######################################################################### @@ -36,9 +36,9 @@ test : test.cpp ../ClassDigitizer.o ../MultiBuilder.o ../ClassInfluxDB.o @echo "--------- making test" $(CC) $(COPTS) -o test test.cpp ../ClassDigitizer.o ../MultiBuilder.o ../ClassInfluxDB.o $(CAENLIBS) $(ROOTLIBS) -lcurl -test_indep : test_indep.cpp ../RegisterAddress.h ../macro.h - @echo "--------- making test_indep" - $(CC) $(COPTS) -o test_indep test_indep.cpp $(CAENLIBS) +# test_indep : test_indep.cpp ../RegisterAddress.h ../macro.h +# @echo "--------- making test_indep" +# $(CC) $(COPTS) -o test_indep test_indep.cpp $(CAENLIBS) DataReader : DataReaderScript.cpp ../ClassData.h MultiBuilder.o @echo "--------- making DataReader" @@ -48,13 +48,13 @@ DataReader : DataReaderScript.cpp ../ClassData.h MultiBuilder.o # @echo "--------- making EventBuilder" # $(CC) $(COPTS) -o EventBuilder_old EventBuilder_old.cpp MultiBuilder.o $(ROOTLIBS) -EventBuilder : EventBuilder.cpp ../ClassData.h fsuReader.h fsutsReader.h ../Hit.h CustomStruct.h +EventBuilder : EventBuilder.cpp ../ClassData.h fsuReader.h ../Hit.h @echo "--------- making EventBuilder" $(CC) $(COPTS) -o EventBuilder EventBuilder.cpp $(ROOTLIBS) -EventBuilderNoTrace : EventBuilderNoTrace.cpp ../ClassData.h fsuReader.h ../Hit.h CustomStruct.h - @echo "--------- making EventBuilderNoTrace" - $(CC) $(COPTS) -o EventBuilderNoTrace EventBuilderNoTrace.cpp $(ROOTLIBS) +# EventBuilderNoTrace : EventBuilderNoTrace.cpp ../ClassData.h fsuReader.h ../Hit.h +# @echo "--------- making EventBuilderNoTrace" +# $(CC) $(COPTS) -o EventBuilderNoTrace EventBuilderNoTrace.cpp $(ROOTLIBS) DumpFSU2ROOT : DumpFSU2ROOT.cpp ../ClassData.h MultiBuilder.o @echo "--------- making DumpFSU2ROOT" diff --git a/Aux/fsuReader.h b/Aux/fsuReader.h index 20aa52e..8c59eec 100644 --- a/Aux/fsuReader.h +++ b/Aux/fsuReader.h @@ -3,7 +3,7 @@ #include #include -#include "AggSeparator.h" +// #include "AggSeparator.h" class FSUReader{ @@ -65,12 +65,10 @@ class FSUReader{ std::vector ReadBatch(unsigned int batchSize = 1000000, bool verbose = false); // output the sorted Hit - void SortAndSaveTS(unsigned int batchSize = 1000000, bool verbose = false); - - std::string SaveHit(std::vector hitList, bool isAppend = false); - + // std::string SaveHit(std::vector hitList, bool isAppend = false); // std::string SaveHit2NewFile(std::string saveFolder = "./", std::string indexStr = ""); - off_t GetTSFileSize() const {return tsFileSize;} + // void SortAndSaveTS(unsigned int batchSize = 1000000, bool verbose = false); + // off_t GetTSFileSize() const {return tsFileSize;} //TODO //void SplitFile(unsigned long hitSizePreFile); @@ -577,6 +575,7 @@ inline std::vector FSUReader::ReadBatch(unsigned int batchSize, bool verbos } +/* inline void FSUReader::SortAndSaveTS(unsigned int batchSize, bool verbose){ int count = 0; @@ -706,8 +705,9 @@ inline void FSUReader::SortAndSaveTS(unsigned int batchSize, bool verbose){ printf("================= finished.\n"); } +*/ - +/* inline std::string FSUReader::SaveHit(std::vector hitList, bool isAppend){ std::string outFileName; @@ -785,85 +785,6 @@ inline std::string FSUReader::SaveHit(std::vector hitList, bool isAppend){ return outFileName; } - - -// inline std::string FSUReader::SaveHit2NewFile(std::string saveFolder, std::string indexStr){ - -// std::string folder = ""; -// size_t found = fileName.find_last_of('/'); -// std::string outFileName = fileName; -// if( found != std::string::npos ){ -// folder = fileName.substr(0, found + 1); -// outFileName = fileName.substr(found +1 ); -// } - -// if( saveFolder.empty() ) saveFolder = "./"; -// if( saveFolder.back() != '/') saveFolder += '/'; - -// //checkif the saveFolder exist; -// if( saveFolder != "./"){ -// if (!std::filesystem::exists(saveFolder)) { -// if (std::filesystem::create_directory(saveFolder)) { -// std::cout << "Directory created successfully." << std::endl; -// } else { -// std::cerr << "Failed to create directory." << std::endl; -// } -// } -// } - -// outFileName = saveFolder + outFileName + ".ts" + indexStr; - -// SaveHit( this->hit, saveFolder + outFileName, indexStr); - - - // FILE * outFile = fopen(outFileName.c_str(), "wb"); //overwrite binary - - // uint32_t header = 0xAA000000; - // header += sn; - // fwrite( &header, 4, 1, outFile ); - // uint64_t hitSize = hit.size(); - // fwrite( &hitSize, 8, 1, outFile); - - // for( ulong i = 0; i < hitSize; i++){ - - // if( i% 10000 == 0 ) printf("Saving %lu/%lu Hit (%.2f%%)\n\033[A\r", i, hitSize, i*100./hitSize); - - // uint16_t flag = hit[i].ch + (hit[i].pileUp << 8) ; - - // if( DPPType == DPPTypeCode::DPP_PSD_CODE ) flag += ( 1 << 15); - // if( hit[i].traceLength > 0 ) flag += (1 << 14); - - // // fwrite( &(hit[i].ch), 1, 1, outFile); - // fwrite( &flag, 2, 1, outFile); - // fwrite( &(hit[i].energy), 2, 1, outFile); - // if( DPPType == DPPTypeCode::DPP_PSD_CODE ) fwrite( &(hit[i].energy2), 2, 1, outFile); - // fwrite( &(hit[i].timestamp), 6, 1, outFile); - // fwrite( &(hit[i].fineTime), 2, 1, outFile); - // if( hit[i].traceLength > 0 ) fwrite( &(hit[i].traceLength), 2, 1, outFile); - - // for( uShort j = 0; j < hit[i].traceLength; j++){ - // fwrite( &(hit[i].trace[j]), 2, 1, outFile); - // } - - // } - - // tsFileSize = ftello(outFile); // unsigned int = Max ~4GB - // fclose(outFile); - - // printf("Saved to %s, size: ", outFileName.c_str()); - // if( tsFileSize < 1024 ) { - // printf(" %ld Byte", tsFileSize); - // }else if( tsFileSize < 1024*1024 ) { - // printf(" %.2f kB", tsFileSize/1024.); - // }else if( tsFileSize < 1024*1024*1024){ - // printf(" %.2f MB", tsFileSize/1024./1024.); - // }else{ - // printf(" %.2f GB", tsFileSize/1024./1024./1024.); - // } - // printf("\n"); - -// return outFileName; - -// } +*/ diff --git a/Aux/AggSeparator.h b/Aux/obsolete/AggSeparator.h similarity index 100% rename from Aux/AggSeparator.h rename to Aux/obsolete/AggSeparator.h diff --git a/Aux/CustomStruct.h b/Aux/obsolete/CustomStruct.h similarity index 100% rename from Aux/CustomStruct.h rename to Aux/obsolete/CustomStruct.h diff --git a/Aux/EventBuilderNoTrace.cpp b/Aux/obsolete/EventBuilderNoTrace.cpp similarity index 100% rename from Aux/EventBuilderNoTrace.cpp rename to Aux/obsolete/EventBuilderNoTrace.cpp diff --git a/Aux/EventBuilder_clumsy.cpp b/Aux/obsolete/EventBuilder_clumsy.cpp similarity index 100% rename from Aux/EventBuilder_clumsy.cpp rename to Aux/obsolete/EventBuilder_clumsy.cpp diff --git a/Aux/EventBuilder_old.cpp b/Aux/obsolete/EventBuilder_old.cpp similarity index 100% rename from Aux/EventBuilder_old.cpp rename to Aux/obsolete/EventBuilder_old.cpp diff --git a/Aux/fsutsReader.h b/Aux/obsolete/fsutsReader.h similarity index 100% rename from Aux/fsutsReader.h rename to Aux/obsolete/fsutsReader.h diff --git a/Aux/test_indep.cpp b/Aux/obsolete/test_indep.cpp similarity index 100% rename from Aux/test_indep.cpp rename to Aux/obsolete/test_indep.cpp