diff --git a/benchmarks/dis/gen.sh b/benchmarks/dis/gen.sh index 4a42081ae6f437d542de677613eef22f4c6c9516..173fd4ed7ac890c78c19b40b6f54f88c72ec6608 100755 --- a/benchmarks/dis/gen.sh +++ b/benchmarks/dis/gen.sh @@ -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 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 \ -O2 -std=c++11 -pedantic -W -Wall -Wshadow -fPIC \ -L/usr/local/lib -Wl,-rpath,/usr/local/lib -lpythia8 -ldl \ @@ -75,7 +75,7 @@ echo "done" ## ============================================================================= ## Step 4: Run the event 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 echo "ERROR running pythia" exit 1 diff --git a/benchmarks/dvcs/scripts/dvcs_tests.cxx b/benchmarks/dvcs/scripts/dvcs_tests.cxx index 4f37494c040927f282f28193f45b5862c88f601c..70ccaa4ac4d5b828d30f856105ea834811add81d 100644 --- a/benchmarks/dvcs/scripts/dvcs_tests.cxx +++ b/benchmarks/dvcs/scripts/dvcs_tests.cxx @@ -12,6 +12,8 @@ using json = nlohmann::json; #include "eicd/TrackParametersCollection.h" #include "eicd/ClusterCollection.h" #include "eicd/ClusterData.h" +#include "eicd/ReconstructedParticleCollection.h" +#include "eicd/ReconstructedParticleData.h" using ROOT::RDataFrame; using namespace ROOT::VecOps; @@ -56,6 +58,15 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) { } 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) { std::vector<double> res; @@ -95,6 +106,8 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ auto df0 = df.Define("isThrown", "mcparticles2.genStatus == 1") .Define("thrownParticles", "mcparticles2[isThrown]") .Define("thrownP", fourvec, {"thrownParticles"}) + .Define("dumRec", dumfourvec, {"DummyReconstructedParticles"}) + .Define("dumNPart", "dumRec.size()") .Define("p_thrown", momentum, {"thrownP"}) .Define("nTracks", "outputTrackParameters.size()") .Define("p_track", p_track, {"outputTrackParameters"}) @@ -107,6 +120,7 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ .Define("q", q_vec, {"eprime"}) .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 n_Q2 = df0.Filter("Q2>1").Count(); @@ -116,6 +130,12 @@ void dvcs_tests(const char* fname = "rec_dvcs.root"){ c->SaveAs("results/dvcs/Q2.pdf"); 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 json j; j["Q2 cut"]["pass"] = *n_Q2; diff --git a/options/tracker_reconstruction.py b/options/tracker_reconstruction.py index 6e05eb4c56bd3323002ea0472204e7e50e430637..3101824c52cada8cfe524da2dfb8e9c3b027af99 100644 --- a/options/tracker_reconstruction.py +++ b/options/tracker_reconstruction.py @@ -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__EMCalorimeterDigi as EMCalorimeterDigi +from Configurables import Jug__Base__MC2DummyParticle as MC2DummyParticle + from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker @@ -52,6 +54,10 @@ podioinput = PodioInput("PodioReader", collections=["mcparticles","SiTrackerEndcapHits","SiTrackerBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG) #"SiVertexBarrelHits", +dummy = MC2DummyParticle("MC2Dummy", + inputCollection="mcparticles", + outputCollection="DummyReconstructedParticles") + ## copiers to get around input --> output copy bug. Note the "2" appended to the output collection. copier = MCCopier("MCCopier", inputCollection="mcparticles", @@ -205,6 +211,7 @@ out.outputCommands = ["keep *", ApplicationMgr( TopAlg = [podioinput, + dummy, copier, trkcopier, ecal_digi, ufsd_digi2,ufsd_digi, #vtx_digi, ecal_reco, diff --git a/tools/dev-shell b/tools/dev-shell index d452525c4fce25ea3bb207a38cdc3b5e22ae9b14..0295f14bd010fb6539d0dc966c7a984bad1fc608 100755 --- a/tools/dev-shell +++ b/tools/dev-shell @@ -62,8 +62,7 @@ case ${OS} in if [ ! -f $PREFIX/juggler_latest.sif ] || [ ! -z ${FORCE_UPDATE} ]; then echo " - Fetching singularity image" mkdir -p $PREFIX - wget https://eicweb.phy.anl.gov/eic/juggler/-/jobs/artifacts/master/raw/build/juggler.sif?job=docker:singularity - -O $PREFIX/juggler_latest.sif + wget https://eicweb.phy.anl.gov/eic/juggler/-/jobs/artifacts/master/raw/build/juggler.sif?job=singularity:latest -O $PREFIX/juggler_latest.sif fi echo " - Using singularity to launch shell..." singularity exec $PREFIX/juggler_latest.sif eic-shell