HerdSoftware  0.3.2
StkIntersectionsAlgo.h
Go to the documentation of this file.
1 /*
2  * StkIntersectionsAlgo.h
3  *
4  * Created on: 24 Oct 2019
5  * Author: Lorenzo Pacini
6  */
7 
8 #ifndef HERD_COMPUTESTKACCINFO_H_
9 #define HERD_COMPUTESTKACCINFO_H_
10 
11 #include "algorithm/Algorithm.h"
12 #include "common/RefFrame.h"
13 #include "common/SidesArray.h"
14 #include "dataobjects/Plane.h"
16 
17 using namespace EA;
18 
19 namespace Herd {
20 
21 // clang-format off
44 // clang-format on
45 class StkIntersectionsAlgo : public Algorithm {
46 public:
51  StkIntersectionsAlgo(const std::string &name);
52 
57  bool Initialize() override;
58 
63  bool Process() override;
64 
69  bool Finalize() override;
70 
71 private:
78  bool CheckIfPointIsInStkSurface(const Point &p, const RefFrame::Side &view);
79 
87  bool CheckIfPointIsInABox(const Point &p1, const Point &p2, const Point p);
88 
96  bool CheckIfPointIsInABox_SpecificCorners(const Point &pXNegYNegZNeg, const Point &pXPosYPosZPos, const Point p);
97 
104  float PntDistance(const Point &p1, const Point &p2);
105 
106  observer_ptr<EventDataStore> _evStore;
107 
109 
111 
112  const float _Prec; // cm
113  const unsigned int _NStkLayers;
114 
115  const float _topStkZ[12]; // cm
116  const float _topStkX;
117  const float _topStkY;
118  const float _topStkDX;
119  const float _topStkDY;
120  const float _XnegStkX[12];
121  const float _XnegStkY;
122  const float _XnegStkZ;
123  const float _XnegStkDY;
124  const float _XnegStkDZ;
125  const float _XposStkX[12];
126  const float _XposStkY;
127  const float _XposStkZ;
128  const float _XposStkDY;
129  const float _XposStkDZ;
130  const float _YnegStkY[12];
131  const float _YnegStkZ;
132  const float _YnegStkX;
133  const float _YnegStkDZ;
134  const float _YnegStkDX;
135  const float _YposStkY[12];
136  const float _YposStkZ;
137  const float _YposStkX;
138  const float _YposStkDZ;
139  const float _YposStkDX;
140 };
141 
142 } // namespace Herd
143 
144 #endif /* HERD_COMPUTESTKACCINFO_H_ */
const float _YnegStkX
Definition: StkIntersectionsAlgo.h:132
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
const float _XnegStkY
Definition: StkIntersectionsAlgo.h:121
observer_ptr< EventDataStore > _evStore
Pointer to the event data store.
Definition: StkIntersectionsAlgo.h:106
A container of information about interesections between a track and the STK.
Definition: StkIntersections.h:64
const float _topStkDY
Definition: StkIntersectionsAlgo.h:119
const float _YposStkDZ
Definition: StkIntersectionsAlgo.h:138
Side
Aliases for the five sides. RefFrame.h common/RefFrame.h.
Definition: RefFrame.h:113
const float _YnegStkDZ
Definition: StkIntersectionsAlgo.h:133
An algorithm that calculate the intersections between a track and the STK.
Definition: StkIntersectionsAlgo.h:45
SidesArray< std::vector< Plane > > _Planes
STK surfaces for each side and each layer.
Definition: StkIntersectionsAlgo.h:110
const float _YposStkZ
Definition: StkIntersectionsAlgo.h:136
const float _XnegStkDZ
Definition: StkIntersectionsAlgo.h:124
const float _XnegStkZ
Definition: StkIntersectionsAlgo.h:122
const float _topStkY
Definition: StkIntersectionsAlgo.h:117
A class describing a vector in 3D space.
Definition: Vec3D.h:33
const float _XposStkY
Definition: StkIntersectionsAlgo.h:126
const float _Prec
Definition: StkIntersectionsAlgo.h:112
const float _topStkDX
Definition: StkIntersectionsAlgo.h:118
An array that accepts side as subscripts.
Definition: SidesArray.h:72
const unsigned int _NStkLayers
Definition: StkIntersectionsAlgo.h:113
const float _YnegStkDX
Definition: StkIntersectionsAlgo.h:134
const float _XposStkZ
Definition: StkIntersectionsAlgo.h:127
const float _topStkX
Definition: StkIntersectionsAlgo.h:116
const float _YposStkDX
Definition: StkIntersectionsAlgo.h:139
const float _XnegStkDY
Definition: StkIntersectionsAlgo.h:123
const float _XposStkDZ
Definition: StkIntersectionsAlgo.h:129
const float _XposStkDY
Definition: StkIntersectionsAlgo.h:128
const float _YposStkX
Definition: StkIntersectionsAlgo.h:137
StkIntersections _stkIntersections
The stkIntersections object to fill with the computed information.
Definition: StkIntersectionsAlgo.h:108
const float _YnegStkZ
Definition: StkIntersectionsAlgo.h:131