CbmRoot
Loading...
Searching...
No Matches
Hit.cxx
Go to the documentation of this file.
1/* Copyright (C) 2024 Facility for Antiproton and Ion Research in Europe, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dominik Smith [committer], Matus Kalisky, Florian Uhlig, Andrey Lebedev */
4
10#include "Hit.h"
11
12namespace cbm::algo::trd
13{
14
15 Hit::Hit() : Hit(-1, 0., 0., 0., 0., 0., 0., 0., -1, -1., -1.) {}
16
17 Hit::Hit(int32_t address, const ROOT::Math::XYZVector& pos, const ROOT::Math::XYZVector& dpos, double dxy,
18 int32_t refId, double eLoss, double time, double timeError)
19 : Hit(address, pos.X(), pos.Y(), pos.Z(), dpos.X(), dpos.Y(), dpos.Z(), dxy, refId, time, timeError)
20 {
21 fELoss = eLoss;
22 }
23
24 Hit::Hit(int32_t address, double x, double y, double z, double dx, double dy, double dz, double dxy, int32_t refId,
25 double time, double timeError)
26 : fX(x)
27 , fY(y)
28 , fZ(z)
29 , fDx(dx)
30 , fDy(dy)
31 , fDz(dz)
32 , fDxy(dxy)
33 , fRefId(refId)
34 , fAddress(address)
35 , fTime(time)
36 , fTimeError(timeError)
37 , fDefine(0)
38 , fNeighborId(-1)
39 , fELoss(-1.)
40 {
41 }
42
43 void Hit::Position(ROOT::Math::XYZVector& pos) const { pos.SetXYZ(X(), Y(), Z()); }
44
45 void Hit::PositionError(ROOT::Math::XYZVector& dpos) const { dpos.SetXYZ(Dx(), Dy(), Dz()); }
46
47 void Hit::SetPosition(const ROOT::Math::XYZVector& pos)
48 {
49 SetX(pos.X());
50 SetY(pos.Y());
51 SetZ(pos.Z());
52 }
53
54 void Hit::SetPositionError(const ROOT::Math::XYZVector& dpos)
55 {
56 SetDx(dpos.X());
57 SetDy(dpos.Y());
58 SetDz(dpos.Z());
59 }
60
61
62} // namespace cbm::algo::trd
TVector3 dpos
A light-weight TRD hit class for online reconstruction, based on CbmTrdHit. .
void PositionError(ROOT::Math::XYZVector &dpos) const
Copies hit position error to pos.
Definition Hit.cxx:45
Hit()
Default constructor.
Definition Hit.cxx:15
void SetPositionError(const ROOT::Math::XYZVector &dpos)
Definition Hit.cxx:54
void Position(ROOT::Math::XYZVector &pos) const
Copies hit position to pos.
Definition Hit.cxx:43
void SetPosition(const ROOT::Math::XYZVector &pos)
Sets position of the hit.
Definition Hit.cxx:47
A light-weight TRD hit class for online reconstruction, based on CbmTrdHit. .