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

Added analysis script to the tracking job

- Updated for second track param init
- Not sure if "track param init" is different from "track seeding" but will keep these a separate concepts for now.

- modified:   tracking/central_electrons.sh
- modified:   tracking/options/tracker_reconstruction.py
- modified:   tracking/scripts/rec_central_electrons.cxx
parent cb3417fb
Branches
No related tags found
1 merge request!29Added analysis script to the tracking job
......@@ -22,7 +22,7 @@ echo "JUGGLER_N_EVENTS = ${JUGGLER_N_EVENTS}"
echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}"
## Build the detector constructors.
### Build the detector constructors.
git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git
mkdir ${JUGGLER_DETECTOR}/build
pushd ${JUGGLER_DETECTOR}/build
......@@ -52,7 +52,6 @@ if [[ "$?" -ne "0" ]] ; then
exit 1
fi
# Need to figure out how to pass file name to juggler from the commandline
xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ../tracking/options/tracker_reconstruction.py
......@@ -67,6 +66,10 @@ pwd
mkdir -p results/tracking
root -b -q "tracking/scripts/rec_central_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running juggler"
exit 1
fi
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/.
......
......@@ -100,6 +100,13 @@ trk_find_alg1 = TrackFindingAlgorithm("trk_find_alg1",
parts_from_fit = ParticlesFromTrackFit("parts_from_fit",
inputTrajectories="trajectories",
outputParticles="ReconstructedParticles",
outputTrackParameters="outputTrackParameters",
OutputLevel=DEBUG)
parts_from_fit1 = ParticlesFromTrackFit("parts_from_fit1",
inputTrajectories="trajectories1",
outputParticles="ReconstructedParticles1",
outputTrackParameters="outputTrackParameters1",
OutputLevel=DEBUG)
#types = []
......@@ -139,8 +146,9 @@ ApplicationMgr(
sourcelinker,
cluster_init, trackpartruth,
trk_find_alg,
#trk_find_alg1,
trk_find_alg1,
parts_from_fit,
parts_from_fit1,
out
],
EvtSel = 'NONE',
......
......@@ -93,6 +93,7 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo
.Define("p_thrown", momentum, {"thrownP"})
.Define("nTracks", "outputTrackParameters.size()")
.Define("p_track", p_track, {"outputTrackParameters"})
.Define("p_track1", p_track, {"outputTrackParameters1"})
.Define("delta_p",
[](const std::vector<double>& tracks,
const std::vector<double>& thrown) {
......@@ -104,11 +105,24 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo
}
return res;
},
{"p_track", "p_thrown"});
{"p_track", "p_thrown"})
.Define("delta_p1",
[](const std::vector<double>& tracks,
const std::vector<double>& thrown) {
std::vector<double> res;
for (const auto &p1 : thrown) {
for (const auto &p2 : tracks) {
res.push_back(p1 - p2);
}
}
return res;
},
{"p_track1", "p_thrown"});
auto h_nTracks = df0.Histo1D({"h_nTracks", "; N tracks ", 10, 0, 10}, "nTracks");
auto h_pTracks = df0.Histo1D({"h_pTracks", "; GeV/c ", 100, 0, 10}, "p_track");
auto h_delta_p = df0.Histo1D({"h_delta_p", "; GeV/c ", 100, -10, 10}, "delta_p");
auto h_delta_p1 = df0.Histo1D({"h_delta_p1", "; GeV/c ", 100, -10, 10}, "delta_p1");
auto c = new TCanvas();
......@@ -121,6 +135,8 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo
c->SaveAs("results/tracking/rec_central_electrons_pTracks.pdf");
h_delta_p->DrawCopy();
h_delta_p1->SetLineColor(2);
h_delta_p1->DrawCopy("same");
c->SaveAs("results/tracking/rec_central_electrons_delta_p.png");
c->SaveAs("results/tracking/rec_central_electrons_delta_p.pdf");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment