Skip to content

Commit

Permalink
Merge pull request #1151 from JeffersonLab/elton_2pi_primakoff
Browse files Browse the repository at this point in the history
Elton 2pi primakoff
  • Loading branch information
markito3 authored Jun 18, 2018
2 parents a4157c7 + f1ddab1 commit b770062
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 58 deletions.
35 changes: 2 additions & 33 deletions src/plugins/Analysis/Z2pi_trees/scripts/README
Original file line number Diff line number Diff line change
@@ -1,33 +1,2 @@
# Elton Smith. Updated June 7, 2017. Mod for Z2pi_trees
# Here is the sequence of instructions to generate, fit and view generated distributions

gen_2pi_primakoff> gen_2pi_primakoff -c gen_2pi_primakoff_signal.cfg -o tree_gen_2pi_primakoff_signal.root -hd gen_2pi_primakoff_signal.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n 100000 -r 31000
gen_2pi_primakoff> gen_2pi_primakoff -c gen_2pi_primakoff_flat.cfg -o tree_gen_2pi_primakoff_flat.root -hd gen_2pi_primakoff_flat.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n 100000 -r 31000

# Here are instructions for processing MC smeared output files / or data

gen_2pi_primakoff> hd_root -PPLUGINS=monitoring_hists,Z2pi_trees -PNTHREADS=4 -PEVENTS_TO_KEEP=10000 ../hddm/dana_rest_gen_2pi_primakoff_030000_00*.hddm -o hd_root_Z2pi_trees_signal.root
gen_2pi_primakoff> mv tree_Z2pi_trees.root tree_hd_root_Z2pi_trees_signal.root

gen_2pi_primakoff> root -l -b tree_hd_root_Z2pi_trees_signal.root
root [0] .x $ROOT_ANALYSIS_HOME/scripts/Load_DSelector.C
root [0] Z2pi_trees_Tree->Process("DSelector_Z2pi_trees.C+");
root [0] .q;
gen_2pi_primakoff> mv DSelector_Z2pi_trees.root DSelector_Z2pi_trees_signal.root
gen_2pi_primakoff> mv tree_DSelector_Z2pi_trees.root tree_DSelector_Z2pi_trees_signal.root
gen_2pi_primakoff> root -l
root [0].x plot_Z2pi_trees.C("DSelector_Z2pi_trees_signal")
root [0].q

gen_2pi_primakoff> tree_to_amptools tree_DSelector_Z2pi_trees_signal.root Z2pi_trees_Tree
gen_2pi_primakoff> mv AmpToolsInputTree.root tree_DSelector_Z2pi_trees_signal_amptools.root

gen_2pi_primakoff> fit -c fit_2pi_primakoff.cfg
gen_2pi_primakoff> cp twopi_primakoff.fit twopi_primakoff_DSelect.fit
gen_2pi_primakoff> twopi_plotter_primakoff twopi_primakoff_DSelect.fit -o twopi_primakoff_DSelect.root
gen_2pi_primakoff> mv twopi_fitPars.txt twopi_primakoff_DSelect.fit2
gen_2pi_primakoff> root -l
root [0] .x twopi_primakoff.C



# Elton Smith. Updated June 14, 2018. Mod for Z2pi_trees
# Use the script streamline2.csh to execute commands to process CPP MC through Amplitude Analysis
2 changes: 1 addition & 1 deletion src/plugins/Analysis/Z2pi_trees/scripts/call_DSelector2.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ void call_DSelector2 (TString file)
//
cout << "call_DSelector2: file=" << file << endl;
gROOT->LoadMacro("$ROOT_ANALYSIS_HOME/scripts/Load_DSelector.C");
pippimmisspb208__B2_Tree->Process("DSelector_Z2pi_trees2.C+");
pippimmisspb208__B2_Tree->Process(file);
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ sum Primakoff Aminus
# data Primakoff ROOTDataReader tree_gen_2pi_primakoff_signal_100000.root
genmc Primakoff ROOTDataReader treeFlat_gen_2pi_primakoff_sw1pw1000_NOTAG_flat_1000000_amptools.root
accmc Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_NOTAG_flat_1000000_amptools.root
data Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG40_signal_1000000_amptools_InTime.root
bkgnd Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG40_signal_1000000_amptools_OutTime.root
data Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG10_signal_1000000_amptools_InTime.root
bkgnd Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG10_signal_1000000_amptools_OutTime.root

# amplitude Primakoff::Aplus TwoPiAngles_primakoff (phipol, pol fraction, m_rho, PhaseFactor, flat)
# phipol is the lab azimuthal angle of the polarization vector.
Expand Down Expand Up @@ -96,7 +96,7 @@ amplitude Primakoff::Aminus::g1V1-1 BreitWigner rho 1 1 2

initialize Primakoff::Aplus::g1V00 cartesian 10.0 0.0
initialize Primakoff::Aplus::g1V11 cartesian 2000.0 0.0 real
initialize Primakoff::Aplus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aplus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aplus::g1V1-1 cartesian 0.0 0.0

initialize Primakoff::Aminus::g1V00 cartesian 10.0 0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
#
#####################################
#### THIS IS A CONFIG FILE ####
#####################################
##
## Blank lines or lines beginning with a "#" are ignored.
##
## Double colons (::) are treated like a space.
## This is sometimes useful for grouping (for example,
## grouping strings like "reaction::sum::amplitudeName")
##
## All non-comment lines must begin with one of the following keywords.
##
## (note: <word> means necessary
## (word) means optional)
##
## include <file>
## define <word> (defn1) (defn2) (defn3) ...
## fit <fitname>
## keyword <keyword> <min arguments> <max arguments>
## reaction <reaction> <particle1> <particle2> (particle3) ...
## data <reaction> <class> (arg1) (arg2) (arg3) ...
## genmc <reaction> <class> (arg1) (arg2) (arg3) ...
## accmc <reaction> <class> (arg1) (arg2) (arg3) ...
## normintfile <reaction> <file>
## sum <reaction> <sum> (sum2) (sum3) ...
## amplitude <reaction> <sum> <amp> <class> (arg1) (arg2) ([par]) ...
## initialize <reaction> <sum> <amp> <"events"/"polar"/"cartesian">
## <value1> <value2> ("fixed"/"real")
## scale <reaction> <sum> <amp> <value or [parameter]>
## constrain <reaction1> <sum1> <amp1> <reaction2> <sum2> <amp2> ...
## permute <reaction> <sum> <amp> <index1> <index2> ...
## parameter <par> <value> ("fixed"/"bounded"/"gaussian")
## (lower/central) (upper/error)
## DEPRECATED:
## datafile <reaction> <file> (file2) (file3) ...
## genmcfile <reaction> <file> (file2) (file3) ...
## accmcfile <reaction> <file> (file2) (file3) ...
##
#####################################

#Take useful definitions from gen_3pi.cfg
define rho 0.775 0.146
# some definitions for adjusting the beam polarization. In the equations beamX: Polarization>0, beamY: Polarization<0.
# Phi is the azimuthal angle of the polarization vector in degrees (in the lab coordinates)
define phipol 0
define polFrac 0.7
define beamX 0 polFrac
define beamY 90 polFrac

# Uniform angles: flat=1; YLMs: flat=0;
define flat 0

fit twopi_primakoff

reaction Primakoff gamma Pi+ Pi- Pb208

normintfile Primakoff twopi_primakoff_ni.txt

# sum contains two terms for s-wave production of pi+pi-
sum Primakoff Aplus
sum Primakoff Aminus

# genmc Primakoff ROOTDataReader tree_gen_2pi_primakoff_flat_100000.root
# accmc Primakoff ROOTDataReader tree_gen_2pi_primakoff_flat_100000.root
# data Primakoff ROOTDataReader tree_gen_2pi_primakoff_signal_100000.root
genmc Primakoff ROOTDataReader treeFlat_gen_2pi_primakoff_sw1pw1000_NOTAG_flat_1000000_amptools.root
accmc Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_NOTAG_flat_1000000_amptools.root
data Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG10_signal_1000000_amptools_InTimeW.root

# amplitude Primakoff::Aplus TwoPiAngles_primakoff (phipol, pol fraction, m_rho, PhaseFactor, flat)
# phipol is the lab azimuthal angle of the polarization vector.
# pol fraction is the linear polarization of the beam
# m_rho Jz component of rho
# Phasefactor determines prefix factor to amplitudes in computation
# flat=1 generates distribution uniform in angles. flat=0 use YLMs

amplitude Primakoff::Aplus::g1V00 TwoPiAngles_primakoff phipol polFrac 0 0 flat
amplitude Primakoff::Aplus::g1V00 TwoPiWt_primakoff 1.29 0. 1 2
amplitude Primakoff::Aplus::g1V11 TwoPiAngles_primakoff phipol polFrac 1 2 flat
amplitude Primakoff::Aplus::g1V11 BreitWigner rho 1 1 2
amplitude Primakoff::Aplus::g1V10 TwoPiAngles_primakoff phipol polFrac 0 2 flat
amplitude Primakoff::Aplus::g1V10 BreitWigner rho 1 1 2
amplitude Primakoff::Aplus::g1V1-1 TwoPiAngles_primakoff phipol polFrac -1 2 flat
amplitude Primakoff::Aplus::g1V1-1 BreitWigner rho 1 1 2

amplitude Primakoff::Aminus::g1V00 TwoPiAngles_primakoff phipol polFrac 0 1 flat
amplitude Primakoff::Aminus::g1V00 TwoPiWt_primakoff 1.29 0. 1 2
amplitude Primakoff::Aminus::g1V11 TwoPiAngles_primakoff phipol polFrac 1 3 flat
amplitude Primakoff::Aminus::g1V11 BreitWigner rho 1 1 2
amplitude Primakoff::Aminus::g1V10 TwoPiAngles_primakoff phipol polFrac 0 3 flat
amplitude Primakoff::Aminus::g1V10 BreitWigner rho 1 1 2
amplitude Primakoff::Aminus::g1V1-1 TwoPiAngles_primakoff phipol polFrac -1 3 flat
amplitude Primakoff::Aminus::g1V1-1 BreitWigner rho 1 1 2

initialize Primakoff::Aplus::g1V00 cartesian 10.0 0.0
initialize Primakoff::Aplus::g1V11 cartesian 2000.0 0.0 real
initialize Primakoff::Aplus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aplus::g1V1-1 cartesian 0.0 0.0

initialize Primakoff::Aminus::g1V00 cartesian 10.0 0.0
initialize Primakoff::Aminus::g1V11 cartesian 2000.0 0.0
initialize Primakoff::Aminus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aminus::g1V1-1 cartesian 0.0 0.0

constrain Primakoff::Aplus::g1V00 Primakoff::Aminus::g1V00
constrain Primakoff::Aplus::g1V11 Primakoff::Aminus::g1V11
constrain Primakoff::Aplus::g1V10 Primakoff::Aminus::g1V10
constrain Primakoff::Aplus::g1V1-1 Primakoff::Aminus::g1V1-1





Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ sum Primakoff Aminus
# data Primakoff ROOTDataReader tree_gen_2pi_primakoff_signal_100000.root
genmc Primakoff ROOTDataReader treeFlat_gen_2pi_primakoff_sw1pw1000_NOTAG_flat_1000000_amptools.root
accmc Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_NOTAG_flat_1000000_amptools.root
data Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG40_signal_1000000_amptools_W.root
data Primakoff ROOTDataReader treeFlat_DSelector_Z2pi_trees_sw1pw1000_TAG10_signal_1000000_amptools_W.root

# amplitude Primakoff::Aplus TwoPiAngles_primakoff (phipol, pol fraction, m_rho, PhaseFactor, flat)
# phipol is the lab azimuthal angle of the polarization vector.
Expand Down Expand Up @@ -94,12 +94,12 @@ amplitude Primakoff::Aminus::g1V1-1 TwoPiAngles_primakoff phipol polFrac -1 3 fl
amplitude Primakoff::Aminus::g1V1-1 BreitWigner rho 1 1 2

initialize Primakoff::Aplus::g1V00 cartesian 10.0 0.0
initialize Primakoff::Aplus::g1V11 cartesian 1000.0 0.0 real
initialize Primakoff::Aplus::g1V11 cartesian 2000.0 0.0 real
initialize Primakoff::Aplus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aplus::g1V1-1 cartesian 0.0 0.0

initialize Primakoff::Aminus::g1V00 cartesian 10.0 0.0
initialize Primakoff::Aminus::g1V11 cartesian 1000.0 0.0
initialize Primakoff::Aminus::g1V11 cartesian 2000.0 0.0
initialize Primakoff::Aminus::g1V10 cartesian 0.0 0.0
initialize Primakoff::Aminus::g1V1-1 cartesian 0.0 0.0

