Belle II Software prerelease-11-00-00a
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/trackingUtilities/eventdata/trajectories/CDCTrajectory2D.h>
11
12#include <cdc/topology/ISuperLayer.h>
13#include <cdc/topology/EStereoKind.h>
14
15#include <vector>
16
17namespace Belle2 {
22 namespace TrackingUtilities {
23
25 template <class T>
26 class CDCSegment : public std::vector<T> {
27
28 public:
30 CDCSegment() = default;
31
43
45 bool isAxial() const
46 {
48 }
49
58 {
59 return CDC::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 std::stable_sort(this->begin(), this->end(), [](const T & recoHit, const T & otherRecoHit) {
84 return recoHit.getArcLength2D() < otherRecoHit.getArcLength2D();
85 });
86 }
87
89 double getAliasScore() const
90 {
91 return m_aliasScore;
92 }
93
95 void setAliasScore(double aliasScore)
96 {
97 m_aliasScore = aliasScore;
98 }
99
100 private:
103
105 // Stefano S: this was not initialized, I was not sure if to use 0 was safe
106 // then I set the default value to NaN to solve a warning.
107 // Not clear to me why the variable is "double" and not boolean
108 double m_aliasScore = std::numeric_limits<double>::quiet_NaN();
109
110 };
111
112 }
114}
void setTrajectory2D(const CDCTrajectory2D &trajectory2D) const
Setter for the two dimensional trajectory fitted to the segment.
Definition CDCSegment.h:75
CDCSegment()=default
Default constructor for ROOT.
bool isAxial() const
Indicator if the underlying wires are axial.
Definition CDCSegment.h:45
CDC::ISuperLayer getISuperLayer() const
Returns the common super layer id of all stored tracking hits.
Definition CDCSegment.h:57
CDCTrajectory2D & getTrajectory2D() const
Getter for the two dimensional trajectory fitted to the segment.
Definition CDCSegment.h:69
CDCTrajectory2D m_trajectory2D
Memory for the two dimensional trajectory fitted to this segment.
Definition CDCSegment.h:102
void sortByArcLength2D()
Sort the recoHits according to their perpS information.
Definition CDCSegment.h:81
CDC::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:95
const std::vector< T > & items() const
Legacy accessor for the items of the segments, still used in some corners.
Definition CDCSegment.h:63
double m_aliasScore
Flag to indicate that this segment has a valid alias version.
Definition CDCSegment.h:108
double getAliasScore() const
Getter for the flag that this segment may have an aliased version.
Definition CDCSegment.h:89
Particle trajectory as it is seen in xy projection represented as a circle.
EStereoKind
Type for the stereo property of the wire.
Definition EStereoKind.h:20
@ c_Axial
Constant for an axial wire.
Definition EStereoKind.h:22
signed short ISuperLayer
The type of the layer and superlayer ids.
Definition ISuperLayer.h:24
Abstract base class for different kinds of events.
static EStereoKind getStereoKind(ISuperLayer iSuperLayer)
Returns the stereo kind of the super layer.
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.