Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stdDev plots to Analysis and summary plot method in Postprocessor #54

Draft
wants to merge 57 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
7456914
Added stdDev plots to Analysis and summary plot method in Postprocessor
Oct 27, 2021
e16490d
Updated stdDev routines to plot 1D z-binned histograms in Q2 vs. x
Nov 2, 2021
3964cb9
Updated z-binned hists in Q2vsx
Nov 4, 2021
e7b3f08
Updated resolution plots to use Gaussian fits
Nov 9, 2021
740369a
Small updates to marker style and config file options.
Nov 11, 2021
e2eac24
Merged in updates from main
Nov 11, 2021
7643abb
Removed extra assymetry injection block from merge conflict resolution
Nov 11, 2021
fdaa6bb
Added in histogram definitions missing from merge conflict resolution
Nov 11, 2021
233fa22
Fixing legend sizing issue
Nov 11, 2021
801cc7c
Merge branch 'main' into xq2_resolutions
Nov 12, 2021
deca0ff
Updated legend placement in `PostProcessor.cxx`
Nov 12, 2021
f7159f1
Added zero lines to draw with `THStacks` in `PostProcessor::DrawSDInB…
Nov 12, 2021
8bf1e36
Updated purity to contamination plot for better y axis scaling when p…
Nov 12, 2021
65fba73
Added full sim analysis script for resolutions
Nov 15, 2021
280ea1f
Merge branch 'main' of https://github.com/c-dilks/largex-eic into xq2…
Nov 15, 2021
352f921
Small updates to resolution scripts and working out purities in `Anal…
Nov 15, 2021
80b78a2
Added PID purity plots and scripts to make and run analysis/postproce…
Nov 16, 2021
6492cf9
Small updates: removed y axis scaling in `PostProcessor::DrawInBins()…
Nov 16, 2021
f49acfa
Still debugging pid assignments, also fixed old issues in scripts
Nov 17, 2021
0f2d204
Added analysis and postprocessing scripts for different reconstructio…
Nov 19, 2021
ae36351
Simplified analysis script creation for different reconstruction methods
Nov 19, 2021
9c133b7
Fixed small typo
Nov 19, 2021
6938b2b
More small typos
Nov 19, 2021
cb508ac
Fixed typos in creation script
Nov 19, 2021
2b45584
Updated analysis script creation
Nov 19, 2021
cb82f50
Finally fixed creation script
Nov 19, 2021
e881e8c
Fixed small typo
Nov 19, 2021
5eb36f0
Updated getPID() method and fixed typo in creation script
Nov 19, 2021
5e1146a
Changed z limits in `macro/analysis_resolution.C` and fixed bug with …
Nov 22, 2021
dec8cd9
Added TODO for mRICH which is now eRICH I think...
Nov 22, 2021
2c52399
Added efficiency plots (not tested yet)
Nov 22, 2021
6914d46
Fixed min count check in PostProcessor::plotSDsInBinsTogether()
Nov 22, 2021
9e2ba9f
Added x-binned purity and efficiency plots
Nov 23, 2021
424851f
Fixed a couple typos from last commit
Nov 23, 2021
05706c7
Changed arg names for clarity in FillHistosEfficiency
Nov 23, 2021
498f731
Fixed typo in x-binned efficiencies and updated z limits in macro/ana…
Nov 23, 2021
4f96bf0
Added test script for plotting different hadronic method results toge…
Nov 23, 2021
2be5eeb
Added plotting script for kinematics and purities/efficiencies all to…
Nov 27, 2021
973f9fd
No changes
Nov 27, 2021
73fb42f
Changed marker size in plotPurities.C
Nov 27, 2021
c03f771
Switched to kin->GetTrackPID() Method in AnalysisDelphes.cxx
Nov 27, 2021
cc924d1
Added new updates for cards
Nov 27, 2021
08deb5a
Updated cuts and default plots selected in macro/analysis_resolution.C
Nov 27, 2021
ce9413e
Updated default plots selected
Nov 27, 2021
923564b
Fixed variable name typo for FillHistosEfficiency in Analysis.cxx
Nov 27, 2021
038b4b2
Added back in kvMC assignment which was missing from pulling main
Nov 27, 2021
669f8ac
Now PostProcessor.cxx also writes out fithists used for resolutions
Nov 27, 2021
da7ca53
Quick (temporary) fix to select ±K, ±pi all in same final state bin
Nov 27, 2021
920e0c8
Updated upper q2 limit in macro/analysis_resolution.C
Nov 27, 2021
1a51a6b
Git pulled cards submodule
Nov 27, 2021
5f3102b
Reverted to old getPID() method for now
Nov 28, 2021
5f7eb9c
Reverted back
Nov 28, 2021
1702eaf
Merge branch 'main' of https://github.com/c-dilks/largex-eic into xq2…
Nov 28, 2021
5af1671
Updated default paths for job scripts
Nov 28, 2021
1202fb0
Updated default axes limits and fixed typo with array length in macro…
Nov 28, 2021
50fdba0
Changed file names in plotPurities.C
Dec 1, 2021
6800f69
Merging in new histogram definitions from main in Analysis.cxx
Dec 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions createDelphesScripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/bash

# Create fast simulation resolutions plotting scripts and submit to ifarm
METHOD="Ele" # Switch this to select reconstruction method from {"Ele","JB","DA"}
script="$PWD/macro/analysis_resolution.C"
postScript="$PWD/macro/postprocess_resolution.C"
submitScript="$PWD/submit.sh"
jobScript="$PWD/job.sh"
out="$PWD/macro/"
cd datarec
for file in *-xm25.config
do
energies=`echo $file | sed "s;.config;;g"`
config="${METHOD}_${energies}"
mkdir -p $out/$config
cp $script $out/$config/
newscript=${out}${config}/*.C
eleIn=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*" | sed "s;x.*;;g"`
beamIn=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*" | sed "s;.*x;;g"`
xAng=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*-x[0-9]*" | sed "s;.*-x;;g"`
xAngM=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*-xm[0-9]*" | sed "s;.*-xm;;g"`
echo "file=${file}"
echo "energies=${energies}"
echo "config=${config}"
echo "newscript=${newscript}"
echo "eleIn=${eleIn}"
echo "beamIn=${beamIn}"
echo "xAng=${xAng}"
echo "xAngM=${xAngM}"

# Modify analysis script
sed -i "s;datarec/dis-5x41;datarec/${energies};g" $newscript
sed -i "s;Ele_dis-5x41;${config};g" $newscript
sed -i "s;eleBeamEn=5;eleBeamEn=${eleIn};g" $newscript
sed -i "s;ionBeamEn=41;ionBeamEn=${beamIn};g" $newscript
if [ $xAng ]; then
sed -i "s;crossingAngle=25;crossingAngle=-${xAng};g" $newscript
fi
if [ $xAngM ]; then
sed -i "s;crossingAngle=25;crossingAngle=${xAngM};g" $newscript
fi
sed -i "s;Ele;${METHOD};g" $newscript

# Postprocessor
cp $postScript $out/$config
sed -i "s;dis-5x41;${config};g" $out/$config/postprocess*.C
sed -i "s;testheader;${eleIn}x${beamIn}GeV;g" $out/$config/postprocess*.C

# And job scripts
cp $submitScript $out/$config
cp $jobScript $out/$config
sed -i "s;dis-5x41;${config};g" $out/$config/*.sh

# And submit
sbatch $out/$config/submit.sh
echo --------------------

done
cd ..
echo DONE
48 changes: 48 additions & 0 deletions createFullScripts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash
# Create full simulation resolution plotting scripts and submit to ifarm
script="$PWD/macro/analysis_resolution_SD_Full.C"
postScript="$PWD/macro/postprocess_resolution_SD.C"
submitScript="$PWD/submit.sh"
jobScript="$PWD/job.sh"
out="$PWD/macro/canyonlands/"
cd datarec/canyonlands/
for file in */*.config
do
config=`echo $file | sed "s;.config;;g" | grep -Eo 'canyonlands/.*' | sed 's;canyonlands/;;g' | sed 's;/files;;g'`
mkdir -p $out/$config
cp $script $out/$config/
newscript=${out}${config}/*.C
eleIn=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*" | sed "s;x.*;;g"`
beamIn=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*" | sed "s;.*x;;g"`
xAng=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*-x[0-9]*" | sed "s;.*-x;;g"`
xAngM=`echo $file | grep -Eo "[0-9][0-9]*x[0-9]*-xm[0-9]*" | sed "s;.*-xm;;g"`
echo "name=${name}"
echo "file=${file}"
echo "config=${config}"
echo "newscript=${newscript}"
echo "eleIn=${eleIn}"
echo "beamIn=${beamIn}"
echo "xAng=${xAng}"
echo "xAngM=${xAngM}"

sed -i "s;datarec/dis-5x41.config;${file};g" $newscript
sed -i "s;full_dis-5x41;full_${config};g" $newscript
sed -i "s;eleBeamEn=5;eleBeamEn=${eleIn};g" $newscript
sed -i "s;ionBeamEn=41;ionBeamEn=${beamIn};g" $newscript
if [ $xAng ]; then
sed -i "s;crossingAngle=25;crossingAngle=-${xAng};g" $newscript
fi
if [ $xAngM ]; then
sed -i "s;icrossingAngle=25;crossingAngle=${xAngM};g" $newscript
fi
cp $postScript $out/$config
sed -i "s;dis-5x41;${config};g" $out/$config/*.C
sed -i "s;testheader;${eleIn}x${beamIn}GeV;g" $out/$config/*.C
cp $submitScript $out/$config
cp $jobScript $out/$config
sed -i "s;dis-5x41;canyonlands/${config};g" $out/$config/*.sh
sbatch $out/$config/submit.sh
echo --------------------
done
cd ..
echo DONE
3 changes: 3 additions & 0 deletions datarec/dis-5x41-xm25.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1 4.002e-4 /lustre19/expphy/volatile/halla/solid/dcbyer/eic-data/new/dis-5x41-xm25.root -1
100 2.869e-7 /lustre19/expphy/volatile/halla/solid/dcbyer/eic-data/new/dis-5x41-q2min100-xm25.root -1

6 changes: 6 additions & 0 deletions job.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

cd /work/clas12/users/$USER/eic3/largex-eic
echo "root -q -b macro/dis-5x41/analysis_resolution.C" | ./container/shell.sh
echo "root -q -b macro/dis-5x41/postprocess_resolution.C" | ./container/shell.sh
echo DONE
47 changes: 47 additions & 0 deletions macro/analysis_barak.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
R__LOAD_LIBRARY(Largex)

// make resolution plots
void analysis_barak(
TString infiles="datarec/dis-18x275-xm25.config", /* list of input files */
Double_t eleBeamEn=18, /* electron beam energy [GeV] */
Double_t ionBeamEn=275, /* ion beam energy [GeV] */
Double_t crossingAngle=25, /* crossing angle [mrad] */
TString outfilePrefix="barak_dis-18x275-xm25" /* output filename prefix*/
) {

// setup analysis ========================================
AnalysisDelphes *A = new AnalysisDelphes(
infiles,
eleBeamEn,
ionBeamEn,
crossingAngle,
outfilePrefix
);
A->NBINS = 1; // use this to set the number of bins along each axis, e.g., z binning (except resolution axes) for each overall bin in e.g. x and Q2
A->NBINSRES = 100; // use this to set the number of bins along the resolution axes for each overall bin in e.g. x and Q2
// A->RESHIGH = 1;
// A->RESLOW = -1;
//A->maxEvents = 30000; // use this to limit the number of events
A->SetReconMethod("Ele"); // set reconstruction method
// A->SetReconMethod("JB"); // set reconstruction method
//A->SetReconMethod("DA"); // set reconstruction method
A->AddFinalState("pipTrack"); // pi+ final state
A->AddFinalState("pimTrack"); // pi- final state
A->AddFinalState("KpTrack"); // K+ final state
A->AddFinalState("KmTrack"); // K- final state
A->AddFinalState("pTrack"); // proton final state

// define cuts ====================================
A->AddBinScheme("w"); A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
A->AddBinScheme("y"); A->BinScheme("y")->BuildBin("Range",0.01,0.95); // 0.01 < y < 0.95
A->AddBinScheme("z"); A->BinScheme("z")->BuildBin("Range",0.2,0.9); // 0.2 < z < 0.9
A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
A->AddBinScheme("ptLab"); A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)

// set binning scheme ====================================
A->AddBinScheme("q2"); A->BinScheme("q2")->BuildBins( 25, 0.1, 10000, true );
A->AddBinScheme("x"); A->BinScheme("x")->BuildBins( 25, 0.00001, 1, true );

// perform the analysis ==================================
A->Execute();
};
45 changes: 45 additions & 0 deletions macro/analysis_resolution.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
R__LOAD_LIBRARY(Largex)

// make resolution plots
void analysis_resolution(
TString infiles="datarec/dis-5x41.config", /* list of input files */
Double_t eleBeamEn=5, /* electron beam energy [GeV] */
Double_t ionBeamEn=41, /* ion beam energy [GeV] */
Double_t crossingAngle=25, /* crossing angle [mrad] */
TString outfilePrefix="Ele_dis-5x41" /* output filename prefix*/
) {

// setup analysis ========================================
AnalysisDelphes *A = new AnalysisDelphes(
infiles,
eleBeamEn,
ionBeamEn,
crossingAngle,
outfilePrefix
);
A->NBINS = 1; // use this to set the number of bins along each axis, e.g., z binning (except resolution axes) for each overall bin in e.g. x and Q2
A->NBINSRES = 100; // use this to set the number of bins along the resolution axes for each overall bin in e.g. x and Q2
// A->RESHIGH = 1;
// A->RESLOW = -1;
//A->maxEvents = 30000; // use this to limit the number of events
A->SetReconMethod("Ele"); // set reconstruction method
A->AddFinalState("pipTrack"); // pion final state
// A->AddFinalState("pimTrack"); // pion final state
// A->AddFinalState("KpTrack"); // pion final state
// A->AddFinalState("KmTrack"); // pion final state
// A->AddFinalState("pTrack"); // pion final state

// define cuts ====================================
A->AddBinScheme("w"); A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
A->AddBinScheme("y"); A->BinScheme("y")->BuildBin("Range",0.01,0.95); // 0.01 < y < 0.95
A->AddBinScheme("z"); A->BinScheme("z")->BuildBin("Range",0.2,0.9); // 0.2 < z < 0.9
A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
A->AddBinScheme("ptLab"); A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)

// set binning scheme ====================================
A->AddBinScheme("q2"); A->BinScheme("q2")->BuildBins( 4, 1, 1000, true );
A->AddBinScheme("x"); A->BinScheme("x")->BuildBins( 6, 0.01, 1, true );

// perform the analysis ==================================
A->Execute();
};
41 changes: 41 additions & 0 deletions macro/analysis_resolution_SD_Full.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
R__LOAD_LIBRARY(Largex)

// make resolution plots
void analysis_resolution_SD_Full(
TString infiles="datarec/full_dis-5x41.config", /* list of input files */
Double_t eleBeamEn=5, /* electron beam energy [GeV] */
Double_t ionBeamEn=41, /* ion beam energy [GeV] */
Double_t crossingAngle=25, /* crossing angle [mrad] */
TString outfilePrefix="full_dis-5x41" /* output filename prefix*/
) {

// setup analysis ========================================
AnalysisDD4hep *A = new AnalysisDD4hep(
infiles,
eleBeamEn,
ionBeamEn,
crossingAngle,
outfilePrefix
);
A->NBINS = 5; // use this to set the number of bins along each axis, e.g., z binning (except resolution axes) for each overall bin in e.g. x and Q2
A->NBINSRES = 100; // use this to set the number of bins along the resolution axes for each overall bin in e.g. x and Q2
// A->RESHIGH = 1;
// A->RESLOW = -1;
//A->maxEvents = 30000; // use this to limit the number of events
A->SetReconMethod("Ele"); // set reconstruction method
A->AddFinalState("pipTrack"); // pion final state

// define cuts ====================================
A->AddBinScheme("w"); A->BinScheme("w")->BuildBin("Min",3.0); // W > 3 GeV
A->AddBinScheme("y"); A->BinScheme("y")->BuildBin("Range",0.01,0.95); // 0.01 < y < 0.95
A->AddBinScheme("z"); A->BinScheme("z")->BuildBin("Range",0.2,0.9); // 0.2 < z < 0.9
A->AddBinScheme("xF"); A->BinScheme("xF")->BuildBin("Min",0.0); // xF > 0
A->AddBinScheme("ptLab"); A->BinScheme("ptLab")->BuildBin("Min",0.1); // pT_lab > 0.1 GeV (tracking limit)

// set binning scheme ====================================
A->AddBinScheme("q2"); A->BinScheme("q2")->BuildBins( 4, 1, 100, true );
A->AddBinScheme("x"); A->BinScheme("x")->BuildBins( 6, 0.01, 1, true );

// perform the analysis ==================================
A->Execute();
};
Loading