Skip to content
Snippets Groups Projects
Commit 512f5cd7 authored by Ziyue Zhang's avatar Ziyue Zhang
Browse files

Merge branch 'master' of eicweb.phy.anl.gov:EIC/benchmarks/physics_benchmarks...

Merge branch 'master' of eicweb.phy.anl.gov:EIC/benchmarks/physics_benchmarks into ziyue_work_branch

Restart from scratch
parents e4c9f1ae 8f16597b
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !27. Comments created here will be created in the context of that merge request.
...@@ -61,7 +61,7 @@ echo "Generator output for $GEN_TAG not found in cache, need to run generator" ...@@ -61,7 +61,7 @@ echo "Generator output for $GEN_TAG not found in cache, need to run generator"
## TODO: need to configurability to the generator exe ## TODO: need to configurability to the generator exe
echo "Compiling benchmarks/dis/generator/pythia_dis.cxx ..." echo "Compiling benchmarks/dis/generator/pythia_dis.cxx ..."
g++ benchmarks/dis/generator/pythia_dis.cxx -o pythia_dis \ g++ benchmarks/dis/generator/pythia_dis.cxx -o ${TMP_PATH}/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 \
...@@ -75,7 +75,7 @@ echo "done" ...@@ -75,7 +75,7 @@ echo "done"
## ============================================================================= ## =============================================================================
## Step 4: Run the event generator ## Step 4: Run the event generator
echo "Running the generator" echo "Running the generator"
./pythia_dis ${TMP_PATH}/${GEN_TAG}.hepmc ${TMP_PATH}/pythia_dis ${TMP_PATH}/${GEN_TAG}.hepmc
if [[ "$?" -ne "0" ]] ; then if [[ "$?" -ne "0" ]] ; then
echo "ERROR running pythia" echo "ERROR running pythia"
exit 1 exit 1
......
...@@ -12,6 +12,8 @@ using json = nlohmann::json; ...@@ -12,6 +12,8 @@ using json = nlohmann::json;
#include "eicd/TrackParametersCollection.h" #include "eicd/TrackParametersCollection.h"
#include "eicd/ClusterCollection.h" #include "eicd/ClusterCollection.h"
#include "eicd/ClusterData.h" #include "eicd/ClusterData.h"
#include "eicd/ReconstructedParticleCollection.h"
#include "eicd/ReconstructedParticleData.h"
using ROOT::RDataFrame; using ROOT::RDataFrame;
using namespace ROOT::VecOps; using namespace ROOT::VecOps;
...@@ -56,6 +58,15 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) { ...@@ -56,6 +58,15 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) {
} }
return result; return result;
}; };
auto dumfourvec = [](ROOT::VecOps::RVec<eic::ReconstructedParticleData> const& in) {
std::vector<ROOT::Math::PxPyPzMVector> result;
ROOT::Math::PxPyPzMVector lv;
for (size_t i = 0; i < in.size(); ++i) {
lv.SetCoordinates(in[i].p.x, in[i].p.y, in[i].p.z, in[i].mass);
result.push_back(lv);
}
return result;
};
auto delta_p = [](const std::vector<double>& tracks, const std::vector<double>& thrown) { auto delta_p = [](const std::vector<double>& tracks, const std::vector<double>& thrown) {
std::vector<double> res; std::vector<double> res;
...@@ -95,6 +106,8 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ ...@@ -95,6 +106,8 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){
auto df0 = df.Define("isThrown", "mcparticles2.genStatus == 1") auto df0 = df.Define("isThrown", "mcparticles2.genStatus == 1")
.Define("thrownParticles", "mcparticles2[isThrown]") .Define("thrownParticles", "mcparticles2[isThrown]")
.Define("thrownP", fourvec, {"thrownParticles"}) .Define("thrownP", fourvec, {"thrownParticles"})
.Define("dumRec", dumfourvec, {"DummyReconstructedParticles"})
.Define("dumNPart", "dumRec.size()")
.Define("p_thrown", momentum, {"thrownP"}) .Define("p_thrown", momentum, {"thrownP"})
.Define("nTracks", "outputTrackParameters.size()") .Define("nTracks", "outputTrackParameters.size()")
.Define("p_track", p_track, {"outputTrackParameters"}) .Define("p_track", p_track, {"outputTrackParameters"})
...@@ -107,6 +120,7 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ ...@@ -107,6 +120,7 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){
.Define("q", q_vec, {"eprime"}) .Define("q", q_vec, {"eprime"})
.Define("Q2", "-1.0*(q.Dot(q))"); .Define("Q2", "-1.0*(q.Dot(q))");
auto h_n_dummy = df0.Histo1D({"h_n_dummy", "; h_n_dummy n", 10, 0, 10}, "dumNPart");
auto h_Q2 = df0.Histo1D({"h_Q2", "; Q^{2} [GeV^{2}/c^{2}]", 100, 0, 30}, "Q2"); auto h_Q2 = df0.Histo1D({"h_Q2", "; Q^{2} [GeV^{2}/c^{2}]", 100, 0, 30}, "Q2");
auto n_Q2 = df0.Filter("Q2>1").Count(); auto n_Q2 = df0.Filter("Q2>1").Count();
...@@ -116,6 +130,12 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ ...@@ -116,6 +130,12 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){
c->SaveAs("results/dvcs/Q2.pdf"); c->SaveAs("results/dvcs/Q2.pdf");
fmt::print("{} DVCS events\n",*n_Q2); fmt::print("{} DVCS events\n",*n_Q2);
c = new TCanvas();
h_n_dummy->DrawCopy();
c->SaveAs("results/dvcs/n_dummy.png");
//c->SaveAs("results/dvcs/n_dummy.pdf");
// write output results to json file // write output results to json file
json j; json j;
j["Q2 cut"]["pass"] = *n_Q2; j["Q2 cut"]["pass"] = *n_Q2;
......
...@@ -30,6 +30,8 @@ from Configurables import Jug__Digi__ExampleCaloDigi as ExampleCaloDigi ...@@ -30,6 +30,8 @@ from Configurables import Jug__Digi__ExampleCaloDigi as ExampleCaloDigi
from Configurables import Jug__Digi__UFSDTrackerDigi as UFSDTrackerDigi from Configurables import Jug__Digi__UFSDTrackerDigi as UFSDTrackerDigi
from Configurables import Jug__Digi__EMCalorimeterDigi as EMCalorimeterDigi from Configurables import Jug__Digi__EMCalorimeterDigi as EMCalorimeterDigi
from Configurables import Jug__Base__MC2DummyParticle as MC2DummyParticle
from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction
from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker
...@@ -52,6 +54,10 @@ podioinput = PodioInput("PodioReader", ...@@ -52,6 +54,10 @@ podioinput = PodioInput("PodioReader",
collections=["mcparticles","SiTrackerEndcapHits","SiTrackerBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG) collections=["mcparticles","SiTrackerEndcapHits","SiTrackerBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG)
#"SiVertexBarrelHits", #"SiVertexBarrelHits",
dummy = MC2DummyParticle("MC2Dummy",
inputCollection="mcparticles",
outputCollection="DummyReconstructedParticles")
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection. ## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
copier = MCCopier("MCCopier", copier = MCCopier("MCCopier",
inputCollection="mcparticles", inputCollection="mcparticles",
...@@ -205,6 +211,7 @@ out.outputCommands = ["keep *", ...@@ -205,6 +211,7 @@ out.outputCommands = ["keep *",
ApplicationMgr( ApplicationMgr(
TopAlg = [podioinput, TopAlg = [podioinput,
dummy,
copier, trkcopier, copier, trkcopier,
ecal_digi, ufsd_digi2,ufsd_digi, #vtx_digi, ecal_digi, ufsd_digi2,ufsd_digi, #vtx_digi,
ecal_reco, ecal_reco,
......
...@@ -62,8 +62,7 @@ case ${OS} in ...@@ -62,8 +62,7 @@ case ${OS} in
if [ ! -f $PREFIX/juggler_latest.sif ] || [ ! -z ${FORCE_UPDATE} ]; then if [ ! -f $PREFIX/juggler_latest.sif ] || [ ! -z ${FORCE_UPDATE} ]; then
echo " - Fetching singularity image" echo " - Fetching singularity image"
mkdir -p $PREFIX mkdir -p $PREFIX
wget https://eicweb.phy.anl.gov/eic/juggler/-/jobs/artifacts/master/raw/build/juggler.sif?job=docker:singularity wget https://eicweb.phy.anl.gov/eic/juggler/-/jobs/artifacts/master/raw/build/juggler.sif?job=singularity:latest -O $PREFIX/juggler_latest.sif
-O $PREFIX/juggler_latest.sif
fi fi
echo " - Using singularity to launch shell..." echo " - Using singularity to launch shell..."
singularity exec $PREFIX/juggler_latest.sif eic-shell singularity exec $PREFIX/juggler_latest.sif eic-shell
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment