Belle II Software  release-06-01-15
AnalyzingAlgorithmResiduals.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 // tracking:
11 #include <tracking/trackFindingVXD/analyzingTools/algorithms/AnalyzingAlgorithmBase.h>
12 
13 // root:
14 #include <TMath.h>
15 
16 namespace Belle2 {
26  template <class DataType, class TCInfoType, class VectorType>
27  class AnalyzingAlgorithmResidualPX : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
28  public:
30  AnalyzingAlgorithmResidualPX() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
32 
34  DataType calcData(const TCInfoType& aTC) override
35  {
37  return tcs.refTC->momSeed.X() - tcs.testTC->momSeed.X();
38  }
39  };
40 
41 
42 
44  template <class DataType, class TCInfoType, class VectorType>
45  class AnalyzingAlgorithmResidualPY : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
46  public:
48  AnalyzingAlgorithmResidualPY() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
50 
52  DataType calcData(const TCInfoType& aTC) override
53  {
55  return tcs.refTC->momSeed.Y() - tcs.testTC->momSeed.Y();
56  }
57  };
58 
59 
60 
62  template <class DataType, class TCInfoType, class VectorType>
63  class AnalyzingAlgorithmResidualPZ : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
64  public:
66  AnalyzingAlgorithmResidualPZ() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
68 
70  DataType calcData(const TCInfoType& aTC) override
71  {
73  return tcs.refTC->momSeed.Z() - tcs.testTC->momSeed.Z();
74  }
75  };
76 
77 
78 
80  template <class DataType, class TCInfoType, class VectorType>
81  class AnalyzingAlgorithmResidualPT : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
82  public:
84  AnalyzingAlgorithmResidualPT() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
86 
88  DataType calcData(const TCInfoType& aTC) override
89  {
91  return tcs.refTC->momSeed.Perp() - tcs.testTC->momSeed.Perp();
92  }
93  };
94 
95 
96 
98  template <class DataType, class TCInfoType, class VectorType>
99  class AnalyzingAlgorithmResidualP : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
100  public:
102  AnalyzingAlgorithmResidualP() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
104 
106  DataType calcData(const TCInfoType& aTC) override
107  {
109  return tcs.refTC->momSeed.Mag() - tcs.testTC->momSeed.Mag();
110  }
111  };
112 
113 
114 
116  template <class DataType, class TCInfoType, class VectorType>
117  class AnalyzingAlgorithmResidualPTheta : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
118  public:
120  AnalyzingAlgorithmResidualPTheta() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
122 
124  DataType calcData(const TCInfoType& aTC) override
125  {
127  return tcs.refTC->momSeed.Theta() * 180.*TMath::InvPi() - tcs.testTC->momSeed.Theta() * 180.*TMath::InvPi();
128  }
129  };
130 
131 
132 
134  template <class DataType, class TCInfoType, class VectorType>
135  class AnalyzingAlgorithmResidualPPhi : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
136  public:
138  AnalyzingAlgorithmResidualPPhi() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
140 
142  DataType calcData(const TCInfoType& aTC) override
143  {
145  return tcs.refTC->momSeed.Phi() * 180.*TMath::InvPi() - tcs.testTC->momSeed.Phi() * 180.*TMath::InvPi();
146  }
147  };
148 
149 
150 
152  template <class DataType, class TCInfoType, class VectorType>
153  class AnalyzingAlgorithmResidualPAngle : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
154  public:
156  AnalyzingAlgorithmResidualPAngle() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
158 
160  DataType calcData(const TCInfoType& aTC) override
161  {
163  return tcs.testTC->momSeed.Angle(tcs.refTC->momSeed) * 180.*TMath::InvPi();
164  }
165  };
166 
167 
168 
170  template <class DataType, class TCInfoType, class VectorType>
171  class AnalyzingAlgorithmResidualPTAngle : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
172  public:
174  AnalyzingAlgorithmResidualPTAngle() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
176 
178  DataType calcData(const TCInfoType& aTC) override
179  {
181  VectorType refMom = tcs.refTC->momSeed;
182  refMom.SetZ(0.);
183  VectorType testMom = tcs.testTC->momSeed;
184  testMom.SetZ(0.);
185  return testMom.Angle(refMom) * 180.*TMath::InvPi();
186  }
187  };
188 
189 
190 
192  template <class DataType, class TCInfoType, class VectorType>
193  class AnalyzingAlgorithmResidualPosition : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
194  public:
196  AnalyzingAlgorithmResidualPosition() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
198 
200  DataType calcData(const TCInfoType& aTC) override
201  {
203  return (tcs.refTC->posSeed - tcs.testTC->posSeed).Mag();
204  }
205  };
206 
207 
208 
210  template <class DataType, class TCInfoType, class VectorType>
211  class AnalyzingAlgorithmResidualPositionXY : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
212  public:
214  AnalyzingAlgorithmResidualPositionXY() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
216 
218  DataType calcData(const TCInfoType& aTC) override
219  {
221  return (tcs.refTC->posSeed - tcs.testTC->posSeed).Perp();
222  }
223  };
224 
226 }
Small class for classifying types of analyzing algorithms.
Definition: AlgoritmType.h:25
Base class for storing an algorithm determining the data one wants to have.
virtual const TcPair chooseCorrectPairOfTCs(const TCInfoType &aTC) const
makes sure that TcPair.refTC and .testTC are correctly set - throws exeption if there are problems
Class for storing an algorithm determining the residual (ref-test) of momentum in its angle (directio...
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in its angle (direction residual in degrees)
Class for storing an algorithm determining the residual (ref-test) of momentum in phi (in degrees)
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in phi (in degrees)
Class for storing an algorithm determining the residual (ref-test) of pT in angle (transverse directi...
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of pT in angle (transverse direction residual in degrees)
Class for storing an algorithm determining the residual (ref-test) of momentum in pT.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in pT
Class for storing an algorithm determining the residual (ref-test) of momentum in theta (in degrees)
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in theta (in degrees)
INFO This file contains all the algorithms calculating residuals of something.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in X
Class for storing an algorithm determining the residual (ref-test) of momentum in Y.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in Y
Class for storing an algorithm determining the residual (ref-test) of momentum in Z.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in Z
Class for storing an algorithm determining the residual (ref-test) of momentum in |p|.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of momentum in |p|
Class for storing an algorithm determining the residual (ref-test) of the seed position in XY (=r)
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of the seed position in XY (=r)
Class for storing an algorithm determining the residual (ref-test) of the seed position in 3D.
DataType calcData(const TCInfoType &aTC) override
returns the residual (ref-test) of the seed position in 3D
Abstract base class for different kinds of events.