CbmRoot
Loading...
Searching...
No Matches
CaTriplet.h
Go to the documentation of this file.
1/* Copyright (C) 2019-2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Valentina Akishina, Sergey Gorbunov[committer] */
4
9
10#pragma once // include this header only once per compilation unit
11
12#include "CaHit.h"
13#include "CaSimd.h"
14
15#include <string>
16
17namespace cbm::algo::ca
18{
19
22 class Triplet {
23 public:
25 Triplet() = default;
26
28 Triplet(ca::HitIndex_t iHitL, ca::HitIndex_t iHitM, ca::HitIndex_t iHitR, unsigned int iStaL, unsigned int iStaM,
29 unsigned int iStaR, unsigned char Level, unsigned int firstNeighbour, char nNeighbours, fscal Chi2,
30 fscal Qp, fscal Cqp, fscal tx, fscal Ctx, fscal ty, fscal Cty, bool isMomentumFitted)
31 : fChi2(Chi2)
32 , fQp(Qp)
33 , fCqp(Cqp)
34 , fTx(tx)
35 , fCtx(Ctx)
36 , fTy(ty)
37 , fCty(Cty)
38 , fFirstNeighbour(firstNeighbour)
39 , fHitL(iHitL)
40 , fHitM(iHitM)
41 , fHitR(iHitR)
42 , fNneighbours(nNeighbours)
43 , fLevel(Level)
44 , fSta((iStaL << 4) + ((iStaM - iStaL - 1) << 2) + (iStaR - iStaL - 2))
45 , fIsMomentumFitted(isMomentumFitted)
46 {
47 }
48
50
51 void SetLevel(unsigned char Level) { fLevel = Level; }
52 unsigned char GetLevel() const { return fLevel; }
53
54 ca::HitIndex_t GetLHit() const { return fHitL; }
55 ca::HitIndex_t GetMHit() const { return fHitM; }
56 ca::HitIndex_t GetRHit() const { return fHitR; }
57
58 void SetNNeighbours(int n) { fNneighbours = n; }
59 int GetNNeighbours() const { return fNneighbours; }
60
61 void SetFNeighbour(unsigned int n) { fFirstNeighbour = n; }
62 unsigned int GetFNeighbour() const { return fFirstNeighbour; }
63
64 fscal GetQp() const { return fQp; }
65 fscal GetChi2() const { return fChi2; }
66 fscal GetTime() const { return -111.; }
67
68 int GetLSta() const { return fSta >> 4; }
69 int GetMSta() const { return ((fSta % 16) >> 2) + GetLSta() + 1; }
70 int GetRSta() const { return (fSta % 4) + GetLSta() + 2; }
71
72 fscal GetCqp() const { return fCqp; }
73 fscal GetTx() const { return fTx; }
74 fscal GetCtx() const { return fCtx; }
75 fscal GetTy() const { return fTy; }
76 fscal GetCty() const { return fCty; }
77
78 bool IsMomentumFitted() const { return fIsMomentumFitted; }
79 void SetIsMomentumFitted(bool val) { fIsMomentumFitted = val; }
80
83 std::string ToString(int indentLevel = 0) const;
84
85 private:
88
90 fscal fQp{0.};
91 fscal fCqp{0.};
92 fscal fTx{0.};
93 fscal fCtx{0.};
94 fscal fTy{0.};
95 fscal fCty{0.};
96
97 unsigned int fFirstNeighbour{0};
102
106 unsigned char fLevel{0};
107
108 unsigned short fSta{0};
110 };
111
112} // namespace cbm::algo::ca
A generic hit for the CA tracker (header)
Triplet class represents a short 3-hits track segment called a "triplet".
Definition CaTriplet.h:22
fscal GetTx() const
Definition CaTriplet.h:73
unsigned short fSta
packed station numbers: staL (12b), staM-1-staL (2b), staR-2-staL (2b)
Definition CaTriplet.h:108
fscal GetQp() const
Definition CaTriplet.h:64
bool IsMomentumFitted() const
Definition CaTriplet.h:78
int fNneighbours
n of neighbouring triplets
Definition CaTriplet.h:101
ca::HitIndex_t fHitM
middle hit index (16b)
Definition CaTriplet.h:99
int GetMSta() const
Definition CaTriplet.h:69
std::string ToString(int indentLevel=0) const
Definition CaTriplet.cxx:10
ca::HitIndex_t fHitR
right hit index (16b)
Definition CaTriplet.h:100
unsigned char GetLevel() const
Definition CaTriplet.h:52
fscal GetCty() const
Definition CaTriplet.h:76
Triplet(ca::HitIndex_t iHitL, ca::HitIndex_t iHitM, ca::HitIndex_t iHitR, unsigned int iStaL, unsigned int iStaM, unsigned int iStaR, unsigned char Level, unsigned int firstNeighbour, char nNeighbours, fscal Chi2, fscal Qp, fscal Cqp, fscal tx, fscal Ctx, fscal ty, fscal Cty, bool isMomentumFitted)
Constructor.
Definition CaTriplet.h:28
ca::HitIndex_t GetRHit() const
Definition CaTriplet.h:56
ca::HitIndex_t fHitL
left hit index (16b) in vHits array
Definition CaTriplet.h:98
ca::HitIndex_t GetMHit() const
Definition CaTriplet.h:55
fscal GetTime() const
Definition CaTriplet.h:66
bool fIsMomentumFitted
if the triplet momentum is fitted
Definition CaTriplet.h:109
unsigned int fFirstNeighbour
ID of the first neighbouring triplet.
Definition CaTriplet.h:97
void SetFNeighbour(unsigned int n)
Definition CaTriplet.h:61
fscal fTy
ty at the left hit
Definition CaTriplet.h:94
fscal fCty
RMS^2 of ty.
Definition CaTriplet.h:95
void SetLevel(unsigned char Level)
Setters and getters.
Definition CaTriplet.h:51
ca::HitIndex_t GetLHit() const
Definition CaTriplet.h:54
fscal GetTy() const
Definition CaTriplet.h:75
fscal GetChi2() const
Definition CaTriplet.h:65
unsigned int GetFNeighbour() const
Definition CaTriplet.h:62
int GetNNeighbours() const
Definition CaTriplet.h:59
void SetIsMomentumFitted(bool val)
Definition CaTriplet.h:79
fscal fTx
tx at the left hit
Definition CaTriplet.h:92
Triplet()=default
Default constructor.
fscal fCqp
RMS^2 of q/p.
Definition CaTriplet.h:91
unsigned char fLevel
Definition CaTriplet.h:106
fscal fCtx
RMS^2 of tx.
Definition CaTriplet.h:93
fscal GetCqp() const
Definition CaTriplet.h:72
int GetLSta() const
Definition CaTriplet.h:68
fscal GetCtx() const
Definition CaTriplet.h:74
int GetRSta() const
Definition CaTriplet.h:70
void SetNNeighbours(int n)
Definition CaTriplet.h:58
TODO: SZh 8.11.2022: add selection of parameterisation.
Definition CaBranch.h:14
kf::fscal fscal
Definition CaSimd.h:14
unsigned int HitIndex_t
Index of ca::Hit.
Definition CaHit.h:27