Setting up Postpan
Following these steps will allow you to use existing 'pass1' japan output root files to perform regression using postpan. If you want to run postpan's ./prompt, you will need your own working local version of japan, and some of the instructions below will change as well.
Contents
Getting Started
- Login to the apar account on aonl2:
ssh apar@aonl2
- Create a directory for output file storage
- Making your own folder is important, otherwise whatever you change in your directory will be changed in main prex-prompt.
- Right now, aonl2 has space.
-
mkdir /aonl2/work1/my_directory
- Create a directory for the code
- Go to your own personal apar directory. If you don't have one, make one.
- e.g. if your directory name is my_directory, then
cd ~/my_directory
- e.g. if your directory name is my_directory, then
- Make a new folder inside your directory
-
mkdir prompt
-
- Go to your own personal apar directory. If you don't have one, make one.
- Clone the code from github
-
cd prompt
-
git clone https://github.com/JeffersonLab/prex-prompt.git
-
- Set the environment to use ROOT version 6
- Create a file called reset_env_postpan.csh in the new prex-prompt folder. Copy and paste the following code into it:
setenv PATH `echo $PATH | sed 's/:/\n/g' | grep -v "4.34.36" |grep -v ROOT | awk 'NR==1{printf"%s",$1}; NR>1{printf":%s",$1}'` setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | sed 's/:/\n/g' | grep -v "5.34.36" | grep -v ROOT | awk 'NR==1{printf"%s",$1}; NR>1{printf":%s",$1}'` setenv ROOTSYS /adaqfs/apps/ROOT/6.14-04 <\code>
Setting up for analysis
Currently, ther version of prex-prompt that you pull from github is missing files. There are also many symbolic links that need to be changed. Right now, the symbolic links point to the current working version of japan, and running postpan with these links unchanged could delete or replace files, upload unnecessary plots to the web, and cause a lot of headaches for the WAC. So don't skip these steps!
Getting the missing files
Copy the following missing files and directories to your prex-prompt/postpan
directory from the ~/PREX/prompt/postpan
directory. Do NOT try to save time by deleting and replacing your entire postpan directory. Git tracking will be all messed up!
Example: cp ~/PREX/prompt/postpan/redana ~/my_dir/prompt/prex-prompt/postpan
- conf/
- scripts/
- src/
- redana
- libRedAna.so
- RedDict_rdict.pcm
- rootlogon.C
- Also copy device_list.h from the
~/PREX/prompt/postpan/rootmacros
directory to yourprex-prompt/postpan/rootmacros
directory
Fixing the symbolic links
You will see several symbolic links (the ones in cyan color) inside the prex-prompt
directory.
- Remove the current symbolic links
- Example:
rm Aggregator -i
- PROCEED WITH CAUTION: Typing
rm Aggregator/ -i
(with a slash '/' ) will delete EVERYTHING in the actual Aggregator folder. Please be careful, because autocomplete will put a slash - no slashes allowed!
- Aggregator
- BMODextractor
- hallaweb_online
- japanOutput
- LogFiles
- LRBOutput
- results
- SummaryPlots
- SummaryText
- results in the
postpan
directory
- You will be asked if you want to delete the symbolic link. Type
y
for yes.
- Example:
- Create new directories
- This is what your new output file directory
/aonl2/work1/my_directory
is for - Create directories in this folder with the same names as the links that you just removed from your prex-prompt, EXCEPT japanOutput
- Example:
mkdir /aonl2/work1/<my_directory>/Aggregator
- This is what your new output file directory
- Create new symbolic links pointing to the new directories you just made
- Go into the directory you want to create the link in
-
cd ~/my_directory/prompt/prex-postpan/
-
- Create a new symbolic link that points to your own personal folder
- Example:
ln -s /aonl2/work1/<my_directory>/Aggregator Aggregator
- Example:
- We want to use the already-made japan 'pass1' root files so we don't have to re-run them. Point
japanOutput
to:-
ln -s /chafs2/work1/apar/japanOutput japanOutput
-
- Go into the directory you want to create the link in
Running postpan
At last, you are ready to run!
Running with regression variables already in the root file
- Go into your prex-prompt directory:
cd ~/my_directory/prompt/prex-prompt/
- Source ROOT Version 6:
source reset_env_postpan.csh
- Change the dependent and independent variables for the regression analysis, and add any additional cuts
- These can be found in
prex-prompt/postpan/conf/combo_reg.conf
- Change variables: dv are the dependent varibles and iv are the independent variables
- Add your own custom cuts
- These can be found in
- Run postpan
-
./auto_postpan.sh <run_number>
-
Running with regression variables not in the root file
Sometimes, you'll want to do regression with a linear combination of variables. This is a bit more complicated. You'll need to re-run japan on the raw data so the root tree has the variables you want to look at.
- First, set up japan
- Source your
reset_env_japan.csh file
- Open the japan/Parity/prminput/prex_datahandler.<run#>.map file corresponding to the run you are going to analyse
- See what file is used for [ [ QwCombiner ] ]
- Open that file and add your new variables
- There are examples in the file
- Next, follow the instructions for setting up prompt for analysis
- Do NOT run prompt!
- Run
./qwparity -r <run_number> -c prex_prompt.conf
- This will generate a pass1 japan output file in your japanOutput directory.
- Change the dependent and independent variables for the regression analysis, and add any additional cuts
- These can be found in
prex-prompt/postpan/conf/combo_reg.conf
- Change variables: dv are the dependent varibles and iv are the independent variables
- Add your own custom cuts
- These can be found in
- Run postpan
-
./auto_postpan.sh <run_number>
-
Where is the output?
Running postpan will generate 2 ouput files that will be saved in the results
directory. Running ./auto_postpan.sh
again on the same run number will create files with the same name. So rename your output files if you are going to do this, so you can keep track of them.
- prexPrompt_<run_number>_postpan_summary.txt
- Raw and corrected means and RMSs of your dependent variables
- Raw mean and RMS of your independent variables
- Lists these statistics for the entire run as well as separate mini-runs
- prexPrompt_<run_number>_regress_postpan.root
- Any cuts you put in the configuration file are applied by the cut
ok_cut == 1
- The reg tree contains dependent variables before and after correction, and the independent variables
- The mini tree contains data that you can sort based on mini run number,
minirun
- Any cuts you put in the configuration file are applied by the cut