From a5ac6ba05e8de848bc36798690cadfe0d2a08149 Mon Sep 17 00:00:00 2001 From: "Ryan@WorkStation" Date: Thu, 14 Jul 2022 14:37:03 -0400 Subject: [PATCH] export path to fix the path issue --- .gitignore | 1 + Cleopatra/Isotope.h | 16 +++++++--------- README.md | 3 ++- working/PtolemyGUI | 2 ++ working/PtolemyGUI.C | 10 ++++------ 5 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0b65a4d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +DWBA* diff --git a/Cleopatra/Isotope.h b/Cleopatra/Isotope.h index 966ac3c..c00353c 100644 --- a/Cleopatra/Isotope.h +++ b/Cleopatra/Isotope.h @@ -22,7 +22,7 @@ #include using namespace std; -string massData="../Cleopatra/mass20.txt"; +string massData="/Cleopatra/mass20.txt"; // about the mass**.txt // Mass Excess = (ATOMIC MASS - A)*amu | e.g. n : (1.088664.91585E-6-1)*amu @@ -113,14 +113,12 @@ private: bool isFindOnce; void findHeliosPath(){ - dataSource = massData; -// heliosPath = getenv("HELIOSSYS"); -// if( heliosPath ){ -// dataSource = heliosPath; -// dataSource += "/analysis" + massData; -// }else{ -// dataSource = ".." + massData; -// } + dataSource = massData; + heliosPath = getenv("PtolemyPath"); + if( heliosPath ){ + dataSource = heliosPath; + dataSource += "/.." + massData; + } } diff --git a/README.md b/README.md index 80b17e3..875a373 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,8 @@ Actually the program can run anywhere. It will copy the DWBA file to the present 1. DWBA.in, this is the input file for the ptolmey 2. DWBA.output, this is the output file for the ptolmey 3. DWBA.Ex.txt, this is the excitation energy -4. DWBA.root, this is a root file contains the DWBA angular distribution in TGraph +4. DWBA.Xsec.txt, this is the angular distribution in txt format +5. DWBA.root, this is a root file contains the DWBA angular distribution in TGraph # program structure diff --git a/working/PtolemyGUI b/working/PtolemyGUI index 607482b..46b02bc 100755 --- a/working/PtolemyGUI +++ b/working/PtolemyGUI @@ -2,6 +2,8 @@ dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +export PtolemyPath=$dir + if [[ -f DWBA ]]; then dummy=10 else diff --git a/working/PtolemyGUI.C b/working/PtolemyGUI.C index 331b14e..118a586 100644 --- a/working/PtolemyGUI.C +++ b/working/PtolemyGUI.C @@ -323,11 +323,7 @@ void MyMainFrame::OpenFile(int ID){ TString oldFileName = fileName; - if ( ID == 0 ) fileName = "detectorGeo.txt"; - if ( ID == 1 ) fileName = "reactionConfig.txt"; - if ( ID == 2 ) fileName = "Ex.txt"; if ( ID == 3 ) fileName = "DWBA"; - if ( ID == 4 ) fileName = "../Armory/Check_Simulation_Config.txt"; if ( ID == 5 ) fileName = "DWBA.in"; if ( ID == 6 ) fileName = "DWBA.out"; if ( ID == 7 ) fileName = "DWBA.Xsec.txt"; @@ -380,12 +376,14 @@ void MyMainFrame::Command(int ID) { if( isRun->GetState() && IsFileExist("DWBA.in") ) { //printf("run ptolemy...........\n"); + char * path = getenv("PtolemyPath"); + statusLabel->SetText("Running Ptolemy....."); int output = 1; if( OS_Type == 1 ){ - output = system("../Cleopatra/ptolemy DWBA.out"); + output = system(Form("%s/../Cleopatra/ptolemy DWBA.out", path)); }else{ - output = system("../Cleopatra/ptolemy_mac DWBA.out"); + output = system(Form("%s/../Cleopatra/ptolemy_mac DWBA.out", path)); } statusLabel->SetText("Check terminal, if no massage, Ptolemy run well.");