Belle II Software development
CDCAxialSegmentPair Class Reference

Class representing a pair of reconstructed axial segements in adjacent superlayer. More...

#include <CDCAxialSegmentPair.h>

Public Member Functions

 CDCAxialSegmentPair ()
 Default constructor setting the contained segmetns to nullptr.
 
 CDCAxialSegmentPair (const CDCAxialSegment2D *startSegment, const CDCAxialSegment2D *endSegment)
 Constructor from two segments.
 
 CDCAxialSegmentPair (const CDCAxialSegment2D *startSegment, const CDCAxialSegment2D *endSegment, const CDCTrajectory2D &trajectory2D)
 Constructor from two segments and an assoziated trajectory.
 
bool operator== (CDCAxialSegmentPair const &rhs) const
 Equality comparision based on the pointers to the stored segments.
 
bool operator< (CDCAxialSegmentPair const &rhs) const
 Total ordering sheme comparing the segment pointers.
 
bool checkSegments () const
 Checks the references to the contained three segment for nullptrs.
 
ISuperLayer getStartISuperLayer () const
 Getter for the superlayer id of the start segment.
 
ISuperLayer getEndISuperLayer () const
 Getter for the superlayer id of the end segment.
 
const CDCAxialSegment2DgetStartSegment () const
 Getter for the start segment.
 
void setStartSegment (const CDCAxialSegment2D *startSegment)
 Setter for the start segment.
 
const CDCAxialSegment2DgetEndSegment () const
 Getter for the end segment.
 
void setEndSegment (const CDCAxialSegment2D *endSegment)
 Setter for the end segment.
 
void setSegments (const CDCSegment2D *startSegment, const CDCSegment2D *endSegment)
 Setter for both segments simultaniously.
 
CDCTrajectory2DgetTrajectory2D () const
 Getter for the trajectory of the two dimensional trajectory.
 
void setTrajectory2D (const CDCTrajectory2D &trajectory2D) const
 Setter for the trajectory of the two dimensional trajectory.
 
void clearTrajectory2D () const
 Invalides the currently stored trajectory information.
 
void unsetAndForwardMaskedFlag () const
 Unsets the masked flag of the segment pair's automaton cell, of the contained segments and of the contained wire hits.
 
void setAndForwardMaskedFlag () const
 Sets the masked flag of the segment pair's automaton cell. Also forward the masked flag to the contained segments and the contained wire hits.
 
void receiveMaskedFlag () const
 If one of the contained segments is marked as masked this segment pair is set be masked as well.
 
EForwardBackward isCoaligned (const CDCTrajectory2D &trajectory2D) const
 Checks if the last entity in the vector lies greater or lower travel distance than the last entity.
 
AutomatonCellgetAutomatonCell () const
 Mutable getter for the automaton cell.
 

Private Attributes

const CDCAxialSegment2Dm_startSegment
 Reference to the start segment.
 
const CDCAxialSegment2Dm_endSegment
 Reference to the end segment.
 
CDCTrajectory2D m_trajectory2D
 Reference to the common trajectory.
 
AutomatonCell m_automatonCell
 Automaton cell assoziated with the pair of segments.
 

Friends

bool operator< (CDCAxialSegmentPair const &segmentPair, const CDCAxialSegment2D *axialSegment)
 Define reconstructed segments and segment triples as coaligned on the start segment.
 
bool operator< (const CDCAxialSegment2D *axialSegment, CDCAxialSegmentPair const &segmentPair)
 Define reconstructed segments and segment pairs as coaligned on the start segment.
 

Detailed Description

Class representing a pair of reconstructed axial segements in adjacent superlayer.

Definition at line 31 of file CDCAxialSegmentPair.h.

Constructor & Destructor Documentation

◆ CDCAxialSegmentPair() [1/3]

Default constructor setting the contained segmetns to nullptr.

Definition at line 26 of file CDCAxialSegmentPair.cc.

27 : m_startSegment(nullptr)
28 , m_endSegment(nullptr)
29{
30}
const CDCAxialSegment2D * m_startSegment
Reference to the start segment.
const CDCAxialSegment2D * m_endSegment
Reference to the end segment.

◆ CDCAxialSegmentPair() [2/3]

CDCAxialSegmentPair ( const CDCAxialSegment2D startSegment,
const CDCAxialSegment2D endSegment 
)

Constructor from two segments.

Definition at line 32 of file CDCAxialSegmentPair.cc.

34 : m_startSegment(startSegment)
35 , m_endSegment(endSegment)
36{
37 B2ASSERT("CDCAxialSegmentPair initialized with nullptr as start segment", startSegment);
38 B2ASSERT("CDCAxialSegmentPair initialized with nullptr as end segment", endSegment);
39}

◆ CDCAxialSegmentPair() [3/3]

CDCAxialSegmentPair ( const CDCAxialSegment2D startSegment,
const CDCAxialSegment2D endSegment,
const CDCTrajectory2D trajectory2D 
)

Constructor from two segments and an assoziated trajectory.

Definition at line 41 of file CDCAxialSegmentPair.cc.

44 : m_startSegment(startSegment)
45 , m_endSegment(endSegment)
46 , m_trajectory2D(trajectory2D)
47{
48 B2ASSERT("CDCAxialSegmentPair initialized with nullptr as start segment", startSegment);
49 B2ASSERT("CDCAxialSegmentPair initialized with nullptr as end segment", endSegment);
50}
CDCTrajectory2D m_trajectory2D
Reference to the common trajectory.

Member Function Documentation

◆ checkSegments()

bool checkSegments ( ) const
inline

Checks the references to the contained three segment for nullptrs.

Definition at line 77 of file CDCAxialSegmentPair.h.

78 {
79 return not(m_startSegment == nullptr or m_endSegment == nullptr);
80 }

◆ clearTrajectory2D()

void clearTrajectory2D ( ) const
inline

Invalides the currently stored trajectory information.

Definition at line 131 of file CDCAxialSegmentPair.h.

132 { getTrajectory2D().clear(); }
CDCTrajectory2D & getTrajectory2D() const
Getter for the trajectory of the two dimensional trajectory.
void clear()
Clears all information from this trajectoy.

◆ getAutomatonCell()

AutomatonCell & getAutomatonCell ( ) const
inline

Mutable getter for the automaton cell.

Definition at line 152 of file CDCAxialSegmentPair.h.

153 {
154 return m_automatonCell;
155 }
AutomatonCell m_automatonCell
Automaton cell assoziated with the pair of segments.

◆ getEndISuperLayer()

ISuperLayer getEndISuperLayer ( ) const

Getter for the superlayer id of the end segment.

Definition at line 57 of file CDCAxialSegmentPair.cc.

58{
60}
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
Definition: ISuperLayer.h:102

◆ getEndSegment()

const CDCAxialSegment2D * getEndSegment ( ) const
inline

Getter for the end segment.

Definition at line 101 of file CDCAxialSegmentPair.h.

102 {
103 return m_endSegment;
104 }

◆ getStartISuperLayer()

ISuperLayer getStartISuperLayer ( ) const

Getter for the superlayer id of the start segment.

Definition at line 52 of file CDCAxialSegmentPair.cc.

53{
55}
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.

◆ getStartSegment()

const CDCAxialSegment2D * getStartSegment ( ) const
inline

Getter for the start segment.

Definition at line 89 of file CDCAxialSegmentPair.h.

90 {
91 return m_startSegment;
92 }

◆ getTrajectory2D()

CDCTrajectory2D & getTrajectory2D ( ) const
inline

Getter for the trajectory of the two dimensional trajectory.

Definition at line 121 of file CDCAxialSegmentPair.h.

122 {
123 return m_trajectory2D;
124 }

◆ isCoaligned()

EForwardBackward isCoaligned ( const CDCTrajectory2D trajectory2D) const

Checks if the last entity in the vector lies greater or lower travel distance than the last entity.

Returns:

  • EForwardBackward::c_Forward if the last entity lies behind the first.
  • EForwardBackward::c_Backward if the last entity lies before the first.

Definition at line 90 of file CDCAxialSegmentPair.cc.

91{
92 EForwardBackward startIsCoaligned = trajectory2D.isForwardOrBackwardTo(*(getStartSegment()));
93 EForwardBackward endIsCoaligned = trajectory2D.isForwardOrBackwardTo(*(getEndSegment()));
94 if (startIsCoaligned == EForwardBackward::c_Forward and
95 endIsCoaligned == EForwardBackward::c_Forward) {
96 return EForwardBackward::c_Forward;
97 } else if (startIsCoaligned == EForwardBackward::c_Backward and
98 endIsCoaligned == EForwardBackward::c_Backward) {
99 return EForwardBackward::c_Backward;
100 } else {
101 return EForwardBackward::c_Invalid;
102 }
103}
EForwardBackward isForwardOrBackwardTo(const AHits &hits) const
Calculates if this trajectory and the hits are coaligned Returns:
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.

◆ operator<()

bool operator< ( CDCAxialSegmentPair const &  rhs) const
inline

Total ordering sheme comparing the segment pointers.

Definition at line 55 of file CDCAxialSegmentPair.h.

56 {
57 return
58 std::tie(m_startSegment, m_endSegment) <
59 std::tie(rhs.m_startSegment, rhs.m_endSegment);
60 }

◆ operator==()

bool operator== ( CDCAxialSegmentPair const &  rhs) const
inline

Equality comparision based on the pointers to the stored segments.

Definition at line 47 of file CDCAxialSegmentPair.h.

48 {
49 return
50 std::tie(m_startSegment, m_endSegment) ==
51 std::tie(rhs.m_startSegment, rhs.m_endSegment);
52 }

◆ receiveMaskedFlag()

void receiveMaskedFlag ( ) const

If one of the contained segments is marked as masked this segment pair is set be masked as well.

Definition at line 78 of file CDCAxialSegmentPair.cc.

79{
80 const bool fromHits = true;
81 getStartSegment()->receiveMaskedFlag(fromHits);
82 getEndSegment()->receiveMaskedFlag(fromHits);
83
84 if (getStartSegment()->getAutomatonCell().hasMaskedFlag() or
85 getEndSegment()->getAutomatonCell().hasMaskedFlag()) {
87 }
88}
void setMaskedFlag(bool setTo=true)
Sets the masked flag to the given value. Default value true.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.

◆ setAndForwardMaskedFlag()

void setAndForwardMaskedFlag ( ) const

Sets the masked flag of the segment pair's automaton cell. Also forward the masked flag to the contained segments and the contained wire hits.

Definition at line 70 of file CDCAxialSegmentPair.cc.

71{
73 const bool toHits = true;
74 getStartSegment()->setAndForwardMaskedFlag(toHits);
75 getEndSegment()->setAndForwardMaskedFlag(toHits);
76}

◆ setEndSegment()

void setEndSegment ( const CDCAxialSegment2D endSegment)
inline

Setter for the end segment.

Definition at line 107 of file CDCAxialSegmentPair.h.

108 {
109 m_endSegment = endSegment;
110 }

◆ setSegments()

void setSegments ( const CDCSegment2D startSegment,
const CDCSegment2D endSegment 
)
inline

Setter for both segments simultaniously.

Definition at line 113 of file CDCAxialSegmentPair.h.

114 {
115 m_startSegment = startSegment;
116 m_endSegment = endSegment;
118 }
bool checkSegments() const
Checks the references to the contained three segment for nullptrs.

◆ setStartSegment()

void setStartSegment ( const CDCAxialSegment2D startSegment)
inline

Setter for the start segment.

Definition at line 95 of file CDCAxialSegmentPair.h.

96 {
97 m_startSegment = startSegment;
98 }

◆ setTrajectory2D()

void setTrajectory2D ( const CDCTrajectory2D trajectory2D) const
inline

Setter for the trajectory of the two dimensional trajectory.

Definition at line 127 of file CDCAxialSegmentPair.h.

128 { m_trajectory2D = trajectory2D; }

◆ unsetAndForwardMaskedFlag()

void unsetAndForwardMaskedFlag ( ) const

Unsets the masked flag of the segment pair's automaton cell, of the contained segments and of the contained wire hits.

Definition at line 62 of file CDCAxialSegmentPair.cc.

63{
65 const bool toHits = true;
66 getStartSegment()->unsetAndForwardMaskedFlag(toHits);
67 getEndSegment()->unsetAndForwardMaskedFlag(toHits);
68}
void unsetMaskedFlag()
Resets the masked flag to false.

Friends And Related Function Documentation

◆ operator< [1/2]

bool operator< ( CDCAxialSegmentPair const &  segmentPair,
const CDCAxialSegment2D axialSegment 
)
friend

Define reconstructed segments and segment triples as coaligned on the start segment.

Definition at line 63 of file CDCAxialSegmentPair.h.

65 {
66 return segmentPair.getStartSegment() < axialSegment;
67 }

◆ operator< [2/2]

bool operator< ( const CDCAxialSegment2D axialSegment,
CDCAxialSegmentPair const &  segmentPair 
)
friend

Define reconstructed segments and segment pairs as coaligned on the start segment.

Definition at line 70 of file CDCAxialSegmentPair.h.

72 {
73 return axialSegment < segmentPair.getStartSegment();
74 }

Member Data Documentation

◆ m_automatonCell

AutomatonCell m_automatonCell
mutableprivate

Automaton cell assoziated with the pair of segments.

Definition at line 168 of file CDCAxialSegmentPair.h.

◆ m_endSegment

const CDCAxialSegment2D* m_endSegment
private

Reference to the end segment.

Definition at line 162 of file CDCAxialSegmentPair.h.

◆ m_startSegment

const CDCAxialSegment2D* m_startSegment
private

Reference to the start segment.

Definition at line 159 of file CDCAxialSegmentPair.h.

◆ m_trajectory2D

CDCTrajectory2D m_trajectory2D
mutableprivate

Reference to the common trajectory.

Definition at line 165 of file CDCAxialSegmentPair.h.


The documentation for this class was generated from the following files: