Belle II Software  release-05-01-25
DeltaSlopeZoverS.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2014 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Jakob Lettenbichler (jakob.lettenbichler@oeaw.ac.at) *
7 * *
8 * This software is provided "as is" without any warranty. *
9 **************************************************************************/
10 
11 #pragma once
12 
13 #include <tracking/trackFindingVXD/filterMap/filterFramework/SelectionVariable.h>
14 #include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleCenterXY.h>
15 #include <tracking/trackFindingVXD/filterMap/threeHitVariables/CircleRadius.h>
16 #include <tracking/trackFindingVXD/filterMap/twoHitVariables/CosDirectionXY.h>
17 #include <framework/geometry/B2Vector3.h>
18 #include <cmath>
19 
20 #define DELTASLOPEZOVERS_NAME DeltaSlopeZoverS
21 
22 namespace Belle2 {
32  template <typename PointType >
33  class DELTASLOPEZOVERS_NAME : public SelectionVariable< PointType , 3, double > {
34  public:
35 
38 
40  static double value(const PointType& outerHit, const PointType& centerHit, const PointType& innerHit)
41  {
42 
43  B2Vector3D cCenter = CircleCenterXY<PointType>::value(outerHit, centerHit, innerHit);
44  double circleRadius = CircleRadius<PointType>::calcAvgDistanceXY(outerHit, centerHit, innerHit, cCenter);
45  B2Vector3D vecOuter2cC((outerHit.X() - cCenter.X()),
46  (outerHit.Y() - cCenter.Y()),
47  (outerHit.Z() - cCenter.Z()));
48  B2Vector3D vecCenter2cC((centerHit.X() - cCenter.X()),
49  (centerHit.Y() - cCenter.Y()),
50  (centerHit.Z() - cCenter.Z()));
51  B2Vector3D vecInner2cC((innerHit.X() - cCenter.X()),
52  (innerHit.Y() - cCenter.Y()),
53  (innerHit.Z() - cCenter.Z()));
54 
55  // WARNING: this is only approximately S (valid in the limit of small angles) but might be OK for this use!!!
56  // want to replace id with 2*sin ( alfa ) * circleRadius
57  double alfaOCr = acos(CosDirectionXY<B2Vector3D>::value(vecOuter2cC, vecCenter2cC)) * circleRadius ;
58  double alfaCIr = acos(CosDirectionXY<B2Vector3D>::value(vecCenter2cC, vecInner2cC)) * circleRadius ;
59 
60  // Beware of z>r!:
61  double result = (asin(double(outerHit.Z() - centerHit.Z()) / alfaOCr)) - asin(double(centerHit.Z() - innerHit.Z()) / alfaCIr);
62 
63  return (std::isnan(result) || std::isinf(result)) ? double(0) : result;
64  }
65  };
66 
68 }
Belle2::DELTASLOPEZOVERS_NAME
compares the "slopes" z over arc length.
Definition: DeltaSlopeZoverS.h:33
Belle2::DELTASLOPEZOVERS_NAME::value
static double value(const PointType &outerHit, const PointType &centerHit, const PointType &innerHit)
compares the "slopes" z over arc length.
Definition: DeltaSlopeZoverS.h:40
Belle2::B2Vector3::Z
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:434
Belle2::B2Vector3< double >
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::SelectionVariable
Base class of the selection variable objects used for pair filtering.
Definition: SelectionVariable.h:54
Belle2::DELTASLOPEZOVERS_NAME::PUT_NAME_FUNCTION
PUT_NAME_FUNCTION(DELTASLOPEZOVERS_NAME)
is replaced by "static const std:string name(void)" frunction which returns name of the Class
Belle2::B2Vector3::X
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:430
Belle2::B2Vector3::Y
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:432