diff --git a/tracking/central_electrons.sh b/tracking/central_electrons.sh index 3b8366c84b018e7e1b2d6d98494a7873eaa576cf..75cc37c4e3c30c97f22c7daa55ad7e9e08c6be33 100644 --- a/tracking/central_electrons.sh +++ b/tracking/central_electrons.sh @@ -23,7 +23,7 @@ echo "JUGGLER_DETECTOR = ${JUGGLER_DETECTOR}" ### Build the detector constructors. -git clone https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git +git clone -b acts_v4 https://eicweb.phy.anl.gov/EIC/detectors/${JUGGLER_DETECTOR}.git git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git pushd ${JUGGLER_DETECTOR} ln -s ../accelerator/eic diff --git a/tracking/options/tracker_reconstruction.py b/tracking/options/tracker_reconstruction.py index 76acfdc9bcbf6b11a21a1354c8ca8b866dcaa833..2fa99cae37bec6bb10c1def824cecb99b168a703 100644 --- a/tracking/options/tracker_reconstruction.py +++ b/tracking/options/tracker_reconstruction.py @@ -13,8 +13,8 @@ input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) output_rec_file = str(os.environ["JUGGLER_REC_FILE"]) n_events = str(os.environ["JUGGLER_N_EVENTS"]) -geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)]) -podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG) +geo_service = GeoSvc("GeoSvc", detectors=["{}.xml".format(detector_name)], OutputLevel=WARNING) +podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) from Configurables import PodioInput from Configurables import Jug__Base__InputCopier_dd4pod__Geant4ParticleCollection_dd4pod__Geant4ParticleCollection_ as MCCopier @@ -29,7 +29,7 @@ from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitRecon from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker from Configurables import Jug__Reco__TrackerSourcesLinker as TrackerSourcesLinker -from Configurables import Jug__Reco__TrackingHitsSourceLinker as TrackingHitsSourceLinker +#from Configurables import Jug__Reco__TrackingHitsSourceLinker as TrackingHitsSourceLinker from Configurables import Jug__Reco__TrackParamTruthInit as TrackParamTruthInit from Configurables import Jug__Reco__TrackParamClusterInit as TrackParamClusterInit from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit @@ -43,7 +43,7 @@ from Configurables import Jug__Reco__SimpleClustering as SimpleClustering podioinput = PodioInput("PodioReader", - collections=["mcparticles","SiTrackerEndcapHits","SiTrackerBarrelHits","SiVertexBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG) + collections=["mcparticles","SiTrackerEndcapHits","SiTrackerBarrelHits","EcalBarrelHits"])#, OutputLevel=DEBUG)"SiVertexBarrelHits", ## copiers to get around input --> output copy bug. Note the "2" appended to the output collection. copier = MCCopier("MCCopier", @@ -66,24 +66,24 @@ ufsd_digi2 = UFSDTrackerDigi("ufsd_digi2", outputHitCollection="SiTrackerEndcapRawHits", timeResolution=8) -vtx_digi = UFSDTrackerDigi("vtx_digi", - inputHitCollection="SiVertexBarrelHits", - outputHitCollection="SiVertexBarrelRawHits", - timeResolution=8) +#vtx_digi = UFSDTrackerDigi("vtx_digi", +# inputHitCollection="SiVertexBarrelHits", +# outputHitCollection="SiVertexBarrelRawHits", +# timeResolution=8) ecal_reco = EMCalReconstruction("ecal_reco", inputHitCollection="RawEcalBarrelHits", outputHitCollection="RecEcalBarrelHits", minModuleEdep=0.0*units.MeV, - OutputLevel=DEBUG) + OutputLevel=WARNING) simple_cluster = SimpleClustering("simple_cluster", inputHitCollection="RecEcalBarrelHits", outputClusters="SimpleClusters", minModuleEdep=1.0*units.MeV, maxDistance=50.0*units.cm, - OutputLevel=DEBUG) + OutputLevel=WARNING) # Tracker and vertex reconstruction trk_barrel_reco = TrackerHitReconstruction("trk_barrel_reco", @@ -94,23 +94,24 @@ trk_endcap_reco = TrackerHitReconstruction("trk_endcap_reco", inputHitCollection = ufsd_digi2.outputHitCollection, outputHitCollection="TrackerEndcapRecHits") -vtx_barrel_reco = TrackerHitReconstruction("vtx_barrel_reco", - inputHitCollection = vtx_digi.outputHitCollection, - outputHitCollection="VertexBarrelRecHits") +#vtx_barrel_reco = TrackerHitReconstruction("vtx_barrel_reco", +# inputHitCollection = vtx_digi.outputHitCollection, +# outputHitCollection="VertexBarrelRecHits") # Hit Source linker -sourcelinker = TrackerSourceLinker("trk_srclinker", +sourcelinker = TrackerSourceLinker("sourcelinker", inputHitCollection="TrackerBarrelRecHits", outputSourceLinks="BarrelTrackSourceLinks", + outputMeasurements="BarrelTrackMeasurements", OutputLevel=DEBUG) -trk_hits_srclnkr = TrackerSourcesLinker("trk_srcslnkr", - ITrackerBarrelHits = "VertexBarrelRecHits", - ITrackerEndcapHits = "VertexBarrelRecHits", - OTrackerBarrelHits = "TrackerBarrelRecHits", - OTrackerEndcapHits = "TrackerEndcapRecHits", - outputSourceLinks="TrackerSourceLinks", - OutputLevel=DEBUG) +#trk_hits_srclnkr = TrackerSourcesLinker("trk_srcslnkr", +# ITrackerBarrelHits = "TrackerBarrelRecHits", +# ITrackerEndcapHits = "TrackerEndcapRecHits", +# OTrackerBarrelHits = "TrackerBarrelRecHits", +# OTrackerEndcapHits = "TrackerEndcapRecHits", +# outputSourceLinks="TrackerMeasurements", +# OutputLevel=DEBUG) ## Track param init truth_trk_init = TrackParamTruthInit("truth_trk_init", @@ -121,18 +122,19 @@ truth_trk_init = TrackParamTruthInit("truth_trk_init", clust_trk_init = TrackParamClusterInit("clust_trk_init", inputClusters="SimpleClusters", outputInitialTrackParameters="InitTrackParamsFromClusters", - OutputLevel=DEBUG) + OutputLevel=WARNING) -vtxcluster_trk_init = TrackParamVertexClusterInit("vtxcluster_trk_init", - inputVertexHits="VertexBarrelRecHits", - inputClusters="SimpleClusters", - outputInitialTrackParameters="InitTrackParamsFromVtxClusters", - maxHitRadius=40.0*units.mm, - OutputLevel=DEBUG) +#vtxcluster_trk_init = TrackParamVertexClusterInit("vtxcluster_trk_init", +# inputVertexHits="VertexBarrelRecHits", +# inputClusters="SimpleClusters", +# outputInitialTrackParameters="InitTrackParamsFromVtxClusters", +# maxHitRadius=40.0*units.mm, +# OutputLevel=WARNING) # Tracking algorithms trk_find_alg = TrackFindingAlgorithm("trk_find_alg", - inputSourceLinks = trk_hits_srclnkr.outputSourceLinks, + inputSourceLinks = sourcelinker.outputSourceLinks, + inputMeasurements = sourcelinker.outputMeasurements, inputInitialTrackParameters= "InitTrackParams",#"InitTrackParamsFromClusters", outputTrajectories="trajectories", OutputLevel=DEBUG) @@ -144,27 +146,29 @@ parts_from_fit = ParticlesFromTrackFit("parts_from_fit", OutputLevel=DEBUG) trk_find_alg1 = TrackFindingAlgorithm("trk_find_alg1", - inputSourceLinks = trk_hits_srclnkr.outputSourceLinks, + inputSourceLinks = sourcelinker.outputSourceLinks, + inputMeasurements = sourcelinker.outputMeasurements, inputInitialTrackParameters= "InitTrackParamsFromClusters", outputTrajectories="trajectories1", - OutputLevel=DEBUG) + OutputLevel=WARNING) parts_from_fit1 = ParticlesFromTrackFit("parts_from_fit1", inputTrajectories="trajectories1", outputParticles="ReconstructedParticles1", outputTrackParameters="outputTrackParameters1", - OutputLevel=DEBUG) + OutputLevel=WARNING) -trk_find_alg2 = TrackFindingAlgorithm("trk_find_alg2", - inputSourceLinks = trk_hits_srclnkr.outputSourceLinks, - inputInitialTrackParameters= "InitTrackParamsFromVtxClusters", - outputTrajectories="trajectories2", - OutputLevel=DEBUG) -parts_from_fit2 = ParticlesFromTrackFit("parts_from_fit2", - inputTrajectories="trajectories2", - outputParticles="ReconstructedParticles2", - outputTrackParameters="outputTrackParameters2", - OutputLevel=DEBUG) +#trk_find_alg2 = TrackFindingAlgorithm("trk_find_alg2", +# inputSourceLinks = trk_hits_srclnkr.outputSourceLinks, +# inputMeasurements = trk_hits_srclnkr.outputMeasurements, +# inputInitialTrackParameters= "InitTrackParamsFromVtxClusters", +# outputTrajectories="trajectories2", +# OutputLevel=WARNING) +#parts_from_fit2 = ParticlesFromTrackFit("parts_from_fit2", +# inputTrajectories="trajectories2", +# outputParticles="ReconstructedParticles2", +# outputTrackParameters="outputTrackParameters2", +# OutputLevel=WARNING) #types = [] @@ -198,19 +202,19 @@ out.outputCommands = ["keep *", ApplicationMgr( TopAlg = [podioinput, copier, trkcopier, - ecal_digi, ufsd_digi, ufsd_digi2, vtx_digi, + ecal_digi, ufsd_digi, ufsd_digi2, #vtx_digi, 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_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, trk_find_alg1, parts_from_fit1, - trk_find_alg2, parts_from_fit2, + #trk_find_alg2, parts_from_fit2, out ], EvtSel = 'NONE', EvtMax = n_events, ExtSvc = [podioevent,geo_service], - OutputLevel=DEBUG + OutputLevel=WARNING ) diff --git a/tracking/scripts/gen_central_electrons.cxx b/tracking/scripts/gen_central_electrons.cxx index 794d2fee8f5ebcfbdb10497710d739782eecbd6f..e07d320f422dec3b7751ceadbe782e29c22c0f76 100644 --- a/tracking/scripts/gen_central_electrons.cxx +++ b/tracking/scripts/gen_central_electrons.cxx @@ -17,8 +17,8 @@ using namespace HepMC3; void gen_central_electrons(int n_events = 100, const char* out_fname = "central_electrons.hepmc") { - double cos_theta_min = std::cos( 20.0*(M_PI/180.0)); - double cos_theta_max = std::cos(160.0*(M_PI/180.0)); + double cos_theta_min = std::cos( 80.0*(M_PI/180.0)); + double cos_theta_max = std::cos(100.0*(M_PI/180.0)); WriterAscii hepmc_output(out_fname); int events_parsed = 0; diff --git a/tracking/scripts/rec_central_electrons.cxx b/tracking/scripts/rec_central_electrons.cxx index 8249eceadf6c3d19d86e0912539eaa25956cccf3..962054a2a8b4d6a18479dbc01e76d1fb253fb380 100644 --- a/tracking/scripts/rec_central_electrons.cxx +++ b/tracking/scripts/rec_central_electrons.cxx @@ -93,14 +93,14 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo .Define("nTracks", "outputTrackParameters.size()") .Define("p_track", p_track, {"outputTrackParameters"}) .Define("p_track1", p_track, {"outputTrackParameters1"}) - .Define("p_track2", p_track, {"outputTrackParameters2"}) + //.Define("p_track2", p_track, {"outputTrackParameters2"}) .Define("delta_p0",delta_p, {"p_track", "p_thrown"}) .Define("delta_p1",delta_p, {"p_track1", "p_thrown"}) - .Define("delta_p2",delta_p, {"p_track2", "p_thrown"}) + //.Define("delta_p2",delta_p, {"p_track2", "p_thrown"}) .Define("delta_p_over_p0",delta_p_over_p, {"p_track", "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("N_VtxBarrelHits",[](std::vector<eic::TrackerHitData> hits) { return hits.size();},{"VertexBarrelRecHits"}) + //.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<eic::TrackerHitData> hits) { return hits.size();}, {"TrackerBarrelRecHits"}) .Define("N_SiEndcapHits", [](std::vector<eic::TrackerHitData> hits) { return hits.size();}, {"TrackerEndcapRecHits"}) ; @@ -110,23 +110,23 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo auto h_delta_p0 = df0.Histo1D({"h_delta_p0", "Truth Track Init; GeV/c ", 100, -10, 10}, "delta_p0"); auto h_delta_p1 = df0.Histo1D({"h_delta_p1", "Ecal Cluster Init; GeV/c ", 100, -10, 10}, "delta_p1"); - auto h_delta_p2 = df0.Histo1D({"h_delta_p2", "Ecal Cluster, innner vtx hit Init; GeV/c ", 100, -10, 10}, "delta_p2"); + //auto h_delta_p2 = df0.Histo1D({"h_delta_p2", "Ecal Cluster, innner vtx hit Init; GeV/c ", 100, -10, 10}, "delta_p2"); 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 h_delta_p1_over_p = df0.Histo1D({"h_delta_p1_over_p", "Ecal Cluster Init; delta p/p ", 100, -0.1, 0.1}, "delta_p_over_p1"); - auto h_delta_p2_over_p = df0.Histo1D({"h_delta_p2_over_p", "Ecal Cluster, innner vtx hit Init; delta p/p ", 100, -0.1, 0.1}, "delta_p_over_p2"); + //auto h_delta_p2_over_p = df0.Histo1D({"h_delta_p2_over_p", "Ecal Cluster, innner vtx hit Init; delta p/p ", 100, -0.1, 0.1}, "delta_p_over_p2"); 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 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 hSiEndcap_Nhits = df0.Histo1D({"hSiEndcap_Nhits", "; #theta [deg.]", 20, 0, 20 }, "N_SiEndcapHits"); - 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 hSiEndcap_Ntheta = df0.Histo1D({"hSiEndcap_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(); @@ -145,11 +145,11 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo h1 = (TH1D*) h_delta_p1->Clone(); h1->SetLineColor(2); hs->Add(h1); - h1 = (TH1D*) h_delta_p2->Clone(); - h1->SetLineColor(4); - h1->SetFillStyle(3001); - h1->SetFillColor(4); - hs->Add(h1); + //h1 = (TH1D*) h_delta_p2->Clone(); + //h1->SetLineColor(4); + //h1->SetFillStyle(3001); + //h1->SetFillColor(4); + //hs->Add(h1); hs->Draw("nostack"); c->BuildLegend(); c->SaveAs("results/tracking/rec_central_electrons_delta_p.png"); @@ -162,11 +162,11 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo h1 = (TH1D*) h_delta_p1_over_p->Clone(); h1->SetLineColor(2); hs->Add(h1); - h1 = (TH1D*) h_delta_p2_over_p->Clone(); - h1->SetLineColor(4); - h1->SetFillStyle(3001); - h1->SetFillColor(4); - hs->Add(h1); + //h1 = (TH1D*) h_delta_p2_over_p->Clone(); + //h1->SetLineColor(4); + //h1->SetFillStyle(3001); + //h1->SetFillColor(4); + //hs->Add(h1); hs->Draw("nostack"); c->BuildLegend(); c->SaveAs("results/tracking/rec_central_electrons_delta_p_over_p.png"); @@ -223,12 +223,12 @@ int rec_central_electrons(const char* fname = "topside/rec_central_electrons.roo h1->SetLineColor(2); h2->SetLineColor(2); hs->Add(h2); - h1 = (TH1D*) hVtxBarrel_Nhits->Clone(); - h1->SetLineColor(4); - h1->SetFillStyle(3001); - h1->SetFillColor(4); - hs->Add(h1); - hs->Draw("nostack hist"); + //h1 = (TH1D*) hVtxBarrel_Nhits->Clone(); + //h1->SetLineColor(4); + //h1->SetFillStyle(3001); + //h1->SetFillColor(4); + //hs->Add(h1); + //hs->Draw("nostack hist"); c->BuildLegend(); c->SaveAs("results/tracking/rec_central_electrons_nhits.png"); c->SaveAs("results/tracking/rec_central_electrons_nhits.pdf");