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
20
#include "
delphi_edm4hep/CollectionWriter.h
"
21
#include "
delphi_edm4hep/Tracking/TrackingData.h
"
// Output
22
23
#include <edm4hep/TrackState.h>
24
25
#include <cstdint>
26
27
namespace
delphi_edm4hep::tracking
{
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}
38
enum
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}
65
enum
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}
91
enum
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
98
class
TrackingWriter
:
public
CollectionWriter
{
99
public
:
100
using
CollectionWriter::CollectionWriter
;
101
void
emit
()
override
;
102
};
103
104
}
// namespace delphi_edm4hep::tracking
CollectionWriter.h
TrackingData.h
delphi_edm4hep::CollectionWriter::CollectionWriter
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
Definition
CollectionWriter.h:118
delphi_edm4hep::tracking::TrackingWriter
Definition
Tracking.h:98
delphi_edm4hep::tracking::TrackingWriter::CollectionWriter
CollectionWriter(podio::Frame &frame, EventContext &ctx, bank::Pass pass)
Definition
CollectionWriter.h:118
delphi_edm4hep::tracking::TrackingWriter::emit
void emit() override
Definition
Tracking.cpp:81
delphi_edm4hep::tracking
Definition
Tracking.h:27
delphi_edm4hep::tracking::SelectionFlagBit
SelectionFlagBit
Definition
Tracking.h:91
delphi_edm4hep::tracking::kSelIflvec
@ kSelIflvec
Definition
Tracking.h:94
delphi_edm4hep::tracking::kSelRejected
@ kSelRejected
Definition
Tracking.h:92
delphi_edm4hep::tracking::TrackStateUse
TrackStateUse
Definition
Tracking.h:65
delphi_edm4hep::tracking::kStateAtOther
@ kStateAtOther
Definition
Tracking.h:66
delphi_edm4hep::tracking::kStateAtFirstHit
@ kStateAtFirstHit
Definition
Tracking.h:71
delphi_edm4hep::tracking::kStateAtCalorimeter
@ kStateAtCalorimeter
Definition
Tracking.h:74
delphi_edm4hep::tracking::kStateAtIp
@ kStateAtIp
the perigee helix; exactly one per track
Definition
Tracking.h:69
delphi_edm4hep::tracking::kStateAtVertex
@ kStateAtVertex
Definition
Tracking.h:77
delphi_edm4hep::tracking::DetectorMaskBit
DetectorMaskBit
Definition
Tracking.h:38
delphi_edm4hep::tracking::kDetPrimaryVertex
@ kDetPrimaryVertex
bit 2, primary vertex used in the fit
Definition
Tracking.h:39
delphi_edm4hep::tracking::kDetHpc
@ kDetHpc
bit 10
Definition
Tracking.h:48
delphi_edm4hep::tracking::kDetMuf
@ kDetMuf
bit 31, forward muon chambers
Definition
Tracking.h:57
delphi_edm4hep::tracking::kDetTpc
@ kDetTpc
bit 6
Definition
Tracking.h:45
delphi_edm4hep::tracking::kDetFcb
@ kDetFcb
bit 26
Definition
Tracking.h:55
delphi_edm4hep::tracking::kDetId
@ kDetId
bit 5
Definition
Tracking.h:44
delphi_edm4hep::tracking::kDetFca
@ kDetFca
bit 21
Definition
Tracking.h:52
delphi_edm4hep::tracking::kDetMub
@ kDetMub
bit 15, barrel muon chambers
Definition
Tracking.h:50
delphi_edm4hep::tracking::kDetVd
@ kDetVd
Definition
Tracking.h:40
delphi_edm4hep::tracking::kDetRib
@ kDetRib
bit 7, barrel RICH
Definition
Tracking.h:46
delphi_edm4hep::tracking::kDetOd
@ kDetOd
bit 9
Definition
Tracking.h:47
delphi_edm4hep::tracking::kDetHaf
@ kDetHaf
bit 23, forward HCAL
Definition
Tracking.h:54
delphi_edm4hep::tracking::kDetHab
@ kDetHab
bit 14, barrel HCAL
Definition
Tracking.h:49
delphi_edm4hep::tracking::kDetStic
@ kDetStic
bit 19
Definition
Tracking.h:51
delphi_edm4hep::tracking::kDetRif
@ kDetRif
bit 22, forward RICH
Definition
Tracking.h:53
delphi_edm4hep::tracking::kDetEmf
@ kDetEmf
bit 27
Definition
Tracking.h:56
delphi_edm4hep
include
delphi_edm4hep
Tracking
Tracking.h
Generated by
1.15.0