Belle II Software development
CDCAxialSegmentPair.cc
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#include <tracking/trackFindingCDC/eventdata/tracks/CDCAxialSegmentPair.h>
9
10#include <tracking/trackFindingCDC/eventdata/segments/CDCSegment2D.h>
11#include <tracking/trackFindingCDC/eventdata/segments/CDCAxialSegment2D.h>
12
13#include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
14
15#include <tracking/trackFindingCDC/topology/ISuperLayer.h>
16
17#include <tracking/trackFindingCDC/ca/AutomatonCell.h>
18
19#include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
20
21#include <framework/logging/Logger.h>
22
23using namespace Belle2;
24using namespace TrackFindingCDC;
25
27 : m_startSegment(nullptr)
28 , m_endSegment(nullptr)
29{
30}
31
33 const CDCAxialSegment2D* endSegment)
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}
40
42 const CDCAxialSegment2D* endSegment,
43 const CDCTrajectory2D& trajectory2D)
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}
51
53{
55}
56
58{
60}
61
63{
65 const bool toHits = true;
66 getStartSegment()->unsetAndForwardMaskedFlag(toHits);
67 getEndSegment()->unsetAndForwardMaskedFlag(toHits);
68}
69
71{
73 const bool toHits = true;
74 getStartSegment()->setAndForwardMaskedFlag(toHits);
75 getEndSegment()->setAndForwardMaskedFlag(toHits);
76}
77
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}
89
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}
void setMaskedFlag(bool setTo=true)
Sets the masked flag to the given value. Default value true.
void unsetMaskedFlag()
Resets the masked flag to false.
ISuperLayer getStartISuperLayer() const
Getter for the superlayer id of the start segment.
const CDCAxialSegment2D * getEndSegment() const
Getter for the end segment.
AutomatonCell & getAutomatonCell() const
Mutable getter for the automaton cell.
void setAndForwardMaskedFlag() const
Sets the masked flag of the segment pair's automaton cell. Also forward the masked flag to the contai...
void unsetAndForwardMaskedFlag() const
Unsets the masked flag of the segment pair's automaton cell, of the contained segments and of the con...
CDCAxialSegmentPair()
Default constructor setting the contained segments to nullptr.
const CDCAxialSegment2D * getStartSegment() const
Getter for the start segment.
ISuperLayer getEndISuperLayer() const
Getter for the superlayer id of the end segment.
EForwardBackward isCoaligned(const CDCTrajectory2D &trajectory2D) const
Checks if the last entity in the vector lies greater or lower travel distance than the last entity.
void receiveMaskedFlag() const
If one of the contained segments is marked as masked this segment pair is set be masked as well.
A reconstructed sequence of two dimensional hits in one super layer.
Definition: CDCSegment2D.h:39
Particle trajectory as it is seen in xy projection represented as a circle.
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.
Abstract base class for different kinds of events.
static ISuperLayer getFrom(const T &t)
Returns the superlayer of an object.
Definition: ISuperLayer.h:102