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
Commits
e17a9b39
Commit
e17a9b39
authored
4 years ago
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
add photons and pions
parent
72fa2a2a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!74
add benchmark for sampling calorimeter
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/sampling_ecal/run_emcal_barrel_photons.sh
+107
-0
107 additions, 0 deletions
benchmarks/sampling_ecal/run_emcal_barrel_photons.sh
benchmarks/sampling_ecal/run_emcal_barrel_pion.sh
+107
-0
107 additions, 0 deletions
benchmarks/sampling_ecal/run_emcal_barrel_pion.sh
with
214 additions
and
0 deletions
benchmarks/sampling_ecal/run_emcal_barrel_photons.sh
0 → 100644
+
107
−
0
View file @
e17a9b39
#!/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
This diff is collapsed.
Click to expand it.
benchmarks/sampling_ecal/run_emcal_barrel_pion.sh
0 → 100644
+
107
−
0
View file @
e17a9b39
#!/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_pions"
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
=
"-211"
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/pions
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/pions
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/pions
\
--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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment