-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrack.h
159 lines (125 loc) · 4.06 KB
/
Track.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*!
* \file Track.h
* \brief Data structure and output of the fitting.
* \author Haiwang Yu <yuhw@nmsu.edu>
*/
#ifndef PHGENFIT2_TRACK_H
#define PHGENFIT2_TRACK_H
#include <trackbase/TrkrDefs.h>
#include <TMatrixDSymfwd.h>
#include <TVector3.h>
//STL
#include <map>
#include <memory>
#include <vector>
#include <iostream>
//GenFit
#include <phgenfit/Measurement.h>
namespace genfit
{
class AbsTrackRep;
class MeasuredStateOnPlane;
class Track;
} // namespace genfit
namespace PHGenFit2
{
class Measurement;
class Track
{
public:
//! Default ctor
Track(genfit::AbsTrackRep* rep, TVector3 seed_pos, TVector3 seed_mom, TMatrixDSym seed_cov, const int v = 0);
//! Copy constructor
Track(const PHGenFit2::Track& t);
//! Default dtor
~Track();
//! Add measurement
int addMeasurement(PHGenFit::Measurement* measurement, int id = -1 );
int addMeasurements(std::vector<PHGenFit::Measurement*>& measurements, int id = -1 );
int deleteLastMeasurement();
//!
int updateOneMeasurementKalman(
const std::vector<PHGenFit::Measurement*>& measurements,
std::map<double, std::shared_ptr<PHGenFit2::Track> >& incr_chi2s_new_tracks,
const int base_tp_idx = -1,
const int direction = 1,
const float blowup_factor = 1.,
const bool use_fitted_state = false) const;
/*!
* track_point 0 is the first one, and -1 is the last one
*/
double extrapolateToPlane(genfit::MeasuredStateOnPlane& state, TVector3 O, TVector3 n, const int tr_point_id = 0) const;
//!
double extrapolateToLine(genfit::MeasuredStateOnPlane& state, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0) const;
//!
double extrapolateToCylinder(genfit::MeasuredStateOnPlane& state, double radius, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0, const int direction = 1) const;
//!
double extrapolateToPoint(genfit::MeasuredStateOnPlane& state, TVector3 P, const int tr_point_id = 0) const;
//!
genfit::MeasuredStateOnPlane* extrapolateToPlane(TVector3 O, TVector3 n, const int tr_point_id = 0) const;
//!
genfit::MeasuredStateOnPlane* extrapolateToLine(TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0) const;
//!
genfit::MeasuredStateOnPlane* extrapolateToCylinder(double radius, TVector3 line_point, TVector3 line_direction, const int tr_point_id = 0, const int direction = 1) const;
//!
genfit::MeasuredStateOnPlane* extrapolateToPoint(TVector3 P, const int tr_point_id = 0) const;
//!
genfit::Track* getGenFitTrack() { return _track; }
genfit::Track* getGenFitTrack() const { return _track; }
double get_chi2() const;
double get_ndf() const;
double get_charge() const;
TVector3 get_mom() const;
bool get_track_info( TVector3& pos, TVector3& mom, double& charge, int& nhits, double& length );
// old tracking
const std::vector<unsigned int>& get_cluster_IDs() const
{
return _clusterIDs;
}
void set_cluster_IDs(const std::vector<unsigned int>& clusterIDs)
{
_clusterIDs = clusterIDs;
}
// new tracking
const std::vector<TrkrDefs::cluskey>& get_cluster_keys() const
{
return _clusterkeys;
}
void set_cluster_keys(const std::vector<TrkrDefs::cluskey>& clusterkeys)
{
_clusterkeys = clusterkeys;
}
void set_vertex_id(const unsigned int vert_id)
{
_vertex_id = vert_id;
}
unsigned int get_vertex_id() const
{
//std::cout << " Track: returning vertex_id = " << _vertex_id << std::endl;
return _vertex_id;
}
int get_verbosity() const
{
return verbosity;
}
void set_verbosity(int verbosity)
{
this->verbosity = verbosity;
}
//SMART(genfit::Track) getGenFitTrack() {return _track;}
private:
#if defined(__CINT__) && ! defined(__CLING__)
Track operator=(Track &trk) {}
#else
Track operator=(Track &trk) = delete;
#endif
int verbosity;
genfit::Track* _track;
//std::vector<PHGenFit::Measurement*> _measurements;
std::vector<unsigned int> _clusterIDs;
std::vector<TrkrDefs::cluskey> _clusterkeys;
unsigned int _vertex_id;
//SMART(genfit::Track) _track;
};
} // namespace PHGenFit
#endif