Skip to content
Snippets Groups Projects
Commit c8780170 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

minor restructure

parent 15c35c7f
No related branches found
No related tags found
1 merge request!10Update dis
This commit is part of merge request !10. Comments created here will be created in the context of that merge request.
Showing
with 143 additions and 175 deletions
...@@ -33,9 +33,9 @@ detector: ...@@ -33,9 +33,9 @@ detector:
- ./util/build_detector.sh - ./util/build_detector.sh
include: include:
- local: 'dis/config.yml' - local: 'benchmarks/dis/config.yml'
- local: 'dvmp/config.yml' - local: 'benchmarks/dvmp/config.yml'
- local: 'dvcs/config.yml' - local: 'benchmarks/dvcs/config.yml'
summary: summary:
stage: finish stage: finish
......
{ {
// Ensure fmt is loaded // Ensure fmt is loaded
R__LOAD_LIBRARY(libfmt); R__LOAD_LIBRARY(libfmt);
//
// top-level include-dir
gROOT->ProcessLine(".include include");
// setup a local build directory so we don't polute our source code with // setup a local build directory so we don't polute our source code with
// ROOT dictionaries etc. // ROOT dictionaries etc.
......
File moved
File moved
File moved
File moved
dis:generate: dis:generate:
stage: initialize stage: initialize
image: eicweb.phy.anl.gov:4567/eic/juggler/juggler:latest
needs: [] needs: []
timeout: 1 hours timeout: 1 hours
artifacts: artifacts:
paths: paths:
- results - results
script: script:
- bash dis/gen.sh - bash benchmarks/dis/gen.sh
dis:process: dis:process:
stage: process stage: process
......
...@@ -67,7 +67,7 @@ fi ...@@ -67,7 +67,7 @@ fi
echo "Running the digitization and reconstruction" echo "Running the digitization and reconstruction"
# FIXME Need to figure out how to pass file name to juggler from the commandline # FIXME Need to figure out how to pass file name to juggler from the commandline
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \ xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
gaudirun.py options/tracker_reconstruction.py gaudirun.py config/tracker_reconstruction.py
if [ "$?" -ne "0" ] ; then if [ "$?" -ne "0" ] ; then
echo "ERROR running juggler" echo "ERROR running juggler"
exit 1 exit 1
...@@ -76,7 +76,7 @@ ls -l ...@@ -76,7 +76,7 @@ ls -l
## ============================================================================= ## =============================================================================
## Step 4: Analysis ## Step 4: Analysis
root -b -q "dis/analysis/rec_dis_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")" root -b -q "benchmarks/dis/analysis/rec_dis_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script" echo "ERROR running root script"
exit 1 exit 1
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
echo "Running the DIS benchmarks" echo "Running the DIS benchmarks"
## make sure we launch this script from the project root directory ## make sure we launch this script from the project root directory
PROJECT_ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/.. PROJECT_ROOT="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"/../..
pushd ${PROJECT_ROOT} pushd ${PROJECT_ROOT}
## ============================================================================= ## =============================================================================
...@@ -35,8 +35,8 @@ JUGGLER_FILE_NAME_TAG="dis" ...@@ -35,8 +35,8 @@ JUGGLER_FILE_NAME_TAG="dis"
## ============================================================================= ## =============================================================================
## Step 1: Dummy event generator ## Step 1: Dummy event generator
## TODO better file name that encodes the actual configuration we're running ## TODO better file name that encodes the actual configuration we're running
echo "Compiling dis/src/pythia_dis.cc ..." echo "Compiling benchmarks/dis/generator/pythia_dis.cxx ..."
g++ dis/src/pythia_dis.cc -o pythia_dis \ g++ benchmarks/dis/generator/pythia_dis.cxx -o pythia_dis \
-I/usr/local/include -Iinclude \ -I/usr/local/include -Iinclude \
-O2 -std=c++11 -pedantic -W -Wall -Wshadow -fPIC \ -O2 -std=c++11 -pedantic -W -Wall -Wshadow -fPIC \
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lpythia8 -ldl \ -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lpythia8 -ldl \
......
File moved
...@@ -3,7 +3,7 @@ dvcs:process: ...@@ -3,7 +3,7 @@ dvcs:process:
timeout: 1 hour timeout: 1 hour
needs: ["detector"] needs: ["detector"]
script: script:
- bash dvcs/dvcs.sh - bash benchmarks/dvcs/dvcs.sh
artifacts: artifacts:
paths: paths:
- results - results
...@@ -18,5 +18,3 @@ dvcs:results: ...@@ -18,5 +18,3 @@ dvcs:results:
paths: paths:
- results - results
# reports: # reports:
# junit: ["results/dvcs/dvcs_report.xml"]
...@@ -43,7 +43,7 @@ fi ...@@ -43,7 +43,7 @@ fi
# Need to figure out how to pass file name to juggler from the commandline # Need to figure out how to pass file name to juggler from the commandline
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \ xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv \
gaudirun.py options/tracker_reconstruction.py gaudirun.py config/tracker_reconstruction.py
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler" echo "ERROR running juggler"
exit 1 exit 1
...@@ -51,7 +51,7 @@ fi ...@@ -51,7 +51,7 @@ fi
mkdir -p results/dvcs mkdir -p results/dvcs
root -b -q "dvcs/scripts/dvcs_tests.cxx(\"${JUGGLER_REC_FILE}\")" root -b -q "benchmarks/dvcs/scripts/dvcs_tests.cxx(\"${JUGGLER_REC_FILE}\")"
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script" echo "ERROR running root script"
exit 1 exit 1
...@@ -62,10 +62,6 @@ if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then ...@@ -62,10 +62,6 @@ if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
cp ${JUGGLER_REC_FILE} results/dvcs/. cp ${JUGGLER_REC_FILE} results/dvcs/.
fi fi
# Collect the results
#cp dvcs/report.xml results/dvcs/.
#cp dvcs/report2.xml results/dvcs/.
......
File moved
File moved
File moved
#include "benchmark.hh"
#include "mt.h"
#include "plot.h" #include "plot.h"
#include "util.h"
#include <benchmark.h>
#include <mt.h>
#include <util.h>
#include <ROOT/RDataFrame.hxx> #include <ROOT/RDataFrame.hxx>
#include <cmath> #include <cmath>
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
// TODO: I think it would be better to pass small json configuration file to // TODO: I think it would be better to pass small json configuration file to
// the test, instead of this ever-expanding list of function arguments. // the test, instead of this ever-expanding list of function arguments.
// FIXME: MC does not trace back into particle history. Need to fix that // FIXME: MC does not trace back into particle history. Need to fix that
int vm_invar(const std::string& config_name) { int vm_invar(const std::string& config_name)
{
// read our configuration // read our configuration
std::ifstream config_file{config_name}; std::ifstream config_file{config_name};
nlohmann::json config; nlohmann::json config;
...@@ -33,8 +35,7 @@ int vm_invar(const std::string& config_name) { ...@@ -33,8 +35,7 @@ int vm_invar(const std::string& config_name) {
std::string output_prefix = config["output_prefix"]; std::string output_prefix = config["output_prefix"];
const std::string test_tag = config["test_tag"]; const std::string test_tag = config["test_tag"];
fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green), fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green), "Running VM invariant mass analysis...\n");
"Running VM invariant mass analysis...\n");
fmt::print(" - Vector meson: {}\n", vm_name); fmt::print(" - Vector meson: {}\n", vm_name);
fmt::print(" - Decay particle: {}\n", decay_name); fmt::print(" - Decay particle: {}\n", decay_name);
fmt::print(" - Detector package: {}\n", detector); fmt::print(" - Detector package: {}\n", detector);
...@@ -43,10 +44,8 @@ int vm_invar(const std::string& config_name) { ...@@ -43,10 +44,8 @@ int vm_invar(const std::string& config_name) {
// create our test definition // create our test definition
// test_tag // test_tag
eic::util::Test vm_mass_resolution_test{ eic::util::Test vm_mass_resolution_test{
{{"name", {{"name", fmt::format("{}_{}_{}_mass_resolution", test_tag, vm_name, decay_name)},
fmt::format("{}_{}_{}_mass_resolution", test_tag, vm_name, decay_name)}, {"title", fmt::format("{} -> {} Invariant Mass Resolution", vm_name, decay_name)},
{"title",
fmt::format("{} -> {} Invariant Mass Resolution", vm_name, decay_name)},
{"description", "Invariant Mass Resolution calculated from raw " {"description", "Invariant Mass Resolution calculated from raw "
"tracking data using a Gaussian fit."}, "tracking data using a Gaussian fit."},
{"quantity", "resolution"}, {"quantity", "resolution"},
...@@ -60,8 +59,7 @@ int vm_invar(const std::string& config_name) { ...@@ -60,8 +59,7 @@ int vm_invar(const std::string& config_name) {
const double decay_mass = util::get_pdg_mass(decay_name); const double decay_mass = util::get_pdg_mass(decay_name);
// Ensure our output prefix always ends on a dot, a slash or a dash // Ensure our output prefix always ends on a dot, a slash or a dash
if (output_prefix.back() != '.' && output_prefix.back() != '/' && if (output_prefix.back() != '.' && output_prefix.back() != '/' && output_prefix.back() != '-') {
output_prefix.back() != '-') {
output_prefix += "-"; output_prefix += "-";
} }
...@@ -70,16 +68,14 @@ int vm_invar(const std::string& config_name) { ...@@ -70,16 +68,14 @@ int vm_invar(const std::string& config_name) {
// utility lambda functions to bind the vector meson and decay particle // utility lambda functions to bind the vector meson and decay particle
// types // types
auto momenta_from_tracking = auto momenta_from_tracking = [decay_mass](const std::vector<eic::TrackParametersData>& tracks) {
[decay_mass](const std::vector<eic::TrackParametersData>& tracks) {
return util::momenta_from_tracking(tracks, decay_mass); return util::momenta_from_tracking(tracks, decay_mass);
}; };
//==================================================================== //====================================================================
// Define analysis flow // Define analysis flow
auto d_im = auto d_im = d.Define("p_rec", momenta_from_tracking, {"outputTrackParameters"})
d.Define("p_rec", momenta_from_tracking, {"outputTrackParameters"})
.Define("N", "p_rec.size()") .Define("N", "p_rec.size()")
.Define("p_sim", util::momenta_from_simulation, {"mcparticles2"}) .Define("p_sim", util::momenta_from_simulation, {"mcparticles2"})
//================================================================ //================================================================
...@@ -91,13 +87,9 @@ int vm_invar(const std::string& config_name) { ...@@ -91,13 +87,9 @@ int vm_invar(const std::string& config_name) {
// Define output histograms // Define output histograms
auto h_nu_sim = d_im.Histo1D( auto h_nu_sim = d_im.Histo1D({"h_nu_sim", ";#nu/1000;#", 100, 0., 2.}, "nu_sim");
{"h_nu_sim", ";#nu/1000;#", 100, 0., 2.}, "nu_sim"); auto h_Q2_sim = d_im.Histo1D({"h_Q2_sim", ";Q^{2};#", 100, 0., 15.}, "Q2_sim");
auto h_Q2_sim = d_im.Histo1D( auto h_x_sim = d_im.Histo1D({"h_x_sim", ";x;#", 100, 0., 0.1}, "x_sim");
{"h_Q2_sim", ";Q^{2};#", 100, 0., 15.}, "Q2_sim");
auto h_x_sim = d_im.Histo1D(
{"h_x_sim", ";x;#", 100, 0., 0.1}, "x_sim");
// Plot our histograms. // Plot our histograms.
// TODO: to start I'm explicitly plotting the histograms, but want to // TODO: to start I'm explicitly plotting the histograms, but want to
...@@ -192,8 +184,7 @@ int vm_invar(const std::string& config_name) { ...@@ -192,8 +184,7 @@ int vm_invar(const std::string& config_name) {
vm_mass_resolution_test.error(-1); vm_mass_resolution_test.error(-1);
// write out our test data // write out our test data
eic::util::write_test(vm_mass_resolution_test, eic::util::write_test(vm_mass_resolution_test, fmt::format("{}vm_invar.json", output_prefix));
fmt::format("{}vm_invar.json", output_prefix));
// That's all! // That's all!
return 0; return 0;
......
#include "benchmark.hh"
#include "mt.h"
#include "plot.h" #include "plot.h"
#include "util.h"
#include <benchmark.h>
#include <mt.h>
#include <util.h>
#include <ROOT/RDataFrame.hxx> #include <ROOT/RDataFrame.hxx>
#include <cmath> #include <cmath>
...@@ -20,7 +21,8 @@ ...@@ -20,7 +21,8 @@
// TODO: I think it would be better to pass small json configuration file to // TODO: I think it would be better to pass small json configuration file to
// the test, instead of this ever-expanding list of function arguments. // the test, instead of this ever-expanding list of function arguments.
// FIXME: MC does not trace back into particle history. Need to fix that // FIXME: MC does not trace back into particle history. Need to fix that
int vm_mass(const std::string& config_name) { int vm_mass(const std::string& config_name)
{
// read our configuration // read our configuration
std::ifstream config_file{config_name}; std::ifstream config_file{config_name};
nlohmann::json config; nlohmann::json config;
...@@ -33,8 +35,7 @@ int vm_mass(const std::string& config_name) { ...@@ -33,8 +35,7 @@ int vm_mass(const std::string& config_name) {
std::string output_prefix = config["output_prefix"]; std::string output_prefix = config["output_prefix"];
const std::string test_tag = config["test_tag"]; const std::string test_tag = config["test_tag"];
fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green), fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green), "Running VM invariant mass analysis...\n");
"Running VM invariant mass analysis...\n");
fmt::print(" - Vector meson: {}\n", vm_name); fmt::print(" - Vector meson: {}\n", vm_name);
fmt::print(" - Decay particle: {}\n", decay_name); fmt::print(" - Decay particle: {}\n", decay_name);
fmt::print(" - Detector package: {}\n", detector); fmt::print(" - Detector package: {}\n", detector);
...@@ -43,10 +44,8 @@ int vm_mass(const std::string& config_name) { ...@@ -43,10 +44,8 @@ int vm_mass(const std::string& config_name) {
// create our test definition // create our test definition
// test_tag // test_tag
eic::util::Test vm_mass_resolution_test{ eic::util::Test vm_mass_resolution_test{
{{"name", {{"name", fmt::format("{}_{}_{}_mass_resolution", test_tag, vm_name, decay_name)},
fmt::format("{}_{}_{}_mass_resolution", test_tag, vm_name, decay_name)}, {"title", fmt::format("{} -> {} Invariant Mass Resolution", vm_name, decay_name)},
{"title",
fmt::format("{} -> {} Invariant Mass Resolution", vm_name, decay_name)},
{"description", "Invariant Mass Resolution calculated from raw " {"description", "Invariant Mass Resolution calculated from raw "
"tracking data using a Gaussian fit."}, "tracking data using a Gaussian fit."},
{"quantity", "resolution"}, {"quantity", "resolution"},
...@@ -60,8 +59,7 @@ int vm_mass(const std::string& config_name) { ...@@ -60,8 +59,7 @@ int vm_mass(const std::string& config_name) {
const double decay_mass = util::get_pdg_mass(decay_name); const double decay_mass = util::get_pdg_mass(decay_name);
// Ensure our output prefix always ends on a dot, a slash or a dash // Ensure our output prefix always ends on a dot, a slash or a dash
if (output_prefix.back() != '.' && output_prefix.back() != '/' && if (output_prefix.back() != '.' && output_prefix.back() != '/' && output_prefix.back() != '-') {
output_prefix.back() != '-') {
output_prefix += "-"; output_prefix += "-";
} }
...@@ -70,20 +68,16 @@ int vm_mass(const std::string& config_name) { ...@@ -70,20 +68,16 @@ int vm_mass(const std::string& config_name) {
// utility lambda functions to bind the vector meson and decay particle // utility lambda functions to bind the vector meson and decay particle
// types // types
auto momenta_from_tracking = auto momenta_from_tracking = [decay_mass](const std::vector<eic::TrackParametersData>& tracks) {
[decay_mass](const std::vector<eic::TrackParametersData>& tracks) {
return util::momenta_from_tracking(tracks, decay_mass); return util::momenta_from_tracking(tracks, decay_mass);
}; };
auto find_decay_pair = auto find_decay_pair = [vm_mass](const std::vector<ROOT::Math::PxPyPzMVector>& parts) {
[vm_mass](const std::vector<ROOT::Math::PxPyPzMVector>& parts) {
return util::find_decay_pair(parts, vm_mass); return util::find_decay_pair(parts, vm_mass);
}; };
// util::PrintGeant4(mcparticles2); // util::PrintGeant4(mcparticles2);
// Define analysis flow // Define analysis flow
auto d_im = auto d_im = d.Define("p_rec", momenta_from_tracking, {"outputTrackParameters"})
d.Define("p_rec", momenta_from_tracking, {"outputTrackParameters"})
.Define("N", "p_rec.size()") .Define("N", "p_rec.size()")
.Define("p_sim", util::momenta_from_simulation, {"mcparticles2"}) .Define("p_sim", util::momenta_from_simulation, {"mcparticles2"})
.Define("decay_pair_rec", find_decay_pair, {"p_rec"}) .Define("decay_pair_rec", find_decay_pair, {"p_rec"})
...@@ -97,29 +91,18 @@ int vm_mass(const std::string& config_name) { ...@@ -97,29 +91,18 @@ int vm_mass(const std::string& config_name) {
.Define("rapidity_rec", util::get_y, {"decay_pair_rec"}) .Define("rapidity_rec", util::get_y, {"decay_pair_rec"})
.Define("rapidity_sim", util::get_y, {"decay_pair_sim"}); .Define("rapidity_sim", util::get_y, {"decay_pair_sim"});
// Define output histograms // Define output histograms
auto h_im_rec = d_im.Histo1D( auto h_im_rec = d_im.Histo1D({"h_im_rec", ";m_{ll'} (GeV/c^{2});#", 100, -1.1, vm_mass + 5}, "mass_rec");
{"h_im_rec", ";m_{ll'} (GeV/c^{2});#", 100, -1.1, vm_mass + 5}, "mass_rec"); auto h_im_sim = d_im.Histo1D({"h_im_sim", ";m_{ll'} (GeV/c^{2});#", 100, -1.1, vm_mass + 5}, "mass_sim");
auto h_im_sim = d_im.Histo1D(
{"h_im_sim", ";m_{ll'} (GeV/c^{2});#", 100, -1.1, vm_mass + 5}, "mass_sim");
auto h_pt_rec = d_im.Histo1D( auto h_pt_rec = d_im.Histo1D({"h_pt_rec", ";p_{T} (GeV/c);#", 400, 0., 40.}, "pt_rec");
{"h_pt_rec", ";p_{T} (GeV/c);#", 400, 0., 40.}, "pt_rec"); auto h_pt_sim = d_im.Histo1D({"h_pt_sim", ";p_{T} (GeV/c);#", 400, 0., 40.}, "pt_sim");
auto h_pt_sim = d_im.Histo1D(
{"h_pt_sim", ";p_{T} (GeV/c);#", 400, 0., 40.}, "pt_sim");
auto h_phi_rec = d_im.Histo1D(
{"h_phi_rec", ";#phi_{ll'};#", 90, -M_PI, M_PI}, "phi_rec");
auto h_phi_sim = d_im.Histo1D(
{"h_phi_sim", ";#phi_{ll'};#", 90, -M_PI, M_PI}, "phi_sim");
auto h_y_rec = d_im.Histo1D(
{"h_y_rec", ";y_{ll'};#", 1000, -5., 5.}, "rapidity_rec");
auto h_y_sim = d_im.Histo1D(
{"h_y_sim", ";y_{ll'};#", 1000, -5., 5.}, "rapidity_sim");
auto h_phi_rec = d_im.Histo1D({"h_phi_rec", ";#phi_{ll'};#", 90, -M_PI, M_PI}, "phi_rec");
auto h_phi_sim = d_im.Histo1D({"h_phi_sim", ";#phi_{ll'};#", 90, -M_PI, M_PI}, "phi_sim");
auto h_y_rec = d_im.Histo1D({"h_y_rec", ";y_{ll'};#", 1000, -5., 5.}, "rapidity_rec");
auto h_y_sim = d_im.Histo1D({"h_y_sim", ";y_{ll'};#", 1000, -5., 5.}, "rapidity_sim");
// Plot our histograms. // Plot our histograms.
// TODO: to start I'm explicitly plotting the histograms, but want to // TODO: to start I'm explicitly plotting the histograms, but want to
...@@ -248,7 +231,6 @@ int vm_mass(const std::string& config_name) { ...@@ -248,7 +231,6 @@ int vm_mass(const std::string& config_name) {
t4->Draw(); t4->Draw();
c.Print(fmt::format("{}vm_mass_pt_phi_rapidity.png", output_prefix).c_str()); c.Print(fmt::format("{}vm_mass_pt_phi_rapidity.png", output_prefix).c_str());
} }
// TODO we're not actually doing an IM fit yet, so for now just return an // TODO we're not actually doing an IM fit yet, so for now just return an
...@@ -256,8 +238,7 @@ int vm_mass(const std::string& config_name) { ...@@ -256,8 +238,7 @@ int vm_mass(const std::string& config_name) {
vm_mass_resolution_test.error(-1); vm_mass_resolution_test.error(-1);
// write out our test data // write out our test data
eic::util::write_test(vm_mass_resolution_test, eic::util::write_test(vm_mass_resolution_test, fmt::format("{}vm_mass.json", output_prefix));
fmt::format("{}vm_mass.json", output_prefix));
// That's all! // That's all!
return 0; return 0;
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment