-
Notifications
You must be signed in to change notification settings - Fork 0
/
SpacepointMeasurement2.cc
64 lines (53 loc) · 1.52 KB
/
SpacepointMeasurement2.cc
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
/*!
* \file SpacepointMeasurement.cc
* \brief Handles the palnar type of measurements.
* \author Haiwang Yu <yuhw@nmsu.edu>
*/
#include "SpacepointMeasurement2.h"
#include <GenFit/SpacepointMeasurement.h>
#include <TMatrixDSymfwd.h> // for TMatrixDSym
#include <TMatrixTSym.h>
#include <TVector3.h>
#include <TVectorDfwd.h>
#include <TVectorT.h>
namespace PHGenFit
{
void SpacepointMeasurement2::init(const TVector3& pos, const TMatrixDSym& cov)
{
int nDim = 3;
TVectorD hitCoords(nDim);
TMatrixDSym hitCov(nDim);
hitCoords(0) = pos.X();
hitCoords(1) = pos.Y();
hitCoords(2) = pos.Z();
for (int i = 0; i < 3; i++)
for (int j = 0; j < 3; j++)
hitCov(i, j) = cov(i, j);
int measurementCounter_ = 0;
_measurement = new genfit::SpacepointMeasurement(hitCoords, hitCov, -1,
measurementCounter_,
nullptr);
}
SpacepointMeasurement2::SpacepointMeasurement2(const TVector3& pos, const TVector3& resolution)
{
TMatrixDSym cov(3);
cov.Zero();
cov(0, 0) = resolution.X() * resolution.X();
cov(1, 1) = resolution.Y() * resolution.Y();
cov(2, 2) = resolution.Z() * resolution.Z();
init(pos, cov);
}
/*!
* Ctor
* \param pos measurement position
* \param covariance matrix
*/
SpacepointMeasurement2::SpacepointMeasurement2(const TVector3& pos, const TMatrixDSym& cov)
{
init(pos, cov);
}
SpacepointMeasurement2::~SpacepointMeasurement2()
{
//delete _measurement;
}
} // namespace PHGenFit