Belle II Software  release-08-01-10
DeltaSlopeZoverS.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 
9 #pragma once
10 
11 #include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
12 #include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleCenterXY.h>
13 #include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleRadius.h>
14 #include <tracking/trackFindingVXD/filterMap/twoHitVariables/CosDirectionXY.h>
15 #include <framework/geometry/B2Vector3.h>
16 #include <cmath>
17 
18 #define DELTASLOPEZOVERS_NAME DeltaSlopeZoverS
19 
20 namespace Belle2 {
30  template <typename PointType >
31  class DELTASLOPEZOVERS_NAME : public SelectionVariable< PointType, 3, double > {
32  public:
33 
36 
38  static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
39  {
40 
41  B2Vector3D cCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
42  double circleRadius = CircleRadius<PointType>::calcAvgDistanceXY(outerHit, centerHit, innerHit, cCenter);
43  B2Vector3D vecOuter2cC((outerHit.X() - cCenter.X()),
44  (outerHit.Y() - cCenter.Y()),
45  (outerHit.Z() - cCenter.Z()));
46  B2Vector3D vecCenter2cC((centerHit.X() - cCenter.X()),
47  (centerHit.Y() - cCenter.Y()),
48  (centerHit.Z() - cCenter.Z()));
49  B2Vector3D vecInner2cC((innerHit.X() - cCenter.X()),
50  (innerHit.Y() - cCenter.Y()),
51  (innerHit.Z() - cCenter.Z()));
52 
53  // WARNING: this is only approximately S (valid in the limit of small angles) but might be OK for this use!!!
54  // want to replace id with 2*sin ( alfa ) * circleRadius
55  double alfaOCr = acos(CosDirectionXY<B2Vector3D>::value(vecOuter2cC, vecCenter2cC)) * circleRadius ;
56  double alfaCIr = acos(CosDirectionXY<B2Vector3D>::value(vecCenter2cC, vecInner2cC)) * circleRadius ;
57 
58  // Beware of z>r!:
59  double result = (asin(double(outerHit.Z() - centerHit.Z()) / alfaOCr)) - asin(double(centerHit.Z() - innerHit.Z()) / alfaCIr);
60 
61  return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
62  }
63  };
64 
66 }
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
compares the "slopes" z over arc length.
PUT_NAME_FUNCTION(DELTASLOPEZOVERS_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
static double value(const PointType &outerHit, const PointType &centerHit, const PointType &innerHit)
compares the "slopes" z over arc length.
Base class of the selection variable objects used for pair filtering.
Abstract base class for different kinds of events.