Skip to content
Snippets Groups Projects
Commit a349635a authored by Whitney Armstrong's avatar Whitney Armstrong
Browse files

Adding comparison for conformal finding

	modified:   benchmarks/track_finding/multiple_tracks.sh
	modified:   benchmarks/track_finding/options/track_reconstruction.py
	modified:   benchmarks/track_finding/scripts/gen_multiple_tracks.cxx
	modified:   benchmarks/track_finding/scripts/rec_multiple_tracks.cxx
parent b9fd3c78
No related branches found
No related tags found
No related merge requests found
......@@ -54,33 +54,33 @@ export JUGGLER_REC_FILE="rec_${JUGGLER_FILE_NAME_TAG}.root"
echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
## generate the input events
root -b -q "benchmarks/track_finding/scripts/gen_multiple_tracks.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
fi
echo "Running geant4 simulation"
## run geant4 simulations
npsim --runType batch \
--part.minimalKineticEnergy 1000*GeV \
-v WARNING \
--numberOfEvents ${JUGGLER_N_EVENTS} \
--compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
--inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
--outputFile ${JUGGLER_SIM_FILE}
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
fi
### generate the input events
#root -b -q "benchmarks/track_finding/scripts/gen_multiple_tracks.cxx(${JUGGLER_N_EVENTS}, \"${JUGGLER_FILE_NAME_TAG}.hepmc\")"
#if [[ "$?" -ne "0" ]] ; then
# echo "ERROR running script"
# exit 1
#fi
#
#echo "Running geant4 simulation"
### run geant4 simulations
#npsim --runType batch \
# --part.minimalKineticEnergy 1000*GeV \
# -v WARNING \
# --numberOfEvents ${JUGGLER_N_EVENTS} \
# --compactFile ${DETECTOR_PATH}/${JUGGLER_DETECTOR}.xml \
# --inputFiles ${JUGGLER_FILE_NAME_TAG}.hepmc \
# --outputFile ${JUGGLER_SIM_FILE}
#if [[ "$?" -ne "0" ]] ; then
# echo "ERROR running script"
# exit 1
#fi
rootls -t ${JUGGLER_SIM_FILE}
if [[ -z "${ANALYSIS_ONLY}" ]] ;
then
# Need to figure out how to pass file name to juggler from the commandline
gaudirun.py benchmarks/tracking/options/track_reconstruction.py
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py benchmarks/track_finding/options/track_reconstruction.py
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler"
exit 1
......
......@@ -38,6 +38,7 @@ from Configurables import Jug__Reco__TrackParamTruthInit as TrackParamTruthInit
from Configurables import Jug__Reco__TrackParamClusterInit as TrackParamClusterInit
from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit
from Configurables import Jug__Reco__ConformalXYPeakProtoTracks as ConformalXYPeakProtoTracks
from Configurables import Jug__Reco__TrackFindingAlgorithm as TrackFindingAlgorithm
from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit
from Configurables import Jug__Reco__EMCalReconstruction as EMCalReconstruction
......@@ -48,7 +49,7 @@ from Configurables import Jug__Reco__SimpleClustering as SimpleClustering
algorithms = [ ]
podioinput = PodioInput("PodioReader",
collections=["mcparticles","TrackerEndcapHits","TrackerBarrelHits","VertexBarrelHits","VertexEndcapHits","GEMTrackerEndcapHits"])#, OutputLevel=DEBUG)
collections=["mcparticles","TrackerEndcapHits","TrackerBarrelHits","VertexBarrelHits","VertexEndcapHits","GEMTrackerEndcapHits"])
algorithms.append( podioinput )
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
......@@ -128,6 +129,14 @@ trk_hit_col = TrackingHitsCollector("trk_hit_col",
OutputLevel=DEBUG)
algorithms.append( trk_hit_col )
# Hit Source linker
conformal_find = ConformalXYPeakProtoTracks("conformal_find",
inputTrackerHits=trk_hit_col.trackingHits,
outputProtoTracks="outputProtoTracks",
nProtoTracks="nProtoTracks",
OutputLevel=DEBUG)
algorithms.append( conformal_find )
# Hit Source linker
sourcelinker = TrackerSourceLinker("sourcelinker",
inputHitCollection=trk_hit_col.trackingHits,
......
......@@ -19,7 +19,7 @@ using namespace HepMC3;
*/
void gen_multiple_tracks(int n_events = 100,
const char* out_fname = "multiple_tracks.hepmc",
int n_parts = 2)
int n_parts = 5)
{
double cos_theta_min = std::cos( 10.0*(M_PI/180.0));
double cos_theta_max = std::cos(170.0*(M_PI/180.0));
......
......@@ -87,6 +87,7 @@ int rec_multiple_tracks(const char* fname = "topside/rec_multiple_tracks.root")
auto df0 = df.Define("isThrown", "mcparticles2.genStatus == 1")
.Define("thrownParticles", "mcparticles2[isThrown]")
.Define("thrownP", fourvec, {"thrownParticles"})
.Define("nThrown", "thrownParticles.size()")
.Define("p_thrown", momentum, {"thrownP"})
.Define("theta_thrown", theta, {"thrownP"})
.Define("theta0", "theta_thrown[0]")
......@@ -106,6 +107,9 @@ int rec_multiple_tracks(const char* fname = "topside/rec_multiple_tracks.root")
auto h_delta_p0 = df0.Histo1D({"h_delta_p0", "Truth Track Init; GeV/c ", 100, -10, 10}, "delta_p0");
auto h_nProtoTracks = df0.Histo1D({"h_nProtoTracks", "; n ", 10, 0, 10}, "nProtoTracks");
auto h_nThrown = df0.Histo1D({"h_nThrown", "; n ", 10, 0, 10}, "nThrown");
auto h_delta_p0_over_p = df0.Histo1D({"h_delta_p0_over_p", "Truth Track Init; delta p/p ", 100, -0.1, 0.1}, "delta_p_over_p0");
auto hNhits_vs_theta = df0.Histo1D({"hNhits_vs_theta", "; #theta [deg.]", 40, 0, 180 }, "theta0", "N_Hits");
......@@ -123,6 +127,12 @@ int rec_multiple_tracks(const char* fname = "topside/rec_multiple_tracks.root")
// -----------------------------------------------
auto c = new TCanvas();
h_nThrown->SetLineColor(2);
h_nThrown->DrawCopy();
h_nProtoTracks->DrawCopy("same");
c->SaveAs("results/track_finding/rec_multiple_tracks_nProtoTracks.png");
c->SaveAs("results/track_finding/rec_multiple_tracks_nProtoTracks.pdf");
h_nTracks->DrawCopy();
c->SaveAs("results/track_finding/rec_multiple_tracks_nTracks.png");
c->SaveAs("results/track_finding/rec_multiple_tracks_nTracks.pdf");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment