forked from key4hep/k4RecTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenfitWireMeasurement.h
More file actions
83 lines (69 loc) · 2.8 KB
/
Copy pathGenfitWireMeasurement.h
File metadata and controls
83 lines (69 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2020-2024 Key4hep-Project.
*
* This file is part of Key4hep.
* See https://key4hep.github.io/key4hep-doc/ for further info.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef WIRE_MEASUREMENT_H
#define WIRE_MEASUREMENT_H
#include <iostream>
#include <TDecompSVD.h>
#include <TMatrixD.h>
#include <TMatrixDSym.h>
#include <TVectorD.h>
#include <TrackPoint.h>
#include <WirePointMeasurement.h>
#include "DDSegmentation/BitFieldCoder.h"
#include "detectorCommon/WireTracker_info.h"
#include "edm4hep/SenseWireHitCollection.h"
/** @class WireMeasurement
*
* Interface class that wraps a SenseWireHit object into a GENFIT-compatible WirePointMeasurement.
*
* This class converts a hit in a drift chamber wire (represented by `edm4hep::SenseWireHit`) into a
* `genfit::WirePointMeasurement`, which can be used in GENFIT's track fitting. The conversion requires
* additional detector information such as geometry and segmentation, provided through DD4hep.
*
* The constructor initializes the GENFIT measurement using drift radius and wire geometry, and assigns
* detector and hit indices for identification and debugging purposes.
*
*
* Author: Andrea De Vita
* Date : 2025-06
*
*/
namespace GenfitInterface {
class WireMeasurement {
public:
WireMeasurement(const edm4hep::SenseWireHit& hit, const dd4hep::rec::WireTracker_info_struct* wire_info,
const dd4hep::DDSegmentation::BitFieldCoder* decoder, const bool has_sectors, const int det_idx,
const int hit_idx, const int debug_lvl);
genfit::WirePointMeasurement* getGenFit() const { return m_genfitHit; };
private:
// This pointer is used to create a genfit::TrackPoint, which is then stored
// inside a genfit::Track. The Track aggregates a collection of TrackPoints
// representing the hits used for the track fit.
//
// GENFIT manages ownership of the full chain:
// - A genfit::Track owns its TrackPoints
// - When a Track is deleted, all associated TrackPoints are automatically deleted
// - When a TrackPoint is deleted, the associated measurement object used to
// construct it is also released
//
// Therefore, this pointer is NOT owned by this class and must not be deleted here.
genfit::WirePointMeasurement* m_genfitHit;
};
} // namespace GenfitInterface
#endif