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

Added analysis script to the tracking job

	modified:   central_electrons.sh
	modified:   options/tracker_reconstruction.py
	modified:   scripts/rec_central_electrons.cxx
parent b589590f
No related branches found
No related tags found
1 merge request!28Added analysis script to the tracking job
...@@ -47,6 +47,11 @@ npsim --runType batch \ ...@@ -47,6 +47,11 @@ npsim --runType batch \
--compactFile ${JUGGLER_DETECTOR}.xml \ --compactFile ${JUGGLER_DETECTOR}.xml \
--inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \ --inputFiles ../${JUGGLER_FILE_NAME_TAG}.hepmc \
--outputFile ${JUGGLER_SIM_FILE} --outputFile ${JUGGLER_SIM_FILE}
if [[ "$?" -ne "0" ]] ; then
echo "ERROR running script"
exit 1
fi
# Need to figure out how to pass file name to juggler from the commandline # 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 xenv -x ${JUGGLER_INSTALL_PREFIX}/Juggler.xenv gaudirun.py ../tracking/options/tracker_reconstruction.py
...@@ -59,6 +64,11 @@ ls -l ...@@ -59,6 +64,11 @@ ls -l
popd popd
pwd pwd
mkdir -p results mkdir -p results/tracking
cp topside/${JUGGLER_REC_FILE} results/.
root -b -q "tracking/scripts/rec_central_electrons.cxx(\"${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE}\")"
if [[ "${JUGGLER_N_EVENTS}" -lt "500" ]] ; then
cp ${JUGGLER_DETECTOR}/${JUGGLER_REC_FILE} results/.
fi
...@@ -91,6 +91,12 @@ trk_find_alg = TrackFindingAlgorithm("trk_find_alg", ...@@ -91,6 +91,12 @@ trk_find_alg = TrackFindingAlgorithm("trk_find_alg",
outputTrajectories="trajectories", outputTrajectories="trajectories",
OutputLevel=DEBUG) OutputLevel=DEBUG)
trk_find_alg1 = TrackFindingAlgorithm("trk_find_alg1",
inputSourceLinks="BarrelTrackSourceLinks",
inputInitialTrackParameters= "InitTrackParamsFromClusters",
outputTrajectories="trajectories1",
OutputLevel=DEBUG)
parts_from_fit = ParticlesFromTrackFit("parts_from_fit", parts_from_fit = ParticlesFromTrackFit("parts_from_fit",
inputTrajectories="trajectories", inputTrajectories="trajectories",
outputParticles="ReconstructedParticles", outputParticles="ReconstructedParticles",
...@@ -120,18 +126,21 @@ out.outputCommands = ["keep *", ...@@ -120,18 +126,21 @@ out.outputCommands = ["keep *",
"drop InitTrackParams", "drop InitTrackParams",
"drop trajectories", "drop trajectories",
"drop outputSourceLinks", "drop outputSourceLinks",
"drop outputInitialTrackParameters" "drop outputInitialTrackParameters",
"drop mcparticles"
] ]
ApplicationMgr( ApplicationMgr(
TopAlg = [podioinput, TopAlg = [podioinput,
#copier, trkcopier, copier, trkcopier,
ecal_digi,ecal_reco, ecal_digi,ecal_reco,
simple_cluster, simple_cluster,
ufsd_digi, trackerhit, ufsd_digi, trackerhit,
sourcelinker, sourcelinker,
cluster_init, trackpartruth, cluster_init, trackpartruth,
trk_find_alg, parts_from_fit, trk_find_alg,
#trk_find_alg1,
parts_from_fit,
out out
], ],
EvtSel = 'NONE', EvtSel = 'NONE',
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
#include "eicd/ClusterCollection.h" #include "eicd/ClusterCollection.h"
#include "eicd/ClusterData.h" #include "eicd/ClusterData.h"
using ROOT::RDataFrame;
using namespace ROOT::VecOps;
//namespace edm4hep { //namespace edm4hep {
// //
//std::vector<float> pt (std::vector<MCParticleData> const& in){ //std::vector<float> pt (std::vector<MCParticleData> const& in){
...@@ -54,9 +57,6 @@ std::vector<float> pt (std::vector<dd4pod::Geant4ParticleData> const& in){ ...@@ -54,9 +57,6 @@ std::vector<float> pt (std::vector<dd4pod::Geant4ParticleData> const& in){
return result; return result;
} }
using ROOT::RDataFrame;
using namespace ROOT::VecOps;
auto momentum = [](std::vector<ROOT::Math::PxPyPzMVector> const& in) { auto momentum = [](std::vector<ROOT::Math::PxPyPzMVector> const& in) {
std::vector<double> result; std::vector<double> result;
for (size_t i = 0; i < in.size(); ++i) { for (size_t i = 0; i < in.size(); ++i) {
...@@ -81,8 +81,8 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) { ...@@ -81,8 +81,8 @@ auto fourvec = [](ROOT::VecOps::RVec<dd4pod::Geant4ParticleData> const& in) {
return result; return result;
}; };
int rec_central_electrons(const char* fname = "topside/rec_central_electrons.root")
int rec_central_electrons(const char* fname = "topside/rec_central_electrons.root") { {
ROOT::EnableImplicitMT(); ROOT::EnableImplicitMT();
ROOT::RDataFrame df("events", fname); ROOT::RDataFrame df("events", fname);
...@@ -113,13 +113,16 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo ...@@ -113,13 +113,16 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo
auto c = new TCanvas(); auto c = new TCanvas();
h_nTracks->DrawCopy(); h_nTracks->DrawCopy();
c->SaveAs("results/rec_central_electrons_nTracks.png"); c->SaveAs("results/tracking/rec_central_electrons_nTracks.png");
c->SaveAs("results/tracking/rec_central_electrons_nTracks.pdf");
h_pTracks->DrawCopy(); h_pTracks->DrawCopy();
c->SaveAs("results/rec_central_electrons_pTracks.png"); c->SaveAs("results/tracking/rec_central_electrons_pTracks.png");
c->SaveAs("results/tracking/rec_central_electrons_pTracks.pdf");
h_delta_p->DrawCopy(); h_delta_p->DrawCopy();
c->SaveAs("results/rec_central_electrons_delta_p.png"); c->SaveAs("results/tracking/rec_central_electrons_delta_p.png");
c->SaveAs("results/tracking/rec_central_electrons_delta_p.pdf");
return 0; return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment