Belle II Software  release-08-01-10
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 #include <Math/VectorUtil.h>
16 
17 namespace Belle2 {
27  template <class DataType, class TCInfoType, class VectorType>
28  class AnalyzingAlgorithmResidualPX : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
29  public:
31  AnalyzingAlgorithmResidualPX() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
33 
35  DataType calcData(const TCInfoType& aTC) override
36  {
38  return tcs.refTC->momSeed.X() - tcs.testTC->momSeed.X();
39  }
40  };
41 
42 
43 
45  template <class DataType, class TCInfoType, class VectorType>
46  class AnalyzingAlgorithmResidualPY : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
47  public:
49  AnalyzingAlgorithmResidualPY() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
51 
53  DataType calcData(const TCInfoType& aTC) override
54  {
56  return tcs.refTC->momSeed.Y() - tcs.testTC->momSeed.Y();
57  }
58  };
59 
60 
61 
63  template <class DataType, class TCInfoType, class VectorType>
64  class AnalyzingAlgorithmResidualPZ : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
65  public:
67  AnalyzingAlgorithmResidualPZ() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
69 
71  DataType calcData(const TCInfoType& aTC) override
72  {
74  return tcs.refTC->momSeed.Z() - tcs.testTC->momSeed.Z();
75  }
76  };
77 
78 
79 
81  template <class DataType, class TCInfoType, class VectorType>
82  class AnalyzingAlgorithmResidualPT : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
83  public:
85  AnalyzingAlgorithmResidualPT() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
87 
89  DataType calcData(const TCInfoType& aTC) override
90  {
92  return tcs.refTC->momSeed.Rho() - tcs.testTC->momSeed.Rho();
93  }
94  };
95 
96 
97 
99  template <class DataType, class TCInfoType, class VectorType>
100  class AnalyzingAlgorithmResidualP : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
101  public:
103  AnalyzingAlgorithmResidualP() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
105 
107  DataType calcData(const TCInfoType& aTC) override
108  {
110  return tcs.refTC->momSeed.R() - tcs.testTC->momSeed.R();
111  }
112  };
113 
114 
115 
117  template <class DataType, class TCInfoType, class VectorType>
118  class AnalyzingAlgorithmResidualPTheta : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
119  public:
121  AnalyzingAlgorithmResidualPTheta() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
123 
125  DataType calcData(const TCInfoType& aTC) override
126  {
128  return tcs.refTC->momSeed.Theta() * TMath::RadToDeg() - tcs.testTC->momSeed.Theta() * TMath::RadToDeg();
129  }
130  };
131 
132 
133 
135  template <class DataType, class TCInfoType, class VectorType>
136  class AnalyzingAlgorithmResidualPPhi : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
137  public:
139  AnalyzingAlgorithmResidualPPhi() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
141 
143  DataType calcData(const TCInfoType& aTC) override
144  {
146  return tcs.refTC->momSeed.Phi() * TMath::RadToDeg() - tcs.testTC->momSeed.Phi() * TMath::RadToDeg();
147  }
148  };
149 
150 
151 
153  template <class DataType, class TCInfoType, class VectorType>
154  class AnalyzingAlgorithmResidualPAngle : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
155  public:
157  AnalyzingAlgorithmResidualPAngle() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
159 
161  DataType calcData(const TCInfoType& aTC) override
162  {
164  return ROOT::Math::VectorUtil::Angle(tcs.testTC->momSeed, tcs.refTC->momSeed) * TMath::RadToDeg();
165  }
166  };
167 
168 
169 
171  template <class DataType, class TCInfoType, class VectorType>
172  class AnalyzingAlgorithmResidualPTAngle : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
173  public:
175  AnalyzingAlgorithmResidualPTAngle() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
177 
179  DataType calcData(const TCInfoType& aTC) override
180  {
182  VectorType refMom = tcs.refTC->momSeed;
183  refMom.SetZ(0.);
184  VectorType testMom = tcs.testTC->momSeed;
185  testMom.SetZ(0.);
186  return ROOT::Math::VectorUtil::Angle(testMom, refMom) * TMath::RadToDeg();
187  }
188  };
189 
190 
191 
193  template <class DataType, class TCInfoType, class VectorType>
194  class AnalyzingAlgorithmResidualPosition : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
195  public:
197  AnalyzingAlgorithmResidualPosition() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
199 
201  DataType calcData(const TCInfoType& aTC) override
202  {
204  return (tcs.refTC->posSeed - tcs.testTC->posSeed).R();
205  }
206  };
207 
208 
209 
211  template <class DataType, class TCInfoType, class VectorType>
212  class AnalyzingAlgorithmResidualPositionXY : public AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType> {
213  public:
215  AnalyzingAlgorithmResidualPositionXY() : AnalyzingAlgorithmBase<DataType, TCInfoType, VectorType>
217 
219  DataType calcData(const TCInfoType& aTC) override
220  {
222  return (tcs.refTC->posSeed - tcs.testTC->posSeed).Rho();
223  }
224  };
225 
227 }
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.