delphi-edm4hep
DELPHI SDST/FDST -> EDM4hep converter
Loading...
Searching...
No Matches
Tracking.h
Go to the documentation of this file.
1// Tracking domain: PA.MAIN + PA.TRAC + PSCVEC (VECP / LVLOCK).
2// TrackingWriter emits:
3// <prefix>_TRAC_Tracks Track + AtIP TrackState + 5x5 cov
4// <prefix>_MAIN_Particles charged + neutral, VECP 4-mom
5// <prefix>_VECP_Particles_SelectionFlag UserData<int32>
6// <prefix>_QTRAC_Tracks_d0PV / _z0PV / _d0BS
7// UserData<float> from QTRAC(38..40); mm
8// (cm x10), DELPHI sign, parallel to
9// TRAC_Tracks (charged-only), EMPTY in real
10// DATA. For data use the geometric
11// <prefix>_PV_Tracks_d0PV (Vertex.cpp; mm,
12// LCIO sign): d0 ~= -1x this, z0 agrees.
13//
14// A companion array is named after the collection it parallels.
15// and stores its Output (handle list + index maps) into ctx_.tracking
16// for downstream writers.
17
18#pragma once
19
22
23#include <edm4hep/TrackState.h>
24
25#include <cstdint>
26
28
29/// Bits of `MAIN_Particles_DetectorMask`, as masks. DELPHI numbers these bits
30/// from 1, so a documented "bit N" is `1 << (N - 1)`. Read the C way every cut
31/// lands one detector off and still returns plausible numbers.
32///
33/// Validated on 1994 data: over high-momentum barrel tracks #kDetTpc is set on
34/// ~96% and #kDetId on ~73%, so an ID fraction above the TPC fraction means the
35/// numbering is off by one. #kDetOd appears only above theta ~42 deg and
36/// #kDetFcb only below ~35 deg, which is those detectors' acceptance.
37/// @collection{MAIN_Particles_DetectorMask}
38enum DetectorMaskBit : std::int32_t {
39 kDetPrimaryVertex = 1 << 1, ///< bit 2, primary vertex used in the fit
40 kDetVd = 1 << 3, ///< bit 4. **VD or VFT**, not VD alone
41 ///< (`mammoth.car:13556`); at LEP2 it is set on
42 ///< every VFT-reconstructed track, so a "has VD
43 ///< hits" cut written against it silently widens
44 kDetId = 1 << 4, ///< bit 5
45 kDetTpc = 1 << 5, ///< bit 6
46 kDetRib = 1 << 6, ///< bit 7, barrel RICH
47 kDetOd = 1 << 8, ///< bit 9
48 kDetHpc = 1 << 9, ///< bit 10
49 kDetHab = 1 << 13, ///< bit 14, barrel HCAL
50 kDetMub = 1 << 14, ///< bit 15, barrel muon chambers
51 kDetStic = 1 << 18, ///< bit 19
52 kDetFca = 1 << 20, ///< bit 21
53 kDetRif = 1 << 21, ///< bit 22, forward RICH
54 kDetHaf = 1 << 22, ///< bit 23, forward HCAL
55 kDetFcb = 1 << 25, ///< bit 26
56 kDetEmf = 1 << 26, ///< bit 27
57 kDetMuf = 1 << 30 ///< bit 31, forward muon chambers
58};
59
60/// Which `edm4hep::TrackState::location` values appear on `TRAC_Tracks`, and
61/// what each is here. Values are taken from EDM4hep, not restated, so this
62/// cannot drift from the schema.
63///
64/// @collection{TRAC_Tracks}
65enum TrackStateUse : std::int32_t {
66 kStateAtOther = edm4hep::TrackState::AtOther,
67 ///< PA.TRAX, every other surface: TOF(11), muon
68 ///< chambers (14, 17, 30)
69 kStateAtIp = edm4hep::TrackState::AtIP,
70 ///< the perigee helix; exactly one per track
71 kStateAtFirstHit = edm4hep::TrackState::AtFirstHit,
72 ///< PA.TRAX, TANAGRA detector id 0: the track's own
73 ///< first measured point
74 kStateAtCalorimeter = edm4hep::TrackState::AtCalorimeter,
75 ///< PA.TRAX calorimeter crossings: HPC(9), HAB(13),
76 ///< HAF(22), EMF(26)
77 kStateAtVertex = edm4hep::TrackState::AtVertex
78 ///< AABTAG's impact parameter at AABTAG's own primary
79 ///< vertex; absent on tracks AABTAG skipped
80};
81
82/// Bits of the `MAIN_Particles` selection flag (SKELANA's `LVLOCK`), as masks.
83///
84/// Bit 32 is the sign bit, so a track locked by IFLVEC reads as a large
85/// negative number: `flag > 0` and a bare `if (flag)` both mislead. Test
86/// against these masks on the value cast to `std::uint32_t`. `-1` is not a bit
87/// pattern at all but the converter's sentinel for a particle with no VECP
88/// entry.
89///
90/// @collection{VECP_Particles_SelectionFlag}
91enum SelectionFlagBit : std::uint32_t {
92 kSelRejected = 0x00000001u, ///< bit 1; failed the track-selection cuts,
93 ///< which `IFLSTR = 2` keeps and flags
94 kSelIflvec = 0x80000000u ///< bit 32; locked by IFLVEC's class choice --
95 ///< ours is 22, "lock the charged outgoing"
96};
97
99public:
101 void emit() override;
102};
103
104} // namespace delphi_edm4hep::tracking
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
@ kStateAtIp
the perigee helix; exactly one per track
Definition Tracking.h:69
@ kDetPrimaryVertex
bit 2, primary vertex used in the fit
Definition Tracking.h:39
@ kDetMuf
bit 31, forward muon chambers
Definition Tracking.h:57
@ kDetMub
bit 15, barrel muon chambers
Definition Tracking.h:50
@ kDetRib
bit 7, barrel RICH
Definition Tracking.h:46
@ kDetHaf
bit 23, forward HCAL
Definition Tracking.h:54
@ kDetHab
bit 14, barrel HCAL
Definition Tracking.h:49
@ kDetRif
bit 22, forward RICH
Definition Tracking.h:53