Skip to content
Snippets Groups Projects
Commit 25b5c216 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

Additional far forward benchmarks

parent fb63cd9f
Branches
No related tags found
1 merge request!185Additional far forward benchmarks
......@@ -71,7 +71,7 @@ include:
# - local: 'benchmarks/rich/config.yml'
- local: 'benchmarks/imaging_ecal/config.yml'
- local: 'benchmarks/imaging_shower_ML/config.yml'
- local: 'benchmarks/B0/config.yml'
- local: 'benchmarks/far_forward/config.yml'
final_report:
stage: finish
......
......@@ -3,4 +3,4 @@ B0_far_forward_protons:
stage: run
timeout: 24 hours
script:
- bash benchmarks/B0/far_forward_protons.sh
- bash benchmarks/far_forward/far_forward_protons.sh
......@@ -70,7 +70,7 @@ if [[ -z "${REC_ONLY}" && -z "${ANALYSIS_ONLY}" ]] ;
then
## generate the input events
root -b -q "benchmarks/B0/scripts/gen_far_forward_protons.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
root -b -q "benchmarks/far_forward/scripts/gen_far_forward_protons.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
......@@ -96,22 +96,25 @@ rootls -t ${JUGGLER_SIM_FILE}
if [[ -z "${ANALYSIS_ONLY}" ]] ;
then
# Need to figure out how to pass file name to juggler from the commandline
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/B0/options/B0_tracker_reconstruction.py
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/far_forward/options/far_forward_reconstruction.py
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler"
exit 1
fi
fi
mkdir -p results/B0
mkdir -p results/far_forward
mkdir -p results/far_forward/B0
mkdir -p results/far_forward/RomanPot
mkdir -p results/far_forward/OffMTracker
root -b -q "benchmarks/B0/scripts/rec_far_forward_protons.cxx(\"${JUGGLER_REC_FILE}\")"
root -b -q "benchmarks/far_forward/scripts/rec_far_forward_protons.cxx(\"${JUGGLER_REC_FILE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script"
exit 1
fi
root -b -q "benchmarks/B0/scripts/hits_far_forward_protons.cxx(\"${JUGGLER_SIM_FILE}\")"
root -b -q "benchmarks/far_forward/scripts/hits_far_forward_protons.cxx(\"${JUGGLER_SIM_FILE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running root script"
exit 1
......
......@@ -28,39 +28,77 @@ from Configurables import Jug__Reco__TrackFindingAlgorithm as TrackFindingAlgori
from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit
from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier
from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction
sim_colls = [
"mcparticles",
"B0TrackerHits"
"B0TrackerHits",
"ForwardRomanPotHits",
"ForwardOffMTrackerHits"
]
# list of algorithms
algorithms = []
# input
podin = PodioInput("PodioReader", collections=sim_colls)
podout = PodioOutput("out", filename=output_rec)
algorithms.append(podin)
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
mccopier = MCCopier("MCCopier",
inputCollection="mcparticles",
outputCollection="mcparticles2")
algorithms.append(mccopier)
## Roman pots
ffi_romanpot_digi = TrackerDigi("ffi_romanpot_digi",
inputHitCollection = "ForwardRomanPotHits",
outputHitCollection = "ForwardRomanPotRawHits",
timeResolution = 8)
algorithms.append(ffi_romanpot_digi)
ffi_romanpot_reco = TrackerHitReconstruction("ffi_romanpot_reco",
inputHitCollection = ffi_romanpot_digi.outputHitCollection,
outputHitCollection = "ForwardRomanPotRecHits")
algorithms.append(ffi_romanpot_reco)
## Off momentum tracker
ffi_offmtracker_digi = TrackerDigi("ffi_offmtracker_digi",
inputHitCollection = "ForwardOffMTrackerHits",
outputHitCollection = "ForwardOffMTrackerRawHits",
timeResolution = 8)
algorithms.append(ffi_offmtracker_digi)
ffi_offmtracker_reco = TrackerHitReconstruction("ffi_offmtracker_reco",
inputHitCollection = ffi_offmtracker_digi.outputHitCollection,
outputHitCollection = "ForwardOffMTrackerRedHits")
algorithms.append(ffi_offmtracker_reco)
## B0 tracker
trk_b0_digi = TrackerDigi("trk_b0_digi",
inputHitCollection="B0TrackerHits",
outputHitCollection="B0TrackerRawHits",
timeResolution=8)
algorithms.append(trk_b0_digi)
trk_b0_reco = TrackerReco("trk_b_reco",
inputHitCollection = trk_b0_digi.outputHitCollection,
outputHitCollection="B0TrackerRecHits")
algorithms.append(trk_b0_reco)
sourcelinker = TrackerSourcesLinker("trk_srcslnkr",
inputHitCollections=["B0TrackerRecHits"],
inputHitCollections=[trk_b0_reco.outputHitCollection],
outputSourceLinks="B0TrackerSourceLinks",
outputMeasurements="B0TrackerMeasurements",
OutputLevel=INFO)
algorithms.append(sourcelinker)
## Track param init
truth_trk_init = TrackParamTruthInit("truth_trk_init",
inputMCParticles="mcparticles",
outputInitialTrackParameters="InitTrackParams",
OutputLevel=INFO)
algorithms.append(truth_trk_init)
# Tracking algorithms
trk_find_alg = TrackFindingAlgorithm("trk_find_alg",
......@@ -69,13 +107,17 @@ trk_find_alg = TrackFindingAlgorithm("trk_find_alg",
inputInitialTrackParameters= truth_trk_init.outputInitialTrackParameters,
outputTrajectories="trajectories",
OutputLevel=INFO)
algorithms.append(trk_find_alg)
parts_from_fit = ParticlesFromTrackFit("parts_from_fit",
inputTrajectories=trk_find_alg.outputTrajectories,
outputParticles="ReconstructedParticles",
outputTrackParameters="outputTrackParameters",
OutputLevel=INFO)
algorithms.append(parts_from_fit)
# output
podout = PodioOutput("out", filename=output_rec)
podout.outputCommands = [
"keep *",
"drop InitTrackParams",
......@@ -84,19 +126,12 @@ podout.outputCommands = [
"drop outputInitialTrackParameters",
"drop mcparticles",
]
algorithms.append(podout)
ApplicationMgr(
TopAlg = [podin, mccopier,
trk_b0_digi,
trk_b0_reco,
sourcelinker,
truth_trk_init,
trk_find_alg,
parts_from_fit,
podout
],
TopAlg = algorithms,
EvtSel = 'NONE',
EvtMax = n_events,
EvtMax = n_events,
ExtSvc = [podioevent, geo_service],
OutputLevel=WARNING
)
......
......@@ -139,8 +139,8 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root")
//hs->Add(h1);
hs->Draw("nostack, hist");
c->BuildLegend();
c->SaveAs("results/B0/hits_far_forward_protons_n_hits_vs_theta.png");
c->SaveAs("results/B0/hits_far_forward_protons_n_hits_vs_theta.pdf");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_n_hits_vs_theta.png");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_n_hits_vs_theta.pdf");
c = new TCanvas();
hs = new THStack("theta","; #theta ");
......@@ -161,8 +161,8 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root")
//hs->Add(h1);
hs->Draw("nostack hist");
c->BuildLegend();
c->SaveAs("results/B0/hits_far_forward_protons_theta.png");
c->SaveAs("results/B0/hits_far_forward_protons_theta.pdf");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_theta.png");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_theta.pdf");
c = new TCanvas();
hs = new THStack("hits","; hits ");
......@@ -179,12 +179,12 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.root")
//hs->Add(h1);
//hs->Draw("nostack hist");
c->BuildLegend();
c->SaveAs("results/B0/hits_far_forward_protons_nhits.png");
c->SaveAs("results/B0/hits_far_forward_protons_nhits.pdf");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_nhits.png");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_nhits.pdf");
c = new TCanvas();
hBarrel_x_vs_y->DrawCopy("colz");
c->SaveAs("results/B0/hits_far_forward_protons_xy.png");
c->SaveAs("results/B0/hits_far_forward_protons_xy.pdf");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_xy.png");
c->SaveAs("results/far_forward/B0/hits_far_forward_protons_xy.pdf");
return 0;
}
......@@ -130,12 +130,12 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
auto c = new TCanvas();
h_nTracks->DrawCopy();
c->SaveAs("results/B0/rec_far_forward_protons_nTracks.png");
c->SaveAs("results/B0/rec_far_forward_protons_nTracks.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_nTracks.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_nTracks.pdf");
h_pTracks->DrawCopy();
c->SaveAs("results/B0/rec_far_forward_protons_pTracks.png");
c->SaveAs("results/B0/rec_far_forward_protons_pTracks.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_pTracks.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_pTracks.pdf");
c = new TCanvas();
THStack * hs = new THStack("hs_delta_p","; GeV/c ");
......@@ -151,8 +151,8 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
//hs->Add(h1);
hs->Draw("nostack");
c->BuildLegend();
c->SaveAs("results/B0/rec_far_forward_protons_delta_p.png");
c->SaveAs("results/B0/rec_far_forward_protons_delta_p.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_delta_p.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_delta_p.pdf");
c = new TCanvas();
hs = new THStack("hs_delta_p_over_p","; delta p/p ");
......@@ -168,8 +168,8 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
//hs->Add(h1);
hs->Draw("nostack");
c->BuildLegend();
c->SaveAs("results/B0/rec_far_forward_protons_delta_p_over_p.png");
c->SaveAs("results/B0/rec_far_forward_protons_delta_p_over_p.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_delta_p_over_p.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_delta_p_over_p.pdf");
c = new TCanvas();
hs = new THStack("n_hits","; #theta ");
......@@ -189,8 +189,8 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
//hs->Add(h1);
hs->Draw("nostack, hist");
c->BuildLegend();
c->SaveAs("results/B0/rec_far_forward_protons_n_hits_vs_theta.png");
c->SaveAs("results/B0/rec_far_forward_protons_n_hits_vs_theta.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_n_hits_vs_theta.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_n_hits_vs_theta.pdf");
c = new TCanvas();
hs = new THStack("theta","; #theta ");
......@@ -211,8 +211,8 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
//hs->Add(h1);
hs->Draw("nostack hist");
c->BuildLegend();
c->SaveAs("results/B0/rec_far_forward_protons_theta.png");
c->SaveAs("results/B0/rec_far_forward_protons_theta.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_theta.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_theta.pdf");
c = new TCanvas();
hs = new THStack("hits","; hits ");
......@@ -229,8 +229,8 @@ int rec_far_forward_protons(const char* fname = "topside/rec_far_forward_protons
//hs->Add(h1);
//hs->Draw("nostack hist");
c->BuildLegend();
c->SaveAs("results/B0/rec_far_forward_protons_nhits.png");
c->SaveAs("results/B0/rec_far_forward_protons_nhits.pdf");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_nhits.png");
c->SaveAs("results/far_forward/B0/rec_far_forward_protons_nhits.pdf");
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment