simplify the Process_Run input; some bugs fix; edited README.md

This commit is contained in:
Ryan Tang 2024-07-02 16:54:20 -04:00
parent 6059036c15
commit 76976482fe
6 changed files with 40 additions and 26 deletions

View File

@ -34,6 +34,7 @@ Bool_t GeneralSort::Process(Long64_t entry){
} }
} }
b_evID->GetEntry(entry); b_evID->GetEntry(entry);
b_multi->GetEntry(entry); b_multi->GetEntry(entry);
b_bd->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++){ for( unsigned int i = 0 ; i < multi; i++){
int detID = mapping::map[bd[i]][ch[i]]; int detID = mapping::map[bd[i]][ch[i]];
if( detID < 0 ) continue;
int detType = mapping::FindDetTypeIndex(detID); int detType = mapping::FindDetTypeIndex(detID);
int low = (i == 0 ? 0 : mapping::detMaxID[detType-1]); int low = (i == 0 ? 0 : mapping::detMaxID[detType-1]);
int reducedDetID = detID - low; int reducedDetID = detID - low;
@ -52,7 +54,7 @@ Bool_t GeneralSort::Process(Long64_t entry){
} }
//@===================================== Trace //@===================================== Trace
if( isTraceExist && traceMethod >= 0 ){ if( isTraceExist && traceMethod > 0 ){
b_tl->GetEntry(entry); b_tl->GetEntry(entry);
b_trace->GetEntry(entry); b_trace->GetEntry(entry);
@ -78,7 +80,7 @@ Bool_t GeneralSort::Process(Long64_t entry){
} }
//***=================== fit //***=================== fit
if( traceMethod == 1){ if( traceMethod == 2){
int detType = mapping::FindDetTypeIndex(detID); int detType = mapping::FindDetTypeIndex(detID);
//TODO use a blackList //TODO use a blackList
@ -113,7 +115,7 @@ Bool_t GeneralSort::Process(Long64_t entry){
} }
//***=================== Trapezoid filter //***=================== Trapezoid filter
if( traceMethod == 2){ if( traceMethod == 3){
//TODO //TODO
} }
@ -173,9 +175,9 @@ void GeneralSort::Terminate(){
//^############################################################## //^##############################################################
void GeneralSort::Begin(TTree * tree){ void GeneralSort::Begin(TTree * tree){
printf( "=================================================================\n"); printf( "================================================================================\n");
printf( "===================== SOLARIS GeneralSort.C =================\n"); printf( "============================ SOLARIS GeneralSort.C =========================\n");
printf( "=================================================================\n"); printf( "================================================================================\n");
mapping::PrintMapping(); mapping::PrintMapping();

View File

@ -88,7 +88,7 @@ public :
printf("constructor :: %s\n", __func__); printf("constructor :: %s\n", __func__);
isTraceExist = false; 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; isParallel = false;
@ -199,14 +199,14 @@ void GeneralSort::SetUpTree(){
} }
if( isTraceExist && traceMethod >= 0){ if( isTraceExist && traceMethod > 0){
arr = new TClonesArray("TGraph"); arr = new TClonesArray("TGraph");
newSaveTree->Branch("trace", arr, 256000); newSaveTree->Branch("trace", arr, 256000);
arr->BypassStreamer(); arr->BypassStreamer();
if( traceMethod > 0 ){ if( traceMethod > 1 ){
teE = new Float_t * [mapping::nDetType]; teE = new Float_t * [mapping::nDetType];
teT = new Float_t * [mapping::nDetType]; teT = new Float_t * [mapping::nDetType];
@ -250,11 +250,8 @@ void GeneralSort::DecodeOption(){
isParallel = false; isParallel = false;
} }
// printf(" option: |%s|\n", option.Data());
// printf("trace method: %d \n", traceMethod);
PrintTraceMethod(); PrintTraceMethod();
printf(" Parallel: %d \n", isParallel); printf(" Parallel: %s \n", isParallel ? "Yes" : "No");
printf(" save file: %s \n", saveFileName.Data()); printf(" save file: %s \n", saveFileName.Data());
} }
@ -312,10 +309,10 @@ Bool_t GeneralSort::Notify(){
void GeneralSort::PrintTraceMethod(){ void GeneralSort::PrintTraceMethod(){
const char* traceMethodStr; const char* traceMethodStr;
switch(traceMethod) { switch(traceMethod) {
case -1 : traceMethodStr = "Ignore Trace"; break; case 0 : traceMethodStr = "Ignore Trace"; break;
case 0 : traceMethodStr = "None and Copy Trace"; break; case 1 : traceMethodStr = "None and Copy Trace"; break;
case 1 : traceMethodStr = "Fit"; break; case 2 : traceMethodStr = "Fit"; break;
case 2 : traceMethodStr = "Trapezoid"; break; case 3 : traceMethodStr = "Trapezoid"; break;
default: traceMethodStr = "Unknown"; break; default: traceMethodStr = "Unknown"; break;
} }
printf("\033[1;33m ===== Trace method ? %s \033[m\n", traceMethodStr); printf("\033[1;33m ===== Trace method ? %s \033[m\n", traceMethodStr);

View File

@ -5,7 +5,7 @@
#include "TFile.h" #include "TFile.h"
#include "TProof.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; TString name;
name.Form("../root_data/run%03d.root", runNum); name.Form("../root_data/run%03d.root", runNum);

View File

@ -15,14 +15,18 @@ if [ "$PWD" != "${SOLARISANADIR}/working" ]; then
fi fi
if [ $# -eq 0 ] || [ $1 == "-help" ]; then 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 " RunNum = run number / \"lastRun\" "
echo " EventBld = 2/1/0/-1/-2 || 2 = with Trace" echo " EventBld = 2/1/0/-1/-2 || 2 = with Trace"
echo " GeneralSort = n/0/-n || n = number of worker" echo " GeneralSort = n/0/-n || n = number of worker + TraceMethod * 100"
echo " TraceMethod = -1/0/1/2 || -1 no trace, 0 save trace, 1 fit, 2 trapezoid(not implemented)" 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 " Monitor = 2/1/0 || 1 = single run, 2 = using the list in ChainMonitors.C"
echo "" 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 " * Defult timeWindow for Event builder is 100 tick = 800 ns."
echo "" echo ""
exit 1 exit 1
@ -32,13 +36,20 @@ RUN=$1
runNum=$1 runNum=$1
EventBld=2 EventBld=2
nWorker=1 nWorker=1
TraceMethod=-1 TraceMethod=0
isMonitor=1 isMonitor=1
if [ $# -ge 2 ]; then EventBld=$2; fi if [ $# -ge 2 ]; then EventBld=$2; fi
if [ $# -ge 3 ]; then nWorker=$3; fi if [ $# -ge 3 ]; then nWorker=$3; fi
if [ $# -ge 4 ]; then TraceMethod=$4; fi if [ $# -ge 4 ]; then isMonitor=$4; fi
if [ $# -ge 5 ]; then isMonitor=$5; fi
TraceMethod=$((nWorker / 100));
if [ $temp -lt 0 ]; then
TraceMethod=$((-1 * temp));
fi
nWorker=$((nWorker % 100 ));
if [ "$RUN" == "lastRun" ]; then if [ "$RUN" == "lastRun" ]; then
RUN=$runID RUN=$runID

View File

@ -14,6 +14,10 @@ Analysis
├── root_data // symbolic link to converted root file, created by SetUpNewExp ├── root_data // symbolic link to converted root file, created by SetUpNewExp
└── working // working directory, depends on experiment. └── 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 # Analysis & Simulation
The Armory/AnalysisLib.h constains many small but handy functions. The Armory/AnalysisLib.h constains many small but handy functions.

View File

@ -26,7 +26,7 @@ echo "####### add ${SOLARISANADIR}/Armory into PATH"
echo "####### Define BASH Alias / Functions for SOLARIS" echo "####### Define BASH Alias / Functions for SOLARIS"
alias 2Working='cd ${SOLARISANADIR}/working' alias 2Working='cd ${SOLARISANADIR}/working'
alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/data/RunTimeStamp.dat' alias ShowRunTimeStamp='cat $SOLARISANADIR/data_raw/RunTimeStamp.dat'
function ShowRunSize { function ShowRunSize {
if [ $# -ne 1 ]; then if [ $# -ne 1 ]; then