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

Improve tracking setup

parent 56e69f0e
Branches
No related tags found
1 merge request!100Improve tracking setup
......@@ -91,6 +91,7 @@ then
fi
fi
rootls -t ${JUGGLER_SIM_FILE}
if [[ -z "${ANALYSIS_ONLY}" ]] ;
then
......
......@@ -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__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__Reco__TrackerHitReconstruction as TrackerHitReconstruction
......@@ -47,7 +47,7 @@ from Configurables import Jug__Reco__SimpleClustering as SimpleClustering
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.
copier = MCCopier("MCCopier",
......@@ -61,20 +61,24 @@ ecal_digi = EMCalorimeterDigi("ecal_digi",
inputHitCollection="EcalBarrelHits",
outputHitCollection="RawEcalBarrelHits")
ufsd_digi = UFSDTrackerDigi("ufsd_digi",
trk_b_digi = TrackerDigi("trk_b_digi",
inputHitCollection="TrackerBarrelHits",
outputHitCollection="TrackerBarrelRawHits",
timeResolution=8)
ufsd_digi2 = UFSDTrackerDigi("ufsd_digi2",
trk_ec_digi = TrackerDigi("trk_ec_digi",
inputHitCollection="TrackerEndcapHits",
outputHitCollection="TrackerEndcapRawHits",
timeResolution=8)
#vtx_digi = UFSDTrackerDigi("vtx_digi",
# inputHitCollection="SiVertexBarrelHits",
# outputHitCollection="SiVertexBarrelRawHits",
# timeResolution=8)
vtx_b_digi = TrackerDigi("vtx_b_digi",
inputHitCollection="VertexBarrelHits",
outputHitCollection="VertexBarrelRawHits",
timeResolution=8)
vtx_ec_digi = TrackerDigi("vtx_ec_digi",
inputHitCollection="VertexEndcapHits",
outputHitCollection="VertexEndcapRawHits",
timeResolution=8)
ecal_reco = EMCalReconstruction("ecal_reco",
inputHitCollection="RawEcalBarrelHits",
......@@ -90,30 +94,34 @@ simple_cluster = SimpleClustering("simple_cluster",
OutputLevel=WARNING)
# Tracker and vertex reconstruction
trk_barrel_reco = TrackerHitReconstruction("trk_barrel_reco",
inputHitCollection = ufsd_digi.outputHitCollection,
trk_b_reco = TrackerHitReconstruction("trk_b_reco",
inputHitCollection = trk_b_digi.outputHitCollection,
outputHitCollection="TrackerBarrelRecHits")
trk_endcap_reco = TrackerHitReconstruction("trk_endcap_reco",
inputHitCollection = ufsd_digi2.outputHitCollection,
trk_ec_reco = TrackerHitReconstruction("trk_ec_reco",
inputHitCollection = trk_ec_digi.outputHitCollection,
outputHitCollection="TrackerEndcapRecHits")
#vtx_barrel_reco = TrackerHitReconstruction("vtx_barrel_reco",
# inputHitCollection = vtx_digi.outputHitCollection,
# outputHitCollection="VertexBarrelRecHits")
vtx_b_reco = TrackerHitReconstruction("vtx_b_reco",
inputHitCollection = vtx_b_digi.outputHitCollection,
outputHitCollection="VertexBarrelRecHits")
vtx_ec_reco = TrackerHitReconstruction("vtx_ec_reco",
inputHitCollection = vtx_ec_digi.outputHitCollection,
outputHitCollection="VertexEndcapRecHits")
# Hit Source linker
sourcelinker = TrackerSourceLinker("sourcelinker",
inputHitCollection="TrackerBarrelRecHits",
inputHitCollection=trk_b_reco.outputHitCollection,
outputSourceLinks="BarrelTrackSourceLinks",
outputMeasurements="BarrelTrackMeasurements",
OutputLevel=DEBUG)
#trk_hits_srclnkr = TrackerSourcesLinker("trk_srcslnkr",
# ITrackerBarrelHits = "TrackerBarrelRecHits",
# ITrackerEndcapHits = "TrackerEndcapRecHits",
# OTrackerBarrelHits = "TrackerBarrelRecHits",
# OTrackerEndcapHits = "TrackerEndcapRecHits",
# ITrackerBarrelHits = vtx_b_reco.outputHitCollection,
# ITrackerEndcapHits = vtx_ec_reco.outputHitCollection,
# OTrackerBarrelHits = trk_b_reco.outputHitCollection,
# OTrackerEndcapHits = trk_ec_reco.outputHitCollection,
# outputSourceLinks="TrackerMeasurements",
# OutputLevel=DEBUG)
......@@ -206,9 +214,10 @@ out.outputCommands = ["keep *",
ApplicationMgr(
TopAlg = [podioinput,
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,
trk_barrel_reco, trk_endcap_reco, #vtx_barrel_reco,
sourcelinker, #trk_hits_srclnkr,
clust_trk_init, truth_trk_init, #vtxcluster_trk_init,
trk_find_alg, parts_from_fit,
......
......@@ -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_p2",delta_p_over_p, {"p_track2", "p_thrown"})
//.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_SiEndcapHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerEndcapHits"})
.Define("N_BarrelHits", [](std::vector<dd4pod::TrackerHitData> hits) { return hits.size();}, {"TrackerBarrelHits"})
.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 hSiEndcap_N_vs_theta = df0.Histo1D({"hSiEndcap_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_SiEndcapHits");
auto hBarrel_N_vs_theta = df0.Histo1D({"hBarrel_N_vs_theta", "; #theta [deg.]", 20, 0, 180 }, "theta0", "N_BarrelHits");
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 hSiBarrel_Nhits = df0.Histo1D({"hSiBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_SiBarrelHits");
auto hSiEndcap_Nhits = df0.Histo1D({"hSiEndcap_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_SiEndcapHits");
auto hBarrel_Nhits = df0.Histo1D({"hBarrel_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_BarrelHits");
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 hSiBarrel_Ntheta = df0.Histo1D({"hSiBarrel_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0");
auto hSiEndcap_Ntheta = df0.Histo1D({"hSiEndcap_Ntheta", "; #theta [deg.]", 20, 0, 180 }, "theta0");
auto hBarrel_Ntheta = df0.Histo1D({"hBarrel_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 c = new TCanvas();
auto hs = new THStack("n_hits","; #theta ");
auto h1 = (TH1D*) hSiBarrel_N_vs_theta->Clone();
auto h2 = (TH1D*) hSiBarrel_Ntheta->Clone();
auto h1 = (TH1D*) hBarrel_N_vs_theta->Clone();
auto h2 = (TH1D*) hBarrel_Ntheta->Clone();
h1->Divide(h2);
hs->Add(h1);
h1 = (TH1D*) hSiEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hSiEndcap_Ntheta->Clone();
h1 = (TH1D*) hEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hEndcap_Ntheta->Clone();
h1->Divide(h2);
h1->SetLineColor(2);
hs->Add(h1);
......@@ -144,12 +144,12 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
c = new TCanvas();
hs = new THStack("theta","; #theta ");
h1 = (TH1D*) hSiBarrel_N_vs_theta->Clone();
h2 = (TH1D*) hSiBarrel_Ntheta->Clone();
h1 = (TH1D*) hBarrel_N_vs_theta->Clone();
h2 = (TH1D*) hBarrel_Ntheta->Clone();
//h1->Divide(h2);
hs->Add(h2);
h1 = (TH1D*) hSiEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hSiEndcap_Ntheta->Clone();
h1 = (TH1D*) hEndcap_N_vs_theta->Clone();
h2 = (TH1D*) hEndcap_Ntheta->Clone();
//h1->Divide(h2);
h1->SetLineColor(2);
h2->SetLineColor(2);
......@@ -166,9 +166,9 @@ int hits_central_electrons(const char* fname = "sim_central_electrons.root")
c = new TCanvas();
hs = new THStack("hits","; hits ");
h1 = (TH1D*) hSiBarrel_Nhits->Clone();
h1 = (TH1D*) hBarrel_Nhits->Clone();
hs->Add(h1);
h1 = (TH1D*) hSiEndcap_Nhits->Clone();
h1 = (TH1D*) hEndcap_Nhits->Clone();
h1->SetLineColor(2);
h2->SetLineColor(2);
hs->Add(h2);
......@@ -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 = 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.pdf");
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment