"How to" for analysis code
[last updated July 11, 2019]
Everything should be performed in digios/analysis/working directory,
ATTENTION: |
txt file extension is editable for user. |
dat file extension is not supposed to be edited, they are generated. |
file name will be highlighted with blue color |
How to get option for a method or function ?
For most of the bash script, if you have no argument or the argument is "-help" it will display help massage
working>./process_run
working>../Cleopatra/Transfer -help
For most root macro, for example, RDTCutsCreator(), after typed the first bracket, use tab, it will display the arguments.
root>RDTCutsCreator(
then press tab. it will show
root>RDTCutsCreator(TString filename, TString saveFileName = "rdtCuts.root", int eRange = 4000, int eRange = 60000 )
How to Setup for a new experiment?
CAUTION: Advance user / user familiar with git only |
How to clean up the working directory and prepare for a new experiment?
CAUTION: Advance user / user familiar with git only |
After each experiment, the files in digios directory would be changed.
To check the change,
>cd ~/digios
digios>git status
To snapshot the change
digios>git add -A digios>git commit -m "comment for this snapshot"
It is better to push the snapshot to the github
digios>git push origin [branch name]
CAUTION: Also need to git the DAQ! |
CAUTION: The files in the DAQ and the MAC could be both changed. Mostly, the change in the DAQ is in digios/daq. |
CAUTION: That means the DAQ and MAC has to be merged. |
How to process run?
CAUTION: If the code is git clone or download recently, please go to ~/digios/analysis/GEBSort, and
GEBSort>make offline |
working>./process_run [RUNNUM]
The bash script will download run [RUNNUM], merge, event building, GeneralSort (mapping), and Monitors.C
to see more options, ./process_run without any argument
working>./process_run
How to manually run the Monitors.C for a given run?
make sure gen_runXXX.root is generated in digios/analysis/root_data.
working>root ../root_data/gen_runXXX.root
working>gen_tree->Process("Monitors.C+")
How to process multiple runs ?
edit ChainMonitors.C
you can see it use the TChain class.
to add files, for example, add the run 33 to 40, 42, 45, and 50, and I assume the run 33 to 40, 42, and 45 are already downloaded
chain->Add("../root_data/gen_run03[3-9].root"); chain->Add("../root_data/gen_run04[0,2,5].root"); chain->Add("../root_data/gen_run050.root");
Then, in process_run
working>./process_run 50 1 1 1 2
Notice that it will download, merge, build event, and GeneralSort (mapping) for run 50 ONLY.
How to Donwload all runs into the Mac ?
working>Rsyn_data_from _DAQ.sh
How to output the gen_runXXX.root for multiple runs ?
working>./process_multi_runs [start RUNNUM] [Stop RUNNUM]
How to Calibrate alpha data ?
If statistics for single detector is sufficient, i.e. all peak is clearly identified.
edit the file runsList.txt
working>root AutoCalibrationTrace.C+
select option 1
It will guide you through the process.
If statistics is not so good, we can use the ../Armory/Cali_e_single.C
How to Calibrate (d,p) reaction data ?
( I know It needs more detail )
ONLY for sufficient statistic for individual detector.
edit the file runsList.txt
working>root AutoCalibrationtrace.C+
select option 2
it will guide you through.
In order to speed up the process, it will create a temp.root. a root file only contain e and z.
User can use ../Armory/Check_e_x.root and create a cut to be used in the Monte-Carlo process.
How to output a root file only contain physical data ?
How to download the source code ?
make sure you have git in your computer.
in the directory you like to put in the code. for example, I like to put the code in ~/, then >cd ~/
~/>git clone https://github.com/calemhoffman/digios.git
you will see a folder name digios is there.
digios>cd digios
digios>git status
you will see that you are in the master branch, but you want to switch to the branch for your experiment
To check your experiment
digios>git branch -a
for example your experiment is using the branch h064_15N
digios>git checkout h064_15N
digios>git status
you will see you are in the branch for your experiment.
for analysis, you only need the things inside digios/analysis
Make sure you create folders or symbolic links for data, merged_data, and root_data under digios/analysis.
How to change or add a recoil Cuts ?
see #How to use RDTCutsCreator ?
How to change the array position ?
edit the file detectorGeo.txt
How to change the calculation for Ex and thetaCM ?
edit the file reactionConfig.txt, than recalculate the reaction.dat by running ../Cleopatra/Transfer
working>../Cleopatra/Transfer
How to change the kinematic E-Z line?
see #How to simulate the kinematics?
The E-Z lines are stored in fxList in transfer.root
In Monitors.C, at the end or Monitors::Terminate().
you can see the fxList.
How to simulate the kinematics?
CAUTION: If the code is git clone or download recently, please go to ~/digios/analysis/Cleopatra, and
Cleopatra>make |
edit
- reactionConfig.txt
- detectorGeo.txt
- Ex.txt
Then run
working>../Cleopatra/Transfer
after that, 2 files will be generated, 1) reaction.dat, 2) transfer.root
a tree is inside transfer.root.
you can see the tree branches by
root> tree->Print()
(I know some variable names are confusing, and I will update them soon)
How to use RDTCutsCreator ?
After ./process_run, the ../Armory/RDTCutsCreator.C will be loaded.
root>RDTCutsCreator( [filename], [save file name], [E range], [dE range] )
The default [save file name] is "rdtCuts.root". If you like to use other [save file name], please correct the TString rdtCutFile in Monitors.C
if something go wrong during the RDTCutsCreator, simply delete the "rdtCuts.root".
There is a way to include multiple files for the RDTCutsCreator
root>RDTCutsCreator("../root_data/gen_run02[3-7].root")
or
root>RDTCutsCreator("../root_data/gen_run02[3,5,7,9].root")
How to do DWBA calculation ?
CAUTION: If the code is git clone or download recently, please go to ~/digios/analysis/Cleopatra, and
Cleopatra>make |
CAUTION: ONLY IN LINUX, because Ptolemy only work in Linux. |
edit the file example, then
working>./Cleopatra example 1 1 1 1 0 [minAng] [maxAng] [angStep]
This will generate the example.in, feed to Ptolemy, output example.out, extract the differential cross section into
- example.Xsec.txt
- example.root
And plot the d.s.c. using example.root
It will also generate example.Ex.txt
For arguments meaning, use Cleopatra without any argument
working>./Cleopatra
How to do kinematics simulation with DWBA differential cross section ?
see #How to do DWBA calculation ? first.
edit
- reactionConfig.txt
- detectorGeo.txt
- example
Make sure the reaction in the reactionConfig.txt is matching with that in example
working>./Cleopatra example 1 1 1 0 1 0 180 1
The excitation levels is using example.Ex.txt.
The bash script will calculate the DWBA d.s.c. using Cleopatra, then using ../Cleopatra/Transfer to do the simulation.
see #How to simulate the kinematics?
How to do trace analysis ?
How to count a histogram for a given range ?
How to use the fit to excitation spectrum ?
If the reaction.dat is set properly, after ./process_run, the excite() function will give you the excitation spectrum.
root>excite()
You can use the fitAuto() function to auto fit the spectrum by
root>fitAuto(hEx)
For more option
fitAuto( [hist name], [BG estimation] )
Or you can can fit N-Gauss + 1 linear function. In this case, edit the AutFit_para.txt
root>fitNGaussP1(hEx)