Belle II Software  release-05-01-25
InPhi0TanLBox.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/axes/StandardAxes.h>
13 #include <tracking/trackFindingCDC/hough/boxes/Box.h>
14 #include <tracking/trackFindingCDC/topology/ILayer.h>
15 
16 namespace Belle2 {
21  namespace TrackFindingCDC {
22 
24  class InPhi0TanLBox {
25 
26  public:
28  explicit InPhi0TanLBox(float curlCurv)
29  : m_curlCurv(curlCurv)
30  {}
31 
32  public:
35 
36  public:
38  ESign getDistanceSign(const HoughBox& houghBox,
39  float x,
40  float y,
41  float l,
42  float dxdz,
43  float dydz,
44  ILayer /*iCLayer*/ = -1) const
45  {
46  const std::array<DiscretePhi0, 2>& phi0Vec = houghBox.getBounds<DiscretePhi0>();
47  const std::array<ContinuousTanL, 2>& tanL = houghBox.getBounds<ContinuousTanL>();
48 
49  std::array<float, 2> xRot;
50  xRot[0] = x * phi0Vec[0]->x() + y * phi0Vec[0]->y();
51  xRot[1] = x * phi0Vec[1]->x() + y * phi0Vec[1]->y();
52 
53  std::array<float, 2> yRot;
54  yRot[0] = -x * phi0Vec[0]->y() + y * phi0Vec[0]->x();
55  yRot[1] = -x * phi0Vec[1]->y() + y * phi0Vec[1]->x();
56 
57  std::array<float, 2> dxdzRot;
58  dxdzRot[0] = dxdz * phi0Vec[0]->x() + dydz * phi0Vec[0]->y();
59  dxdzRot[1] = dxdz * phi0Vec[1]->x() + dydz * phi0Vec[1]->y();
60 
61  std::array<float, 2> dydzRot;
62  dydzRot[0] = -dxdz * phi0Vec[0]->y() + dydz * phi0Vec[0]->x();
63  dydzRot[1] = -dxdz * phi0Vec[1]->y() + dydz * phi0Vec[1]->x();
64 
66  const std::array<float, 2>& s = xRot;
67 
68  const bool onlyPositiveArm = 0 < m_curlCurv;
69  if (onlyPositiveArm) {
70  // Reject hit if it is on the inward going branch but the curvature suggest it is no curler
71  if (xRot[0] < 0 and xRot[1] < 0) return ESign::c_Invalid;
72  }
73 
74  // cppcheck-suppress unreadVariable
75  std::array<float, 4> xRotCor;
76  xRotCor[0b00] = xRot[0] + dxdzRot[0] * s[0] * static_cast<float>(tanL[0]);
77  xRotCor[0b01] = xRot[0] + dxdzRot[0] * s[0] * static_cast<float>(tanL[1]);
78  xRotCor[0b10] = xRot[1] + dxdzRot[1] * s[1] * static_cast<float>(tanL[0]);
79  xRotCor[0b11] = xRot[1] + dxdzRot[1] * s[1] * static_cast<float>(tanL[1]);
80 
81  const std::array<float, 4>& sCor = xRotCor;
82 
83  std::array<float, 4> dist;
84  dist[0b00] = -(yRot[0] + dydzRot[0] * sCor[0b00] * static_cast<float>(tanL[0]) + l);
85  dist[0b01] = -(yRot[0] + dydzRot[0] * sCor[0b01] * static_cast<float>(tanL[1]) + l);
86  dist[0b10] = -(yRot[1] + dydzRot[1] * sCor[0b10] * static_cast<float>(tanL[0]) + l);
87  dist[0b11] = -(yRot[1] + dydzRot[1] * sCor[0b11] * static_cast<float>(tanL[1]) + l);
88 
89  return ESignUtil::common(dist);
90  }
91 
92  private:
94  float m_curlCurv;
95  };
96  }
98 }
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::TrackFindingCDC::InPhi0TanLBox::m_curlCurv
float m_curlCurv
Curler curvature - set to value greater zero to activate one arm exclusive finding.
Definition: InPhi0TanLBox.h:102
Belle2::TrackFindingCDC::InPhi0TanLBox::InPhi0TanLBox
InPhi0TanLBox(float curlCurv)
Create a new box with the given curler curvature.
Definition: InPhi0TanLBox.h:36
Belle2::TrackFindingCDC::InPhi0TanLBox::getDistanceSign
ESign getDistanceSign(const HoughBox &houghBox, float x, float y, float l, float dxdz, float dydz, ILayer=-1) const
Function that gives the sign of the distance from an observed drift circle to the sweeped object.
Definition: InPhi0TanLBox.h:46
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::ContinuousValue
Type to have values not based on discrete positions from an array.
Definition: ContinuousValue.h:31