Belle II Software  release-05-02-19
AxialHitQuadTreeProcessor.h
1 /**************************************************************************
2 * BASF2 (Belle Analysis Framework 2) *
3 * Copyright(C) 2014 - Belle II Collaboration *
4 * *
5 * Author: The Belle II Collaboration *
6 * Contributors: Viktor Trusov, Thomas Hauth, Nils Braun, *
7 * Dmitrii Neverov *
8 * *
9 * This software is provided "as is" without any warranty. *
10 **************************************************************************/
11 #pragma once
12 
13 #include <tracking/trackFindingCDC/legendre/quadtree/QuadTreeProcessor.h>
14 #include <tracking/trackFindingCDC/legendre/precisionFunctions/PrecisionUtil.h>
15 
16 #include <tracking/trackFindingCDC/numerics/LookupTable.h>
17 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
18 
19 #include <vector>
20 
21 namespace Belle2 {
26  namespace TrackFindingCDC {
27 
29  class AxialHitQuadTreeProcessor : public QuadTreeProcessor<long, float, const CDCWireHit> {
30 
31  public:
37  static const LookupTable<Vector2D>& getCosSinLookupTable();
41  static std::vector<float> createCurvBound(YSpan curvSpan, int lastLevel);
42 
43  public:
45  AxialHitQuadTreeProcessor(int lastLevel,
46  int seedLevel,
47  const XYSpans& ranges,
48  PrecisionUtil::PrecisionFunction precisionFunction);
49 
55  AxialHitQuadTreeProcessor(const Vector2D& localOrigin,
56  const YSpan& curvSpan,
57  const LookupTable<Vector2D>* cosSinLookupTable);
58 
59  protected: // Section of specialized functions
63  bool isLeaf(QuadTree* node) const final;
64 
72  XYSpans createChild(QuadTree* node, int i, int j) const final;
73 
80  bool isInNode(QuadTree* node, const CDCWireHit* wireHit) const final;
81 
82  protected: // Implementation details
93  bool checkDerivative(QuadTree* node, const CDCWireHit* wireHit) const;
94 
101  bool checkExtremum(QuadTree* node, const CDCWireHit* wireHit) const;
102 
103  public: // debug stuff
105  void drawHits(std::vector<const CDCWireHit*> hits, unsigned int color = 46) const;
107  void drawNode(QuadTree* node) const;
108 
109  private:
111  const LookupTable<Vector2D>* m_cosSinLookupTable;
112 
114  Vector2D m_localOrigin;
115 
121 
123  const double c_curlCurv = 0.02;
124 
127  };
128  }
130 }
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::checkExtremum
bool checkExtremum(QuadTree *node, const CDCWireHit *wireHit) const
Checks whether extremum point is located whithin QuadTree node's ranges.
Definition: AxialHitQuadTreeProcessor.cc:283
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::AxialHitQuadTreeProcessor
AxialHitQuadTreeProcessor(int lastLevel, int seedLevel, const XYSpans &ranges, PrecisionUtil::PrecisionFunction precisionFunction)
Constructor.
Definition: AxialHitQuadTreeProcessor.cc:99
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::c_curlCurv
const double c_curlCurv
The curvature above which the trajectory is considered a curler.
Definition: AxialHitQuadTreeProcessor.h:132
Belle2::TrackFindingCDC::QuadTreeProcessor< long, float, const CDCWireHit >::XYSpans
std::pair< XSpan, YSpan > XYSpans
This pair of spans describes the span of a node.
Definition: QuadTreeProcessor.h:63
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::checkDerivative
bool checkDerivative(QuadTree *node, const CDCWireHit *wireHit) const
Check derivative of the sinogram.
Definition: AxialHitQuadTreeProcessor.cc:264
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::getCosSinLookupTable
static const LookupTable< Vector2D > & getCosSinLookupTable()
Get the standard lookup table containing equally spaces unit vectors (cos, sin)
Definition: AxialHitQuadTreeProcessor.cc:91
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::m_cosSinLookupTable
const LookupTable< Vector2D > * m_cosSinLookupTable
Pinned lookup table for precompute cosine and sine values.
Definition: AxialHitQuadTreeProcessor.h:120
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::isInNode
bool isInNode(QuadTree *node, const CDCWireHit *wireHit) const final
Check whether hit belongs to the quadtree node:
Definition: AxialHitQuadTreeProcessor.cc:196
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::QuadTreeProcessor< long, float, const CDCWireHit >::QuadTree
QuadTreeNode< long, float, Item > QuadTree
The used QuadTree.
Definition: QuadTreeProcessor.h:54
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::createChild
XYSpans createChild(QuadTree *node, int i, int j) const final
Return the new ranges.
Definition: AxialHitQuadTreeProcessor.cc:138
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::m_twoSidedPhaseSpace
bool m_twoSidedPhaseSpace
Indicator whether the two sided phases space insertion check should be used This option should automa...
Definition: AxialHitQuadTreeProcessor.h:129
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::m_localOrigin
Vector2D m_localOrigin
Local origin on which the phase space coordinates are centered.
Definition: AxialHitQuadTreeProcessor.h:123
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::isLeaf
bool isLeaf(QuadTree *node) const final
lastLevel depends on curvature of the track candidate
Definition: AxialHitQuadTreeProcessor.cc:123
Belle2::TrackFindingCDC::PrecisionUtil::PrecisionFunction
std::function< double(double)> PrecisionFunction
Function type which is used for resolution calculations (resolution=f(curvature)) Takes a curvature v...
Definition: PrecisionUtil.h:53
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::m_precisionFunction
PrecisionUtil::PrecisionFunction m_precisionFunction
Lambda which holds resolution function for the quadtree.
Definition: AxialHitQuadTreeProcessor.h:135
Belle2::TrackFindingCDC::QuadTreeProcessor< long, float, const CDCWireHit >::YSpan
typename QuadTree::YSpan YSpan
This pair describes the span in Y for a node.
Definition: QuadTreeProcessor.h:60
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::createCurvBound
static std::vector< float > createCurvBound(YSpan curvSpan, int lastLevel)
Constructs an array with the curvature bounds as generated by the default bin divisions.
Definition: AxialHitQuadTreeProcessor.cc:67
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::drawHits
void drawHits(std::vector< const CDCWireHit * > hits, unsigned int color=46) const
Draw QuadTree node.
Definition: AxialHitQuadTreeProcessor.cc:312
Belle2::TrackFindingCDC::AxialHitQuadTreeProcessor::drawNode
void drawNode(QuadTree *node) const
Draw QuadTree node.
Definition: AxialHitQuadTreeProcessor.cc:354