Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Merge requests
!74
add benchmark for sampling calorimeter
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add benchmark for sampling calorimeter
sampling_cal
into
master
Overview
0
Commits
33
Pipelines
0
Changes
2
Merged
Chao Peng
requested to merge
sampling_cal
into
master
4 years ago
Overview
0
Commits
33
Pipelines
0
Changes
2
Expand
0
0
Merge request reports
Viewing commit
e17a9b39
Prev
Next
Show latest version
2 files
+
214
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
e17a9b39
add photons and pions
· e17a9b39
Chao Peng
authored
4 years ago
benchmarks/sampling_ecal/run_emcal_barrel_photons.sh
0 → 100644
+
107
−
0
Options
#!/bin/bash
if
[[
!
-n
"
${
JUGGLER_DETECTOR
}
"
]]
;
then
export
JUGGLER_DETECTOR
=
"topside"
fi
export
CB_EMCAL_COMPACT_PATH
=
${
DETECTOR_PATH
}
/
${
JUGGLER_DETECTOR
}
.xml
if
[[
!
-n
"
${
CB_EMCAL_NUMEV
}
"
]]
;
then
export
CB_EMCAL_NUMEV
=
1000
fi
if
[[
!
-n
"
${
CB_EMCAL_ENERGY
}
"
]]
;
then
export
CB_EMCAL_ENERGY
=
5.0
fi
if
[[
!
-n
"
${
CB_EMCAL_SAMP_FRAC
}
"
]]
;
then
export
CB_EMCAL_SAMP_FRAC
=
0.014
fi
export
CB_EMCAL_NAME_TAG
=
"emcal_barrel_uniform_photons"
export
CB_EMCAL_GEN_FILE
=
"
${
CB_EMCAL_NAME_TAG
}
.hepmc"
export
CB_EMCAL_SIM_FILE
=
"sim_
${
CB_EMCAL_NAME_TAG
}
.root"
export
CB_EMCAL_REC_FILE
=
"rec_
${
CB_EMCAL_NAME_TAG
}
.root"
echo
"CB_EMCAL_NUMEV =
${
CB_EMCAL_NUMEV
}
"
echo
"CB_EMCAL_COMPACT_PATH =
${
CB_EMCAL_COMPACT_PATH
}
"
# Generate the input events
python benchmarks/sampling_ecal/scripts/gen_particles.py
${
CB_EMCAL_GEN_FILE
}
\
--angmin
90
--angmax
90
--parray
${
CB_EMCAL_ENERGY
}
--particles
=
"22"
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running script: generating input events"
exit
1
fi
ls
-lh
${
CB_EMCAL_GEN_FILE
}
# Run geant4 simulations
npsim
--runType
batch
\
-v
WARNING
\
--part
.minimalKineticEnergy 0.5
*
GeV
\
--numberOfEvents
${
CB_EMCAL_NUMEV
}
\
--compactFile
${
CB_EMCAL_COMPACT_PATH
}
\
--inputFiles
${
CB_EMCAL_GEN_FILE
}
\
--outputFile
${
CB_EMCAL_SIM_FILE
}
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running npdet"
exit
1
fi
rootls
-t
"
${
CB_EMCAL_SIM_FILE
}
"
# Directory for plots
mkdir
-p
results
# CB_EMCAL_OPTION_DIR=${JUGGLER_INSTALL_PREFIX}/Examples/options
# CB_EMCAL_SCRIPT_DIR=${JUGGLER_INSTALL_PREFIX}/Examples/scripts/sampling_calorimeter
CB_EMCAL_OPTION_DIR
=
benchmarks/sampling_ecal/options
CB_EMCAL_SCRIPT_DIR
=
benchmarks/sampling_ecal/scripts
# Run Juggler
# xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ${CB_EMCAL_OPTION_DIR}/sampling_cluster3d.py
gaudirun.py
${
CB_EMCAL_OPTION_DIR
}
/sampling_cluster3d.py
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running juggler"
exit
1
fi
# check required python modules
python
-m
pip
install
-r
benchmarks/sampling_ecal/requirements.txt
# Run analysis script
python
${
CB_EMCAL_SCRIPT_DIR
}
/draw_cluster_layers.py
\
${
CB_EMCAL_REC_FILE
}
-e
0
--topo-size
=
1.0
--compact
=
${
CB_EMCAL_COMPACT_PATH
}
-o
results/photons
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running analysis script: draw_cluster_layers"
exit
1
fi
python
${
CB_EMCAL_SCRIPT_DIR
}
/draw_cluster.py
\
${
CB_EMCAL_REC_FILE
}
-e
0
--topo-size
=
2.0
--compact
=
${
CB_EMCAL_COMPACT_PATH
}
-o
results/photons
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running analysis script: draw_cluster"
exit
1
fi
python
${
CB_EMCAL_SCRIPT_DIR
}
/energy_profile.py
\
${
CB_EMCAL_REC_FILE
}
--type
=
EM
--energy
=
${
CB_EMCAL_ENERGY
}
-o
results/photons
\
--save
=
results/profile.csv
--color
=
royalblue
if
[[
"
$?
"
-ne
"0"
]]
;
then
echo
"ERROR running analysis script: energy_profile"
exit
1
fi
root_filesize
=
$(
stat
--format
=
%s
"
${
CB_EMCAL_REC_FILE
}
"
)
if
[[
"
${
CB_EMCAL_NUMEV
}
"
-lt
"500"
]]
;
then
# file must be less than 10 MB to upload
if
[[
"
${
root_filesize
}
"
-lt
"10000000"
]]
;
then
cp
${
CB_EMCAL_REC_FILE
}
results/.
fi
fi
Loading