diff --git a/benchmarks/clustering/options/full_cal_reco.py b/benchmarks/clustering/options/full_cal_reco.py index b4a8f42534cdf6eb2d58069f1e920d7741c48ce2..19018046c76ca8e6a2a284df14da349e86169297 100644 --- a/benchmarks/clustering/options/full_cal_reco.py +++ b/benchmarks/clustering/options/full_cal_reco.py @@ -9,19 +9,15 @@ import ROOT from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad -detector_name = str(os.environ.get("DETECTOR", "athena")) +detector_name = str(os.environ.get("DETECTOR", "epic")) detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) -detector_version = str(os.environ.get("DETECTOR_VERSION", "master")) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = os.path.join(detector_path, detector_config) # Detector features that affect reconstruction has_ecal_barrel_scfi = False -if 'athena' in detector_name: - has_ecal_barrel_scfi = True -if 'ecce' in detector_name and 'imaging' in detector_config: - has_ecal_barrel_scfi = True if 'epic' in detector_name and 'imaging' in detector_config: has_ecal_barrel_scfi = True @@ -266,7 +262,7 @@ else: algs.append(cb_ecal_clreco) # Central Barrel Ecal SciFi -if 'athena' in detector_name: +if has_ecal_barrel_scfi: scfi_barrel_daq = dict( dynamicRangeADC=50.*MeV, capacityADC=32768, diff --git a/benchmarks/ecal/options/barrel.py b/benchmarks/ecal/options/barrel.py index f60d03ffeb16cd4765d310297411c58f6eca5ad3..62fc3b2d44f9ae27a45ff2a290dd637021957ac3 100644 --- a/benchmarks/ecal/options/barrel.py +++ b/benchmarks/ecal/options/barrel.py @@ -9,18 +9,14 @@ import ROOT from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad -detector_name = str(os.environ.get("DETECTOR", "athena")) +detector_name = str(os.environ.get("DETECTOR", "epic")) detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) -detector_version = str(os.environ.get("DETECTOR_VERSION", "master")) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = str(os.environ.get("JUGGLER_COMPACT_PATH", "{}.xml".format(os.path.join(detector_path, detector_name)))) # Detector features that affect reconstruction has_ecal_barrel_scfi = False -if 'athena' in detector_name: - has_ecal_barrel_scfi = True -if 'ecce' in detector_name and 'imaging' in detector_config: - has_ecal_barrel_scfi = True if 'epic' in detector_name and 'imaging' in detector_config: has_ecal_barrel_scfi = True diff --git a/benchmarks/ecal/options/endcap_e.py b/benchmarks/ecal/options/endcap_e.py index 1aab4beb31148fd38aad8c137521ca19d9910199..597c4733a91a9c6019206f35ef8ba18e1dea3216 100644 --- a/benchmarks/ecal/options/endcap_e.py +++ b/benchmarks/ecal/options/endcap_e.py @@ -8,7 +8,7 @@ import ROOT from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad -detector_name = str(os.environ.get("DETECTOR_CONFIG", "athena")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = str(os.environ.get("JUGGLER_COMPACT_PATH", "{}.xml".format(os.path.join(detector_path, detector_name)))) diff --git a/benchmarks/ecal/options/endcap_i.py b/benchmarks/ecal/options/endcap_i.py index 63469090af29fabdb9e0eaa5b94e33e55f854e8d..1d49cad5f66b194367c72081fb4946c23a6dc2ee 100644 --- a/benchmarks/ecal/options/endcap_i.py +++ b/benchmarks/ecal/options/endcap_i.py @@ -9,7 +9,7 @@ import ROOT from Configurables import ApplicationMgr, EICDataSvc, PodioInput, PodioOutput, GeoSvc from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad -detector_name = str(os.environ.get("DETECTOR_CONFIG", "athena")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = str(os.environ.get("JUGGLER_COMPACT_PATH", "{}.xml".format(os.path.join(detector_path, detector_name)))) ci_ecal_sf = float(os.environ.get("CI_ECAL_SAMP_FRAC", 0.253)) diff --git a/benchmarks/far_forward/analysis/hits_far_forward_protons.cxx b/benchmarks/far_forward/analysis/hits_far_forward_protons.cxx index f1f1f58f615aedeb95211ac220d7365054615ac7..80bb98586241ac8d9fbaf4d2b33d3bccd516ad5c 100644 --- a/benchmarks/far_forward/analysis/hits_far_forward_protons.cxx +++ b/benchmarks/far_forward/analysis/hits_far_forward_protons.cxx @@ -104,11 +104,11 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.edm4he //.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<edm4hep::SimTrackerHitData> hits) { return hits.size();},{"VertexBarrelRecHits"}) - .Define("N_BarrelHits", [](std::vector<edm4hep::SimTrackerHitData> hits) { return hits.size();}, {"TrackerBarrelHits"}) - .Define("N_EndcapHits", [](std::vector<edm4hep::SimTrackerHitData> hits) { return hits.size();}, {"TrackerEndcapHits1"}) + .Define("N_BarrelHits", [](std::vector<edm4hep::SimTrackerHitData> hits) { return hits.size();}, {"OuterSiBarrelHits"}) + .Define("N_EndcapHits", [](std::vector<edm4hep::SimTrackerHitData> hits) { return hits.size();}, {"OuterTrackerEndcapPHits"}) ; - 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 hBarrel_x_vs_y = df0.Histo2D({"hBarrel_x_vs_y", "; x ; y ", 100, -900, 900,100, -900, 900 }, "OuterSiBarrelHits.position.x", "OuterSiBarrelHits.position.y"); 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"); @@ -133,11 +133,6 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.edm4he h1->Divide(h2); h1->SetLineColor(2); hs->Add(h1); - //h1 = (TH1D*) hVtxBarrel_vs_theta->Clone(); - //h1->SetLineColor(4); - //h1->SetFillStyle(3001); - //h1->SetFillColor(4); - //hs->Add(h1); hs->Draw("nostack, hist"); c->BuildLegend(); c->SaveAs("results/far_forward/B0/hits_far_forward_protons_n_hits_vs_theta.png"); @@ -147,19 +142,12 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.edm4he hs = new THStack("theta","; #theta "); h1 = (TH1D*) hBarrel_N_vs_theta->Clone(); h2 = (TH1D*) hBarrel_Ntheta->Clone(); - //h1->Divide(h2); hs->Add(h2); h1 = (TH1D*) hEndcap_N_vs_theta->Clone(); h2 = (TH1D*) hEndcap_Ntheta->Clone(); - //h1->Divide(h2); h1->SetLineColor(2); h2->SetLineColor(2); hs->Add(h2); - //h1 = (TH1D*) hVtxBarrel_vs_theta->Clone(); - //h1->SetLineColor(4); - //h1->SetFillStyle(3001); - //h1->SetFillColor(4); - //hs->Add(h1); hs->Draw("nostack hist"); c->BuildLegend(); c->SaveAs("results/far_forward/B0/hits_far_forward_protons_theta.png"); @@ -173,12 +161,6 @@ int hits_far_forward_protons(const char* fname = "sim_far_forward_protons.edm4he 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"); c->BuildLegend(); c->SaveAs("results/far_forward/B0/hits_far_forward_protons_nhits.png"); c->SaveAs("results/far_forward/B0/hits_far_forward_protons_nhits.pdf"); diff --git a/benchmarks/far_forward/options/far_forward_reconstruction.py b/benchmarks/far_forward/options/far_forward_reconstruction.py index 9b52a4fd978c25a1866a09af2d22b228748c26a9..368ce82d4a15ffefbcaa5e878ab86c44e07a44a9 100644 --- a/benchmarks/far_forward/options/far_forward_reconstruction.py +++ b/benchmarks/far_forward/options/far_forward_reconstruction.py @@ -3,7 +3,7 @@ from Gaudi.Configuration import * from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc from GaudiKernel.SystemOfUnits import MeV, GeV, mm, cm, mrad -detector_name = str(os.environ.get("DETECTOR_CONFIG", "athena")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) compact_path = str(os.environ.get("JUGGLER_COMPACT_PATH", "{}.xml".format(os.path.join(detector_path, detector_name)))) diff --git a/benchmarks/far_forward/options/zdc_reconstruction.py b/benchmarks/far_forward/options/zdc_reconstruction.py index 71d9edab2dc8897a8eb75a8fa8b48c64a919aacf..ba8cc39365276f2ce7c36b97b4514f8ed79fa12f 100644 --- a/benchmarks/far_forward/options/zdc_reconstruction.py +++ b/benchmarks/far_forward/options/zdc_reconstruction.py @@ -14,9 +14,9 @@ from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG kwargs = dict() # input arguments through environment variables -kwargs['input'] = os.environ.get('JUGGLER_SIM_FILE', '../atheta/zdc_photons.edm4hep.root') +kwargs['input'] = os.environ.get('JUGGLER_SIM_FILE', '../epic/zdc_photons.edm4hep.root') kwargs['output'] = os.environ.get('JUGGLER_REC_FILE', 'rec_zdc_photons.root') -kwargs['compact'] = os.environ.get('DETECTOR_COMPACT_PATH', '../atheta/athena.xml') +kwargs['compact'] = os.environ.get('DETECTOR_COMPACT_PATH', '../epic/epic.xml') kwargs['nev'] = int(os.environ.get('JUGGLER_N_EVENTS', 100)) kwargs['PbSci_sf'] = float(os.environ.get('ZDC_PbSCI_SAMP_FRAC', 1.0)) diff --git a/benchmarks/imaging_ecal/options/hybrid_cluster.py b/benchmarks/imaging_ecal/options/hybrid_cluster.py index 172efc1a0cc3971e4909eabeb985e4c7414252ee..982c0b62edf186aa7b839f9547fd54cbba9dbdd4 100644 --- a/benchmarks/imaging_ecal/options/hybrid_cluster.py +++ b/benchmarks/imaging_ecal/options/hybrid_cluster.py @@ -15,18 +15,14 @@ from Configurables import Jug__Reco__ImagingPixelReco as ImagingPixelReco from Configurables import Jug__Reco__ImagingTopoCluster as ImagingTopoCluster from Configurables import Jug__Reco__ImagingClusterReco as ImagingClusterReco -detector_name = str(os.environ.get("DETECTOR", "athena")) +detector_name = str(os.environ.get("DETECTOR", "epic")) detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) -detector_version = str(os.environ.get("DETECTOR_VERSION", "master")) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) # Detector features that affect reconstruction has_ecal_barrel_scfi = False -if 'athena' in detector_name: - has_ecal_barrel_scfi = True -if 'ecce' in detector_name and 'imaging' in detector_config: - has_ecal_barrel_scfi = True if 'epic' in detector_name and 'imaging' in detector_config: has_ecal_barrel_scfi = True diff --git a/benchmarks/imaging_ecal/options/imaging_2dcluster.py b/benchmarks/imaging_ecal/options/imaging_2dcluster.py index 17afb69bc58554c2375e60262272f26d25992f4c..36be9c322c61be696b23e3bb1e0228bbdb787930 100644 --- a/benchmarks/imaging_ecal/options/imaging_2dcluster.py +++ b/benchmarks/imaging_ecal/options/imaging_2dcluster.py @@ -22,9 +22,9 @@ kwargs = dict() kwargs['img_sf'] = float(calib_data['sampling_fraction_img']) # input arguments through environment variables -kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', '../topside/barrel_pion0_5GeV.edm4hep.root') +kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', 'barrel_pion0_5GeV.edm4hep.root') kwargs['output'] = os.environ.get('CB_EMCAL_REC_FILE', 'barrel_pion0_5GeV_cluster.root') -kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', '../topside/test.xml') +kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', 'epic/epic.xml') kwargs['nev'] = int(os.environ.get('CB_EMCAL_NUMEV', 100)) if kwargs['nev'] < 1: diff --git a/benchmarks/imaging_ecal/options/imaging_topocluster.py b/benchmarks/imaging_ecal/options/imaging_topocluster.py index bb60dcb2fc48b3eb47eec7a71f6c6da10c7a5f5b..50a2f6473e7e6222826b375e4c271d29367e307c 100644 --- a/benchmarks/imaging_ecal/options/imaging_topocluster.py +++ b/benchmarks/imaging_ecal/options/imaging_topocluster.py @@ -22,9 +22,9 @@ kwargs = dict() kwargs['sf'] = float(calib_data['sampling_fraction_img']) # input arguments through environment variables -kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', '../topside/barrel_pion0_5GeV.edm4hep.root') +kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', 'barrel_pion0_5GeV.edm4hep.root') kwargs['output'] = os.environ.get('CB_EMCAL_REC_FILE', 'barrel_pion0_5GeV_cluster.root') -kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', '../topside/test.xml') +kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', 'epic/epic.xml') kwargs['nev'] = int(os.environ.get('CB_EMCAL_NUMEV', 100)) if kwargs['nev'] < 1: diff --git a/benchmarks/imaging_ecal/options/scfi_cluster.py b/benchmarks/imaging_ecal/options/scfi_cluster.py index 80cfcd8a935375575e391698ee7cbf76d3af9aa8..b81e8ca441565b30fa16fd99d191179ea444eaa3 100644 --- a/benchmarks/imaging_ecal/options/scfi_cluster.py +++ b/benchmarks/imaging_ecal/options/scfi_cluster.py @@ -12,18 +12,14 @@ from Configurables import Jug__Reco__CalorimeterHitsMerger as CalHitsMerger from Configurables import Jug__Reco__CalorimeterIslandCluster as IslandCluster from Configurables import Jug__Reco__ClusterRecoCoG as RecoCoG -detector_name = str(os.environ.get("DETECTOR", "athena")) +detector_name = str(os.environ.get("DETECTOR", "epic")) detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) -detector_version = str(os.environ.get("DETECTOR_VERSION", "master")) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) detector_path = str(os.environ.get("DETECTOR_PATH", ".")) # Detector features that affect reconstruction has_ecal_barrel_scfi = False -if 'athena' in detector_name: - has_ecal_barrel_scfi = True -if 'ecce' in detector_name and 'imaging' in detector_config: - has_ecal_barrel_scfi = True if 'epic' in detector_name and 'imaging' in detector_config: has_ecal_barrel_scfi = True @@ -35,9 +31,9 @@ kwargs = dict() kwargs['sf'] = float(calib_data['sampling_fraction_scfi']) # input arguments through environment variables -kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', '../topside/barrel_pion0_5GeV.edm4hep.root') +kwargs['input'] = os.environ.get('CB_EMCAL_SIM_FILE', 'barrel_pion0_5GeV.edm4hep.root') kwargs['output'] = os.environ.get('CB_EMCAL_REC_FILE', 'barrel_pion0_5GeV_cluster.root') -kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', '../topside/test.xml') +kwargs['compact'] = os.environ.get('CB_EMCAL_COMPACT_PATH', 'epic/epic.xml') kwargs['nev'] = int(os.environ.get('CB_EMCAL_NUMEV', 100)) if kwargs['nev'] < 1: diff --git a/benchmarks/rich/options/rich_reco.py b/benchmarks/rich/options/rich_reco.py index f3cbb49539b36860e29f0b88c3b9301adb6aacde..f27f62a534302aa0f266e1d10f046e867ef7d283 100644 --- a/benchmarks/rich/options/rich_reco.py +++ b/benchmarks/rich/options/rich_reco.py @@ -3,18 +3,17 @@ from GaudiKernel import SystemOfUnits as units from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc -detector_name = "topside" -if "DETECTOR_CONFIG" in os.environ : - detector_name = str(os.environ["DETECTOR_CONFIG"]) -if "DETECTOR_PATH" in os.environ : - detector_name = str(os.environ["DETECTOR_PATH"])+"/"+detector_name +detector_path = str(os.environ.get("DETECTOR_PATH", ".")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) +detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) # todo add checks 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)]) +geo_service = GeoSvc("GeoSvc", detectors=["{}/{}.xml".format(detector_path, detector_name)]) podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=DEBUG) from Configurables import PodioInput diff --git a/benchmarks/track_finding/options/track_reconstruction.py b/benchmarks/track_finding/options/track_reconstruction.py index 5fa41b5baee98583d87464ebbd57d4ed8566ecf2..6be711ed4717f06505165a8f893ba780c69a919c 100644 --- a/benchmarks/track_finding/options/track_reconstruction.py +++ b/benchmarks/track_finding/options/track_reconstruction.py @@ -3,255 +3,237 @@ from Gaudi.Configuration import * from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc from GaudiKernel import SystemOfUnits as units -detector_name = "topside" -if "DETECTOR_CONFIG" in os.environ : - detector_name = str(os.environ["DETECTOR_CONFIG"]) - -detector_path = "" -if "DETECTOR_PATH" in os.environ : - detector_path = str(os.environ["DETECTOR_PATH"]) - -detector_version = 'default' -if "DETECTOR_VERSION" in os.environ: - env_version = str(os.environ["DETECTOR_VERSION"]) - if 'acadia' in env_version: - detector_version = 'acadia' +detector_path = str(os.environ.get("DETECTOR_PATH", ".")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) +detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) # todo add checks -input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) +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"]) ## note: old version of material map is called material-maps.XXX, new version is materials-map.XXX ## these names are somewhat inconsistent, and should probably all be renamed to 'material-map.XXX' ## FIXME -if detector_version == 'acadia': - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="config/material-maps.json", - OutputLevel=WARNING) -else: - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="calibrations/materials-map.cbor", - OutputLevel=WARNING) -podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) +geo_service = GeoSvc( + "GeoSvc", + detectors=["{}/{}.xml".format(detector_path, detector_name)], + materials="calibrations/materials-map.cbor", + OutputLevel=WARNING, +) +podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) from Configurables import PodioInput from Configurables import Jug__Digi__SimTrackerHitsCollector as SimTrackerHitsCollector from Configurables import Jug__Digi__SiliconTrackerDigi as TrackerDigi -from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction +from Configurables import ( + Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction, +) from Configurables import Jug__Reco__TrackingHitsCollector2 as TrackingHitsCollector from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker from Configurables import Jug__Reco__TrackParamTruthInit as TrackParamTruthInit from Configurables import Jug__Reco__TrackParamClusterInit as TrackParamClusterInit -from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit - -from Configurables import Jug__Reco__ConformalXYPeakProtoTracks as ConformalXYPeakProtoTracks -from Configurables import Jug__Reco__TrackFindingAlgorithm as TrackFindingAlgorithm +from Configurables import ( + Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit, +) + +from Configurables import ( + Jug__Reco__ConformalXYPeakProtoTracks as ConformalXYPeakProtoTracks, +) +from Configurables import Jug__Reco__CKFTracking as CKFTracking from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit from Configurables import Jug__Reco__SimpleClustering as SimpleClustering -algorithms = [ ] +algorithms = [] tracker_endcap_collections = [ - 'TrackerEndcapHits1', - 'TrackerEndcapHits2', - 'TrackerEndcapHits3', - 'TrackerEndcapHits4', - 'TrackerEndcapHits5', - 'TrackerEndcapHits6' + "InnerTrackerEndcapPHits", + "InnerTrackerEndcapNHits", + "MiddleTrackerEndcapPHits", + "MiddleTrackerEndcapNHits", + "OuterTrackerEndcapPHits", + "OuterTrackerEndcapNHits", ] tracker_barrel_collections = [ - 'TrackerBarrelHits' + "SagittaSiBarrelHits", + "OuterSiBarrelHits", ] vertex_barrel_collections = [ - 'VertexBarrelHits' -] -gem_endcap_collections = [ - 'GEMTrackerEndcapHits1', - 'GEMTrackerEndcapHits2', - 'GEMTrackerEndcapHits3' -] -vertex_endcap_collections = [ - 'VertexEndcapHits' + "VertexBarrelHits", ] mpgd_barrel_collections = [ - 'MPGDTrackerBarrelHits1', - 'MPGDTrackerBarrelHits2' + "InnerMPGDBarrelHits", + "OuterMPGDBarrelHits", ] -input_collections = ['MCParticles'] + tracker_endcap_collections + tracker_barrel_collections + vertex_barrel_collections + gem_endcap_collections - -if 'acadia' in detector_version: - input_collections += vertex_endcap_collections -else: - input_collections += mpgd_barrel_collections - -podioinput = PodioInput("PodioReader", - collections=input_collections) -algorithms.append( podioinput ) - -trk_b_coll = SimTrackerHitsCollector("trk_b_coll", - inputSimTrackerHits = tracker_barrel_collections, - outputSimTrackerHits = "TrackerBarrelAllHits") -algorithms.append( trk_b_coll ) -trk_b_digi = TrackerDigi("trk_b_digi", - inputHitCollection = trk_b_coll.outputSimTrackerHits, - outputHitCollection = "TrackerBarrelRawHits", - timeResolution=8) -algorithms.append( trk_b_digi ) - -trk_ec_coll = SimTrackerHitsCollector("trk_ec_coll", - inputSimTrackerHits = tracker_endcap_collections, - outputSimTrackerHits = "TrackerEndcapAllHits") -algorithms.append( trk_ec_coll ) -trk_ec_digi = TrackerDigi("trk_ec_digi", - inputHitCollection = trk_ec_coll.outputSimTrackerHits, - outputHitCollection = "TrackerEndcapRawHits", - timeResolution=8) -algorithms.append( trk_ec_digi ) - -vtx_b_coll = SimTrackerHitsCollector("vtx_b_coll", - inputSimTrackerHits = vertex_barrel_collections, - outputSimTrackerHits = "VertexBarrelAllHits") -algorithms.append( vtx_b_coll ) -vtx_b_digi = TrackerDigi("vtx_b_digi", - inputHitCollection = vtx_b_coll.outputSimTrackerHits, - outputHitCollection = "VertexBarrelRawHits", - timeResolution=8) -algorithms.append( vtx_b_digi ) - -if 'acadia' in detector_version: - vtx_ec_coll = SimTrackerHitsCollector("vtx_ec_coll", - inputSimTrackerHits = vertex_endcap_collections, - outputSimTrackerHits = "VertexEndcapAllHits") - algorithms.append( vtx_ec_coll ) - vtx_ec_digi = TrackerDigi("vtx_ec_digi", - inputHitCollection = vtx_ec_coll.outputSimTrackerHits, - outputHitCollection = "VertexEndcapRawHits", - timeResolution=8) - algorithms.append( vtx_ec_digi ) -else: - mm_b_coll = SimTrackerHitsCollector("mm_b_coll", - inputSimTrackerHits = mpgd_barrel_collections, - outputSimTrackerHits = "MPGDTrackerBarrelAllHits") - algorithms.append( mm_b_coll ) - mm_b_digi = TrackerDigi("mm_b_digi", - inputHitCollection = mm_b_coll.outputSimTrackerHits, - outputHitCollection = "MPGDTrackerBarrelRawHits", - timeResolution=8) - algorithms.append( mm_b_digi ) - -gem_ec_coll = SimTrackerHitsCollector("gem_ec_coll", - inputSimTrackerHits = gem_endcap_collections, - outputSimTrackerHits = "GEMTrackerEndcapAllHits") -algorithms.append( gem_ec_coll ) -gem_ec_digi = TrackerDigi("gem_ec_digi", - inputHitCollection = gem_ec_coll.outputSimTrackerHits, - outputHitCollection = "GEMTrackerEndcapRawHits", - timeResolution=10) -algorithms.append( gem_ec_digi ) +input_collections = ( + ["MCParticles"] + + tracker_endcap_collections + + tracker_barrel_collections + + vertex_barrel_collections + + mpgd_barrel_collections +) + +podioinput = PodioInput("PodioReader", collections=input_collections) +algorithms.append(podioinput) + +trk_b_coll = SimTrackerHitsCollector( + "trk_b_coll", + inputSimTrackerHits=tracker_barrel_collections, + outputSimTrackerHits="TrackerBarrelAllHits", +) +algorithms.append(trk_b_coll) +trk_b_digi = TrackerDigi( + "trk_b_digi", + inputHitCollection=trk_b_coll.outputSimTrackerHits, + outputHitCollection="TrackerBarrelRawHits", + timeResolution=8, +) +algorithms.append(trk_b_digi) + +trk_ec_coll = SimTrackerHitsCollector( + "trk_ec_coll", + inputSimTrackerHits=tracker_endcap_collections, + outputSimTrackerHits="TrackerEndcapAllHits", +) +algorithms.append(trk_ec_coll) +trk_ec_digi = TrackerDigi( + "trk_ec_digi", + inputHitCollection=trk_ec_coll.outputSimTrackerHits, + outputHitCollection="TrackerEndcapRawHits", + timeResolution=8, +) +algorithms.append(trk_ec_digi) + +vtx_b_coll = SimTrackerHitsCollector( + "vtx_b_coll", + inputSimTrackerHits=vertex_barrel_collections, + outputSimTrackerHits="VertexBarrelAllHits", +) +algorithms.append(vtx_b_coll) +vtx_b_digi = TrackerDigi( + "vtx_b_digi", + inputHitCollection=vtx_b_coll.outputSimTrackerHits, + outputHitCollection="VertexBarrelRawHits", + timeResolution=8, +) +algorithms.append(vtx_b_digi) + +mpgd_b_coll = SimTrackerHitsCollector( + "mpgd_b_coll", + inputSimTrackerHits=mpgd_barrel_collections, + outputSimTrackerHits="MPGDTrackerBarrelAllHits", +) +algorithms.append(mpgd_b_coll) +mpgd_b_digi = TrackerDigi( + "mpgd_b_digi", + inputHitCollection=mpgd_b_coll.outputSimTrackerHits, + outputHitCollection="MPGDTrackerBarrelRawHits", + timeResolution=10, +) +algorithms.append(mpgd_b_digi) # Tracker and vertex reconstruction -trk_b_reco = TrackerHitReconstruction("trk_b_reco", - inputHitCollection = trk_b_digi.outputHitCollection, - outputHitCollection="TrackerBarrelRecHits") -algorithms.append( trk_b_reco ) - -trk_ec_reco = TrackerHitReconstruction("trk_ec_reco", - inputHitCollection = trk_ec_digi.outputHitCollection, - outputHitCollection="TrackerEndcapRecHits") -algorithms.append( trk_ec_reco ) - -vtx_b_reco = TrackerHitReconstruction("vtx_b_reco", - inputHitCollection = vtx_b_digi.outputHitCollection, - outputHitCollection="VertexBarrelRecHits") -algorithms.append( vtx_b_reco ) - -if 'acadia' in detector_version: - vtx_ec_reco = TrackerHitReconstruction("vtx_ec_reco", - inputHitCollection = vtx_ec_digi.outputHitCollection, - outputHitCollection="VertexEndcapRecHits") - algorithms.append( vtx_ec_reco ) -else: - mm_b_reco = TrackerHitReconstruction("mm_b_reco", - inputHitCollection = mm_b_digi.outputHitCollection, - outputHitCollection="MPGDTrackerBarrelRecHits") - algorithms.append( mm_b_reco ) - - -gem_ec_reco = TrackerHitReconstruction("gem_ec_reco", - inputHitCollection=gem_ec_digi.outputHitCollection, - outputHitCollection="GEMTrackerEndcapRecHits") -algorithms.append(gem_ec_reco) +trk_b_reco = TrackerHitReconstruction( + "trk_b_reco", + inputHitCollection=trk_b_digi.outputHitCollection, + outputHitCollection="TrackerBarrelRecHits", +) +algorithms.append(trk_b_reco) + +trk_ec_reco = TrackerHitReconstruction( + "trk_ec_reco", + inputHitCollection=trk_ec_digi.outputHitCollection, + outputHitCollection="TrackerEndcapRecHits", +) +algorithms.append(trk_ec_reco) + +vtx_b_reco = TrackerHitReconstruction( + "vtx_b_reco", + inputHitCollection=vtx_b_digi.outputHitCollection, + outputHitCollection="VertexBarrelRecHits", +) +algorithms.append(vtx_b_reco) + +mpgd_b_reco = TrackerHitReconstruction( + "mpgd_b_reco", + inputHitCollection=mpgd_b_digi.outputHitCollection, + outputHitCollection="MPGDTrackerBarrelRecHits", +) +algorithms.append(mpgd_b_reco) input_tracking_hits = [ str(trk_b_reco.outputHitCollection), str(trk_ec_reco.outputHitCollection), str(vtx_b_reco.outputHitCollection), - str(gem_ec_reco.outputHitCollection) ] -if 'acadia' in detector_version: - input_tracking_hits.append(str(vtx_ec_reco.outputHitCollection)) -else: - input_tracking_hits.append(str(mm_b_reco.outputHitCollection)) - -trk_hit_col = TrackingHitsCollector("trk_hit_col", - inputTrackingHits=input_tracking_hits, - trackingHits="trackingHits", - OutputLevel=DEBUG) -algorithms.append( trk_hit_col ) + str(mpgd_b_reco.outputHitCollection), +] + +trk_hit_col = TrackingHitsCollector( + "trk_hit_col", + inputTrackingHits=input_tracking_hits, + trackingHits="trackingHits", +) +algorithms.append(trk_hit_col) # track finding -conformal_find = ConformalXYPeakProtoTracks("conformal_find", - inputTrackerHits=trk_hit_col.trackingHits, - outputProtoTracks="outputProtoTracks", - nProtoTracks="nProtoTracks", - nPhiBins=90, - OutputLevel=DEBUG) -algorithms.append( conformal_find ) - -# Hit Source linker -sourcelinker = TrackerSourceLinker("sourcelinker", - inputHitCollection=trk_hit_col.trackingHits, - outputSourceLinks="TrackSourceLinks", - outputMeasurements="TrackMeasurements") -algorithms.append( sourcelinker ) +conformal_find = ConformalXYPeakProtoTracks( + "conformal_find", + inputTrackerHits=trk_hit_col.trackingHits, + outputProtoTracks="outputProtoTracks", + nProtoTracks="nProtoTracks", + nPhiBins=90, + OutputLevel=DEBUG, +) +algorithms.append(conformal_find) + +# Hit Source linker +sourcelinker = TrackerSourceLinker( + "sourcelinker", + inputHitCollection=trk_hit_col.trackingHits, + outputSourceLinks="TrackSourceLinks", + outputMeasurements="TrackMeasurements", +) +algorithms.append(sourcelinker) ## Track param init -truth_trk_init = TrackParamTruthInit("truth_trk_init", - inputMCParticles="MCParticles", - outputInitialTrackParameters="InitTrackParams") - #OutputLevel=DEBUG) -algorithms.append( truth_trk_init ) +truth_trk_init = TrackParamTruthInit( + "truth_trk_init", + inputMCParticles="MCParticles", + outputInitialTrackParameters="InitTrackParams", +) +algorithms.append(truth_trk_init) # Tracking algorithms -trk_find_alg = TrackFindingAlgorithm("trk_find_alg", - inputSourceLinks = sourcelinker.outputSourceLinks, - inputMeasurements = sourcelinker.outputMeasurements, - inputInitialTrackParameters= "InitTrackParams",#"InitTrackParamsFromClusters", - outputTrajectories="trajectories") - #OutputLevel=DEBUG) -algorithms.append( trk_find_alg ) - -parts_from_fit = ParticlesFromTrackFit("parts_from_fit", - inputTrajectories="trajectories", - outputParticles="ReconstructedParticles", - outputTrackParameters="outputTrackParameters") - #OutputLevel=DEBUG) -algorithms.append( parts_from_fit ) - -#types = [] +trk_find_alg = CKFTracking( + "trk_find_alg", + inputSourceLinks=sourcelinker.outputSourceLinks, + inputMeasurements=sourcelinker.outputMeasurements, + inputInitialTrackParameters="InitTrackParams", + outputTrajectories="trajectories", +) +algorithms.append(trk_find_alg) + +parts_from_fit = ParticlesFromTrackFit( + "parts_from_fit", + inputTrajectories="trajectories", + outputParticles="ReconstructedParticles", + outputTrackParameters="outputTrackParameters", +) +algorithms.append(parts_from_fit) + +# types = [] ## this printout is useful to check that the type information is passed to python correctly -#print("---------------------------------------\n") -#print("---\n# List of input and output types by class") -#for configurable in sorted([ PodioInput, EICDataSvc, PodioOutput, -# TrackerHitReconstruction,ExampleCaloDigi, +# print("---------------------------------------\n") +# print("---\n# List of input and output types by class") +# for configurable in sorted([ PodioInput, EICDataSvc, PodioOutput, +# TrackerHitReconstruction,ExampleCaloDigi, # UFSDTrackerDigi, TrackerSourceLinker, # PodioOutput], # key=lambda c: c.getType()): @@ -262,24 +244,24 @@ algorithms.append( parts_from_fit ) # if isinstance(prop, DataHandleBase): # types.append(prop.type()) # print(" {}: \"{}\"".format(propname, prop.type())) -#print("---") +# print("---") out = PodioOutput("out", filename=output_rec_file) -out.outputCommands = ["keep *", - "drop BarrelTrackSourceLinks", - "drop InitTrackParams", - "drop trajectories", - "drop outputSourceLinks", - "drop outputInitialTrackParameters", - "keep MCParticles" - ] +out.outputCommands = [ + "keep *", + "drop BarrelTrackSourceLinks", + "drop InitTrackParams", + "drop trajectories", + "drop outputSourceLinks", + "drop outputInitialTrackParameters", + "keep MCParticles", +] algorithms.append(out) ApplicationMgr( - TopAlg = algorithms, - EvtSel = 'NONE', - EvtMax = n_events, - ExtSvc = [podioevent,geo_service], - OutputLevel=WARNING - ) - + TopAlg=algorithms, + EvtSel="NONE", + EvtMax=n_events, + ExtSvc=[podioevent, geo_service], + OutputLevel=WARNING, +) diff --git a/benchmarks/track_fitting/options/track_reconstruction.py b/benchmarks/track_fitting/options/track_reconstruction.py index c1f949ebb341191d59c2f6da15e78e5155a07684..fb357fc9def940779700bc197253126ae3378f17 100644 --- a/benchmarks/track_fitting/options/track_reconstruction.py +++ b/benchmarks/track_fitting/options/track_reconstruction.py @@ -3,246 +3,223 @@ from Gaudi.Configuration import * from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc from GaudiKernel import SystemOfUnits as units -detector_name = "athena" -if "DETECTOR_CONFIG" in os.environ : - detector_name = str(os.environ["DETECTOR_CONFIG"]) - -detector_path = "" -if "DETECTOR_PATH" in os.environ : - detector_path = str(os.environ["DETECTOR_PATH"]) - -detector_version = 'default' -if "DETECTOR_VERSION" in os.environ: - env_version = str(os.environ["DETECTOR_VERSION"]) - if 'acadia' in env_version: - detector_version = 'acadia' +detector_path = str(os.environ.get("DETECTOR_PATH", ".")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) +detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) # todo add checks -input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) +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"]) ## note: old version of material map is called material-maps.XXX, new version is materials-map.XXX ## these names are somewhat inconsistent, and should probably all be renamed to 'material-map.XXX' ## FIXME -if detector_version == 'acadia': - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="config/material-maps.json", - OutputLevel=WARNING) -else: - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="calibrations/materials-map.cbor", - OutputLevel=WARNING) -podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) +geo_service = GeoSvc( + "GeoSvc", + detectors=["{}/{}.xml".format(detector_path, detector_name)], + materials="calibrations/materials-map.cbor", + OutputLevel=WARNING, +) +podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) from Configurables import PodioInput from Configurables import Jug__Digi__SimTrackerHitsCollector as SimTrackerHitsCollector from Configurables import Jug__Digi__SiliconTrackerDigi as TrackerDigi -from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction +from Configurables import ( + Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction, +) from Configurables import Jug__Reco__TrackingHitsCollector2 as TrackingHitsCollector from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker from Configurables import Jug__Reco__TrackParamTruthInit as TrackParamTruthInit from Configurables import Jug__Reco__TrackParamClusterInit as TrackParamClusterInit -from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit +from Configurables import ( + Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit, +) -from Configurables import Jug__Reco__TrackFindingAlgorithm as TrackFindingAlgorithm +from Configurables import Jug__Reco__CKFTracking as CKFTracking from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit from Configurables import Jug__Reco__SimpleClustering as SimpleClustering -algorithms = [ ] +algorithms = [] tracker_endcap_collections = [ - 'TrackerEndcapHits1', - 'TrackerEndcapHits2', - 'TrackerEndcapHits3', - 'TrackerEndcapHits4', - 'TrackerEndcapHits5', - 'TrackerEndcapHits6' + "InnerTrackerEndcapPHits", + "InnerTrackerEndcapNHits", + "MiddleTrackerEndcapPHits", + "MiddleTrackerEndcapNHits", + "OuterTrackerEndcapPHits", + "OuterTrackerEndcapNHits", ] tracker_barrel_collections = [ - 'TrackerBarrelHits' + "SagittaSiBarrelHits", + "OuterSiBarrelHits", ] vertex_barrel_collections = [ - 'VertexBarrelHits' -] -gem_endcap_collections = [ - 'GEMTrackerEndcapHits1', - 'GEMTrackerEndcapHits2', - 'GEMTrackerEndcapHits3' -] -vertex_endcap_collections = [ - 'VertexEndcapHits' + "VertexBarrelHits", ] mpgd_barrel_collections = [ - 'MPGDTrackerBarrelHits1', - 'MPGDTrackerBarrelHits2' + "InnerMPGDBarrelHits", + "OuterMPGDBarrelHits", ] -input_collections = ['MCParticles'] + tracker_endcap_collections + tracker_barrel_collections + vertex_barrel_collections + gem_endcap_collections - -if 'acadia' in detector_version: - input_collections += vertex_endcap_collections -else: - input_collections += mpgd_barrel_collections - -podioinput = PodioInput("PodioReader", - collections=input_collections) -algorithms.append( podioinput ) - -trk_b_coll = SimTrackerHitsCollector("trk_b_coll", - inputSimTrackerHits = tracker_barrel_collections, - outputSimTrackerHits = "TrackerBarrelAllHits") -algorithms.append( trk_b_coll ) -trk_b_digi = TrackerDigi("trk_b_digi", - inputHitCollection = trk_b_coll.outputSimTrackerHits, - outputHitCollection = "TrackerBarrelRawHits", - timeResolution=8) -algorithms.append( trk_b_digi ) - -trk_ec_coll = SimTrackerHitsCollector("trk_ec_coll", - inputSimTrackerHits = tracker_endcap_collections, - outputSimTrackerHits = "TrackerEndcapAllHits") -algorithms.append( trk_ec_coll ) -trk_ec_digi = TrackerDigi("trk_ec_digi", - inputHitCollection = trk_ec_coll.outputSimTrackerHits, - outputHitCollection = "TrackerEndcapRawHits", - timeResolution=8) -algorithms.append( trk_ec_digi ) - -vtx_b_coll = SimTrackerHitsCollector("vtx_b_coll", - inputSimTrackerHits = vertex_barrel_collections, - outputSimTrackerHits = "VertexBarrelAllHits") -algorithms.append( vtx_b_coll ) -vtx_b_digi = TrackerDigi("vtx_b_digi", - inputHitCollection = vtx_b_coll.outputSimTrackerHits, - outputHitCollection = "VertexBarrelRawHits", - timeResolution=8) -algorithms.append( vtx_b_digi ) - -if 'acadia' in detector_version: - vtx_ec_coll = SimTrackerHitsCollector("vtx_ec_coll", - inputSimTrackerHits = vertex_endcap_collections, - outputSimTrackerHits = "VertexEndcapAllHits") - algorithms.append( vtx_ec_coll ) - vtx_ec_digi = TrackerDigi("vtx_ec_digi", - inputHitCollection = vtx_ec_coll.outputSimTrackerHits, - outputHitCollection = "VertexEndcapRawHits", - timeResolution=8) - algorithms.append( vtx_ec_digi ) -else: - mm_b_coll = SimTrackerHitsCollector("mm_b_coll", - inputSimTrackerHits = mpgd_barrel_collections, - outputSimTrackerHits = "MPGDTrackerBarrelAllHits") - algorithms.append( mm_b_coll ) - mm_b_digi = TrackerDigi("mm_b_digi", - inputHitCollection = mm_b_coll.outputSimTrackerHits, - outputHitCollection = "MPGDTrackerBarrelRawHits", - timeResolution=8) - algorithms.append( mm_b_digi ) - -gem_ec_coll = SimTrackerHitsCollector("gem_ec_coll", - inputSimTrackerHits = gem_endcap_collections, - outputSimTrackerHits = "GEMTrackerEndcapAllHits") -algorithms.append( gem_ec_coll ) -gem_ec_digi = TrackerDigi("gem_ec_digi", - inputHitCollection = gem_ec_coll.outputSimTrackerHits, - outputHitCollection = "GEMTrackerEndcapRawHits", - timeResolution=10) -algorithms.append( gem_ec_digi ) +input_collections = ( + ["MCParticles"] + + tracker_endcap_collections + + tracker_barrel_collections + + vertex_barrel_collections + + mpgd_barrel_collections +) + +podioinput = PodioInput("PodioReader", collections=input_collections) +algorithms.append(podioinput) + +trk_b_coll = SimTrackerHitsCollector( + "trk_b_coll", + inputSimTrackerHits=tracker_barrel_collections, + outputSimTrackerHits="TrackerBarrelAllHits", +) +algorithms.append(trk_b_coll) +trk_b_digi = TrackerDigi( + "trk_b_digi", + inputHitCollection=trk_b_coll.outputSimTrackerHits, + outputHitCollection="TrackerBarrelRawHits", + timeResolution=8, +) +algorithms.append(trk_b_digi) + +trk_ec_coll = SimTrackerHitsCollector( + "trk_ec_coll", + inputSimTrackerHits=tracker_endcap_collections, + outputSimTrackerHits="TrackerEndcapAllHits", +) +algorithms.append(trk_ec_coll) +trk_ec_digi = TrackerDigi( + "trk_ec_digi", + inputHitCollection=trk_ec_coll.outputSimTrackerHits, + outputHitCollection="TrackerEndcapRawHits", + timeResolution=8, +) +algorithms.append(trk_ec_digi) + +vtx_b_coll = SimTrackerHitsCollector( + "vtx_b_coll", + inputSimTrackerHits=vertex_barrel_collections, + outputSimTrackerHits="VertexBarrelAllHits", +) +algorithms.append(vtx_b_coll) +vtx_b_digi = TrackerDigi( + "vtx_b_digi", + inputHitCollection=vtx_b_coll.outputSimTrackerHits, + outputHitCollection="VertexBarrelRawHits", + timeResolution=8, +) +algorithms.append(vtx_b_digi) + +mpgd_b_coll = SimTrackerHitsCollector( + "mpgd_b_coll", + inputSimTrackerHits=mpgd_barrel_collections, + outputSimTrackerHits="MPGDTrackerBarrelAllHits", +) +algorithms.append(mpgd_b_coll) +mpgd_b_digi = TrackerDigi( + "mpgd_b_digi", + inputHitCollection=mpgd_b_coll.outputSimTrackerHits, + outputHitCollection="MPGDTrackerBarrelRawHits", + timeResolution=8, +) +algorithms.append(mpgd_b_digi) # Tracker and vertex reconstruction -trk_b_reco = TrackerHitReconstruction("trk_b_reco", - inputHitCollection = trk_b_digi.outputHitCollection, - outputHitCollection="TrackerBarrelRecHits") -algorithms.append( trk_b_reco ) - -trk_ec_reco = TrackerHitReconstruction("trk_ec_reco", - inputHitCollection = trk_ec_digi.outputHitCollection, - outputHitCollection="TrackerEndcapRecHits") -algorithms.append( trk_ec_reco ) - -vtx_b_reco = TrackerHitReconstruction("vtx_b_reco", - inputHitCollection = vtx_b_digi.outputHitCollection, - outputHitCollection="VertexBarrelRecHits") -algorithms.append( vtx_b_reco ) - -if 'acadia' in detector_version: - vtx_ec_reco = TrackerHitReconstruction("vtx_ec_reco", - inputHitCollection = vtx_ec_digi.outputHitCollection, - outputHitCollection="VertexEndcapRecHits") - algorithms.append( vtx_ec_reco ) -else: - mm_b_reco = TrackerHitReconstruction("mm_b_reco", - inputHitCollection = mm_b_digi.outputHitCollection, - outputHitCollection="MPGDTrackerBarrelRecHits") - algorithms.append( mm_b_reco ) - -gem_ec_reco = TrackerHitReconstruction("gem_ec_reco", - inputHitCollection=gem_ec_digi.outputHitCollection, - outputHitCollection="GEMTrackerEndcapRecHits") -algorithms.append(gem_ec_reco) +trk_b_reco = TrackerHitReconstruction( + "trk_b_reco", + inputHitCollection=trk_b_digi.outputHitCollection, + outputHitCollection="TrackerBarrelRecHits", +) +algorithms.append(trk_b_reco) + +trk_ec_reco = TrackerHitReconstruction( + "trk_ec_reco", + inputHitCollection=trk_ec_digi.outputHitCollection, + outputHitCollection="TrackerEndcapRecHits", +) +algorithms.append(trk_ec_reco) + +vtx_b_reco = TrackerHitReconstruction( + "vtx_b_reco", + inputHitCollection=vtx_b_digi.outputHitCollection, + outputHitCollection="VertexBarrelRecHits", +) +algorithms.append(vtx_b_reco) + +mpgd_b_reco = TrackerHitReconstruction( + "mpgd_b_reco", + inputHitCollection=mpgd_b_digi.outputHitCollection, + outputHitCollection="MPGDTrackerBarrelRecHits", +) +algorithms.append(mpgd_b_reco) input_tracking_hits = [ str(trk_b_reco.outputHitCollection), str(trk_ec_reco.outputHitCollection), str(vtx_b_reco.outputHitCollection), - str(gem_ec_reco.outputHitCollection) ] -if 'acadia' in detector_version: - input_tracking_hits.append(str(vtx_ec_reco.outputHitCollection)) -else: - input_tracking_hits.append(str(mm_b_reco.outputHitCollection)) - -trk_hit_col = TrackingHitsCollector("trk_hit_col", - inputTrackingHits=input_tracking_hits, - trackingHits="trackingHits", - OutputLevel=DEBUG) -algorithms.append( trk_hit_col ) - -# Hit Source linker -sourcelinker = TrackerSourceLinker("sourcelinker", - inputHitCollection=trk_hit_col.trackingHits, - outputSourceLinks="TrackSourceLinks", - outputMeasurements="TrackMeasurements", - OutputLevel=DEBUG) -algorithms.append( sourcelinker ) + str(mpgd_b_reco.outputHitCollection), +] + +trk_hit_col = TrackingHitsCollector( + "trk_hit_col", + inputTrackingHits=input_tracking_hits, + trackingHits="trackingHits", +) +algorithms.append(trk_hit_col) + +# Hit Source linker +sourcelinker = TrackerSourceLinker( + "sourcelinker", + inputHitCollection=trk_hit_col.trackingHits, + outputSourceLinks="TrackSourceLinks", + outputMeasurements="TrackMeasurements", +) +algorithms.append(sourcelinker) ## Track param init -truth_trk_init = TrackParamTruthInit("truth_trk_init", - inputMCParticles="MCParticles", - outputInitialTrackParameters="InitTrackParams", - OutputLevel=DEBUG) - #OutputLevel=DEBUG) -algorithms.append( truth_trk_init ) +truth_trk_init = TrackParamTruthInit( + "truth_trk_init", + inputMCParticles="MCParticles", + outputInitialTrackParameters="InitTrackParams", +) +algorithms.append(truth_trk_init) # Tracking algorithms -trk_find_alg = TrackFindingAlgorithm("trk_find_alg", - inputSourceLinks = sourcelinker.outputSourceLinks, - inputMeasurements = sourcelinker.outputMeasurements, - inputInitialTrackParameters= "InitTrackParams",#"InitTrackParamsFromClusters", - outputTrajectories="trajectories", - OutputLevel=DEBUG) -algorithms.append( trk_find_alg ) - -parts_from_fit = ParticlesFromTrackFit("parts_from_fit", - inputTrajectories="trajectories", - outputParticles="ReconstructedParticles", - outputTrackParameters="outputTrackParameters") - #OutputLevel=DEBUG) -algorithms.append( parts_from_fit ) - -#types = [] +trk_find_alg = CKFTracking( + "trk_find_alg", + inputSourceLinks=sourcelinker.outputSourceLinks, + inputMeasurements=sourcelinker.outputMeasurements, + inputInitialTrackParameters="InitTrackParams", + outputTrajectories="trajectories", +) +algorithms.append(trk_find_alg) + +parts_from_fit = ParticlesFromTrackFit( + "parts_from_fit", + inputTrajectories="trajectories", + outputParticles="ReconstructedParticles", + outputTrackParameters="outputTrackParameters", +) +algorithms.append(parts_from_fit) + +# types = [] ## this printout is useful to check that the type information is passed to python correctly -#print("---------------------------------------\n") -#print("---\n# List of input and output types by class") -#for configurable in sorted([ PodioInput, EICDataSvc, PodioOutput, -# TrackerHitReconstruction,ExampleCaloDigi, +# print("---------------------------------------\n") +# print("---\n# List of input and output types by class") +# for configurable in sorted([ PodioInput, EICDataSvc, PodioOutput, +# TrackerHitReconstruction,ExampleCaloDigi, # UFSDTrackerDigi, TrackerSourceLinker, # PodioOutput], # key=lambda c: c.getType()): @@ -253,24 +230,24 @@ algorithms.append( parts_from_fit ) # if isinstance(prop, DataHandleBase): # types.append(prop.type()) # print(" {}: \"{}\"".format(propname, prop.type())) -#print("---") +# print("---") out = PodioOutput("out", filename=output_rec_file) -out.outputCommands = ["keep *", - "drop BarrelTrackSourceLinks", - "drop InitTrackParams", - "drop trajectories", - "drop outputSourceLinks", - "drop outputInitialTrackParameters", - "keep MCParticles" - ] +out.outputCommands = [ + "keep *", + "drop BarrelTrackSourceLinks", + "drop InitTrackParams", + "drop trajectories", + "drop outputSourceLinks", + "drop outputInitialTrackParameters", + "keep MCParticles", +] algorithms.append(out) ApplicationMgr( - TopAlg = algorithms, - EvtSel = 'NONE', - EvtMax = n_events, - ExtSvc = [podioevent,geo_service], - OutputLevel=WARNING - ) - + TopAlg=algorithms, + EvtSel="NONE", + EvtMax=n_events, + ExtSvc=[podioevent, geo_service], + OutputLevel=WARNING, +) diff --git a/benchmarks/tracking/options/track_reconstruction.py b/benchmarks/tracking/options/track_reconstruction.py index 5c106b5013f1ac2fe5814786bce48ed6813282bb..e09e3f57794c4c8445404ec8c87c096a55b6d4bd 100644 --- a/benchmarks/tracking/options/track_reconstruction.py +++ b/benchmarks/tracking/options/track_reconstruction.py @@ -3,257 +3,242 @@ from Gaudi.Configuration import * from Configurables import ApplicationMgr, EICDataSvc, PodioOutput, GeoSvc from GaudiKernel import SystemOfUnits as units -detector_name = "topside" -if "DETECTOR_CONFIG" in os.environ : - detector_name = str(os.environ["DETECTOR_CONFIG"]) - -detector_path = "" -if "DETECTOR_PATH" in os.environ : - detector_path = str(os.environ["DETECTOR_PATH"]) - -detector_version = 'default' -if "DETECTOR_VERSION" in os.environ: - env_version = str(os.environ["DETECTOR_VERSION"]) - if 'acadia' in env_version: - detector_version = 'acadia' +detector_path = str(os.environ.get("DETECTOR_PATH", ".")) +detector_name = str(os.environ.get("DETECTOR_CONFIG", "epic")) +detector_config = str(os.environ.get("DETECTOR_CONFIG", detector_name)) +detector_version = str(os.environ.get("DETECTOR_VERSION", "main")) # todo add checks -input_sim_file = str(os.environ["JUGGLER_SIM_FILE"]) +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"]) ## note: old version of material map is called material-maps.XXX, new version is materials-map.XXX -## these names are somewhat inconsistent, and should probably all be renamed to 'material-map.XXX' +## these names are somewhat inconsistent, and should probably all be renamed to 'material-map.XXX' ## FIXME -if detector_version == 'acadia': - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="config/material-maps.json", - OutputLevel=WARNING) -else: - geo_service = GeoSvc("GeoSvc", - detectors=["{}/{}.xml".format(detector_path,detector_name)], - materials="calibrations/materials-map.cbor", - OutputLevel=WARNING) -podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) +geo_service = GeoSvc( + "GeoSvc", + detectors=["{}/{}.xml".format(detector_path, detector_name)], + materials="calibrations/materials-map.cbor", + OutputLevel=WARNING, +) +podioevent = EICDataSvc("EventDataSvc", inputs=[input_sim_file], OutputLevel=WARNING) from Configurables import PodioInput from Configurables import Jug__Digi__SimTrackerHitsCollector as SimTrackerHitsCollector from Configurables import Jug__Digi__SiliconTrackerDigi as TrackerDigi -from Configurables import Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction +from Configurables import ( + Jug__Reco__TrackerHitReconstruction as TrackerHitReconstruction, +) from Configurables import Jug__Reco__TrackingHitsCollector2 as TrackingHitsCollector from Configurables import Jug__Reco__TrackerSourceLinker as TrackerSourceLinker from Configurables import Jug__Reco__TrackParamTruthInit as TrackParamTruthInit from Configurables import Jug__Reco__TrackParamClusterInit as TrackParamClusterInit -from Configurables import Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit +from Configurables import ( + Jug__Reco__TrackParamVertexClusterInit as TrackParamVertexClusterInit, +) -from Configurables import Jug__Reco__TrackFindingAlgorithm as TrackFindingAlgorithm +from Configurables import Jug__Reco__CKFTracking as CKFTracking from Configurables import Jug__Reco__ParticlesFromTrackFit as ParticlesFromTrackFit from Configurables import Jug__Reco__TrackProjector as TrackProjector from Configurables import Jug__Reco__SimpleClustering as SimpleClustering -algorithms = [ ] +algorithms = [] tracker_endcap_collections = [ - 'TrackerEndcapHits1', - 'TrackerEndcapHits2', - 'TrackerEndcapHits3', - 'TrackerEndcapHits4', - 'TrackerEndcapHits5', - 'TrackerEndcapHits6' + "InnerTrackerEndcapPHits", + "InnerTrackerEndcapNHits", + "MiddleTrackerEndcapPHits", + "MiddleTrackerEndcapNHits", + "OuterTrackerEndcapPHits", + "OuterTrackerEndcapNHits", ] tracker_barrel_collections = [ - 'TrackerBarrelHits' + "SagittaSiBarrelHits", + "OuterSiBarrelHits", ] vertex_barrel_collections = [ - 'VertexBarrelHits' -] -gem_endcap_collections = [ - 'GEMTrackerEndcapHits1', - 'GEMTrackerEndcapHits2', - 'GEMTrackerEndcapHits3' -] -vertex_endcap_collections = [ - 'VertexEndcapHits' + "VertexBarrelHits", ] mpgd_barrel_collections = [ - 'MPGDTrackerBarrelHits1', - 'MPGDTrackerBarrelHits2' + "InnerMPGDBarrelHits", + "OuterMPGDBarrelHits", ] -input_collections = ['MCParticles'] + tracker_endcap_collections + tracker_barrel_collections + vertex_barrel_collections + gem_endcap_collections - -if 'acadia' in detector_version: - input_collections += vertex_endcap_collections -else: - input_collections += mpgd_barrel_collections - -podioinput = PodioInput("PodioReader", - collections=input_collections) -algorithms.append( podioinput ) - -trk_b_coll = SimTrackerHitsCollector("trk_b_coll", - inputSimTrackerHits = tracker_barrel_collections, - outputSimTrackerHits = "TrackerBarrelAllHits") -algorithms.append( trk_b_coll ) -trk_b_digi = TrackerDigi("trk_b_digi", - inputHitCollection = trk_b_coll.outputSimTrackerHits, - outputHitCollection = "TrackerBarrelRawHits", - timeResolution=8) -algorithms.append( trk_b_digi ) - -trk_ec_coll = SimTrackerHitsCollector("trk_ec_coll", - inputSimTrackerHits = tracker_endcap_collections, - outputSimTrackerHits = "TrackerEndcapAllHits") -algorithms.append( trk_ec_coll ) -trk_ec_digi = TrackerDigi("trk_ec_digi", - inputHitCollection = trk_ec_coll.outputSimTrackerHits, - outputHitCollection = "TrackerEndcapRawHits", - timeResolution=8) -algorithms.append( trk_ec_digi ) - -vtx_b_coll = SimTrackerHitsCollector("vtx_b_coll", - inputSimTrackerHits = vertex_barrel_collections, - outputSimTrackerHits = "VertexBarrelAllHits") -algorithms.append( vtx_b_coll ) -vtx_b_digi = TrackerDigi("vtx_b_digi", - inputHitCollection = vtx_b_coll.outputSimTrackerHits, - outputHitCollection = "VertexBarrelRawHits", - timeResolution=8) -algorithms.append( vtx_b_digi ) - -if 'acadia' in detector_version: - vtx_ec_coll = SimTrackerHitsCollector("vtx_ec_coll", - inputSimTrackerHits = vertex_endcap_collections, - outputSimTrackerHits = "VertexEndcapAllHits") - algorithms.append( vtx_ec_coll ) - vtx_ec_digi = TrackerDigi("vtx_ec_digi", - inputHitCollection = vtx_ec_coll.outputSimTrackerHits, - outputHitCollection = "VertexEndcapRawHits", - timeResolution=8) - algorithms.append( vtx_ec_digi ) -else: - mm_b_coll = SimTrackerHitsCollector("mm_b_coll", - inputSimTrackerHits = mpgd_barrel_collections, - outputSimTrackerHits = "MPGDTrackerBarrelAllHits") - algorithms.append( mm_b_coll ) - mm_b_digi = TrackerDigi("mm_b_digi", - inputHitCollection = mm_b_coll.outputSimTrackerHits, - outputHitCollection = "MPGDTrackerBarrelRawHits", - timeResolution=8) - algorithms.append( mm_b_digi ) - -gem_ec_coll = SimTrackerHitsCollector("gem_ec_coll", - inputSimTrackerHits = gem_endcap_collections, - outputSimTrackerHits = "GEMTrackerEndcapAllHits") -algorithms.append( gem_ec_coll ) -gem_ec_digi = TrackerDigi("gem_ec_digi", - inputHitCollection = gem_ec_coll.outputSimTrackerHits, - outputHitCollection = "GEMTrackerEndcapRawHits", - timeResolution=10) -algorithms.append( gem_ec_digi ) +input_collections = ( + ["MCParticles"] + + tracker_endcap_collections + + tracker_barrel_collections + + vertex_barrel_collections + + mpgd_barrel_collections +) + +podioinput = PodioInput("PodioReader", collections=input_collections) +algorithms.append(podioinput) + +trk_b_coll = SimTrackerHitsCollector( + "trk_b_coll", + inputSimTrackerHits=tracker_barrel_collections, + outputSimTrackerHits="TrackerBarrelAllHits", +) +algorithms.append(trk_b_coll) +trk_b_digi = TrackerDigi( + "trk_b_digi", + inputHitCollection=trk_b_coll.outputSimTrackerHits, + outputHitCollection="TrackerBarrelRawHits", + timeResolution=8, +) +algorithms.append(trk_b_digi) + +trk_ec_coll = SimTrackerHitsCollector( + "trk_ec_coll", + inputSimTrackerHits=tracker_endcap_collections, + outputSimTrackerHits="TrackerEndcapAllHits", +) +algorithms.append(trk_ec_coll) +trk_ec_digi = TrackerDigi( + "trk_ec_digi", + inputHitCollection=trk_ec_coll.outputSimTrackerHits, + outputHitCollection="TrackerEndcapRawHits", + timeResolution=8, +) +algorithms.append(trk_ec_digi) + +vtx_b_coll = SimTrackerHitsCollector( + "vtx_b_coll", + inputSimTrackerHits=vertex_barrel_collections, + outputSimTrackerHits="VertexBarrelAllHits", +) +algorithms.append(vtx_b_coll) +vtx_b_digi = TrackerDigi( + "vtx_b_digi", + inputHitCollection=vtx_b_coll.outputSimTrackerHits, + outputHitCollection="VertexBarrelRawHits", + timeResolution=8, +) +algorithms.append(vtx_b_digi) + +mpgd_b_coll = SimTrackerHitsCollector( + "mpgd_b_coll", + inputSimTrackerHits=mpgd_barrel_collections, + outputSimTrackerHits="MPGDTrackerBarrelAllHits", +) +algorithms.append(mpgd_b_coll) +mpgd_b_digi = TrackerDigi( + "mpgd_b_digi", + inputHitCollection=mpgd_b_coll.outputSimTrackerHits, + outputHitCollection="MPGDTrackerBarrelRawHits", + timeResolution=10, +) +algorithms.append(mpgd_b_digi) # Tracker and vertex reconstruction -trk_b_reco = TrackerHitReconstruction("trk_b_reco", - inputHitCollection = trk_b_digi.outputHitCollection, - outputHitCollection="TrackerBarrelRecHits") -algorithms.append( trk_b_reco ) - -trk_ec_reco = TrackerHitReconstruction("trk_ec_reco", - inputHitCollection = trk_ec_digi.outputHitCollection, - outputHitCollection="TrackerEndcapRecHits") -algorithms.append( trk_ec_reco ) - -vtx_b_reco = TrackerHitReconstruction("vtx_b_reco", - inputHitCollection = vtx_b_digi.outputHitCollection, - outputHitCollection="VertexBarrelRecHits") -algorithms.append( vtx_b_reco ) - -if 'acadia' in detector_version: - vtx_ec_reco = TrackerHitReconstruction("vtx_ec_reco", - inputHitCollection = vtx_ec_digi.outputHitCollection, - outputHitCollection="VertexEndcapRecHits") - algorithms.append( vtx_ec_reco ) -else: - mm_b_reco = TrackerHitReconstruction("mm_b_reco", - inputHitCollection = mm_b_digi.outputHitCollection, - outputHitCollection="MPGDTrackerBarrelRecHits") - algorithms.append( mm_b_reco ) - -gem_ec_reco = TrackerHitReconstruction("gem_ec_reco", - inputHitCollection=gem_ec_digi.outputHitCollection, - outputHitCollection="GEMTrackerEndcapRecHits") -algorithms.append(gem_ec_reco) +trk_b_reco = TrackerHitReconstruction( + "trk_b_reco", + inputHitCollection=trk_b_digi.outputHitCollection, + outputHitCollection="TrackerBarrelRecHits", +) +algorithms.append(trk_b_reco) + +trk_ec_reco = TrackerHitReconstruction( + "trk_ec_reco", + inputHitCollection=trk_ec_digi.outputHitCollection, + outputHitCollection="TrackerEndcapRecHits", +) +algorithms.append(trk_ec_reco) + +vtx_b_reco = TrackerHitReconstruction( + "vtx_b_reco", + inputHitCollection=vtx_b_digi.outputHitCollection, + outputHitCollection="VertexBarrelRecHits", +) +algorithms.append(vtx_b_reco) + +mpgd_b_reco = TrackerHitReconstruction( + "mpgd_b_reco", + inputHitCollection=mpgd_b_digi.outputHitCollection, + outputHitCollection="MPGDTrackerBarrelRecHits", +) +algorithms.append(mpgd_b_reco) input_tracking_hits = [ str(trk_b_reco.outputHitCollection), str(trk_ec_reco.outputHitCollection), str(vtx_b_reco.outputHitCollection), - str(gem_ec_reco.outputHitCollection) ] -if 'acadia' in detector_version: - input_tracking_hits.append(str(vtx_ec_reco.outputHitCollection)) -else: - input_tracking_hits.append(str(mm_b_reco.outputHitCollection)) - -trk_hit_col = TrackingHitsCollector("trk_hit_col", - inputTrackingHits=input_tracking_hits, - trackingHits="trackingHits") -algorithms.append( trk_hit_col ) - -# Hit Source linker -sourcelinker = TrackerSourceLinker("sourcelinker", - inputHitCollection=trk_hit_col.trackingHits, - outputSourceLinks="TrackSourceLinks", - outputMeasurements="TrackMeasurements") -algorithms.append( sourcelinker ) + str(mpgd_b_reco.outputHitCollection), +] + +trk_hit_col = TrackingHitsCollector( + "trk_hit_col", + inputTrackingHits=input_tracking_hits, + trackingHits="trackingHits", +) +algorithms.append(trk_hit_col) + +# Hit Source linker +sourcelinker = TrackerSourceLinker( + "sourcelinker", + inputHitCollection=trk_hit_col.trackingHits, + outputSourceLinks="TrackSourceLinks", + outputMeasurements="TrackMeasurements", +) +algorithms.append(sourcelinker) ## Track param init -truth_trk_init = TrackParamTruthInit("truth_trk_init", - inputMCParticles="MCParticles", - outputInitialTrackParameters="InitTrackParams") -algorithms.append( truth_trk_init ) +truth_trk_init = TrackParamTruthInit( + "truth_trk_init", + inputMCParticles="MCParticles", + outputInitialTrackParameters="InitTrackParams", +) +algorithms.append(truth_trk_init) # Tracking algorithms -trk_find_alg = TrackFindingAlgorithm("trk_find_alg", - inputSourceLinks = sourcelinker.outputSourceLinks, - inputMeasurements = sourcelinker.outputMeasurements, - inputInitialTrackParameters = "InitTrackParams", - outputTrajectories = "trajectories") -algorithms.append( trk_find_alg ) - -parts_from_fit = ParticlesFromTrackFit("parts_from_fit", - inputTrajectories = "trajectories", - outputParticles = "ReconstructedParticles", - outputTrackParameters = "outputTrackParameters") -algorithms.append( parts_from_fit ) - -trk_proj_hcal_endcap_n = TrackProjector("trk_proj_hcal_endcap_n", - inputTrajectories = trk_find_alg.outputTrajectories, - outputTrackSegments = "HcalEndcapNTrackSegments", - firstSmallerThanZ = -200*units.cm, +trk_find_alg = CKFTracking( + "trk_find_alg", + inputSourceLinks=sourcelinker.outputSourceLinks, + inputMeasurements=sourcelinker.outputMeasurements, + inputInitialTrackParameters="InitTrackParams", + outputTrajectories="trajectories", +) +algorithms.append(trk_find_alg) + +parts_from_fit = ParticlesFromTrackFit( + "parts_from_fit", + inputTrajectories="trajectories", + outputParticles="ReconstructedParticles", + outputTrackParameters="outputTrackParameters", ) -algorithms.append( trk_proj_hcal_endcap_n ) +algorithms.append(parts_from_fit) + +trk_proj_hcal_endcap_n = TrackProjector( + "trk_proj_hcal_endcap_n", + inputTrajectories=trk_find_alg.outputTrajectories, + outputTrackSegments="HcalEndcapNTrackSegments", + firstSmallerThanZ=-200 * units.cm, +) +algorithms.append(trk_proj_hcal_endcap_n) out = PodioOutput("out", filename=output_rec_file) -out.outputCommands = ["keep *", - "drop BarrelTrackSourceLinks", - "drop InitTrackParams", - "drop trajectories", - "drop outputSourceLinks", - "drop outputInitialTrackParameters", - "keep MCParticles" - ] +out.outputCommands = [ + "keep *", + "drop BarrelTrackSourceLinks", + "drop InitTrackParams", + "drop trajectories", + "drop outputSourceLinks", + "drop outputInitialTrackParameters", + "keep MCParticles", +] algorithms.append(out) ApplicationMgr( - TopAlg = algorithms, - EvtSel = 'NONE', - EvtMax = n_events, - ExtSvc = [podioevent,geo_service], - OutputLevel=WARNING - ) + TopAlg=algorithms, + EvtSel="NONE", + EvtMax=n_events, + ExtSvc=[podioevent, geo_service], + OutputLevel=WARNING, +)