Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
Manage
Activity
Members
Labels
Plan
Issues
22
Issue boards
Milestones
Wiki
Code
Merge requests
21
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIC
benchmarks
reconstruction_benchmarks
Merge requests
!231
Draft: Resolve "Add BTOF Benchmark"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Draft: Resolve "Add BTOF Benchmark"
80-add-btof-benchmark
into
master
Overview
0
Commits
8
Pipelines
0
Changes
11
Open
Zhenyu Ye
requested to merge
80-add-btof-benchmark
into
master
3 years ago
Overview
0
Commits
8
Pipelines
0
Changes
1
Expand
Closes
#80
👍
0
👎
0
Merge request reports
Viewing commit
51c707c3
Prev
Next
Show latest version
1 file
+
12
−
11
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
51c707c3
add BTOF benchmark
· 51c707c3
Zhenyu Ye
authored
3 years ago
benchmarks/tof/options/track_reconstruction.py
0 → 100644
+
229
−
0
Options
from
Gaudi.Configuration
import
*
from
Configurables
import
ApplicationMgr
,
EICDataSvc
,
PodioOutput
,
GeoSvc
from
GaudiKernel
import
SystemOfUnits
as
units
detector_name
=
"
topside
"
if
"
JUGGLER_DETECTOR
"
in
os
.
environ
:
detector_name
=
str
(
os
.
environ
[
"
JUGGLER_DETECTOR
"
])
detector_path
=
""
if
"
DETECTOR_PATH
"
in
os
.
environ
:
detector_path
=
str
(
os
.
environ
[
"
DETECTOR_PATH
"
])
detector_version
=
'
default
'
if
"
JUGGLER_DETECTOR_VERSION
"
in
os
.
environ
:
env_version
=
str
(
os
.
environ
[
"
JUGGLER_DETECTOR_VERSION
"
])
if
'
acadia
'
in
env_version
:
detector_version
=
'
acadia
'
# 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_path
,
detector_name
)],
OutputLevel
=
WARNING
)
podioevent
=
EICDataSvc
(
"
EventDataSvc
"
,
inputs
=
[
input_sim_file
],
OutputLevel
=
WARNING
)
from
Configurables
import
PodioInput
from
Configurables
import
Jug__Digi__SiliconTrackerDigi
as
TrackerDigi
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__ParticlesFromTrackFit
as
ParticlesFromTrackFit
from
Configurables
import
Jug__Reco__SimpleClustering
as
SimpleClustering
algorithms
=
[
]
input_collections
=
[
'
mcparticles
'
,
'
TrackerEndcapHits
'
,
'
TrackerBarrelHits
'
,
'
TOFBarrelHits
'
,
'
VertexBarrelHits
'
,
'
GEMTrackerEndcapHits
'
]
if
'
acadia
'
in
detector_version
:
input_collections
.
append
(
'
VertexEndcapHits
'
)
else
:
input_collections
.
append
(
'
MPGDTrackerBarrelHits
'
)
podioinput
=
PodioInput
(
"
PodioReader
"
,
collections
=
input_collections
)
#, OutputLevel=DEBUG)
algorithms
.
append
(
podioinput
)
trk_b_digi
=
TrackerDigi
(
"
trk_b_digi
"
,
inputHitCollection
=
"
TrackerBarrelHits
"
,
outputHitCollection
=
"
TrackerBarrelRawHits
"
,
timeResolution
=
8
)
algorithms
.
append
(
trk_b_digi
)
trk_ec_digi
=
TrackerDigi
(
"
trk_ec_digi
"
,
inputHitCollection
=
"
TrackerEndcapHits
"
,
outputHitCollection
=
"
TrackerEndcapRawHits
"
,
timeResolution
=
8
)
algorithms
.
append
(
trk_ec_digi
)
vtx_b_digi
=
TrackerDigi
(
"
vtx_b_digi
"
,
inputHitCollection
=
"
VertexBarrelHits
"
,
outputHitCollection
=
"
VertexBarrelRawHits
"
,
timeResolution
=
8
)
algorithms
.
append
(
vtx_b_digi
)
if
'
acadia
'
in
detector_version
:
vtx_ec_digi
=
TrackerDigi
(
"
vtx_ec_digi
"
,
inputHitCollection
=
"
VertexEndcapHits
"
,
outputHitCollection
=
"
VertexEndcapRawHits
"
,
timeResolution
=
8
)
algorithms
.
append
(
vtx_ec_digi
)
else
:
mm_b_digi
=
TrackerDigi
(
"
mm_b_digi
"
,
inputHitCollection
=
"
MPGDTrackerBarrelHits
"
,
outputHitCollection
=
"
MPGDTrackerBarrelRawHits
"
,
timeResolution
=
8
)
algorithms
.
append
(
mm_b_digi
)
tof_b_digi
=
TrackerDigi
(
"
tof_b_digi
"
,
inputHitCollection
=
"
TOFBarrelHits
"
,
outputHitCollection
=
"
TOFBarrelRawHits
"
,
timeResolution
=
20
)
algorithms
.
append
(
tof_b_digi
)
gem_ec_digi
=
TrackerDigi
(
"
gem_ec_digi
"
,
inputHitCollection
=
"
GEMTrackerEndcapHits
"
,
outputHitCollection
=
"
GEMTrackerEndcapRawHits
"
,
timeResolution
=
10
)
algorithms
.
append
(
gem_ec_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
)
tof_b_reco
=
TrackerHitReconstruction
(
"
tof_b_reco
"
,
inputHitCollection
=
tof_b_digi
.
outputHitCollection
,
outputHitCollection
=
"
TOFBarrelRecHits
"
)
algorithms
.
append
(
tof_b_reco
)
gem_ec_reco
=
TrackerHitReconstruction
(
"
gem_ec_reco
"
,
inputHitCollection
=
gem_ec_digi
.
outputHitCollection
,
outputHitCollection
=
"
GEMTrackerEndcapRecHits
"
)
algorithms
.
append
(
gem_ec_reco
)
input_tracking_hits
=
[
str
(
trk_b_reco
.
outputHitCollection
),
str
(
trk_ec_reco
.
outputHitCollection
),
str
(
vtx_b_reco
.
outputHitCollection
),
str
(
tof_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
)
# 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
)
## Track param init
truth_trk_init
=
TrackParamTruthInit
(
"
truth_trk_init
"
,
inputMCParticles
=
"
mcparticles
"
,
outputInitialTrackParameters
=
"
InitTrackParams
"
)
#OutputLevel=DEBUG)
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 = []
## 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,
# UFSDTrackerDigi, TrackerSourceLinker,
# PodioOutput],
# key=lambda c: c.getType()):
# print("\"{}\":".format(configurable.getType()))
# props = configurable.getDefaultProperties()
# for propname, prop in sorted(props.items()):
# print(" prop name: {}".format(propname))
# if isinstance(prop, DataHandleBase):
# types.append(prop.type())
# print(" {}: \"{}\"".format(propname, prop.type()))
#print("---")
out
=
PodioOutput
(
"
out
"
,
filename
=
output_rec_file
)
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
)
Loading