Belle II Software  release-05-01-25
ImpactSweeped.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/hough/perigee/ImpactRep.h>
13 #include <tracking/trackFindingCDC/hough/boxes/SweepBox.h>
14 #include <tracking/trackFindingCDC/hough/baseelements/SameSignChecker.h>
15 #include <tracking/trackFindingCDC/topology/ILayer.h>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23 
27  template<class T, class AImpact = ContinuousImpact>
28  class AImpactSweeped : public T {
29 
30  public:
32  using T::T;
33 
34  public:
36  using HoughBox = SweepBox<AImpact, typename T::HoughBox>;
37 
39  using SubordinaryHoughBox = typename T::HoughBox;
40 
41  public:
44  ESign getDistanceSign(const HoughBox& houghBox,
45  float x,
46  float y,
47  float signedDriftLength,
48  float dxdz = 0,
49  float dydz = 0,
50  ILayer iCLayer = -1) const
51  {
52  float lowerImpact(houghBox.template getLowerBound<AImpact>());
53  float upperImpact(houghBox.template getUpperBound<AImpact>());
54  const SubordinaryHoughBox& subordinaryHoughBox = houghBox.getSubordinaryBox();
55 
56  const float lowerY = y - lowerImpact;
57  const ESign lowerDistSign = T::getDistanceSign(subordinaryHoughBox,
58  x, lowerY,
59  signedDriftLength,
60  dxdz, dydz,
61  iCLayer);
62 
63  const float upperY = y - upperImpact;
64  const ESign upperDistSign = T::getDistanceSign(subordinaryHoughBox,
65  x, upperY,
66  signedDriftLength,
67  dxdz, dydz,
68  iCLayer);
69 
70  return ESignUtil::common(lowerDistSign, upperDistSign);
71  }
72  };
73  }
75 }
Belle2::TrackFindingCDC::ESignUtil::common
static ESign common(ESign n1, ESign n2)
Check if two values have a common sign.
Definition: ESign.h:67
Belle2::TrackFindingCDC::AImpactSweeped::getDistanceSign
ESign getDistanceSign(const HoughBox &houghBox, float x, float y, float signedDriftLength, float dxdz=0, float dydz=0, ILayer iCLayer=-1) const
Function that gives the sign of the distance from an observed drift circle to the sweeped object.
Definition: ImpactSweeped.h:52
Belle2::TrackFindingCDC::ESignUtil::ESign
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:37
Belle2::TrackFindingCDC::AImpactSweeped::SubordinaryHoughBox
typename T::HoughBox SubordinaryHoughBox
The hough box without the sweep in d0.
Definition: ImpactSweeped.h:47
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::AImpactSweeped::HoughBox
SweepBox< AImpact, typename T::HoughBox > HoughBox
The box to which this object correspondes.
Definition: ImpactSweeped.h:44