Expand Down
36 changes: 18 additions & 18 deletions src/plugins/Analysis/Z2pi_trees/scripts/streamline2.csh
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ unset base
unset maxev

if( $#argv == 0 ) then
set run = "031001"
set run = "031002"
set base = "sw1pw1000_TAG10"
# set base = "TEST"
set maxev = 1000000
set maxev = 100000
else if ( $#argv == 1) then
set run = $1
set base = ""
Expand All @@ -32,7 +32,7 @@ else
echo "Too many arguments=" $1 $2 $3 $4
endif

cd /work/halld/home/elton/gen_2pi_primakoff_signal/Z2pi_trees
cd /work/halld/home/elton/gen_2pi_primakoff_signal/Z2pi_trees_tutorial

echo " run =" $run
echo " base=" $base
Expand All @@ -41,16 +41,16 @@ set savebase = $base

# Here are instructions for processing MC smeared output files / or data

# gen_2pi_primakoff -c gen_2pi_primakoff_signal.cfg -o tree_gen_2pi_primakoff_signal_${maxev}.root -hd gen_2pi_primakoff_signal.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n ${maxev} -r ${run}
#Not Needed: gen_2pi_primakoff -c gen_2pi_primakoff_signal.cfg -o tree_gen_2pi_primakoff_signal_${maxev}.root -hd gen_2pi_primakoff_signal.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n ${maxev} -r ${run}

# hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PCOMBO:DEBUG_LEVEL=500 -PKINFIT:DEBUG_LEVEL=500 -PANALYSIS:DEBUG_LEVEL=500 -PVERTEXINFO:DEBUG_LEVEL=500 -PEVENTS_TO_KEEP=${maxev} ../../gen_2pi_primakoff_${base}/hddm/dana_rest_gen_2pi_primakoff_${base}_signal_${run}_*.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}.root
#Optional: hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PCOMBO:DEBUG_LEVEL=500 -PKINFIT:DEBUG_LEVEL=500 -PANALYSIS:DEBUG_LEVEL=500 -PVERTEXINFO:DEBUG_LEVEL=500 -PEVENTS_TO_KEEP=${maxev} ../../gen_2pi_primakoff_${base}/hddm/dana_rest_gen_2pi_primakoff_${base}_signal_${run}_*.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}.root

# echo "echo:" hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PEVENTS_TO_KEEP=${maxev} ../../gen_2pi_primakoff_signal/hddm/dana_rest_gen_2pi_primakoff_${run}_*.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}.root
# hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PEVENTS_TO_KEEP=${maxev} ../../gen_2pi_primakoff_signal/hddm/dana_rest_gen_2pi_primakoff_${run}_*.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}.root
# echo "echo:" hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PEVENTS_TO_KEEP=${maxev} -PKALMAN:ADD_VERTEX_POINT=1 ../hddm/dana_rest_gen_2pi_primakoff_${base}_${run}_19*.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}_test.root
# hd_root -PPLUGINS=monitoring_hists,ReactionFilter -PReaction1=1_111__m111_8_9 -PNTHREADS=4 -PEVENTS_TO_KEEP=1000 -PKALMAN:ADD_VERTEX_POINT=1 ../hddm/dana_rest_gen_2pi_primakoff_${base}_${run}_190.hddm -o hd_root_Z2pi_trees_${base}_signal_${maxev}_test.root
#
# Use this option if root trees have already been created using MC wrapper
# rm -f tree_pippimmisspb208.root
# hadd tree_pippimmisspb208.root ../root/tree_pippimmisspb208__B2_gen_2pi_primakoff_${base}_${run}*.root
# hadd tree_pippimmisspb208.root ../root/tree_pippimmisspb208__B2_gen_2pi_primakoff_${base}_${run}_19*.root
# mv tree_pippimmisspb208.root tree_hd_root_Z2pi_trees_${base}_signal_${maxev}.root
# root -b -q tree_hd_root_Z2pi_trees_${base}_signal_${maxev}.root 'call_DSelector2.C("DSelector_Z2pi_trees2.C+")' >! DSelector_Z2pi_trees_${base}_signal_${maxev}.list
# mv DSelector_Z2pi_trees.root DSelector_Z2pi_trees_${base}_signal_${maxev}.root
Expand All @@ -69,8 +69,8 @@ set savebase = $base
# Now repeat for flat distribution. Also need the generated flat distributions.
set base = "sw1pw1000_NOTAG"

# gen_2pi_primakoff -c gen_2pi_primakoff_flat.cfg -o tree_gen_2pi_${base}_primakoff_flat_${maxev}.root -hd gen_2pi_primakoff_flat.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n ${maxev} -r ${run}
# root -b -q tree_gen_2pi_primakoff_${base}_flat_${maxev}_gen.root 'call_MakeAmpToolsFlat_gen.C'
#No longer needed: gen_2pi_primakoff -c gen_2pi_primakoff_flat.cfg -o tree_gen_2pi_${base}_primakoff_flat_${maxev}.root -hd gen_2pi_primakoff_flat.hddm -a 5.5 -b 6.0 -p 6.0 -m 11.6 -n ${maxev} -r ${run}
#No longer needed: root -b -q tree_gen_2pi_primakoff_${base}_flat_${maxev}_gen.root 'call_MakeAmpToolsFlat_gen.C'
#
# use the following process to obtain generated 'tagged'files
# hd_root -PPLUGINS=monitoring_hists,mcthrown_tree -PNTHREADS=4 -PEVENTS_TO_KEEP=${maxev} ../../gen_2pi_primakoff_flat/hddm/dana_rest_gen_2pi_primakoff_${base}_${run}_*.hddm -o hd_root_Z2pi_trees_${base}_flat_${maxev}_gen.root
Expand All @@ -79,9 +79,9 @@ set base = "sw1pw1000_NOTAG"
# mv AmpToolsInputTree.root treeFlat_gen_2pi_primakoff_${base}_flat_${maxev}_amptools.root

#
# Use this option if root trees have already been created using MC wrapper
# Use this option if root trees have already been created using MC wrapper for flat files.
# rm -f tree_pippimmisspb208.root
# hadd tree_pippimmisspb208.root ../../gen_2pi_primakoff_flat/root/tree_pippimmisspb208__B2_gen_2pi_primakoff_${base}_${run}*.root
# hadd tree_pippimmisspb208.root ../../gen_2pi_primakoff_flat/root/tree_pippimmisspb208__B2_gen_2pi_primakoff_${base}_${run}_18*.root
# mv tree_pippimmisspb208.root tree_hd_root_Z2pi_trees_${base}_flat_${maxev}.root
# root -b -q tree_hd_root_Z2pi_trees_${base}_flat_${maxev}.root 'call_DSelector2.C("DSelector_Z2pi_trees2.C+")' >! DSelector_Z2pi_trees_${base}_flat_${maxev}.list
# mv DSelector_Z2pi_trees.root DSelector_Z2pi_trees_${base}_flat_${maxev}.root
Expand All @@ -92,14 +92,14 @@ set base = "sw1pw1000_NOTAG"
# mv AmpToolsInputTree.root treeFlat_DSelector_Z2pi_trees_${base}_flat_${maxev}_amptools.root

# set base = ${savebase}
set tagfit = "File"
set tagfit = "Intime"
set base = ${savebase}_${tagfit}

fit -c fit_2pi_primakoff_${tagfit}_${maxev}.cfg >! twopi_primakoff_DSelect_${base}_${maxev}.list
cp twopi_primakoff.fit twopi_primakoff_DSelect_${base}_${maxev}.fit
twopi_plotter_primakoff twopi_primakoff_DSelect_${base}_${maxev}.fit -o twopi_primakoff_DSelect_${base}_${maxev}.root
mv twopi_fitPars.txt twopi_primakoff_DSelect_${base}_${maxev}.fit2
root -q -l twopi_primakoff.C\(\"twopi_primakoff_DSelect_${base}_${maxev}\",${maxev}\)
# fit -c fit_2pi_primakoff_${tagfit}_${maxev}.cfg >! twopi_primakoff_DSelect_${base}_${maxev}.list
# cp twopi_primakoff.fit twopi_primakoff_DSelect_${base}_${maxev}.fit
# twopi_plotter_primakoff twopi_primakoff_DSelect_${base}_${maxev}.fit -o twopi_primakoff_DSelect_${base}_${maxev}.root
# mv twopi_fitPars.txt twopi_primakoff_DSelect_${base}_${maxev}.fit2
# root -q -l twopi_primakoff.C\(\"twopi_primakoff_DSelect_${base}_${maxev}\",${maxev}\)

unset echo

0 comments on commit b770062

Please sign in to comment.