Belle II Software  release-08-01-10
CDCSegment.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
11 
12 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
13 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
14 
15 #include <vector>
16 
17 namespace Belle2 {
22  namespace TrackFindingCDC {
23 
25  template <class T>
26  class CDCSegment : public std::vector<T> {
27 
28  public:
30  CDCSegment() = default;
31 
39  EStereoKind getStereoKind() const
40  {
42  }
43 
45  bool isAxial() const
46  {
47  return getStereoKind() == EStereoKind::c_Axial;
48  }
49 
57  ISuperLayer getISuperLayer() const
58  {
59  return ISuperLayerUtil::getFrom(this->front());
60  }
61 
63  const std::vector<T>& items() const
64  {
65  return *this;
66  }
67 
70  {
71  return m_trajectory2D;
72  }
73 
75  void setTrajectory2D(const CDCTrajectory2D& trajectory2D) const
76  {
77  m_trajectory2D = trajectory2D;
78  }
79 
82  {
83  // cppcheck-suppress constParameter
84  std::stable_sort(this->begin(), this->end(), [](const T & recoHit, const T & otherRecoHit) {
85  return recoHit.getArcLength2D() < otherRecoHit.getArcLength2D();
86  });
87  }
88 
90  double getAliasScore() const
91  {
92  return m_aliasScore;
93  }
94 
96  void setAliasScore(double aliasScore)
97  {
98  m_aliasScore = aliasScore;
99  }
100 
101  private:
104 
106  double m_aliasScore;
107 
108  };
109 
110  }
112 }
A sequence of hits limited to one superlayer.
Definition: CDCSegment.h:26
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:75
ISuperLayer getISuperLayer() const
Returns the common super layer id of all stored tracking hits.
Definition: CDCSegment.h:57
CDCSegment()=default
Default constructor for ROOT.
bool isAxial() const
Indicator if the underlying wires are axial.
Definition: CDCSegment.h:45
CDCTrajectory2D m_trajectory2D
Memory for the two dimensional trajectory fitted to this segment.
Definition: CDCSegment.h:103
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition: CDCSegment.h:81
const std::vector< T > & items() const
Legacy accessor for the items of the segments, still used in some corners.
Definition: CDCSegment.h:63
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:69
EStereoKind getStereoKind() const
Returns the common stereo type of all hits.
Definition: CDCSegment.h:39
void setAliasScore(double aliasScore)
Setter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:96
double m_aliasScore
Boolean flag to indicate that this segment has a valid alias version.
Definition: CDCSegment.h:106
double getAliasScore() const
Getter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:90
Particle trajectory as it is seen in xy projection represented as a circle.
Abstract base class for different kinds of events.
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:26
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
Definition: ISuperLayer.h:102