Belle II Software  release-05-01-25
InPhi0Box.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/boxes/Box.h>
13 #include <tracking/trackFindingCDC/topology/ILayer.h>
14 
15 #include <array>
16 #include <cmath>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24 
26  class InPhi0Box {
27 
28  public:
30  InPhi0Box(float curlCurv = NAN) : m_curlCurv(std::fabs(curlCurv)) {}
31 
32  public:
35 
36  public:
47  ESign getDistanceSign(const HoughBox& houghBox,
48  float x,
49  float y,
50  float l,
51  float /*dxdz*/ = 0,
52  float /*dydz*/ = 0,
53  ILayer /*iCLayer*/ = -1) const
54  {
55  const std::array<DiscretePhi0, 2>& phi0Vec = houghBox.getBounds<DiscretePhi0>();
56 
57  std::array<float, 2> xRot;
58  xRot[0] = x * phi0Vec[0]->x() + y * phi0Vec[0]->y();
59  xRot[1] = x * phi0Vec[1]->x() + y * phi0Vec[1]->y();
60 
61  const bool onlyPositiveArm = 0 < m_curlCurv;
62  if (onlyPositiveArm) {
63  // Reject hit if it is on the inward going branch but the curvature suggest it is no curler
64  if (xRot[0] < 0 and xRot[1] < 0) return ESign::c_Invalid;
65  }
66 
67  std::array<float, 2> yRotPlusL;
68  yRotPlusL[0] = -x * phi0Vec[0]->y() + y * phi0Vec[0]->x() - l;
69  yRotPlusL[1] = -x * phi0Vec[1]->y() + y * phi0Vec[1]->x() - l;
70 
71  std::array<float, 2> dist;
72  dist[0] = - yRotPlusL[0];
73  dist[1] = - yRotPlusL[1];
74 
75  return ESignUtil::common(dist[0], dist[1]);
76  }
77 
78  private:
80  float m_curlCurv;
81  };
82  }
84 }
Belle2::TrackFindingCDC::Box
The base class for all boxes.
Definition: Box.h:43
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::DiscreteValue
Representation for a discrete position in an array of discrete positions.
Definition: DiscreteValue.h:33
Belle2::TrackFindingCDC::ESignUtil::ESign
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:37
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::InPhi0Box::getDistanceSign
ESign getDistanceSign(const HoughBox &houghBox, float x, float y, float l, float=0, float=0, ILayer=-1) const
Function that gives the sign of the distance from an observed drift circle to the familiy of curves.
Definition: InPhi0Box.h:55
Belle2::TrackFindingCDC::InPhi0Box::InPhi0Box
InPhi0Box(float curlCurv=NAN)
Constructor taking the curler curvature - pass a value greater 0 to activate one arm exclusive findin...
Definition: InPhi0Box.h:38
Belle2::TrackFindingCDC::InPhi0Box::m_curlCurv
float m_curlCurv
Curler curvature - set a value greater zero to activate one arm exclusive finding.
Definition: InPhi0Box.h:88