Belle II Software  release-05-02-19
CDCSegment.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - 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/eventdata/trajectories/CDCTrajectory2D.h>
13 
14 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
15 #include <tracking/trackFindingCDC/topology/EStereoKind.h>
16 
17 #include <vector>
18 
19 namespace Belle2 {
24  namespace TrackFindingCDC {
25 
27  template <class T>
28  class CDCSegment : public std::vector<T> {
29 
30  public:
32  CDCSegment() = default;
33 
41  EStereoKind getStereoKind() const
42  {
44  }
45 
47  bool isAxial() const
48  {
49  return getStereoKind() == EStereoKind::c_Axial;
50  }
51 
59  ISuperLayer getISuperLayer() const
60  {
61  return ISuperLayerUtil::getFrom(this->front());
62  }
63 
65  const std::vector<T>& items() const
66  {
67  return *this;
68  }
69 
72  {
74  }
75 
77  void setTrajectory2D(const CDCTrajectory2D& trajectory2D) const
78  {
79  m_trajectory2D = trajectory2D;
80  }
81 
83  void sortByArcLength2D()
84  {
85  std::stable_sort(this->begin(), this->end(), [](const T & recoHit, const T & otherRecoHit) {
86  return recoHit.getArcLength2D() < otherRecoHit.getArcLength2D();
87  });
88  }
89 
91  double getAliasScore() const
92  {
93  return m_aliasScore;
94  }
95 
97  void setAliasScore(double aliasScore)
98  {
99  m_aliasScore = aliasScore;
100  }
101 
102  private:
105 
107  double m_aliasScore;
108 
109  };
110 
111  }
113 }
Belle2::TrackFindingCDC::CDCSegment::sortByArcLength2D
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition: CDCSegment.h:91
Belle2::TrackFindingCDC::ISuperLayerUtil::getFrom
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
Definition: ISuperLayer.h:112
Belle2::TrackFindingCDC::ISuperLayerUtil::getStereoKind
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
Definition: ISuperLayer.cc:28
Belle2::TrackFindingCDC::CDCSegment::m_trajectory2D
CDCTrajectory2D m_trajectory2D
Memory for the two dimensional trajectory fitted to this segment.
Definition: CDCSegment.h:112
Belle2::TrackFindingCDC::CDCTrajectory2D
Particle trajectory as it is seen in xy projection represented as a circle.
Definition: CDCTrajectory2D.h:46
Belle2::TrackFindingCDC::CDCSegment::setTrajectory2D
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:85
Belle2::TrackFindingCDC::CDCSegment::m_aliasScore
double m_aliasScore
Boolean flag to indicate that this segment has a valid alias version.
Definition: CDCSegment.h:115
Belle2::TrackFindingCDC::CDCSegment::isAxial
bool isAxial() const
Indicator if the underlying wires are axial.
Definition: CDCSegment.h:55
Belle2::TrackFindingCDC::CDCSegment::getStereoKind
EStereoKind getStereoKind() const
Returns the common stereo type of all hits.
Definition: CDCSegment.h:49
Belle2::TrackFindingCDC::CDCSegment::getAliasScore
double getAliasScore() const
Getter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:99
Belle2::TrackFindingCDC::CDCSegment::getTrajectory2D
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Definition: CDCSegment.h:79
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCSegment::getISuperLayer
ISuperLayer getISuperLayer() const
Returns the common super layer id of all stored tracking hits.
Definition: CDCSegment.h:67
Belle2::TrackFindingCDC::CDCSegment::items
const std::vector< T > & items() const
Legacy accessor for the items of the segments, still used in some corners.
Definition: CDCSegment.h:73
Belle2::TrackFindingCDC::CDCSegment::CDCSegment
CDCSegment()=default
Default constructor for ROOT.
Belle2::TrackFindingCDC::CDCSegment::setAliasScore
void setAliasScore(double aliasScore)
Setter for the flag that this segment may have an aliased version.
Definition: CDCSegment.h:105