PandaRoot
PndFtsHelpers.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //
14 // Created by Bartosz Sobol on 13.05.2020.
15 //
16 
17 #pragma once
18 
19 #include <utility>
20 #include <vector>
21 #include <array>
22 #include <algorithm>
23 
24 #include "PndFtsStraw.h"
25 #include "PndFtsGeom.h"
26 #include "PndFtsSimpleHit.h"
27 
28 namespace PndFtsTrackFinder {
29 
30 struct XZPoint : public TObject {
31  XZPoint() = default;
32 
33  inline explicit XZPoint(const PndFtsStraw &straw) : fX{straw.fX}, fZ{straw.fZ} {};
34 
35  inline XZPoint(const float x, const float z) : fX{x}, fZ{z} {};
36 
37  float fX{};
38  float fZ{};
39 
40  ClassDef(XZPoint, 1);
41 };
42 
43 struct Line : public TObject {
44  Line() = default;
45 
46  Line(float slope, float intercept) : fSlope{slope}, fIntercept{intercept} {}
47 
48  float fSlope{};
49  float fIntercept{};
50 
51  ClassDef(Line, 1);
52 };
53 
54 using TangentLineArray = std::array<Line, 4>;
55 
56 struct Circle : public TObject {
57  Circle() = default;
58 
59  Circle(float radius, XZPoint origin) : fRadius{radius}, fOrigin{std::move(origin)} {}
60 
61  float fRadius{};
62  XZPoint fOrigin{};
63 
64  ClassDef(Circle, 1);
65 };
66 
67 struct Point2D {
68  inline Point2D(float abscissa, float ordinate) : fAbscissa(abscissa), fOrdinate(ordinate) {}
69 
70  float fAbscissa;
71  float fOrdinate;
72 };
73 
74 struct YZVirtualHit {
75  YZVirtualHit() = default;
76 
77  inline YZVirtualHit(const PndFtsSimpleHit &baseHit, float y, float z) : fBaseHit{baseHit}, fY{y}, fZ{z} {};
78 
79  PndFtsSimpleHit fBaseHit;
80  float fY;
81  float fZ;
82 };
83 
84 using ZYVirtualHitVector = std::vector<YZVirtualHit>;
85 using ZYVirtualHitVectorPair = std::pair<ZYVirtualHitVector, ZYVirtualHitVector>;
86 using ZYVirtualHitPair = std::pair<YZVirtualHit, YZVirtualHit>;
87 using ZYVirtualHitPairVector = std::vector<ZYVirtualHitPair>;
88 
89 struct TrackRange {
90  uint32_t fBegin;
91  uint32_t fNTracks;
92 };
93 
94 } // namespace PndFtsTrackFinder
Circle(float radius, XZPoint origin)
Definition: PndFtsHelpers.h:59
YZVirtualHit(const PndFtsSimpleHit &baseHit, float y, float z)
Definition: PndFtsHelpers.h:77
std::vector< ZYVirtualHitPair > ZYVirtualHitPairVector
Definition: PndFtsHelpers.h:87
Point2D(float abscissa, float ordinate)
Definition: PndFtsHelpers.h:68
std::vector< YZVirtualHit > ZYVirtualHitVector
Definition: PndFtsHelpers.h:84
XZPoint(const float x, const float z)
Definition: PndFtsHelpers.h:35
Line(float slope, float intercept)
Definition: PndFtsHelpers.h:46
std::pair< YZVirtualHit, YZVirtualHit > ZYVirtualHitPair
Definition: PndFtsHelpers.h:86
std::array< Line, 4 > TangentLineArray
Definition: PndFtsHelpers.h:54
std::pair< ZYVirtualHitVector, ZYVirtualHitVector > ZYVirtualHitVectorPair
Definition: PndFtsHelpers.h:85
XZPoint(const PndFtsStraw &straw)
Definition: PndFtsHelpers.h:33