diff --git a/.gitignore b/.gitignore index 6f91b52..0475b57 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ MergeEVT evt2hist ev22txt EventBuilder +EventBuilder2 *.so *.d diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 0417a1e..699630b 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -14,6 +14,17 @@ "cStandard": "c17", "cppStandard": "c++17", "intelliSenseMode": "macos-clang-arm64" + }, + { + "name": "Ryan", + "includePath": [ + "${workspaceFolder}/**", + "/opt/root/**" + ], + "defines": [], + "compilerPath": "/usr/bin/clang", + "cStandard": "c17", + "cppStandard": "c++17" } ], "version": 4 diff --git a/.vscode/settings.json b/.vscode/settings.json index 98b7879..40876d6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -64,6 +64,35 @@ "unordered_set": "cpp", "valarray": "cpp", "variant": "cpp", - "vector": "cpp" + "vector": "cpp", + "any": "cpp", + "atomic": "cpp", + "strstream": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "chrono": "cpp", + "codecvt": "cpp", + "compare": "cpp", + "concepts": "cpp", + "exception": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "random": "cpp", + "source_location": "cpp", + "system_error": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "format": "cpp", + "numbers": "cpp", + "ranges": "cpp", + "semaphore": "cpp", + "stop_token": "cpp", + "thread": "cpp", + "cfenv": "cpp", + "cinttypes": "cpp", + "typeindex": "cpp" } } \ No newline at end of file diff --git a/armory/EventBuilder.cpp b/armory/EventBuilder.cpp index c174946..962e7d8 100644 --- a/armory/EventBuilder.cpp +++ b/armory/EventBuilder.cpp @@ -1,7 +1,13 @@ +/*================== + +Thie event builder both sort and build event. skip the *.to file. + +===================*/ + #include #include #include -#include +#include #include #include "TFile.h" @@ -11,170 +17,220 @@ #include "TStopwatch.h" #include "TTreeIndex.h" -#include "../mapping.h" +#include /** struct timeval, select() */ +inline unsigned int getTime_us(){ + unsigned int time_us; + struct timeval t1; + struct timezone tz; + gettimeofday(&t1, &tz); + time_us = (t1.tv_sec) * 1000 * 1000 + t1.tv_usec; + return time_us; +} + +// #include +// inline unsigned long long getTime_ns(){ +// std::chrono::high_resolution_clock::time_point currentTime = std::chrono::high_resolution_clock::now(); +// std::chrono::nanoseconds nanoseconds = std::chrono::duration_cast(currentTime.time_since_epoch()); +// return nanoseconds.count(); +// } + +#include "evtReader.h" #define MAXMULTI 100 +#define BUFFERSIZE 1000000 // number of time and filePos in buffer +#define DEBUG 0 int main(int argn, char **argv){ printf("=====================================\n"); - printf("=== Event Builder from *_raw.root ===\n"); + printf("=== Event Builder from *.evt ===\n"); printf("=====================================\n"); - if (argn != 2 && argn != 3 && argn != 4 ) { + if (argn < 6 ) { printf("Usage :\n"); - printf("%s [_raw.root File] \n", argv[0]); - printf(" timeWindows : default = 100 \n"); - printf(" SaveFileName : default is *.root \n"); + printf("%s [timeWindows] [mapping file] [Reject Flag] [SaveFileName] [*.evt File1] [*.evt File2] ...\n", argv[0]); + printf(" timeWindows [int]: 1 unit = 10 ns \n"); + printf(" mapping file path [str]: the path of mapping file. \n"); + printf(" Reject Flag [int]: 0 = no rejection, 1 = reject no gamma, 2 = reject no GAGG. see mapping.h\n"); + printf(" SaveFileName [str]: custom save file name \n"); return 1; } - - TString inFileName = argv[1]; // need to check name - int timeWindow = 100; - if( argn >= 3 ) timeWindow = atoi(argv[2]); - - printf(">>> Opening input %s \n", inFileName.Data()); - TFile * inFile = new TFile(inFileName, "READ"); - if( inFile->IsOpen() == false ) { - printf("!!!! cannot open file %s \n", inFileName.Data()); - return 0; + + int timeWindow = atoi(argv[1]); + TString mappingFilePath = argv[2]; + unsigned short rejectFlag = atoi(argv[3]); + TString outFileName = argv[4]; + + std::vector inFileList; + for( int i = 5; i < argn; i++) inFileList.push_back(argv[i]); + + printf(" Mapping file Path : %s \n", mappingFilePath.Data()); + printf(" Time window : %d ticks\n", timeWindow); + printf(" Reject Flag : %u \n", rejectFlag); + printf(" outfile Name : %s \n", outFileName.Data()); + + printf("--------------- Number of in files %ld \n", inFileList.size()); + for( size_t i = 0; i < inFileList.size(); i++){ + printf("%2ld | %s \n", i, inFileList[i].c_str()); } - - TTree * tree = (TTree *) inFile->Get("tree"); - - Long64_t evID; - UShort_t detID; - UShort_t energy; - ULong64_t energy_t; - TBranch *b_data_ID; //! - TBranch *b_ID; //! - TBranch *b_energy; //! - TBranch *b_energy_timestamp; //! + printf("================================== Digesting Mapping file (to be impletmented\n"); - tree->SetBranchAddress("evID", &evID, &b_data_ID); - tree->SetBranchAddress("id", &detID, &b_ID); - tree->SetBranchAddress("e", &energy, &b_energy); - tree->SetBranchAddress("e_t", &energy_t, &b_energy_timestamp); - - Long64_t totnumEntry = tree->GetEntries(); - - printf(" total Entry : %lld \n", totnumEntry); - printf(" event Build window: %d tick = %d nsec \n", timeWindow, timeWindow * 10); - - printf(">>> Buidling Index using the timestamp\n"); - tree->BuildIndex("e_t"); - TTreeIndex *in = (TTreeIndex*) tree->GetTreeIndex(); - Long64_t * index = in->GetIndex(); - - ULong64_t time0; //time-0 for each event - int timeDiff; - - TString outFileName = inFileName; - outFileName.Remove(inFileName.First("_raw")); - outFileName.Append(".root"); - if( argn >=4 ) outFileName = argv[3]; - - printf(">>> out File name : \033[1;31m%s\033[m\n", outFileName.Data()); - + + + + printf("================================== Creating Tree\n"); + printf(">>> Create output tree\n"); TFile * saveFile = new TFile(outFileName, "recreate"); - saveFile->cd(); TTree * newtree = new TTree("tree", outFileName); - Int_t eventID = 0 ; - Int_t multi = 0; /// this is total multipicilty for all detectors - newtree->Branch("multi", &multi, "multi/I"); - - - newtree->Branch("evID", &eventID, "event_ID/l"); + UInt_t eventID = 0 ; + UInt_t multi = 0; /// this is total multipicilty for all detectors + newtree->Branch("multi", &multi, "multi/i"); + newtree->Branch("evID", &eventID, "event_ID/i"); - Int_t multiCry = 0 ; /// thi is total multiplicity for all crystal - newtree->Branch("multiCry", &multiCry, "multiplicity_crystal/I"); + // Int_t multiCry = 0 ; /// thi is total multiplicity for all crystal + // newtree->Branch("multiCry", &multiCry, "multiplicity_crystal/I"); - int id[MAXMULTI] = {0}; - double e[MAXMULTI] = {TMath::QuietNaN()}; + UInt_t id[MAXMULTI] = {0}; + Int_t e[MAXMULTI] = {-1}; ULong64_t e_t[MAXMULTI] = {0}; - newtree->Branch("id", id, "id[multi]/I" ); - newtree->Branch("e", e, "e[multi]/D" ); + newtree->Branch("id", id, "id[multi]/i" ); + newtree->Branch("e", e, "e[multi]/I" ); newtree->Branch("e_t", e_t, "e_timestamp[multi]/l"); - + + saveFile->cd(); + printf("================== Start processing....\n"); Float_t Frac = 0.05; ///Progress bar TStopwatch StpWatch; StpWatch.Start(); - int multiOverflow = 0; - - for( Long64_t entry = 0; entry < totnumEntry; entry++){ - - /*********** Progress Bar ******************************************/ - if (entry>totnumEntry*Frac-1) { - TString msg; msg.Form("%llu", totnumEntry/1000); - int len = msg.Sizeof(); - printf(" %3.0f%% (%*llu/%llu k) processed in %6.1f sec | expect %6.1f sec\n", - Frac*100, len, entry/1000,totnumEntry/1000,StpWatch.RealTime(), StpWatch.RealTime()/Frac); - StpWatch.Start(kFALSE); - Frac+=0.1; - } - - Long64_t ev = index[entry]; - - b_ID->GetEntry(ev, 0); - b_energy->GetEntry(ev, 0); - b_energy_timestamp->GetEntry(ev, 0); - - if( time0 == 0) { - time0 = energy_t; - multi = 0; - } - timeDiff = (int) (energy_t - time0); - - if( timeDiff < timeWindow ) { - - if( multi > MAXMULTI ){ - multiOverflow++; - }else{ - id[multi] = detID; - e[multi] = energy; - e_t[multi] = energy_t; - multi ++; - if( detID < NCRYSTAL ) multiCry++; - } - }else{ - ///---- end of event - saveFile->cd(); - newtree->Fill(); - eventID ++; - - ///---- clear data - for( int i = 0; i < MAXMULTI ; i ++){ - id[i] = 0; - e[i] = TMath::QuietNaN(); - e_t[i] = 0; - } - multi = 0; - multiCry = 0; - - - /// fill 1st data of an event - time0 = energy_t; - timeDiff = 0; + std::vector hitList; + evtReader * reader = nullptr; + std::vector event; + event.clear(); + unsigned long int totalBlock; + unsigned long int blockCount = 0 ; - id[multi] = detID; - e[multi] = energy; - e_t[multi] = energy_t; - multi++; - if( detID < NCRYSTAL ) multiCry++; - } + unsigned long long tStart = 0; + unsigned long long tEnd = 0; + + unsigned int runStartTime = getTime_us(); + + for( size_t i = 0 ; i < inFileList.size(); i++){ + + reader = new evtReader(inFileList[i]); + reader->ScanNumberOfBlock(); + totalBlock = reader->GetNumberOfBlock(); + blockCount = 0; + + do{ + + hitList = reader->ReadBatchPos(BUFFERSIZE, DEBUG); + blockCount += hitList.size(); + printf(" %lu block %lu / %lu | %u \n", hitList.size(), blockCount, totalBlock, eventID); + if( hitList.size() == 0 ) break; + + for( size_t k = 0; k < hitList.size(); k++ ){ + + reader->ReadBlockAtPos(hitList[k].inFilePos); + + if( eventID == 0 ) tStart = reader->data->time; + + if( event.size() == 0 ) { + + event.push_back(*(reader->data)); + + if( timeWindow < 0 ) { // no event build + multi = 1; + e[0] = event[0].energy; + e_t[0] = event[0].time; + + if( DEBUG ){ + printf("====================== event %u, event size %u\n", eventID, multi); + printf("%6d, %12llu \n", event[0].energy, event[0].time); + } + + saveFile->cd(); + newtree->Fill(); + + eventID ++; + event.clear(); + } + + continue; + + }else{ + + if( hitList[k].time - event.front().time <= timeWindow ){ + event.push_back(*(reader->data)); + }else{ + + //save event + multi = event.size(); + + if( DEBUG ) printf("====================== event %u, event size %u\n", eventID, multi); + for( size_t p = 0; p < multi; p++ ) { + if( DEBUG ) printf("%lu | %6d, %12llu \n", p, event[p].energy, event[p].time); + e[p] = event[p].energy; + e_t[p] = event[p].time; + } + + saveFile->cd(); + newtree->Fill(); + + eventID ++; + + //clear event + event.clear(); + event.push_back(*(reader->data)); + + } + } + + } + + }while(true); + + tEnd = reader->data->time; + delete reader; } - printf("============================== finished.\n"); + //save the last event + if( timeWindow >= 0 ){ + multi = event.size(); + for( size_t p = 0; p < multi; p++ ) { + if( DEBUG ) printf("%lu | %6d, %12llu \n", p, event[p].energy, event[p].time); + e[p] = event[p].energy; + e_t[p] = event[p].time; + } + saveFile->cd(); + newtree->Fill(); + eventID ++; + } - saveFile->cd(); newtree->Write(); + + unsigned int runEndTime = getTime_us(); + double runTime = (runEndTime - runStartTime) * 1e-6; + printf("========================================= finished.\n"); + printf(" event building time = %.2f sec = %.2f min\n", runTime, runTime/60.); + printf(" total events built = %u by event builder (%llu in tree)\n", eventID , newtree->GetEntriesFast()); + double tDuration_sec = (tEnd - tStart) * 1e-9; + printf(" first timestamp = %20llu ns\n", tStart); + printf(" last timestamp = %20llu ns\n", tEnd); + printf(" total data duration = %.2f sec = %.2f min\n", tDuration_sec, tDuration_sec/60.); + printf("==============> saved to %s \n", outFileName.Data()); + + // TMacro info; + // info.AddLine(Form("tStart= %20llu ns",tStart)); + // info.AddLine(Form(" tEnd= %20llu ns",tEnd)); + // info.Write("info"); + saveFile->Close(); - - printf(" total number of event Built : %d \n", eventID); - printf(" total event has multi > %6d : %d \n", MAXMULTI, multiOverflow); -} + + + return 0; +} \ No newline at end of file diff --git a/armory/EventBuilder2.cpp b/armory/EventBuilder2.cpp deleted file mode 100644 index 7c9238f..0000000 --- a/armory/EventBuilder2.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/*================== - -Thie event builder both sort and build event. skip the *.to file. - -===================*/ - -#include -#include -#include -#include -#include - -#include "TFile.h" -#include "TTree.h" -#include "TMath.h" -#include "TBenchmark.h" -#include "TStopwatch.h" -#include "TTreeIndex.h" - -#include "../mapping.h" - -#include "evtReader.h" - -#define MAXMULTI 100 -#define MAXBUFFER 100 // number of hit in memory buffer - -int main(int argn, char **argv){ - printf("=====================================\n"); - printf("=== Event Builder from *.evt ===\n"); - printf("=====================================\n"); - - if (argn < 5 ) { - printf("Usage :\n"); - printf("%s [timeWindows] [Reject Flag] [SaveFileName] [*.evt File1 [*.evt File2] ...\n", argv[0]); - printf(" timeWindows [int]: 1 unit = 10 ns \n"); - printf(" Reject Flag [int]: 0 = no rejection, 1 = reject no gamma, 2 = reject no GAGG. see mapping.h\n"); - printf(" SaveFileName [str]: custom save file name \n"); - return 1; - } - - unsigned short timeWindow = atoi(argv[1]); - unsigned short rejectFlag = atoi(argv[2]); - TString outFileName = argv[3]; - - std::vector inFileList; - for( int i = 4; i < argn; i++) inFileList.push_back(argv[i]); - - //========== put data into RAM buffer. - std::vector hitListA, hitListB; - evtReader * reader = nullptr; - - for( size_t i = 0 ; i < inFileList.size(); i++){ - - reader = new evtReader(inFileList[i]); - reader->ScanNumberOfBlock(); - - reader->ReadBatchDataAndSort(MAXBUFFER); - hitListA = reader->GetDataList(); - - reader->ReadBatchDataAndSort(MAXBUFFER); - hitListB = reader->GetDataList(); - - delete reader; - } - - - return 0; -} \ No newline at end of file diff --git a/armory/EventBuilder_seperated.cpp b/armory/EventBuilder_seperated.cpp deleted file mode 100644 index 45fd3cf..0000000 --- a/armory/EventBuilder_seperated.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include -#include -#include -#include -#include - -#include "TFile.h" -#include "TTree.h" -#include "TMath.h" -#include "TBenchmark.h" -#include "TStopwatch.h" -#include "TTreeIndex.h" - -#include "../mapping.h" - -Int_t eventID = 0 ; -double e[NCRYSTAL]; -ULong64_t e_t[NCRYSTAL]; -double bgo[NBGO]; -ULong64_t bgo_t[NBGO]; -Short_t other[NOTHER]; -Short_t multi; - -void ClearTreeData(){ - - for( int i = 0; i < NCRYSTAL; i++){ - e[i] = TMath::QuietNaN(); - e_t[i] = 0; - //pileup[i] = 0; - //hit[i] = 0; - } - for( int i = 0; i < NBGO; i++) { - bgo[i] = TMath::QuietNaN(); - bgo_t[i] = 0 ; - } - for( int i = 0; i < NOTHER; i++) { - other[i] = TMath::QuietNaN(); - } - multi = 0; -} - -int main(int argn, char **argv){ - printf("=====================================\n"); - printf("=== Event Builder ===\n"); - printf("=====================================\n"); - - if (argn != 2 && argn != 3 && argn != 4 ) { - printf("Usage :\n"); - printf("%s [_raw.root File] \n", argv[0]); - printf(" timeWindows : default = 100 \n"); - printf(" SaveFileName : default is *.root \n"); - return 1; - } - - TString inFileName = argv[1]; // need to check name - int timeWindow = 100; - if( argn >= 3 ) timeWindow = atoi(argv[2]); - - printf(">>> Opening input %s \n", inFileName.Data()); - TFile * inFile = new TFile(inFileName, "READ"); - if( inFile->IsOpen() == false ) { - printf("!!!! cannot open file %s \n", inFileName.Data()); - return 0; - } - - TTree * tree = (TTree *) inFile->Get("tree"); - - Long64_t evID; - UShort_t detID; - UShort_t energy; - ULong64_t energy_t; - - TBranch *b_data_ID; //! - TBranch *b_ID; //! - TBranch *b_energy; //! - TBranch *b_energy_timestamp; //! - - tree->SetBranchAddress("evID", &evID, &b_data_ID); - tree->SetBranchAddress("id", &detID, &b_ID); - tree->SetBranchAddress("e", &energy, &b_energy); - tree->SetBranchAddress("e_t", &energy_t, &b_energy_timestamp); - - Long64_t totnumEntry = tree->GetEntries(); - - printf( "total Entry : %lld \n", totnumEntry); - - printf(">>> Buidling Index using the timestamp\n"); - tree->BuildIndex("e_t"); - TTreeIndex *in = (TTreeIndex*) tree->GetTreeIndex(); - Long64_t * index = in->GetIndex(); - - ULong64_t time0; //time-0 for each event - int timeDiff; - - - TString outFileName = inFileName; - outFileName.Remove(inFileName.First("_raw")); - outFileName.Append(".root"); - if( argn >=4 ) outFileName = argv[3]; - - printf(">>> out File name : %s\n", outFileName.Data()); - - printf(">>> Create output tree\n"); - TFile * saveFile = new TFile(outFileName, "recreate"); - saveFile->cd(); - TTree * newtree = new TTree("tree", "tree"); - - newtree->Branch("evID", &eventID, "event_ID/l"); - newtree->Branch("e", e, Form("e[%d]/D", NCRYSTAL)); - newtree->Branch("e_t", e_t, Form("e_timestamp[%d]/l", NCRYSTAL)); - //newtree->Branch("p", pileup, Form("pile_up_flag[%d]/s", NCRYSTAL)); - //newtree->Branch("hit", hit, Form("hit[%d]/s", NCRYSTAL)); - - newtree->Branch("bgo", bgo, Form("BGO_e[%d]/D", NBGO)); - newtree->Branch("bgo_t", bgo_t, Form("BGO_timestamp[%d]/l", NBGO)); - - newtree->Branch("other", other, Form("other_e[%d]/D", NOTHER)); - - newtree->Branch("multi", &multi, "multiplicity_crystal/I"); - - ClearTreeData(); - - printf("================== Start processing....\n"); - Float_t Frac = 0.1; ///Progress bar - TStopwatch StpWatch; - StpWatch.Start(); - eventID = 0; - - for( Long64_t entry = 0; entry < totnumEntry; entry++){ - - - /*********** Progress Bar ******************************************/ - if (entry>totnumEntry*Frac-1) { - TString msg; msg.Form("%llu", totnumEntry/1000); - int len = msg.Sizeof(); - printf(" %3.0f%% (%*llu/%llu k) processed in %6.1f sec | expect %6.1f sec\n", - Frac*100, len, entry/1000,totnumEntry/1000,StpWatch.RealTime(), StpWatch.RealTime()/Frac); - StpWatch.Start(kFALSE); - Frac+=0.1; - } - - entry = index[entry]; - - b_ID->GetEntry(entry); - b_energy->GetEntry(entry); - b_energy_timestamp->GetEntry(entry); - - if( time0 == 0) time0 = energy_t; - timeDiff = (int) (energy_t - time0); - - if( timeDiff < timeWindow ) { - - if ( detID < NCRYSTAL ){ - e[detID] = energy; - e_t[detID] = energy_t; - multi++; - } - if ( 100 <= detID && detID < 100 + NBGO ){ - bgo[detID-100] = energy; - bgo_t[detID-100] = energy_t; - } - if ( 200 <= detID && detID < 200 + NOTHER){ - other[detID-200] = energy; - } - - //printf("%d | %3d %6d %10llu, %3d\n", multi, detID, energy, energy_t, timeDiff); - - }else{ - //---- end of event - eventID ++; - - saveFile->cd(); - newtree->Fill(); - - ClearTreeData(); - - /// fill 1st data of an event - time0 = energy_t; - timeDiff = 0; - - if ( detID < NCRYSTAL ){ - e[detID] = energy; - e_t[detID] = energy_t; - multi = 1; - } - if ( 100 <= detID && detID < 100 + NBGO ){ - bgo[detID-100] = energy; - bgo_t[detID-100] = energy_t; - } - if ( 200 <= detID && detID < 200 + NOTHER){ - other[detID-200] = energy; - } - - } - - } - - printf("============================== finished.\n"); - - saveFile->cd(); - newtree->Write(); - saveFile->Close(); - - printf(" total number of event Built : %d \n", eventID); - -} diff --git a/armory/MergeEVT.cpp b/armory/MergeEVT.cpp deleted file mode 100644 index ae58511..0000000 --- a/armory/MergeEVT.cpp +++ /dev/null @@ -1,132 +0,0 @@ -#include -#include -#include -#include -#include -#include "TFile.h" -#include "TTree.h" -#include "TString.h" -#include "TMath.h" -#include "TBenchmark.h" -#include - -#define MAX_CRATES 2 -#define MAX_BOARDS_PER_CRATE 13 -#define MAX_CHANNELS_PER_BOARD 16 -#define BOARD_START 2 - -#include "../mapping.h" -#include "../armory/DataBlock.h" -#include "../armory/evtReader.h" - -//############################################# -// main -//############################################# -int main(int argn, char **argv) { - - printf("=====================================\n"); - printf("=== evt --> _raw.root ===\n"); - printf("=====================================\n"); - - if (argn < 3 ) { - printf("Usage :\n"); - printf("%s [outFile] [evt1] [evt2] [evt3] ..... \n", argv[0]); - printf("e.g.: \n"); - printf("%s hahaha_raw.root haha-000.evt haha-001.evt haha-002.evt\n", argv[0]); - printf("%s hahaha_raw.root `ls haha-*.evt`\n", argv[0]); - return 1; - } - - TString outFileName = argv[1]; - int nFiles = argn-2; - TString inFileName[nFiles]; - for( int i = 0; i < nFiles ; i++){ - inFileName[i] = argv[i+2]; - printf(" in file - %2d: %s\n", i, inFileName[i].Data()); - } - - printf(" out file: %s\n", outFileName.Data()); - - - evtReader * evt = new evtReader(); - DataBlock * data = evt->data; - short detID; - printf("====================================\n"); - - //====== ROOT file - TFile * outFile = new TFile(outFileName, "recreate"); - TTree * tree = new TTree("tree", "tree"); - - tree->Branch("evID", &data->eventID, "data_ID/L"); - tree->Branch("detID", &detID, "detID/s"); - tree->Branch("e", &data->energy, "crystal_energy/s"); - tree->Branch("e_t", &data->time, "crystal_timestamp/l"); - tree->Branch("p", &data->pileup, "pileup/O"); - tree->Branch("trace_length", &data->trace_length, "trace_length/s"); - tree->Branch("trace", data->trace, "trace[trace_length]/s"); - - TBenchmark gClock; - gClock.Reset(); - gClock.Start("timer"); - - //========================================= - //========================================= - //========================================= - //========================================= - for( int i = 0; i < nFiles; i++){ - - evt->OpenFile(inFileName[i]); - if( evt->IsOpen() == false ) continue; - - Long64_t measureCount = 0; - printf("\033[1;31mProcessing file: %s\033[0m\n", inFileName[i].Data()); - TBenchmark clock2; - clock2.Reset(); - clock2.Start("timer"); - - evt->ScanNumberOfBlock(); - - //=============== Read File - while( evt->IsEndOfFile() == false ){ - - evt->ReadBlock(); - //evt->PrintStatus(10000); - - int id = data->crate*MAX_BOARDS_PER_CRATE*MAX_CHANNELS_PER_BOARD + (data->slot-BOARD_START)*MAX_CHANNELS_PER_BOARD + data->ch; - detID = mapping[id]; - - //cern fill tree - outFile->cd(); - tree->Fill(); - } - - clock2.Stop("timer"); - double time = clock2.GetRealTime("timer"); - float tempf = (float)evt->GetFilePos()/(1024.*1024.*1024.); - printf(" measurements: \x1B[32m%lld \x1B[0m | %.3f GB\n", evt->GetBlockID(), tempf); - printf(" Time used:%3.0f min %5.2f sec\n", TMath::Floor(time/60.), time - TMath::Floor(time/60.)*60.); - printf(" Root file size so far: %.4f GB\n", outFile->GetSize()/1024./1024./1024.); - - } - - gClock.Stop("timer"); - double time = gClock.GetRealTime("timer"); - gClock.Start("timer"); - float tempf = (float)evt->GetFilePos()/(1024.*1024.*1024.); - printf("Total measurements: \x1B[32m%lld \x1B[0m\nPercent Complete: \x1B[32m%ld%% of %.3f GB\x1B[0m\nTime used:%3.0f min %5.2f sec\033[A\r", - evt->GetBlockID()+1, (100*evt->GetFilePos()/evt->GetFileSize()), tempf, TMath::Floor(time/60.), time - TMath::Floor(time/60.)*60.); - - - //cern save root - outFile->cd(); - double totRootSize = outFile->GetSize()/1024./1024./1024.; - tree->Write(); - outFile->Close(); - - gClock.Stop("timer"); - time = gClock.GetRealTime("timer"); - printf("\n==================== finished.\r\n"); - printf("Total time spend : %3.0f min %5.2f sec\n", TMath::Floor(time/60.), time - TMath::Floor(time/60.)*60.); - printf(" File size of %s : %.3f GB \n", outFileName.Data(), totRootSize); - -} diff --git a/armory/XIAEventBuilder.excalidraw b/armory/XIAEventBuilder.excalidraw index 32d11dd..42742d8 100644 --- a/armory/XIAEventBuilder.excalidraw +++ b/armory/XIAEventBuilder.excalidraw @@ -4,26 +4,30 @@ "source": "https://excalidraw.com", "elements": [ { - "id": "F7K7zMR1U55-x1Y0zNheF", "type": "rectangle", - "x": 911.1777777777761, - "y": 115, - "width": 217, - "height": 49.296296296296305, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 315, + "versionNonce": 1719979265, + "index": "a0", + "isDeleted": false, + "id": "F7K7zMR1U55-x1Y0zNheF", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 911.1777777777761, + "y": 115, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 217, + "height": 49.296296296296305, "seed": 1288944801, - "version": 313, - "versionNonce": 1380621359, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 1 + }, "boundElements": [ { "type": "text", @@ -33,74 +37,77 @@ "id": "wVuMtUwvQDwX0zsvknEbS", "type": "arrow" }, - { - "id": "j2LC8-0hrLNZXTpYAtx19", - "type": "arrow" - }, { "id": "v0ZCxQCjw27_GScx0D8wJ", "type": "arrow" } ], - "updated": 1647819194534, + "updated": 1717007561924, "link": null, - "fontSize": 24.97113665389526, - "baseline": 30.296296296296305 + "locked": false }, { - "id": "a-Y-OVWiKnXczi4Nhg3-k", "type": "text", + "version": 420, + "versionNonce": 866820495, + "index": "a1", + "isDeleted": false, + "id": "a-Y-OVWiKnXczi4Nhg3-k", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, "x": 916.1777777777761, "y": 124.14814814814815, + "strokeColor": "#000000", + "backgroundColor": "transparent", "width": 207, "height": 31, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "sharp", "seed": 307235695, - "version": 419, - "versionNonce": 111582319, - "isDeleted": false, - "boundElements": null, - "updated": 1647819196222, + "groupIds": [], + "frameId": null, + "roundness": null, + "boundElements": [], + "updated": 1717007549844, "link": null, - "text": "*.evt", + "locked": false, "fontSize": 24.97113665389526, "fontFamily": 1, + "text": "*.evt", "textAlign": "center", "verticalAlign": "middle", - "baseline": 22, "containerId": "F7K7zMR1U55-x1Y0zNheF", - "originalText": "*.evt" + "originalText": "*.evt", + "autoResize": true, + "lineHeight": 1.2414332767332916 }, { - "id": "soHz1JXys4CcGsQ3wYg0G", "type": "rectangle", - "x": 725.4370370370365, - "y": 291.659259259259, - "width": 217.79999999999995, - "height": 62.7407407407408, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 274, + "versionNonce": 720716513, + "index": "a2", + "isDeleted": false, + "id": "soHz1JXys4CcGsQ3wYg0G", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 725.4370370370365, + "y": 291.659259259259, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 217.79999999999995, + "height": 62.7407407407408, "seed": 784122305, - "version": 273, - "versionNonce": 949300495, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 1 + }, "boundElements": [ { "type": "text", @@ -119,41 +126,40 @@ "type": "arrow" } ], - "updated": 1647818401509, + "updated": 1717007549844, "link": null, - "fontSize": 24.971673819742485, - "baseline": 43.7407407407408 + "locked": false }, { - "id": "lVG_kdGInlSn8Z2rog8y_", "type": "rectangle", - "x": 904.5925925925924, - "y": 489.6592592592576, - "width": 217.79999999999995, - "height": 62.7407407407408, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 452, + "versionNonce": 471701423, + "index": "a3", + "isDeleted": false, + "id": "lVG_kdGInlSn8Z2rog8y_", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 904.5925925925924, + "y": 489.6592592592576, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 217.79999999999995, + "height": 62.7407407407408, "seed": 678994785, - "version": 451, - "versionNonce": 1100843809, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 1 + }, "boundElements": [ { "id": "BrUYg7L4kzqjcJN7o7PEr", "type": "text" }, - { - "type": "text", - "id": "BrUYg7L4kzqjcJN7o7PEr" - }, { "id": "cVfBGP1caGY3pgFvecDal", "type": "arrow" @@ -171,37 +177,36 @@ "type": "arrow" } ], - "updated": 1647818401509, + "updated": 1717007549844, "link": null, - "fontSize": 24.971673819742485, - "baseline": 43.7407407407408 + "locked": false }, { - "id": "75BzEnWMBt8CyzY_59Z5z", "type": "rectangle", - "x": 1043.5925925925924, - "y": 733.6592592592576, - "width": 218, - "height": 72, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 562, + "versionNonce": 1877753537, + "index": "a4", + "isDeleted": false, + "id": "75BzEnWMBt8CyzY_59Z5z", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 1043.5925925925924, + "y": 733.6592592592576, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 218, + "height": 72, "seed": 492968513, - "version": 561, - "versionNonce": 3329583, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 1 + }, "boundElements": [ - { - "id": "MtjqdHYBc5PTU-ra8NZHg", - "type": "text" - }, { "id": "MtjqdHYBc5PTU-ra8NZHg", "type": "text" @@ -214,10 +219,6 @@ "id": "P7NpNHMmnsu-hhgwxYmo2", "type": "arrow" }, - { - "type": "text", - "id": "MtjqdHYBc5PTU-ra8NZHg" - }, { "id": "P9cZwyL3gt9n5Uc2t372O", "type": "arrow" @@ -231,222 +232,156 @@ "type": "arrow" } ], - "updated": 1647818578857, + "updated": 1717007549844, "link": null, - "fontSize": 24.971673819742485, - "baseline": 43.7407407407408 + "locked": false }, { - "id": "N-IcJz-VgLd4G_w5IGZzo", - "type": "rectangle", - "x": 1073.2, - "y": 295.24444444444384, - "width": 217.79999999999995, - "height": 62.7407407407408, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "type": "text", + "version": 373, + "versionNonce": 408469153, + "index": "a6", + "isDeleted": false, + "id": "B5h2e4cOtLsO2Z2nCmXUv", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 1768193537, - "version": 360, - "versionNonce": 1477198831, - "isDeleted": false, - "boundElements": [ - { - "id": "qh81Y2_UCqH6h6CdDOgs3", - "type": "text" - }, - { - "type": "text", - "id": "qh81Y2_UCqH6h6CdDOgs3" - }, - { - "id": "j2LC8-0hrLNZXTpYAtx19", - "type": "arrow" - }, - { - "id": "P7NpNHMmnsu-hhgwxYmo2", - "type": "arrow" - } - ], - "updated": 1647818401510, - "link": null, - "fontSize": 24.971673819742485, - "baseline": 43.7407407407408 - }, - { - "id": "B5h2e4cOtLsO2Z2nCmXUv", - "type": "text", + "angle": 0, "x": 730.4370370370365, "y": 307.52962962962937, - "width": 207.79999999999995, - "height": 31, - "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", + "width": 207.79999999999995, + "height": 31, + "seed": 1364715503, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, + "link": null, + "locked": false, + "fontSize": 24.971673819742485, + "fontFamily": 1, + "text": "*.evt.to.fsu.xxx", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "soHz1JXys4CcGsQ3wYg0G", + "originalText": "*.evt.to.fsu.xxx", + "autoResize": true, + "lineHeight": 1.2414065722535408 + }, + { + "type": "text", + "version": 553, + "versionNonce": 1167112175, + "index": "a7", + "isDeleted": false, + "id": "BrUYg7L4kzqjcJN7o7PEr", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 1364715503, - "version": 372, - "versionNonce": 678113121, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401509, - "link": null, - "text": "*.evt.to.fsu.xxx", - "fontSize": 24.971673819742485, - "fontFamily": 1, - "textAlign": "center", - "verticalAlign": "middle", - "baseline": 22, - "containerId": "soHz1JXys4CcGsQ3wYg0G", - "originalText": "*.evt.to.fsu.xxx" - }, - { - "id": "BrUYg7L4kzqjcJN7o7PEr", - "type": "text", + "angle": 0, "x": 909.5925925925924, "y": 505.52962962962806, - "width": 207.79999999999995, - "height": 31, - "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", + "width": 207.79999999999995, + "height": 31, + "seed": 1623507279, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, + "link": null, + "locked": false, + "fontSize": 24.971673819742485, + "fontFamily": 1, + "text": "*.root", + "textAlign": "center", + "verticalAlign": "middle", + "containerId": "lVG_kdGInlSn8Z2rog8y_", + "originalText": "*.root", + "autoResize": true, + "lineHeight": 1.2414065722535408 + }, + { + "type": "text", + "version": 674, + "versionNonce": 585777793, + "index": "a8", + "isDeleted": false, + "id": "MtjqdHYBc5PTU-ra8NZHg", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 1623507279, - "version": 552, - "versionNonce": 1496118127, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401509, - "link": null, - "text": "*.root", - "fontSize": 24.971673819742485, - "fontFamily": 1, - "textAlign": "center", - "verticalAlign": "middle", - "baseline": 22, - "containerId": "lVG_kdGInlSn8Z2rog8y_", - "originalText": "*.root" - }, - { - "id": "MtjqdHYBc5PTU-ra8NZHg", - "type": "text", + "angle": 0, "x": 1048.5925925925924, "y": 738.6592592592576, + "strokeColor": "#000000", + "backgroundColor": "transparent", "width": 208, "height": 62, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", "seed": 1964271183, - "version": 673, - "versionNonce": 1808511041, - "isDeleted": false, - "boundElements": null, - "updated": 1647818578857, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "text": "*.root \n(simplified)", + "locked": false, "fontSize": 24.971673819742485, "fontFamily": 1, + "text": "*.root \n(simplified)", "textAlign": "center", "verticalAlign": "middle", - "baseline": 53, "containerId": "75BzEnWMBt8CyzY_59Z5z", - "originalText": "*.root (simplified)" + "originalText": "*.root (simplified)", + "autoResize": true, + "lineHeight": 1.2414065722535408 }, { - "id": "qh81Y2_UCqH6h6CdDOgs3", - "type": "text", - "x": 1078.2, - "y": 311.1148148148142, - "width": 207.79999999999995, - "height": 31, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "type": "arrow", + "version": 541, + "versionNonce": 207637089, + "index": "aA", + "isDeleted": false, + "id": "wVuMtUwvQDwX0zsvknEbS", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 252122593, - "version": 472, - "versionNonce": 817723009, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401510, - "link": null, - "text": "*_raw.root", - "fontSize": 24.971673819742485, - "fontFamily": 1, - "textAlign": "center", - "verticalAlign": "middle", - "baseline": 22, - "containerId": "N-IcJz-VgLd4G_w5IGZzo", - "originalText": "*_raw.root" - }, - { - "id": "wVuMtUwvQDwX0zsvknEbS", - "type": "arrow", + "angle": 0, "x": 989.7524966807964, "y": 171.54049434487996, - "width": 119.53370984275955, - "height": 111.2296296296297, - "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "width": 119.53370984275955, + "height": 111.2296296296297, "seed": 270153423, - "version": 540, - "versionNonce": 202549537, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401728, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - -119.53370984275955, - 111.2296296296297 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "F7K7zMR1U55-x1Y0zNheF", "focus": -0.0325789073360154, @@ -457,92 +392,49 @@ "focus": -0.05177259320591252, "gap": 8.889135284749358 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" - }, - { - "id": "j2LC8-0hrLNZXTpYAtx19", - "type": "arrow", - "x": 1071.4586718849273, - "y": 167.96867255870347, - "width": 96.61242742710613, - "height": 120.19259259259263, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 1714358337, - "version": 556, - "versionNonce": 218291457, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401729, - "link": null, + "endArrowhead": "arrow", "points": [ [ 0, 0 ], [ - 96.61242742710613, - 120.19259259259263 + -119.53370984275955, + 111.2296296296297 ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "F7K7zMR1U55-x1Y0zNheF", - "focus": -0.22659935572522302, - "gap": 3.6723762624071696 - }, - "endBinding": { - "elementId": "N-IcJz-VgLd4G_w5IGZzo", - "focus": 0.12586559770339084, - "gap": 7.083179293147765 - }, - "startArrowhead": null, - "endArrowhead": "arrow" + ] }, { - "id": "cVfBGP1caGY3pgFvecDal", "type": "arrow", + "version": 654, + "versionNonce": 227169857, + "index": "aC", + "isDeleted": false, + "id": "cVfBGP1caGY3pgFvecDal", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 1, + "opacity": 100, + "angle": 0, "x": 849.5865308468354, "y": 363.4377152877662, - "width": 110.30000188482575, - "height": 120.91851851851857, - "angle": 0, "strokeColor": "#000000", "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "width": 110.30000188482575, + "height": 120.91851851851857, "seed": 401824335, - "version": 653, - "versionNonce": 226596065, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401729, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - 110.30000188482575, - 120.91851851851857 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "soHz1JXys4CcGsQ3wYg0G", "focus": 0.15714684037187934, @@ -553,94 +445,74 @@ "focus": -0.14655181276661794, "gap": 5.303025452972918 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" - }, - { - "id": "P7NpNHMmnsu-hhgwxYmo2", - "type": "arrow", - "x": 1164.970878303926, - "y": 371.7773136588039, - "width": 97.11257500279567, - "height": 110.90062868698101, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 1, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 340614223, - "version": 669, - "versionNonce": 555634881, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401729, - "link": null, + "endArrowhead": "arrow", "points": [ [ 0, 0 ], [ - -97.11257500279567, - 110.90062868698101 + 110.30000188482575, + 120.91851851851857 ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "N-IcJz-VgLd4G_w5IGZzo", - "focus": -0.16439384322771664, - "gap": 13.792128473619215 - }, - "endBinding": { - "elementId": "lVG_kdGInlSn8Z2rog8y_", - "focus": 0.15239560394816007, - "gap": 6.981316913472767 - }, - "startArrowhead": null, - "endArrowhead": "arrow" + ] }, { - "id": "kVnTUQ4sLOO3BBCX6jXhQ", - "type": "text", - "x": 1152.5222222222214, - "y": 205.5518518518516, - "width": 121, - "height": 31, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "type": "arrow", + "version": 774, + "versionNonce": 451274863, + "index": "aD", + "isDeleted": false, + "id": "P7NpNHMmnsu-hhgwxYmo2", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, + "angle": 0, + "x": 1060.4009592684429, + "y": 181.7773136588039, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 15.625510909633476, + "height": 300.900628686981, + "seed": 340614223, "groupIds": [], - "strokeSharpness": "round", - "seed": 1848809359, - "version": 176, - "versionNonce": 243225711, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401510, + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007567164, "link": null, - "text": "MergeEVT", - "fontSize": 25.096296296296305, - "fontFamily": 1, - "textAlign": "center", - "verticalAlign": "top", - "baseline": 22, - "containerId": null, - "originalText": "MergeEVT" + "locked": false, + "startBinding": null, + "endBinding": { + "elementId": "lVG_kdGInlSn8Z2rog8y_", + "focus": 0.5837873001893779, + "gap": 6.981316913472767 + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + 15.625510909633476, + 300.900628686981 + ] + ] }, { "type": "text", - "version": 269, - "versionNonce": 455192065, + "version": 270, + "versionNonce": 1814677615, + "index": "aF", "isDeleted": false, "id": "hjpjwQjIcE6KzKaFdR-Wf", "fillStyle": "hachure", @@ -657,23 +529,29 @@ "height": 31.3703703703704, "seed": 1804472239, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [], - "updated": 1647818401510, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 25.096296296296305, "fontFamily": 1, "text": "pxi-fsu.time-order", - "baseline": 22.3703703703704, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "pxi-fsu.time-order" + "originalText": "pxi-fsu.time-order", + "autoResize": true, + "lineHeight": 1.2500000000000007 }, { "type": "text", - "version": 320, - "versionNonce": 1670966927, + "version": 321, + "versionNonce": 445151745, + "index": "aG", "isDeleted": false, "id": "__bmlLJ8PwPTagBBqD9VN", "fillStyle": "hachure", @@ -690,23 +568,29 @@ "height": 31.3703703703704, "seed": 24381761, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [], - "updated": 1647818401510, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 25.0962962962963, "fontFamily": 1, "text": "to2root", - "baseline": 22.3703703703704, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "to2root" + "originalText": "to2root", + "autoResize": true, + "lineHeight": 1.250000000000001 }, { "type": "text", - "version": 378, - "versionNonce": 1906197985, + "version": 392, + "versionNonce": 2020050799, + "index": "aH", "isDeleted": false, "id": "D8BUfkyxf6YqzPnGnv0Xh", "fillStyle": "hachure", @@ -715,31 +599,37 @@ "roughness": 1, "opacity": 100, "angle": 0, - "x": 1130.5629629629611, - "y": 414.78888888888935, + "x": 1096.5629629629611, + "y": 292.78888888888935, "strokeColor": "#000000", "backgroundColor": "transparent", "width": 154.16296296296298, "height": 31.3703703703704, "seed": 2079320367, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [], - "updated": 1647818401510, + "updated": 1717007563722, "link": null, + "locked": false, "fontSize": 25.096296296296305, "fontFamily": 1, "text": "EventBuilder", - "baseline": 22.3703703703704, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "EventBuilder" + "originalText": "EventBuilder", + "autoResize": true, + "lineHeight": 1.2500000000000007 }, { "type": "text", - "version": 425, - "versionNonce": 851068079, + "version": 426, + "versionNonce": 1917555169, + "index": "aI", "isDeleted": false, "id": "lDDXAL1aSoy5lFPULFt7x", "fillStyle": "hachure", @@ -756,54 +646,53 @@ "height": 31, "seed": 915951567, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [], - "updated": 1647818401510, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 25.096296296296305, "fontFamily": 1, "text": "PreAnalyzer.C/h", - "baseline": 22, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "PreAnalyzer.C/h" + "originalText": "PreAnalyzer.C/h", + "autoResize": true, + "lineHeight": 1.2352420306965757 }, { - "id": "P9cZwyL3gt9n5Uc2t372O", "type": "arrow", - "x": 1035.759503509729, - "y": 559, - "width": 113.19349271635019, - "height": 171, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 237, + "versionNonce": 1465366703, + "index": "aJ", + "isDeleted": false, + "id": "P9cZwyL3gt9n5Uc2t372O", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 1, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 1035.759503509729, + "y": 559, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 113.19349271635019, + "height": 171, "seed": 1496444239, - "version": 236, - "versionNonce": 1995357871, - "isDeleted": false, - "boundElements": null, - "updated": 1647818579061, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - 113.19349271635019, - 171 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "lVG_kdGInlSn8Z2rog8y_", "focus": 0.02212915002641517, @@ -814,30 +703,45 @@ "focus": 0.17023883632050066, "gap": 3.6592592592576807 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + 113.19349271635019, + 171 + ] + ] }, { - "id": "ZsQWjOTkWl1BHRSTW0mJ5", "type": "ellipse", - "x": 446, - "y": 601, - "width": 232, - "height": 73, - "angle": 0, - "strokeColor": "#862e9c", - "backgroundColor": "transparent", + "version": 194, + "versionNonce": 899722689, + "index": "aK", + "isDeleted": false, + "id": "ZsQWjOTkWl1BHRSTW0mJ5", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 446, + "y": 601, + "strokeColor": "#862e9c", + "backgroundColor": "transparent", + "width": 232, + "height": 73, "seed": 470581825, - "version": 193, - "versionNonce": 1961694529, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "type": "text", @@ -860,77 +764,78 @@ "type": "arrow" } ], - "updated": 1647818534010, - "link": null + "updated": 1717007549844, + "link": null, + "locked": false }, { - "id": "51dKlklstHadFKrB7n8YD", "type": "text", + "version": 170, + "versionNonce": 1952107215, + "index": "aL", + "isDeleted": false, + "id": "51dKlklstHadFKrB7n8YD", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 100, + "angle": 0, "x": 451, "y": 620, - "width": 222, - "height": 35, - "angle": 0, "strokeColor": "#862e9c", "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 2, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "width": 222, + "height": 35, "seed": 2003805697, - "version": 169, - "versionNonce": 1812634447, - "isDeleted": false, - "boundElements": null, - "updated": 1647818534010, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "text": "histograms", + "locked": false, "fontSize": 28, "fontFamily": 1, + "text": "histograms", "textAlign": "center", "verticalAlign": "middle", - "baseline": 25, "containerId": "ZsQWjOTkWl1BHRSTW0mJ5", - "originalText": "histograms" + "originalText": "histograms", + "autoResize": true, + "lineHeight": 1.25 }, { - "id": "-k5eaNk8YWIjOcetbUfQD", "type": "arrow", - "x": 767.4529205935671, - "y": 361, - "width": 166.43973876604423, - "height": 231.250681401247, - "angle": 0, - "strokeColor": "#087f5b", - "backgroundColor": "transparent", + "version": 186, + "versionNonce": 732384673, + "index": "aM", + "isDeleted": false, + "id": "-k5eaNk8YWIjOcetbUfQD", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 767.4529205935671, + "y": 361, + "strokeColor": "#087f5b", + "backgroundColor": "transparent", + "width": 166.43973876604423, + "height": 231.250681401247, "seed": 716854561, - "version": 185, - "versionNonce": 2017449089, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401730, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - -166.43973876604423, - 231.250681401247 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "soHz1JXys4CcGsQ3wYg0G", "focus": 0.3008510701329823, @@ -941,44 +846,49 @@ "focus": 0.05419282065109363, "gap": 10.809776398154149 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" - }, - { - "id": "agzkYqEEC-88Vv_sngi_8", - "type": "arrow", - "x": 897, - "y": 517.4796917499153, - "width": 258.11148037057353, - "height": 84.07554502722894, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 2, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", - "seed": 1856136961, - "version": 181, - "versionNonce": 1104697711, - "isDeleted": false, - "boundElements": null, - "updated": 1647818537368, - "link": null, + "endArrowhead": "arrow", "points": [ [ 0, 0 ], [ - -258.11148037057353, - 84.07554502722894 + -166.43973876604423, + 231.250681401247 ] - ], - "lastCommittedPoint": null, + ] + }, + { + "type": "arrow", + "version": 182, + "versionNonce": 1064737007, + "index": "aN", + "isDeleted": false, + "id": "agzkYqEEC-88Vv_sngi_8", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 100, + "angle": 0, + "x": 897, + "y": 517.4796917499153, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 258.11148037057353, + "height": 84.07554502722894, + "seed": 1856136961, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, + "link": null, + "locked": false, "startBinding": { "elementId": "lVG_kdGInlSn8Z2rog8y_", "focus": 0.620792481604644, @@ -989,33 +899,62 @@ "focus": -0.20747175231881398, "gap": 8.313284858991366 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -258.11148037057353, + 84.07554502722894 + ] + ] }, { - "id": "v0ZCxQCjw27_GScx0D8wJ", "type": "arrow", - "x": 903, - "y": 137, - "width": 356.6226706500755, - "height": 453.59365180321606, - "angle": 0, - "strokeColor": "#087f5b", - "backgroundColor": "transparent", + "version": 257, + "versionNonce": 193917313, + "index": "aO", + "isDeleted": false, + "id": "v0ZCxQCjw27_GScx0D8wJ", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 903, + "y": 137, + "strokeColor": "#087f5b", + "backgroundColor": "transparent", + "width": 356.6226706500755, + "height": 453.59365180321606, "seed": 1168510799, - "version": 256, - "versionNonce": 1948477505, - "isDeleted": false, - "boundElements": null, - "updated": 1647818401731, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, + "locked": false, + "startBinding": { + "elementId": "F7K7zMR1U55-x1Y0zNheF", + "focus": 0.5062605203705725, + "gap": 8.1777777777761 + }, + "endBinding": { + "elementId": "ZsQWjOTkWl1BHRSTW0mJ5", + "focus": -0.21950372001865495, + "gap": 10.7293622763748 + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", "points": [ [ 0, @@ -1029,42 +968,33 @@ -356.6226706500755, 453.59365180321606 ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "F7K7zMR1U55-x1Y0zNheF", - "focus": 0.5062605203705725, - "gap": 8.1777777777761 - }, - "endBinding": { - "elementId": "ZsQWjOTkWl1BHRSTW0mJ5", - "focus": -0.21950372001865495, - "gap": 10.7293622763748 - }, - "startArrowhead": null, - "endArrowhead": "arrow" + ] }, { - "id": "WMRgg95DFetUO43ksQt5B", "type": "ellipse", - "x": 751, - "y": 890, - "width": 263, - "height": 71, - "angle": 0, - "strokeColor": "#1864ab", - "backgroundColor": "transparent", + "version": 105, + "versionNonce": 1848877839, + "index": "aP", + "isDeleted": false, + "id": "WMRgg95DFetUO43ksQt5B", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 751, + "y": 890, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", + "width": 263, + "height": 71, "seed": 941781135, - "version": 104, - "versionNonce": 527404097, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "type": "text", @@ -1079,77 +1009,78 @@ "type": "arrow" } ], - "updated": 1647818491994, - "link": null + "updated": 1717007549844, + "link": null, + "locked": false }, { - "id": "zXhQXzRWuABV0jsxbzfu6", "type": "text", + "version": 81, + "versionNonce": 2056722785, + "index": "aQ", + "isDeleted": false, + "id": "zXhQXzRWuABV0jsxbzfu6", + "fillStyle": "hachure", + "strokeWidth": 1, + "strokeStyle": "solid", + "roughness": 2, + "opacity": 100, + "angle": 0, "x": 756, "y": 913, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", "width": 253, "height": 35, - "angle": 0, - "strokeColor": "#1864ab", - "backgroundColor": "transparent", - "fillStyle": "hachure", - "strokeWidth": 1, - "strokeStyle": "solid", - "roughness": 2, - "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", "seed": 1086239503, - "version": 80, - "versionNonce": 2052002895, - "isDeleted": false, - "boundElements": null, - "updated": 1647818491995, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "text": "PIDcuts.root", + "locked": false, "fontSize": 28, "fontFamily": 1, + "text": "PIDcuts.root", "textAlign": "center", "verticalAlign": "top", - "baseline": 25, "containerId": "WMRgg95DFetUO43ksQt5B", - "originalText": "PIDcuts.root" + "originalText": "PIDcuts.root", + "autoResize": true, + "lineHeight": 1.25 }, { - "id": "ehETUc00eCNlcTlQ6HACy", "type": "arrow", - "x": 1067.1280479269299, - "y": 821.808328929171, - "width": 91.32732084972486, - "height": 77.15092278310533, - "angle": 0, - "strokeColor": "#1864ab", - "backgroundColor": "transparent", + "version": 63, + "versionNonce": 1896507695, + "index": "aR", + "isDeleted": false, + "id": "ehETUc00eCNlcTlQ6HACy", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 1067.1280479269299, + "y": 821.808328929171, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", + "width": 91.32732084972486, + "height": 77.15092278310533, "seed": 1879927841, - "version": 62, - "versionNonce": 1943037857, - "isDeleted": false, - "boundElements": null, - "updated": 1647818579062, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - -91.32732084972486, - 77.15092278310533 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "75BzEnWMBt8CyzY_59Z5z", "focus": 0.15675849444476955, @@ -1160,33 +1091,62 @@ "focus": 0.44826161833932643, "gap": 1.690359702747088 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -91.32732084972486, + 77.15092278310533 + ] + ] }, { - "id": "w0d6KBM1NTHTPajgPOe6R", "type": "arrow", - "x": 1035, - "y": 773.6182054324441, - "width": 435, - "height": 88.61820543244414, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 228, + "versionNonce": 1242514753, + "index": "aS", + "isDeleted": false, + "id": "w0d6KBM1NTHTPajgPOe6R", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 1035, + "y": 773.6182054324441, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 435, + "height": 88.61820543244414, "seed": 2125616111, - "version": 227, - "versionNonce": 1836114159, - "isDeleted": false, - "boundElements": null, - "updated": 1647818584992, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, + "locked": false, + "startBinding": { + "elementId": "75BzEnWMBt8CyzY_59Z5z", + "focus": 0.10530264507321531, + "gap": 8.592592592592268 + }, + "endBinding": { + "elementId": "ZsQWjOTkWl1BHRSTW0mJ5", + "focus": 0.37415443247287694, + "gap": 12.94027309192736 + }, + "lastCommittedPoint": null, + "startArrowhead": null, + "endArrowhead": "arrow", "points": [ [ 0, @@ -1200,94 +1160,81 @@ -435, -88.61820543244414 ] - ], - "lastCommittedPoint": null, - "startBinding": { - "elementId": "75BzEnWMBt8CyzY_59Z5z", - "focus": 0.10530264507321531, - "gap": 8.592592592592268 - }, - "endBinding": { - "elementId": "ZsQWjOTkWl1BHRSTW0mJ5", - "focus": 0.37415443247287694, - "gap": 12.94027309192736 - }, - "startArrowhead": null, - "endArrowhead": "arrow" + ] }, { - "id": "eCLuWwIT2U3T29vZemg1y", "type": "text", - "x": 698, - "y": 756.5, - "width": 224, - "height": 35, - "angle": 0, - "strokeColor": "#000000", - "backgroundColor": "transparent", + "version": 81, + "versionNonce": 358837071, + "index": "aT", + "isDeleted": false, + "id": "eCLuWwIT2U3T29vZemg1y", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 698, + "y": 756.5, + "strokeColor": "#000000", + "backgroundColor": "transparent", + "width": 224, + "height": 35, "seed": 410247489, - "version": 80, - "versionNonce": 2018981967, - "isDeleted": false, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "id": "4hPuEiYm-RMAejSmybE6w", "type": "arrow" } ], - "updated": 1647818589123, + "updated": 1717007549844, "link": null, - "text": "PIDAnalyzer.C/h", + "locked": false, "fontSize": 28, "fontFamily": 1, + "text": "PIDAnalyzer.C/h", "textAlign": "center", "verticalAlign": "top", - "baseline": 25, "containerId": null, - "originalText": "PIDAnalyzer.C/h" + "originalText": "PIDAnalyzer.C/h", + "autoResize": true, + "lineHeight": 1.25 }, { - "id": "4hPuEiYm-RMAejSmybE6w", "type": "arrow", - "x": 852.040358857486, - "y": 882.8297567412599, - "width": 35.84606170772679, - "height": 79.82975674125987, - "angle": 0, - "strokeColor": "#1864ab", - "backgroundColor": "transparent", + "version": 79, + "versionNonce": 1968633121, + "index": "aU", + "isDeleted": false, + "id": "4hPuEiYm-RMAejSmybE6w", "fillStyle": "hachure", "strokeWidth": 1, "strokeStyle": "solid", "roughness": 2, "opacity": 100, - "groupIds": [], - "strokeSharpness": "round", + "angle": 0, + "x": 852.040358857486, + "y": 882.8297567412599, + "strokeColor": "#1864ab", + "backgroundColor": "transparent", + "width": 35.84606170772679, + "height": 79.82975674125987, "seed": 492766657, - "version": 78, - "versionNonce": 881415791, - "isDeleted": false, - "boundElements": null, - "updated": 1647818589124, + "groupIds": [], + "frameId": null, + "roundness": { + "type": 2 + }, + "boundElements": [], + "updated": 1717007549844, "link": null, - "points": [ - [ - 0, - 0 - ], - [ - -35.84606170772679, - -79.82975674125987 - ] - ], - "lastCommittedPoint": null, + "locked": false, "startBinding": { "elementId": "WMRgg95DFetUO43ksQt5B", "focus": -0.09547986936337077, @@ -1298,13 +1245,25 @@ "focus": 0.056964146096280574, "gap": 11.5 }, + "lastCommittedPoint": null, "startArrowhead": null, - "endArrowhead": "arrow" + "endArrowhead": "arrow", + "points": [ + [ + 0, + 0 + ], + [ + -35.84606170772679, + -79.82975674125987 + ] + ] }, { "type": "text", - "version": 107, - "versionNonce": 1647045825, + "version": 108, + "versionNonce": 1737959791, + "index": "aV", "isDeleted": false, "id": "C5Xu4VJ1CEf58a-TdzRL1", "fillStyle": "hachure", @@ -1321,28 +1280,34 @@ "height": 35, "seed": 405206223, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "id": "4hPuEiYm-RMAejSmybE6w", "type": "arrow" } ], - "updated": 1647818543962, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 28, "fontFamily": 1, "text": "Analyzer.C/h", - "baseline": 25, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "Analyzer.C/h" + "originalText": "Analyzer.C/h", + "autoResize": true, + "lineHeight": 1.25 }, { "type": "text", - "version": 142, - "versionNonce": 333894415, + "version": 143, + "versionNonce": 1608362241, + "index": "aW", "isDeleted": false, "id": "qw9NHyRhajjjBoBiDpEXg", "fillStyle": "hachure", @@ -1359,28 +1324,34 @@ "height": 35, "seed": 2090504335, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "id": "4hPuEiYm-RMAejSmybE6w", "type": "arrow" } ], - "updated": 1647818525703, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 28, "fontFamily": 1, "text": "evt2hist", - "baseline": 25, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "evt2hist" + "originalText": "evt2hist", + "autoResize": true, + "lineHeight": 1.25 }, { "type": "text", - "version": 146, - "versionNonce": 182333153, + "version": 147, + "versionNonce": 1424892815, + "index": "aX", "isDeleted": false, "id": "yqiXgQkxg-0w8UIolLf0z", "fillStyle": "hachure", @@ -1397,23 +1368,28 @@ "height": 35, "seed": 650914657, "groupIds": [], - "strokeSharpness": "round", + "frameId": null, + "roundness": { + "type": 2 + }, "boundElements": [ { "id": "4hPuEiYm-RMAejSmybE6w", "type": "arrow" } ], - "updated": 1647819096455, + "updated": 1717007549844, "link": null, + "locked": false, "fontSize": 28, "fontFamily": 1, "text": "GAGGPIDCutCreator.C", - "baseline": 25, "textAlign": "center", "verticalAlign": "top", "containerId": null, - "originalText": "GAGGPIDCutCreator.C" + "originalText": "GAGGPIDCutCreator.C", + "autoResize": true, + "lineHeight": 1.25 } ], "appState": { diff --git a/armory/evtReader.h b/armory/evtReader.h index dc5f45d..fbf6340 100644 --- a/armory/evtReader.h +++ b/armory/evtReader.h @@ -17,6 +17,24 @@ #define MAX_CHANNELS_PER_BOARD 16 #define BOARD_START 2 + +class timePos{ +public: + timePos(ULong64_t time, unsigned long int inFilePos){ + this->time = time; + this->inFilePos = inFilePos; + } + + ULong64_t time; + unsigned long int inFilePos; + + void Print(){ + printf("time: %16llu, filePos: %lu\n", time, inFilePos); + } + +}; + + class evtReader{ public: @@ -26,6 +44,7 @@ class evtReader{ FILE * inFile; long int inFileSize; + long int inFilePos0; long int inFilePos; bool endOfFile; bool isOpened; @@ -40,8 +59,6 @@ class evtReader{ long int inFilePosPrecent[10]; Long64_t blockIDPrecent[10]; - std::vector dataList; - ///============================================ Methods public: @@ -65,12 +82,18 @@ class evtReader{ int ReadBlock(int opt = 0); /// 0 = default, fill data /// 1 = no fill data + int ReadBlockAtPos(unsigned long int filePos); + void ScanNumberOfBlock(); void JumptoPrecent(int precent); ///this is offset by 1 block void PrintStatus(int mod); - std::vector ReadBatchDataAndSort(long numData); - + + std::vector timePosList; + unsigned long int filePosK; + std::vector ReadBatchPos(long batchSize, bool verbose = false); + void SortTimePos(); + }; @@ -82,6 +105,8 @@ evtReader::evtReader(){ inFileSize = 0; inFilePos = 0; + inFilePos0 = 0; + filePosK = 0; nBlock = 0; blockID = -1; @@ -92,8 +117,7 @@ evtReader::evtReader(){ evtReader::~evtReader(){ - fclose(inFile); - delete inFile; + fclose(inFile); //already delete inFile delete data; } @@ -104,6 +128,8 @@ evtReader::evtReader(TString inFileName){ inFileSize = 0; inFilePos = 0; + inFilePos0 = 0; + filePosK = 0; nBlock = 0; blockID = -1; @@ -154,6 +180,13 @@ bool evtReader::IsEndOfFile() { return haha > 0 ? true: false; } +int evtReader::ReadBlockAtPos(unsigned long int filePos){ + + fseek( inFile, filePos, SEEK_SET); + + return ReadBlock(0); + +} int evtReader::ReadBlock(int opt){ @@ -162,6 +195,8 @@ int evtReader::ReadBlock(int opt){ unsigned int header[4]; ///read 4 header, unsigned int = 4 byte = 32 bits. + inFilePos0 = inFilePos; + if ( fread(header, sizeof(header), 1, inFile) != 1 ) { endOfFile = true; return -1; @@ -277,6 +312,8 @@ void evtReader::ScanNumberOfBlock(){ printf("scan complete: number of data Block : %ld\n", nBlock); inFilePos = 0; + inFilePos0 = 0; + filePosK = 0; blockID = -1; rewind(inFile); ///back to the File begining @@ -310,23 +347,141 @@ void evtReader::PrintStatus(int mod){ } -std::vector evtReader::ReadBatchDataAndSort(long numData){ +void evtReader::SortTimePos(){ + std::sort(timePosList.begin(), timePosList.end(), [](const timePos & a, const timePos & b) { return a.time < b.time; }); +} - std::vector dataList_A; - if( endOfFile ){ - return dataList_A; +std::vector evtReader::ReadBatchPos(long batchSize, bool verbose){ + + if( verbose ) printf("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& %s / %lu / %lu\n", __func__, filePosK, inFileSize ); + + fseek( inFile, filePosK, SEEK_SET); + + std::vector timePosList_A; + if( filePosK == inFileSize ){ + timePosList_A = timePosList; + timePosList.clear(); + return timePosList_A; } - dataList.clear(); + if( timePosList.size() == 0 ){ + int res = 0; + do{ + res = ReadBlock(); + timePosList.push_back( timePos(data->time, inFilePos0)); + }while( timePosList.size() < batchSize && res == 1); + SortTimePos(); + unsigned long long t0_B = timePosList.front().time; + unsigned long long t1_B = timePosList.back().time; + if( verbose ) { + printf(" hit in memeory : %7zu | %lu | %lu \n", timePosList.size(), inFilePos, inFileSize); + printf("t0 : %15llu\n", t0_B); + printf("t1 : %15llu\n", t1_B); + } + timePosList_A = timePosList; + timePosList.clear(); - for( long long k = 0; k < std::min(numData, nBlock); k++){ - ReadBlock(); - dataList.push_back(*data); + }else{ + timePosList_A = timePosList; + timePosList.clear(); } - //sort the dataList - std::sort(dataList.begin(), dataList.end(), [](const DataBlock & a, const DataBlock & b) { return a.time < b.time; }); + if( feof(inFile) ) return timePosList_A; + + int res = 0; + do{ + res = ReadBlock(); + timePosList.push_back(timePos(data->time, inFilePos0)); + }while( timePosList.size() < batchSize && res == 1); + SortTimePos(); + unsigned long long t0_B = timePosList.front().time; + unsigned long long t1_B = timePosList.back().time; + if( verbose ) { + printf(" hit in memeory : %7zu | %lu | %lu \n", timePosList.size(), inFilePos, inFileSize); + printf("t0 : %15llu\n", t0_B); + printf("t1 : %15llu\n", t1_B); + } + + unsigned long long t0_A = timePosList_A.front().time; + unsigned long long t1_A = timePosList_A.back().time; + ulong ID_A = 0; + ulong ID_B = 0; + + if( t0_A >= t0_B) { + printf("\033[0;31m!!!!!!!!!!!!!!!!! %s | Need to increase the batch size. \033[0m\n", __func__); + printf("present batch size : %lu \n", batchSize); + printf("timePosList_A t0_A : %15llu\n", t0_A); + printf("timePosList t0_B : %15llu\n", t0_B); + return std::vector (); + } + + if( t1_A > t0_B) { // need to sort between two hitList + + if( verbose ) { + printf("############# need to sort \n"); + printf("=========== sume of A + B : %zu \n", timePosList_A.size() + timePosList.size()); + } + + std::vector timePosListTemp; + + // find the hit that is >= t0_B, save them to timePosListTemp + for( size_t j = 0; j < timePosList_A.size() ; j++){ + if( timePosList_A[j].time < t0_B ) continue;; + if( ID_A == 0 ) ID_A = j; + timePosListTemp.push_back(timePosList_A[j]); + } + + // remove timePosList_A element that is >= t0_B + timePosList_A.erase(timePosList_A.begin() + ID_A, timePosList_A.end() ); + + // find the hit that is <= t1_A, save them to timePosListTemp + for( size_t j = 0; j < timePosList.size(); j++){ + if( timePosList[j].time > t1_A ) { + break; + } + timePosListTemp.push_back(timePosList[j]); + ID_B = j + 1; + } + + // remove hit elements that is <= t1_A + timePosList.erase(timePosList.begin(), timePosList.begin() + ID_B ); + + // sort timePosListTemp + std::sort(timePosListTemp.begin(), timePosListTemp.end(), [](const timePos& a, const timePos& b) { + return a.time < b.time; + }); + + + if( verbose ) { + printf("----------------- ID_A : %lu, Drop\n", ID_A); + printf("----------------- ID_B : %lu, Drop\n", ID_B); + printf("=========== sume of A + B + Temp : %zu \n", timePosList_A.size() + timePosList.size() + timePosListTemp.size()); + printf("----------------- refill timePosList_A \n"); + } + + for( size_t j = 0; j < timePosListTemp.size(); j++){ + timePosList_A.push_back(timePosListTemp[j]); + } + timePosListTemp.clear(); + + if( verbose ) { + printf("=========== sume of A + B : %zu \n", timePosList_A.size() + timePosList.size()); + printf(" A in memeory : %7zu \n", timePosList_A.size()); + printf("t0 : %15llu\n", timePosList_A.front().time); + printf("t1 : %15llu\n", timePosList_A.back().time); + + printf(" B in memeory : %7zu | %lu | %lu \n", timePosList.size(), inFilePos, inFileSize); + printf("t0 : %15llu\n", timePosList.front().time); + printf("t1 : %15llu\n", timePosList.back().time); + } + + } + + filePosK = inFilePos; + + return timePosList_A; } + #endif diff --git a/armory/makefile b/armory/makefile index c5f79b8..0a5ff99 100644 --- a/armory/makefile +++ b/armory/makefile @@ -1,11 +1,11 @@ CC=g++ #all: to2root evt2hist MergeEVT ev22txt EventBuilder pxi-time-order -all: to2root evt2hist MergeEVT ev22txt EventBuilder pxi-fsu-time-order +all: to2root evt2hist ev22txt EventBuilder pxi-fsu-time-order #this is FSU evt to root -xia2root: ../armory/xia2root.cpp - $(CC) ../armory/xia2root.cpp -o xia2root `root-config --cflags --glibs` +# xia2root: ../armory/xia2root.cpp +# $(CC) ../armory/xia2root.cpp -o xia2root `root-config --cflags --glibs` #xia2ev2_nopart: armory/xia2ev2_nopart.cpp # $(CC) armory/xia2ev2_nopart.cpp -o xia2ev2_nopart @@ -15,8 +15,8 @@ to2root: ../armory/to2root.cpp ../armory/DataBlock.h ../armory/evtReader.h ../ma $(CC) ../armory/to2root.cpp -o to2root `root-config --cflags --glibs` #this is for online root -MergeEVT: ../armory/MergeEVT.cpp ../armory/DataBlock.h ../armory/evtReader.h ../mapping.h - $(CC) ../armory/MergeEVT.cpp -o MergeEVT `root-config --cflags --glibs` +# MergeEVT: ../armory/MergeEVT.cpp ../armory/DataBlock.h ../armory/evtReader.h ../mapping.h +# $(CC) ../armory/MergeEVT.cpp -o MergeEVT `root-config --cflags --glibs` #this is for online spectrums evt2hist: ../armory/evt2hist.cpp ../armory/DataBlock.h ../armory/evtReader.h ../mapping.h @@ -28,7 +28,7 @@ pxi-fsu-time-order: ../armory/pxi-fsu-time-order.cpp ev22txt: ../armory/ev22txt.cpp $(CC) ../armory/ev22txt.cpp -o ev22txt -EventBuilder: ../armory/EventBuilder.cpp +EventBuilder: ../armory/EventBuilder.cpp $(CC) ../armory/EventBuilder.cpp -o EventBuilder `root-config --cflags --glibs` test: ../armory/test.cpp ../armory/DataBlock.h ../armory/evtReader.h ../mapping.h diff --git a/armory/programs_explain.png b/armory/programs_explain.png index db206a6..8845bee 100644 Binary files a/armory/programs_explain.png and b/armory/programs_explain.png differ diff --git a/armory/pxi-time-order.c b/armory/pxi-time-order.c deleted file mode 100644 index 9bd03b4..0000000 --- a/armory/pxi-time-order.c +++ /dev/null @@ -1,431 +0,0 @@ -/*********************************************************/ -/* PXI Time Order -- J.M. Allmond (ORNL) -- v1 Jul 2016 */ -/* -- v2 Feb 2018 */ -/* -- v3 Jun 2018 */ -/* -- v4 May 2019 */ -/* */ -/* !Time Order Events from Pixie-16 digitizers */ -/* !Max of: */ -/* !IDs = static, Evts = dynamic, data = dynamic */ -/* */ -/* gcc -o pxi-time-order pxi-time-order.c */ -/* ./pxi-time-order datafile */ -/*********************************************************/ - -///////////////////////////////////////////////////////// -//Code assumes that sequential sub events for a // -//specific channel are time ordered; therefore, // -//unmerge data into circular buffers on a per // -//channel id basis and then remerge channels in // -//time order. // -///////////////////////////////////////////////////////// - - -#include -#include -#include -#include -#include - -#define MAX_CRATES 2 -#define MAX_BOARDS_PER_CRATE 13 -#define MAX_CHANNELS_PER_BOARD 16 -#define BOARD_START 2 - -#define MAX_ID MAX_CRATES*MAX_BOARDS_PER_CRATE*MAX_CHANNELS_PER_BOARD - -#define HEADER_LENGTH 4 //unit = words with 4 bytes per word -#define MAX_SUB_LENGTH 2016 //unit = words with 4 bytes per word ; 2016 --> 40 micro-second trace + 4 word header + 12 extra header - - -#define DEF_SUB_EVENTS 100 //number of events for each dynamic buffer level -#define M1_SUB_EVENTS 1000 //manual input for irregular / non-linear / non-geometric progression -#define M2_SUB_EVENTS 5000 -#define M3_SUB_EVENTS 20000 -#define M4_SUB_EVENTS 50000 -#define M5_SUB_EVENTS 100000 -#define MAX_SUB_EVENTS 200000 - -#define MAX_MALLOC 4000*1024*1024L //2GB - -struct subevent -{ - long long int timestamp; - int length; //unit = words with 4 bytes per word - unsigned int *data; -}; - -struct subevent *subevents[MAX_ID]; -int nevts[MAX_ID], iptr[MAX_ID]; -int maxevts[MAX_ID]; - - -int main(int argc, char **argv) { - - FILE *fpr, *fpw; - long int fprsize=0, fprsize_orig=0, fprsize_old=-1, fprpos=0; - - int online = 0; - - unsigned int subhead[HEADER_LENGTH]; - memset(subhead, 0, sizeof(subhead)); - int pause=0; - - long long int nwords=0, evts_tot_read=0, evts_tot_write=0; - - long long int time=0,time_old=0; - int length=0; - int chn=0; - int sln=0; - int crn=0; - int id=0; - - int idmax=0; - int totmem=0; - int outoforder=0; - int evts_old=0; - int evts_new=0; - - long long int timemin=0, timemin_old=0; - int min_id = -1; - - memset(nevts, 0, sizeof(nevts)); - memset(iptr, 0, sizeof(iptr)); - - int i=0, j=0; - div_t e_div; - - - //open input event file - if ((fpr = fopen(argv[1], "r")) == NULL) { - fprintf(stderr, "Error, cannot open input file %s\n", argv[1]); - return 1; - } - - //write time order file to current location, not location of event file - char filenameto[80]; - char *filename = strrchr(argv[1], '/'); - if (filename == NULL) strcpy(filenameto,argv[1]); - else strcpy(filenameto,filename+1); - strcat(filenameto,".to"); - if ((fpw = fopen(filenameto, "w")) == NULL) { - fprintf(stderr, "Error, cannot open output file %s\n", filenameto); - return 1; - } - - - //check for lockfile, active PID, and event file for auto "online" mode detection - FILE *FPLOCK; - char lockfile[1024]; - strcpy(lockfile, getenv("HOME")); - strcat(lockfile, "/.Pixie16Lock"); - int lockpid; - - FILE *FPPATH; - char pathfile[1024]; - char line[1024]; - char onlinefile[1024]; - strcpy(pathfile, getenv("HOME")); - strcat(pathfile, "/.Pixie16Path"); - - FPLOCK = fopen(lockfile, "r"); - if (FPLOCK != NULL) { - fscanf(FPLOCK, "%d", &lockpid); - fclose(FPLOCK); - //PID from lockfile matches a running PID; run timesort in "online" mode for now - if (getpgid(lockpid) >= 0) { - FPPATH = fopen(pathfile, "r"); - if (FPPATH == NULL) { - online = 0; - } - else { - fgets(line, 1024, FPPATH); //skip first line - fgets(line, 1024, FPPATH); //need second line - sscanf(line,"%s\n", onlinefile); - fclose(FPPATH); - if (filename == NULL) { - if (strcmp(onlinefile,argv[1]) == 0) { - online = 1; - } - } - else { - if (strcmp(onlinefile,filename+1) == 0) { - online = 1; - } - } - } - } - } - if (online == 1) printf("Auto Mode: \x1B[32mOnline\x1B[0m\n"); - else printf("Auto Mode: \x1B[32mOffline\x1B[0m\n"); - - //check file size for auto "online" mode - fprpos = ftell(fpr); - fseek(fpr, 0L, SEEK_END); - fprsize = fprsize_orig = ftell(fpr); - fseek(fpr, fprpos, SEEK_SET); - - - - - //Get memory for default number of subevents per channel id - for (i=0; i= 0) { - FPPATH = fopen(pathfile, "r"); - if (FPPATH != NULL) { - fgets(line, 1024, FPPATH); //skip first line - fgets(line, 1024, FPPATH); //need second line - sscanf(line,"%s\n", onlinefile); - fclose(FPPATH); - if (filename == NULL) { - if (strcmp(onlinefile,argv[1]) == 0) online = 1; - } - else { - if (strcmp(onlinefile,filename+1) == 0) online = 1; - } - } - } - } - } //end auto online - - - //read 4-byte header - if (fread(subhead, sizeof(subhead), 1, fpr) != 1) break; - nwords = nwords + HEADER_LENGTH; - chn = subhead[0] & 0xF; - sln = (subhead[0] & 0xF0) >> 4; - crn = (subhead[0] & 0xF00) >> 8; - id = crn*MAX_BOARDS_PER_CRATE*MAX_CHANNELS_PER_BOARD + (sln-BOARD_START)*MAX_CHANNELS_PER_BOARD + chn; - length = (subhead[0] & 0x7FFE0000) >> 17; //unit = words with 4 bytes per word - time = ( (long long int)(subhead[2] & 0xFFFF) << 32) + subhead[1]; - if (id > idmax) idmax = id; - - } - - //check memory - if (totmem > MAX_MALLOC) {printf("Error: Exceeded MAX_MALLOC"); return -1;} - - //Expand memory for more events (careful when final is to left of initial in circular buffer) - if ( maxevts[id] - nevts[id] == 1 && totmem < MAX_MALLOC) { - - if (maxevts[id] == DEF_SUB_EVENTS) {evts_old = DEF_SUB_EVENTS; evts_new = M1_SUB_EVENTS;} - if (maxevts[id] == M1_SUB_EVENTS) {evts_old = M1_SUB_EVENTS; evts_new = M2_SUB_EVENTS;} - if (maxevts[id] == M2_SUB_EVENTS) {evts_old = M2_SUB_EVENTS; evts_new = M3_SUB_EVENTS;} - if (maxevts[id] == M3_SUB_EVENTS) {evts_old = M3_SUB_EVENTS; evts_new = M4_SUB_EVENTS;} - if (maxevts[id] == M4_SUB_EVENTS) {evts_old = M4_SUB_EVENTS; evts_new = M5_SUB_EVENTS;} - if (maxevts[id] == M5_SUB_EVENTS) {evts_old = M5_SUB_EVENTS; evts_new = MAX_SUB_EVENTS;} - - if (maxevts[id]==evts_old && totmem + (evts_new-evts_old)*(sizeof(struct subevent) + sizeof(unsigned int)*length) < MAX_MALLOC) { - subevents[id] = (struct subevent *) realloc(subevents[id], sizeof(struct subevent)*evts_new); - if (subevents[id] == NULL) { - printf("realloc failed\n"); - return -1; - } - totmem = totmem - sizeof(struct subevent)*evts_old + sizeof(struct subevent)*evts_new; - maxevts[id] = evts_new; - for (j=evts_old; j evts_old) { - for (j=0; j 3.5 sec) - // large gap could be from low rate or un/replug - if ( time_old == 0 || (time - time_old)/10000000 > 35 ) time_old = time; - - //fill buffers until full (online mode will stop filling buffers after 2.5 sec lag betweeen output/input) - if ( nevts[id] < maxevts[id] && ( (time - time_old)/10000000 < 25 || online == 0 ) ) { - - - j = nevts[id] + iptr[id]; - if (j >= maxevts[id]) j -= maxevts[id]; - - subevents[id][j].timestamp = time; - - if (subevents[id][j].data == NULL) { - subevents[id][j].data = (unsigned int *) malloc(sizeof(unsigned int)*length); - if (subevents[id][j].data == NULL) { - printf("malloc failed\n"); - return -1; - } - totmem += sizeof(unsigned int)*length; - } - else if (length != subevents[id][j].length) { //not needed anymore since always free data after use now. Keep for future ... - subevents[id][j].data = (unsigned int *) realloc(subevents[id][j].data, sizeof(unsigned int)*length); - if (subevents[id][j].data == NULL) { - printf("realloc failed\n"); - return -1; - } - totmem = totmem - sizeof(unsigned int)*subevents[id][j].length + sizeof(unsigned int)*length; - } - - subevents[id][j].length = length; - - if (length>HEADER_LENGTH) { - if (fread(subevents[id][j].data + HEADER_LENGTH, (length-HEADER_LENGTH)*sizeof(int), 1, fpr) != 1) break; - nwords = nwords + (length-HEADER_LENGTH); - } - - for (i=0; i < HEADER_LENGTH; i++) { - subevents[id][j].data[i] = subhead[i]; - } - - nevts[id]++; - evts_tot_read++; - - } - else { - pause = 1; - break; - } - - } // end while for fill buffers - ///////// - - - ///////// - // write event with minimum time to file - timemin_old = timemin; - timemin = -1; - for (i=0; i < idmax + 1; i++) { //could be MAX_ID but limit ourselves to current max, idmax - if (nevts[i] > 0) { - if (timemin == -1) { - timemin = subevents[i][iptr[i]].timestamp; - time_old = timemin; - min_id = i; - } - else if (subevents[i][iptr[i]].timestamp < timemin) { - timemin = subevents[i][iptr[i]].timestamp; - time_old = timemin; - min_id = i; - } - } - } - - - if (timemin > -1) { - if (timemin < timemin_old) { - printf("\nWarning!!! timemin = %lld and timemin_old = %lld and min_id = %d\n", timemin, timemin_old, min_id); - outoforder++; - } - if (subevents[min_id][iptr[min_id]].data == NULL) {printf("Error: data = NULL\n"); return -1;} - fwrite(subevents[min_id][iptr[min_id]].data, sizeof(unsigned int)*subevents[min_id][iptr[min_id]].length, 1, fpw); - - //free data memory up until it's needed again - free(subevents[min_id][iptr[min_id]].data); - subevents[min_id][iptr[min_id]].data = NULL; - totmem -= sizeof(unsigned int)*subevents[min_id][iptr[min_id]].length; - subevents[min_id][iptr[min_id]].length = 0; - subevents[min_id][iptr[min_id]].timestamp = 0; - - nevts[min_id]--; - if (++iptr[min_id] >= maxevts[min_id]) iptr[min_id] -= maxevts[min_id]; - evts_tot_write++; - } - else break; - ///////// - - - //print statistics - //e_div=div(evts_tot_read,10000); - //if ( e_div.rem == 0) - if( evts_tot_read % 10000 == 0 ) - printf("Malloc (%d MB) : evts in (\x1B[34m%lld\x1B[0m) : evts out (\x1B[32m%lld\x1B[0m) : diff (\x1B[31m%lld\x1B[0m)\r", (totmem)/1024/1024, evts_tot_read, evts_tot_write, evts_tot_read-evts_tot_write); - - } //end main while - - - //cleanup - fclose(fpr); - fclose(fpw); - for (i=0; i 0) printf("\x1B[31mWarning, there are %d events out of time order\x1B[0m\n", outoforder); - if (totmem != 0) printf("\x1B[31mError: total memory not conserved\x1B[0m\n"); - - - return 0; -} - - diff --git a/armory/text.cpp b/armory/text.cpp deleted file mode 100644 index 4066ff6..0000000 --- a/armory/text.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/*================== - -Thie event builder both sort and build event. skip the *.to file. - -===================*/ - -#include -#include -#include -#include -#include - -#include "TFile.h" -#include "TTree.h" -#include "TMath.h" -#include "TBenchmark.h" -#include "TStopwatch.h" -#include "TTreeIndex.h" - -#include "../mapping.h" - -#include "evtReader.h" - -#define MAXMULTI 100 -#define MAXBUFFER 100 // number of hit in memory buffer - -int main(int argn, char **argv){ - printf("=====================================\n"); - printf("=== Event Builder from *.evt ===\n"); - printf("=====================================\n"); - - if (argn < 5 ) { - printf("Usage :\n"); - printf("%s [timeWindows] [Reject Flag] [SaveFileName] [*.evt File1 [*.evt File2] ...\n", argv[0]); - printf(" timeWindows [int]: 1 unit = 10 ns \n"); - printf(" Reject Flag [int]: 0 = no rejection, 1 = reject no gamma, 2 = reject no GAGG. see mapping.h\n"); - printf(" SaveFileName [str]: custom save file name \n"); - return 1; - } - - unsigned short timeWindow = atoi(argv[1]); - unsigned short rejectFlag = atoi(argv[2]); - TString outFileName = argv[3]; - - std::vector inFileList; - for( int i = 4; i < argn; i++) inFileList.push_back(argv[i]); - - //========== put data into RAM buffer. - std::vector hitListA, hitListB; - evtReader * reader = nullptr; - - for( size_t i = 0 ; i < inFileList.size(); i++){ - - reader = new evtReader(inFileList[i]); - reader->ScanNumberOfBlock(); - - // reader->ReadBatchDataAndSort(MAXBUFFER); - // hitListA = reader->GetDataList(); - - // reader->ReadBatchDataAndSort(MAXBUFFER); - // hitListB = reader->GetDataList(); - - - - - - - delete reader; - } - - - return 0; -} \ No newline at end of file diff --git a/armory/xia2root.cpp b/armory/xia2root.cpp deleted file mode 100644 index 20037fd..0000000 --- a/armory/xia2root.cpp +++ /dev/null @@ -1,375 +0,0 @@ -#include -#include -#include -#include -#include -#include "TFile.h" -#include "TTree.h" -#include "TString.h" -#include "TMath.h" -#include - -#define NUMDET 64 /// number of detector -#define STARTDETID 15 - -std::vector SplitStr(std::string tempLine, std::string splitter, int shift = 0){ - - std::vector output; - - size_t pos; - do{ - pos = tempLine.find(splitter); /// fine splitter - if( pos == 0 ){ ///check if it is splitter again - tempLine = tempLine.substr(pos+1); - continue; - } - - std::string secStr; - if( pos == std::string::npos ){ - secStr = tempLine; - }else{ - secStr = tempLine.substr(0, pos+shift); - tempLine = tempLine.substr(pos+shift); - } - - ///check if secStr is begin with space - while( secStr.substr(0, 1) == " "){ - secStr = secStr.substr(1); - }; - - ///check if secStr is end with space - while( secStr.back() == ' '){ - secStr = secStr.substr(0, secStr.size()-1); - } - - output.push_back(secStr); - //printf(" |%s---\n", secStr.c_str()); - - }while(pos != std::string::npos ); - - return output; -} - -std::vector> LoadCorrectionParameters(TString corrFile){ - - printf("==================== load correction parameters : %s", corrFile.Data()); - std::ifstream file; - file.open(corrFile.Data()); - - std::vector> corr; - corr.clear(); - - std::vector detCorr; - detCorr.clear(); - - if( file.is_open() ){ - - while( file.good() ){ - - std::string line; - getline(file, line); - - if( line.substr(0,1) == "#" ) continue; - if( line.substr(0,2) == "//" ) continue; - if( line.size() == 0 ) continue; - - std::vector temp = SplitStr(line, " "); - - detCorr.clear(); - for( int i = 0; i < (int) temp.size() ; i++){ - detCorr.push_back(std::stod(temp[i])); - } - corr.push_back(detCorr); - } - - file.close(); - - printf(".... done\n"); - printf("===== correction parameters \n"); - for( int i = 0; i < (int) corr.size(); i++){ - printf("det : %2d | ", i ); - int len = (int) corr[i].size(); - for( int j = 0; j < len - 1 ; j++){ - printf("%6.2f, ", corr[i][j]); - } - printf("%6.2f\n", corr[i][len-1]); - } - - }else{ - printf(".... fail\n"); - } - - return corr; -} - - -//################################################################################### -//################ ########################### -//################ main ########################### -//################ ########################### -//################################################################################### -int main(int argn,char **argv) { - if ( argn == 1 ) { - printf("Usage: \n"); - printf("%s file_in.evt raw_Opt timeWidow correctionFile\n", argv[0]); - printf(" | | |\n"); - printf(" | | + correction file, row for det, col for order of correction\n"); - printf(" | |\n"); - printf(" | + when build event, event build window, 1 = 10 ns, default 100\n"); - printf(" + default 0 = raw, 1 = event build \n"); - /// std::cerr<<"Usage:\n "<= 3 ) rawOpt = atoi(argv[2]); - - int timeWindow = 100; - if ( argn >= 4 ) timeWindow = atoi(argv[3]); - - TString corrFileName = ""; - bool hasCorr = false; - if ( argn == 5 ) { - corrFileName = argv[4]; - hasCorr = true; - } - - FILE *infile=fopen(argv[1],"r"); - if (infile==NULL) { - printf("cannot open file : %s \n", argv[1]); - ///std::cerr<<"Problem opening "<> corr; - if( hasCorr ) corr = LoadCorrectionParameters(corrFileName); - - int chan,slot,chann; - int pu; /// pile up - int energy; - double cEnergy; - unsigned long long evtime; - unsigned short cfd; - - int pileupcount = 0; - int zerocount = 0; - int PileUp[64]; - - const unsigned long maskpu = 2147483648; - const unsigned long multiplier = 4294967296LL; - - double energyA[NUMDET]; - double cEnergyA[NUMDET]; - unsigned long long timeA[NUMDET]; - int puA[NUMDET]; - long long diffTimeA[NUMDET]; - unsigned short cfdA[NUMDET]; - int multi = 0; /// multipicilty in an event - int detMulti[NUMDET]; /// multiplicity in a detector in an event - - TFile * outFile = new TFile(outFileName, "RECREATE"); - outFile->cd(); - TTree * tree = new TTree("tree", "tree"); - - tree->Branch("eventID", &eventID, "event_number/l"); - - if ( rawOpt == 0 ){ /// when save raw data - tree->Branch("chan", &chan, "chan/I"); - tree->Branch("slot", &slot, "slot/I"); - tree->Branch("chann", &chann, "channel number/I"); - tree->Branch("pu", &pu, "pile-up/I"); - tree->Branch("energy", &energy, "energy/I"); - if( hasCorr) tree->Branch("cEnergy", &cEnergy, "corrected_energy/D"); - tree->Branch("time", &evtime, "timestamp/l"); - tree->Branch("cfd", &cfd, "cfd/s"); - }else{ /// when build event by time-window - tree->Branch("energy", energyA, Form("energy[%d]/D", NUMDET)); - if( hasCorr) tree->Branch("cEnergy", cEnergyA, Form("corrected_energy[%d]/D", NUMDET)); - tree->Branch("time", timeA, Form("timestamp[%d]/l", NUMDET)); - tree->Branch("dtime", diffTimeA, Form("diff_time[%d]/L", NUMDET)); - tree->Branch("pu", puA, Form("pile_up[%d]/I", NUMDET)); - tree->Branch("cfd", cfdA, Form("cfd[%d]/I", NUMDET)); - tree->Branch("multi", &multi, "multiplicity/I"); - tree->Branch("detMulti", detMulti, Form("det_multiplicity[%d]/I", NUMDET)); - } - - ///change this for 64bit compiler long *bufsam=NULL; - - //clear energy and time array - for( int i = 0; i < NUMDET; i++){ - energyA[i] = TMath::QuietNaN(); - cEnergyA[i] = TMath::QuietNaN(); - timeA[i] = 0; - diffTimeA[i] = -999; - cfdA[i] = 0; - puA[i] = -1; - detMulti[i] = 0; - } - multi = 0; - - unsigned long long startTime = 0; - long long diffTime = 0; - - int bread = 1; - int bsam = 2; - long * bufsiz=new long[bsam]; - unsigned int *bufsam = NULL; - - printf("============ Start looping events | build event ? %s", rawOpt == 0 ? "No" : "Yes"); - if( rawOpt == 1 ) { - printf(" time window : +- %d click\n", timeWindow); - }else{ - printf("\n"); - } - while ( !feof(infile) ) { - - // get buffer size - ///change long -> int for 64 bit - fread(bufsiz,sizeof(int),bread,infile); /// read 1 int (4 byte) from infile and save to bufsize - int bsize = bufsiz[0] -4 ; - if (feof(infile)) break; - blockNum ++; - - ///change for 64bit bufsam=new long[bsize/4+1]; - bufsam = new unsigned int[bsize/4+1]; - fread((char*)bufsam, 1, bsize, infile); /// read bsize of 1 byte from infile and save to char - ///printf("============ bsize : %d \n", bsize); - ///for( int i = 0; i < bsize; i++) printf("%d, ", bufsam[i]); - ///printf("\n"); - - if (bufsam[0] == 30) { - block30Num ++; - chan = (bufsam[2]) & (15); - slot = ((bufsam[2]) & (240))/16; - chann = (slot - 2)*16 + chan + 1; - pu = ((bufsam[2]) & (maskpu))/maskpu; - energy = ((bufsam[5]) & 65535); - unsigned long long evtimehi = ((bufsam[4]) & 65535); - unsigned long long evtimelo = bufsam[3]; - evtime = evtimelo + multiplier*evtimehi; - cfd = bufsam[4]/65536; - - if ( energy == 0 ) zerocount++; - if ( pu > 0 ) pileupcount++; - if ((pu > 0 ) && ( chann > 0 ) && ( chann < 65 )) PileUp[chann-1]++; - - if( blockNum % 100000 == 0 ) printf("."); - ///if( blockNum % 100000 == 0 ) printf("%llu \n", blockNum); - ///if( block30Num < 50) printf("b30: %10llu, chan: %d, slot: %d, chann: %2d, pu: %2d, energy: %5d, evtime: %13llu, cfd: %d\n", block30Num, chan, slot, chann, pu, energy, evtime, cfd); - - /// energy correction - if ( hasCorr ){ - cEnergy = 0; - int order = (int) corr[chann-1].size(); - for( int i = 0; i < order ; i++){ - cEnergy += corr[chann-1][i] * TMath::Power((double)energy, i); - } - } - - if ( rawOpt == 0 ) { - eventID++; - outFile->cd(); - tree->Fill(); - }else{ /// build event - - if ( startTime == 0 ) startTime = evtime; - - diffTime = evtime - startTime; - - if( -timeWindow < diffTime && diffTime < timeWindow ){ - - if( !TMath::IsNaN(energyA[chann-1]) ) detMulti[chann-1] ++; - energyA[chann-1] = energy; - cEnergyA[chann-1] = cEnergy; - timeA[chann-1] = evtime; - diffTimeA[chann-1] = diffTime; - puA[chann-1] = pu; - detMulti[chann-1]++; - multi++; - - - }else{ - /// fill tree - eventID++; - outFile->cd(); - tree->Fill(); - /// clear energy and time array - multi = 0; - for( int i = 0; i < NUMDET; i++){ - energyA[i] = TMath::QuietNaN(); - cEnergyA[i] = TMath::QuietNaN(); - timeA[i] = 0; - diffTimeA[i] = -999; - puA[i] = -1; - detMulti[i] = 0; - cfdA[i] = 0; - } - - /// fill the 1st data of a new event - startTime = evtime; - energyA[chann-1] = energy; - cEnergyA[chann-1] = cEnergy; - timeA[chann-1] = evtime; - diffTimeA[chann-1] = 0; - puA[chann-1] = pu; - detMulti[chann-1]++; - multi++; - } - } - - } ///end if bufsam[0]=30 - - } - - delete [] bufsiz; - delete [] bufsam; - fclose(infile); - - printf("\n============ end of event loop, totoal block read: %llu \n", blockNum); - - eventID++; - outFile->cd(); - tree->Write(); - outFile->Close(); - - - //========================= Print summary - printf("============================================\n"); - ///printf(" number of block: %llu\n", blockNum); - printf(" number of type 30 block: %llu\n", block30Num); - printf(" event built: %llu\n", eventID); - printf("============================================\n"); - - return 0; -} -