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

Improve tracking setup

parent 56e69f0e
No related branches found
No related tags found
1 merge request!100Improve tracking setup
...@@ -91,6 +91,7 @@ then ...@@ -91,6 +91,7 @@ then
fi fi
fi fi
rootls -t ${JUGGLER_SIM_FILE}
if [[ -z "${ANALYSIS_ONLY}" ]] ; if [[ -z "${ANALYSIS_ONLY}" ]] ;
then then
......
...@@ -26,7 +26,7 @@ from Configurables import Jug__Base__InputCopier_dd4pod__CalorimeterHitCollectio ...@@ -26,7 +26,7 @@ from Configurables import Jug__Base__InputCopier_dd4pod__CalorimeterHitCollectio
from Configurables import Jug__Base__InputCopier_dd4pod__TrackerHitCollection_dd4pod__TrackerHitCollection_ as TrkCopier from Configurables import Jug__Base__InputCopier_dd4pod__TrackerHitCollection_dd4pod__TrackerHitCollection_ as TrkCopier
from Configurables import Jug__Digi__ExampleCaloDigi as ExampleCaloDigi from Configurables import Jug__Digi__ExampleCaloDigi as ExampleCaloDigi
from Configurables import Jug__Digi__UFSDTrackerDigi as UFSDTrackerDigi from Configurables import Jug__Digi__UFSDTrackerDigi as TrackerDigi
from Configurables import Jug__Digi__EMCalorimeterDigi as EMCalorimeterDigi from Configurables import Jug__Digi__EMCalorimeterDigi as EMCalorimeterDigi
from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction
...@@ -47,7 +47,7 @@ from Configurables import Jug__Reco__SimpleClustering as SimpleClustering ...@@ -47,7 +47,7 @@ from Configurables import Jug__Reco__SimpleClustering as SimpleClustering
podioinput = PodioInput("PodioReader", podioinput = PodioInput("PodioReader",
collections=["mcparticles","TrackerEndcapHits","TrackerBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG)"SiVertexBarrelHits", collections=["mcparticles","TrackerEndcapHits","TrackerBarrelHits","VertexBarrelHits","VertexEndcapHits","EcalBarrelHits"])#, OutputLevel=DEBUG)
## copiers to get around input --> output copy bug. Note the "2" appended to the output collection. ## copiers to get around input --> output copy bug. Note the "2" appended to the output collection.
copier = MCCopier("MCCopier", copier = MCCopier("MCCopier",
...@@ -61,20 +61,24 @@ ecal_digi = EMCalorimeterDigi("ecal_digi", ...@@ -61,20 +61,24 @@ ecal_digi = EMCalorimeterDigi("ecal_digi",
inputHitCollection="EcalBarrelHits", inputHitCollection="EcalBarrelHits",
outputHitCollection="RawEcalBarrelHits") outputHitCollection="RawEcalBarrelHits")
ufsd_digi = UFSDTrackerDigi("ufsd_digi", trk_b_digi = TrackerDigi("trk_b_digi",
inputHitCollection="TrackerBarrelHits", inputHitCollection="TrackerBarrelHits",
outputHitCollection="TrackerBarrelRawHits", outputHitCollection="TrackerBarrelRawHits",
timeResolution=8) timeResolution=8)
ufsd_digi2 = UFSDTrackerDigi("ufsd_digi2", trk_ec_digi = TrackerDigi("trk_ec_digi",
inputHitCollection="TrackerEndcapHits", inputHitCollection="TrackerEndcapHits",
outputHitCollection="TrackerEndcapRawHits", outputHitCollection="TrackerEndcapRawHits",
timeResolution=8) timeResolution=8)
#vtx_digi = UFSDTrackerDigi("vtx_digi", vtx_b_digi = TrackerDigi("vtx_b_digi",
# inputHitCollection="SiVertexBarrelHits", inputHitCollection="VertexBarrelHits",
# outputHitCollection="SiVertexBarrelRawHits", outputHitCollection="VertexBarrelRawHits",
# timeResolution=8) timeResolution=8)
vtx_ec_digi = TrackerDigi("vtx_ec_digi",
inputHitCollection="VertexEndcapHits",
outputHitCollection="VertexEndcapRawHits",
timeResolution=8)
ecal_reco = EMCalReconstruction("ecal_reco", ecal_reco = EMCalReconstruction("ecal_reco",
inputHitCollection="RawEcalBarrelHits", inputHitCollection="RawEcalBarrelHits",
...@@ -90,30 +94,34 @@ simple_cluster = SimpleClustering("simple_cluster", ...@@ -90,30 +94,34 @@ simple_cluster = SimpleClustering("simple_cluster",
OutputLevel=WARNING) OutputLevel=WARNING)
# Tracker and vertex reconstruction # Tracker and vertex reconstruction
trk_barrel_reco = TrackerHitReconstruction("trk_barrel_reco", trk_b_reco = TrackerHitReconstruction("trk_b_reco",
inputHitCollection = ufsd_digi.outputHitCollection, inputHitCollection = trk_b_digi.outputHitCollection,
outputHitCollection="TrackerBarrelRecHits") outputHitCollection="TrackerBarrelRecHits")
trk_endcap_reco = TrackerHitReconstruction("trk_endcap_reco", trk_ec_reco = TrackerHitReconstruction("trk_ec_reco",
inputHitCollection = ufsd_digi2.outputHitCollection, inputHitCollection = trk_ec_digi.outputHitCollection,
outputHitCollection="TrackerEndcapRecHits") outputHitCollection="TrackerEndcapRecHits")
#vtx_barrel_reco = TrackerHitReconstruction("vtx_barrel_reco", vtx_b_reco = TrackerHitReconstruction("vtx_b_reco",
# inputHitCollection = vtx_digi.outputHitCollection, inputHitCollection = vtx_b_digi.outputHitCollection,
# outputHitCollection="VertexBarrelRecHits") outputHitCollection="VertexBarrelRecHits")
vtx_ec_reco = TrackerHitReconstruction("vtx_ec_reco",
inputHitCollection = vtx_ec_digi.outputHitCollection,
outputHitCollection="VertexEndcapRecHits")
# Hit Source linker # Hit Source linker
sourcelinker = TrackerSourceLinker("sourcelinker", sourcelinker = TrackerSourceLinker("sourcelinker",
inputHitCollection="TrackerBarrelRecHits", inputHitCollection=trk_b_reco.outputHitCollection,
outputSourceLinks="BarrelTrackSourceLinks", outputSourceLinks="BarrelTrackSourceLinks",
outputMeasurements="BarrelTrackMeasurements", outputMeasurements="BarrelTrackMeasurements",
OutputLevel=DEBUG) OutputLevel=DEBUG)
#trk_hits_srclnkr = TrackerSourcesLinker("trk_srcslnkr", #trk_hits_srclnkr = TrackerSourcesLinker("trk_srcslnkr",
# ITrackerBarrelHits = "TrackerBarrelRecHits", # ITrackerBarrelHits = vtx_b_reco.outputHitCollection,
# ITrackerEndcapHits = "TrackerEndcapRecHits", # ITrackerEndcapHits = vtx_ec_reco.outputHitCollection,
# OTrackerBarrelHits = "TrackerBarrelRecHits", # OTrackerBarrelHits = trk_b_reco.outputHitCollection,
# OTrackerEndcapHits = "TrackerEndcapRecHits", # OTrackerEndcapHits = trk_ec_reco.outputHitCollection,
# outputSourceLinks="TrackerMeasurements", # outputSourceLinks="TrackerMeasurements",
# OutputLevel=DEBUG) # OutputLevel=DEBUG)
...@@ -206,9 +214,10 @@ out.outputCommands = ["keep *", ...@@ -206,9 +214,10 @@ out.outputCommands = ["keep *",
ApplicationMgr( ApplicationMgr(
TopAlg = [podioinput, TopAlg = [podioinput,
copier, trkcopier, copier, trkcopier,
ecal_digi, ufsd_digi, ufsd_digi2, #vtx_digi, ecal_digi,
trk_b_digi, trk_ec_digi, vtx_b_digi, vtx_ec_digi,
trk_b_reco, trk_ec_reco, vtx_b_reco, vtx_ec_reco,
ecal_reco, simple_cluster, ecal_reco, simple_cluster,
trk_barrel_reco, trk_endcap_reco, #vtx_barrel_reco,
sourcelinker, #trk_hits_srclnkr, sourcelinker, #trk_hits_srclnkr,
clust_trk_init, truth_trk_init, #vtxcluster_trk_init, clust_trk_init, truth_trk_init, #vtxcluster_trk_init,
trk_find_alg, parts_from_fit, trk_find_alg, parts_from_fit,
......
...@@ -103,32 +103,32 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root") ...@@ -103,32 +103,32 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
//.Define("delta_p_over_p1",delta_p_over_p, {"p_track1", "p_thrown"}) //.Define("delta_p_over_p1",delta_p_over_p, {"p_track1", "p_thrown"})
//.Define("delta_p_over_p2",delta_p_over_p, {"p_track2", "p_thrown"}) //.Define("delta_p_over_p2",delta_p_over_p, {"p_track2", "p_thrown"})
//.Define("N_VtxBarrelHits",[](std::vector<eic::TrackerHitData> hits) { return hits.size();},{"VertexBarrelRecHits"}) //.Define("N_VtxBarrelHits",[](std::vector<eic::TrackerHitData> hits) { return hits.size();},{"VertexBarrelRecHits"})
.Define("N_SiBarrelHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerBarrelHits"}) .Define("N_BarrelHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerBarrelHits"})
.Define("N_SiEndcapHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerEndcapHits"}) .Define("N_EndcapHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerEndcapHits"})
; ;
auto hSiBarrel_x_vs_y = df0.Histo2D({"hSiBarrel_x_vs_y", "; x ; y ", 100, -900, 900,100, -900, 900 }, "TrackerBarrelHits.position.x", "TrackerBarrelHits.position.y"); auto hBarrel_x_vs_y = df0.Histo2D({"hBarrel_x_vs_y", "; x ; y ", 100, -900, 900,100, -900, 900 }, "TrackerBarrelHits.position.x", "TrackerBarrelHits.position.y");
auto hSiBarrel_N_vs_theta = df0.Histo1D({"hSiBarrel_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_SiBarrelHits"); auto hBarrel_N_vs_theta = df0.Histo1D({"hBarrel_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_BarrelHits");
auto hSiEndcap_N_vs_theta = df0.Histo1D({"hSiEndcap_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_SiEndcapHits"); auto hEndcap_N_vs_theta = df0.Histo1D({"hEndcap_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_EndcapHits");
//auto hVtxBarrel_N_vs_theta = df0.Histo1D({"hVtxBarrel_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_VtxBarrelHits"); //auto hVtxBarrel_N_vs_theta = df0.Histo1D({"hVtxBarrel_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_VtxBarrelHits");
auto hSiBarrel_Nhits = df0.Histo1D({"hSiBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_SiBarrelHits"); auto hBarrel_Nhits = df0.Histo1D({"hBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_BarrelHits");
auto hSiEndcap_Nhits = df0.Histo1D({"hSiEndcap_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_SiEndcapHits"); auto hEndcap_Nhits = df0.Histo1D({"hEndcap_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_EndcapHits");
//auto hVtxBarrel_Nhits = df0.Histo1D({"hVtxBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_VtxBarrelHits"); //auto hVtxBarrel_Nhits = df0.Histo1D({"hVtxBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_VtxBarrelHits");
auto hSiBarrel_Ntheta = df0.Histo1D({"hSiBarrel_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0"); auto hBarrel_Ntheta = df0.Histo1D({"hBarrel_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0");
auto hSiEndcap_Ntheta = df0.Histo1D({"hSiEndcap_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0"); auto hEndcap_Ntheta = df0.Histo1D({"hEndcap_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0");
//auto hVtxBarrel_Ntheta = df0.Histo1D({"hVtxBarrel_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0"); //auto hVtxBarrel_Ntheta = df0.Histo1D({"hVtxBarrel_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0");
auto c = new TCanvas(); auto c = new TCanvas();
auto hs = new THStack("n_hits","; #theta "); auto hs = new THStack("n_hits","; #theta ");
auto h1 = (TH1D*) hSiBarrel_N_vs_theta->Clone(); auto h1 = (TH1D*) hBarrel_N_vs_theta->Clone();
auto h2 = (TH1D*) hSiBarrel_Ntheta->Clone(); auto h2 = (TH1D*) hBarrel_Ntheta->Clone();
h1->Divide(h2); h1->Divide(h2);
hs->Add(h1); hs->Add(h1);
h1 = (TH1D*) hSiEndcap_N_vs_theta->Clone(); h1 = (TH1D*) hEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hSiEndcap_Ntheta->Clone(); h2 = (TH1D*) hEndcap_Ntheta->Clone();
h1->Divide(h2); h1->Divide(h2);
h1->SetLineColor(2); h1->SetLineColor(2);
hs->Add(h1); hs->Add(h1);
...@@ -144,12 +144,12 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root") ...@@ -144,12 +144,12 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
c = new TCanvas(); c = new TCanvas();
hs = new THStack("theta","; #theta "); hs = new THStack("theta","; #theta ");
h1 = (TH1D*) hSiBarrel_N_vs_theta->Clone(); h1 = (TH1D*) hBarrel_N_vs_theta->Clone();
h2 = (TH1D*) hSiBarrel_Ntheta->Clone(); h2 = (TH1D*) hBarrel_Ntheta->Clone();
//h1->Divide(h2); //h1->Divide(h2);
hs->Add(h2); hs->Add(h2);
h1 = (TH1D*) hSiEndcap_N_vs_theta->Clone(); h1 = (TH1D*) hEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hSiEndcap_Ntheta->Clone(); h2 = (TH1D*) hEndcap_Ntheta->Clone();
//h1->Divide(h2); //h1->Divide(h2);
h1->SetLineColor(2); h1->SetLineColor(2);
h2->SetLineColor(2); h2->SetLineColor(2);
...@@ -166,9 +166,9 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root") ...@@ -166,9 +166,9 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
c = new TCanvas(); c = new TCanvas();
hs = new THStack("hits","; hits "); hs = new THStack("hits","; hits ");
h1 = (TH1D*) hSiBarrel_Nhits->Clone(); h1 = (TH1D*) hBarrel_Nhits->Clone();
hs->Add(h1); hs->Add(h1);
h1 = (TH1D*) hSiEndcap_Nhits->Clone(); h1 = (TH1D*) hEndcap_Nhits->Clone();
h1->SetLineColor(2); h1->SetLineColor(2);
h2->SetLineColor(2); h2->SetLineColor(2);
hs->Add(h2); hs->Add(h2);
...@@ -183,7 +183,7 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root") ...@@ -183,7 +183,7 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
c->SaveAs("results/tracking/hits_central_electrons_nhits.pdf"); c->SaveAs("results/tracking/hits_central_electrons_nhits.pdf");
c = new TCanvas(); c = new TCanvas();
hSiBarrel_x_vs_y->DrawCopy("colz"); hBarrel_x_vs_y->DrawCopy("colz");
c->SaveAs("results/tracking/hits_central_electrons_xy.png"); c->SaveAs("results/tracking/hits_central_electrons_xy.png");
c->SaveAs("results/tracking/hits_central_electrons_xy.pdf"); c->SaveAs("results/tracking/hits_central_electrons_xy.pdf");
return 0; return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment