Belle II Software development
Segment.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/dataobjects/FullSecID.h>
11
12// C++-std:
13#include <string>
14
15namespace Belle2 {
24 template<class HitType>
25 class Segment {
26 protected:
30 HitType* m_outerHit = nullptr;
31
33 HitType* m_innerHit = nullptr;
34
36 const std::int64_t m_identifier = -1;
37
40
43
44 public:
51 {}
52
53
60 Segment(FullSecID::BaseType outerSector, FullSecID::BaseType innerSector, HitType* outerNode, HitType* innerNode):
61 m_outerHit(outerNode),
62 m_innerHit(innerNode),
63 m_identifier(static_cast<std::int64_t>(outerNode->getID()) << 32 | static_cast<std::int64_t>
64 (innerNode->getID())), // Use int TrackNode IDs to construct int Segment ID
65 m_outerSector(outerSector),
66 m_innerSector(innerSector)
67 {}
68
72 bool operator==(const Segment& b) const
73 {
74 return (*getInnerHit() == *b.getInnerHit() and * getOuterHit() == *b.getOuterHit());
75 }
76
79
81 std::int64_t getID() const { return m_identifier; }
82
84 std::string getName() const
85 {
86 if (m_identifier >= 0)
87 return "Out: " + m_outerHit->getName() + ")" + ",\nin: " + m_innerHit->getName();
88 else
89 return "Out: missing,\nin: missing";
90 }
91
93 inline const HitType* getInnerHit() const { return m_innerHit; }
94
95
97 inline const HitType* getOuterHit() const { return m_outerHit; }
98
99
102
103
106 };
108} //Belle2 namespace
Class to identify a sector inside of the VXD.
Definition: FullSecID.h:33
unsigned int BaseType
defines the base type used for FullSecID
Definition: FullSecID.h:38
The Segment class This class represents segments of track candidates needed for TrackFinderVXD-Module...
Definition: Segment.h:25
HitType * m_innerHit
pointer to hit forming the inner end of the Segment.
Definition: Segment.h:33
FullSecID::BaseType m_outerSector
iD of sector carrying outer hit
Definition: Segment.h:39
FullSecID::BaseType getInnerSecID() const
returns inner secID of current Segment
Definition: Segment.h:101
Segment(FullSecID::BaseType outerSector, FullSecID::BaseType innerSector, HitType *outerNode, HitType *innerNode)
Constructor.
Definition: Segment.h:60
std::int64_t getID() const
************************* PUBLIC MEMBER FUNCTIONS *************************
Definition: Segment.h:81
std::string getName() const
returns longer debugging name of this segment
Definition: Segment.h:84
bool operator==(const Segment &b) const
************************* OPERATORS *************************
Definition: Segment.h:72
const std::int64_t m_identifier
unique identifier
Definition: Segment.h:36
const HitType * getOuterHit() const
returns outer hit of current Segment
Definition: Segment.h:97
FullSecID::BaseType getOuterSecID() const
returns outer secID of current Segment
Definition: Segment.h:105
Segment()
************************* CONSTRUCTORS *************************
Definition: Segment.h:48
FullSecID::BaseType m_innerSector
iD of sector carrying inner hit
Definition: Segment.h:42
const HitType * getInnerHit() const
returns inner hit of current Segment
Definition: Segment.h:93
HitType * m_outerHit
************************* DATA MEMBERS *************************
Definition: Segment.h:30
Abstract base class for different kinds of events.
STL namespace.