From 76976482fede48dc574afdaa7f715bcb62c35f0a Mon Sep 17 00:00:00 2001 From: "Ryan@SOLARIS_testStation" Date: Tue, 2 Jul 2024 16:54:20 -0400 Subject: [PATCH] simplify the Process_Run input; some bugs fix; edited README.md --- Armory/GeneralSort.C | 14 ++++++++------ Armory/GeneralSort.h | 19 ++++++++----------- Armory/GeneralSortAgent.C | 2 +- Armory/Process_Run | 25 ++++++++++++++++++------- README.md | 4 ++++ SOLARIS.sh | 2 +- 6 files changed, 40 insertions(+), 26 deletions(-) diff --git a/Armory/GeneralSort.C b/Armory/GeneralSort.C index e08d647..187f4d9 100644 --- a/Armory/GeneralSort.C +++ b/Armory/GeneralSort.C @@ -34,6 +34,7 @@ Bool_t GeneralSort::Process(Long64_t entry){ } } + b_evID->GetEntry(entry); b_multi->GetEntry(entry); b_bd->GetEntry(entry); @@ -44,6 +45,7 @@ Bool_t GeneralSort::Process(Long64_t entry){ for( unsigned int i = 0 ; i < multi; i++){ int detID = mapping::map[bd[i]][ch[i]]; + if( detID < 0 ) continue; int detType = mapping::FindDetTypeIndex(detID); int low = (i == 0 ? 0 : mapping::detMaxID[detType-1]); int reducedDetID = detID - low; @@ -52,7 +54,7 @@ Bool_t GeneralSort::Process(Long64_t entry){ } //@===================================== Trace - if( isTraceExist && traceMethod >= 0 ){ + if( isTraceExist && traceMethod > 0 ){ b_tl->GetEntry(entry); b_trace->GetEntry(entry); @@ -78,7 +80,7 @@ Bool_t GeneralSort::Process(Long64_t entry){ } //***=================== fit - if( traceMethod == 1){ + if( traceMethod == 2){ int detType = mapping::FindDetTypeIndex(detID); //TODO use a blackList @@ -113,7 +115,7 @@ Bool_t GeneralSort::Process(Long64_t entry){ } //***=================== Trapezoid filter - if( traceMethod == 2){ + if( traceMethod == 3){ //TODO } @@ -173,9 +175,9 @@ void GeneralSort::Terminate(){ //^############################################################## void GeneralSort::Begin(TTree * tree){ - printf( "=================================================================\n"); - printf( "===================== SOLARIS GeneralSort.C =================\n"); - printf( "=================================================================\n"); + printf( "================================================================================\n"); + printf( "============================ SOLARIS GeneralSort.C =========================\n"); + printf( "================================================================================\n"); mapping::PrintMapping(); diff --git a/Armory/GeneralSort.h b/Armory/GeneralSort.h index 361e78b..873edd8 100644 --- a/Armory/GeneralSort.h +++ b/Armory/GeneralSort.h @@ -88,7 +88,7 @@ public : printf("constructor :: %s\n", __func__); isTraceExist = false; - traceMethod = 0; // -1 = ignore trace, 0 = no trace fit, 1 = fit, 2 = trapezoid + traceMethod = 0; // 0 = ignore trace, 1 = no trace fit, 2 = fit, 3 = trapezoid isParallel = false; @@ -199,14 +199,14 @@ void GeneralSort::SetUpTree(){ } - if( isTraceExist && traceMethod >= 0){ + if( isTraceExist && traceMethod > 0){ arr = new TClonesArray("TGraph"); newSaveTree->Branch("trace", arr, 256000); arr->BypassStreamer(); - if( traceMethod > 0 ){ + if( traceMethod > 1 ){ teE = new Float_t * [mapping::nDetType]; teT = new Float_t * [mapping::nDetType]; @@ -250,11 +250,8 @@ void GeneralSort::DecodeOption(){ isParallel = false; } - - // printf(" option: |%s|\n", option.Data()); - // printf("trace method: %d \n", traceMethod); PrintTraceMethod(); - printf(" Parallel: %d \n", isParallel); + printf(" Parallel: %s \n", isParallel ? "Yes" : "No"); printf(" save file: %s \n", saveFileName.Data()); } @@ -312,10 +309,10 @@ Bool_t GeneralSort::Notify(){ void GeneralSort::PrintTraceMethod(){ const char* traceMethodStr; switch(traceMethod) { - case -1 : traceMethodStr = "Ignore Trace"; break; - case 0 : traceMethodStr = "None and Copy Trace"; break; - case 1 : traceMethodStr = "Fit"; break; - case 2 : traceMethodStr = "Trapezoid"; break; + case 0 : traceMethodStr = "Ignore Trace"; break; + case 1 : traceMethodStr = "None and Copy Trace"; break; + case 2 : traceMethodStr = "Fit"; break; + case 3 : traceMethodStr = "Trapezoid"; break; default: traceMethodStr = "Unknown"; break; } printf("\033[1;33m ===== Trace method ? %s \033[m\n", traceMethodStr); diff --git a/Armory/GeneralSortAgent.C b/Armory/GeneralSortAgent.C index 26c2a8a..12510bf 100644 --- a/Armory/GeneralSortAgent.C +++ b/Armory/GeneralSortAgent.C @@ -5,7 +5,7 @@ #include "TFile.h" #include "TProof.h" -void GeneralSortAgent(Int_t runNum, int nWorker = 1, int traceMethod = -1){ +void GeneralSortAgent(Int_t runNum, int nWorker = 1, int traceMethod = 0){ TString name; name.Form("../root_data/run%03d.root", runNum); diff --git a/Armory/Process_Run b/Armory/Process_Run index b665482..9bf1d3f 100755 --- a/Armory/Process_Run +++ b/Armory/Process_Run @@ -15,14 +15,18 @@ if [ "$PWD" != "${SOLARISANADIR}/working" ]; then fi if [ $# -eq 0 ] || [ $1 == "-help" ]; then - echo "$ Process_Run [RunNum] [EventBuild] [GeneralSort] [TraceMethod] [Monitor]" + echo "$ Process_Run [RunNum] [EventBuild] [GeneralSort] [Monitor]" echo " RunNum = run number / \"lastRun\" " echo " EventBld = 2/1/0/-1/-2 || 2 = with Trace" - echo " GeneralSort = n/0/-n || n = number of worker" - echo " TraceMethod = -1/0/1/2 || -1 no trace, 0 save trace, 1 fit, 2 trapezoid(not implemented)" + echo " GeneralSort = n/0/-n || n = number of worker + TraceMethod * 100" + echo " TraceMethod = 0 no trace" + echo " = 1 save trace" + echo " = 2 WS fit" + echo " = 3 trapezoid(not implemented)" + echo " e.g. 208 = WS trace with 8 workers" echo " Monitor = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C" echo "" - echo " * negative option = force (except for TraceMethod and Monitor)." + echo " * negative option = force." echo " * Defult timeWindow for Event builder is 100 tick = 800 ns." echo "" exit 1 @@ -32,13 +36,20 @@ RUN=$1 runNum=$1 EventBld=2 nWorker=1 -TraceMethod=-1 +TraceMethod=0 isMonitor=1 if [ $# -ge 2 ]; then EventBld=$2; fi if [ $# -ge 3 ]; then nWorker=$3; fi -if [ $# -ge 4 ]; then TraceMethod=$4; fi -if [ $# -ge 5 ]; then isMonitor=$5; fi +if [ $# -ge 4 ]; then isMonitor=$4; fi + + +TraceMethod=$((nWorker / 100)); +if [ $temp -lt 0 ]; then + TraceMethod=$((-1 * temp)); +fi + +nWorker=$((nWorker % 100 )); if [ "$RUN" == "lastRun" ]; then RUN=$runID diff --git a/README.md b/README.md index 5207adf..29110fc 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,10 @@ Analysis ├── root_data // symbolic link to converted root file, created by SetUpNewExp └── working // working directory, depends on experiment. +# ROOT issue + +We are still using TProof for parallel calculation. TProof is not pre-compiled since 6.32+. And 6.30 only precompiled for Ubuntu 22.04. So, for system using Ubuntu 24.04, user must precompiled to root in order to work. + # Analysis & Simulation The Armory/AnalysisLib.h constains many small but handy functions. diff --git a/SOLARIS.sh b/SOLARIS.sh index 44594a2..1d20098 100644 --- a/SOLARIS.sh +++ b/SOLARIS.sh @@ -26,7 +26,7 @@ echo "####### add ${SOLARISANADIR}/Armory into PATH" echo "####### Define BASH Alias / Functions for SOLARIS" alias 2Working='cd ${SOLARISANADIR}/working' -alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/data/RunTimeStamp.dat' +alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/RunTimeStamp.dat' function ShowRunSize { if [ $# -ne 1 ]; then