The FairShip reconstruction chain converts raw Monte Carlo hits stored in a simulation file into fitted tracks and decay-vertex candidates without ever writing back to the original MC file. The pipeline runs in three broad phases — digitisation, pattern recognition with track fitting, and vertex finding — each phase producing branches in a dedicated output tree. Downstream analysis then merges the MC and reconstruction data on-the-fly through ROOT’s friend-tree mechanism, keeping the two datasets cleanly separated on disk while making them appear as a single tree in code.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ShipSoft/FairShip/llms.txt
Use this file to discover all available pages before exploring further.
Pipeline at a glance
Digitisation
ShipDigiReco reads every MC hit branch from cbmsim in sim_*.root and converts
true energy deposits into detector-realistic digitised hits. Straw tube hits are
smeared by a drift-time model (drift velocity + spatial resolution σ) to produce
Digi_*Hits branches. Other sub-detectors — SBT, TimeDet, UpstreamTagger, SplitCal,
MTC — are digitised by their own dedicated detector classes.Pattern Recognition
Digitised straw hits are passed to
shipPatRec.execute(), which groups hits into
track candidates. Two backends are available: the default AR (Artificial Retina)
algorithm and the FH (Fast Hough transform), selectable via --patRec. A third
experimental TemplateMatching method is also supported.Track Fitting
Track candidates from pattern recognition are passed to the GenFit2 DAF
(Deterministic Annealing Filter) Kalman fitter via
shipStrawTracking. The fitter
uses genfit::TGeoMaterialInterface for material effects and
genfit::FairShipFields for the magnetic field map. Each fitted track is stored as a
genfit::Track* in FitTracks; the integer vector fitTrack2MC maps each fitted
track index to the originating MC particle index in MCTrack.Vertex Finding
shipVertex.Task loops over all pairs of good fitted tracks and finds the point of
closest approach, iterating the extrapolation until the vertex Z position converges to
within 0.1 cm. Decay-vertex candidates are stored as ShipParticle objects in the
Particles branch, each carrying the 4-momentum, DOCA, and vertex covariance matrix.
Vertexing can be skipped with --noVertexing.File conventions
| File pattern | Tree | Contents |
|---|---|---|
sim_*.root | cbmsim | MC tracks (ShipMCTrack), straw points (strawtubesPoint), all sub-detector MC hit branches |
geo_*.root | FAIRGeom, ShipGeo | TGeo geometry + ShipGeo configuration dictionary |
sim_*_rec.root | ship_reco_sim | ShipEventHeader, Digi_*Hits, FitTracks, fitTrack2MC, Particles, Tracklets |
The reconstruction output tree is always named
ship_reco_sim. ShipAna and the
analysis toolkit rely on this exact name when calling AddFriend.Friend-tree mechanism
Because simulation and reconstruction live in separate files, analysis code joins them with ROOT’s friend-tree API:TChain is also supported for multi-file datasets:
Pattern recognition backends
- AR (default)
- FH
- TemplateMatching
- ACTS (experimental)
The Artificial Retina algorithm (
--patRec AR) is the production default. It
processes hits in each of the four straw tube stations and uses a retina scoring
function to identify track seeds, then extends seeds across stations. It is robust
against high occupancy and produces low clone rates.Tracking benchmark
Performance of the reconstruction chain is quantified bymacro/run_tracking_benchmark.py, which fires a particle gun, runs the full sim → reco chain as subprocesses, and then calls python/tracking_benchmark.py to compute:
- Track finding efficiency — fraction of reconstructible MC tracks matched to a reco track (Wilson score uncertainty)
- Clone rate — fraction of reco tracks matched to an already-matched MC track
- Ghost rate — fraction of reco tracks not matched to any MC track
- Momentum resolution — σ(Δp/p) from a Gaussian fit
tracking_benchmark_histos.root.
Further reading
Running ShipReco
Full reference for
macro/ShipReco.py: arguments, output branches, and usage
examples.Running ShipAna
How to analyse reconstruction output with
macro/ShipAna.py and the
analysis_toolkit.Tracking & Pattern Recognition
Deep dive into pattern recognition algorithms, GenFit track fitting, ACTS
integration, and the tracking benchmark.