BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
MucRecHitID.cxx
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2003/12/13 Zhengyun You Peking University
7 *
8 * 2004/09/12 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
13
14// IMPLEMENTATION OF MucRecHitID METHODS. ================================
15
16// Constructor.
18 const int seg,
19 const int gap,
20 const int hit)
21 : m_Part(part), m_Seg(seg), m_Gap(gap), m_Hit(hit)
22{ }
23
24// Copy constructor.
26 : m_Part(source.m_Part),
27 m_Seg(source.m_Seg),
28 m_Gap(source.m_Gap),
29 m_Hit(source.m_Hit)
30{ }
31
32// Destructor.
34{ }
35
36// Assignment operator.
39{
40 // Assignment operator.
41 if (this != &orig) { // Watch out for self-assignment!
42 m_Part = orig.m_Part;
43 m_Seg = orig.m_Seg;
44 m_Gap = orig.m_Gap;
45 m_Hit = orig.m_Hit;
46 }
47 return *this;
48}
49
50bool
52{
53 if ( m_Part == other.m_Part &&
54 m_Seg == other.m_Seg &&
55 m_Gap == other.m_Gap &&
56 m_Hit == other.m_Hit )
57 return true;
58 else
59 return false;
60}
61
62bool
64{
65 if ( m_Part == other.m_Part &&
66 m_Seg == other.m_Seg &&
67 m_Gap == other.m_Gap &&
68 m_Hit == other.m_Hit )
69 return false;
70 else
71 return true;
72}
73
74bool
75MucRecHitID::operator < (const MucRecHitID& other) const
76{
77 if (m_Part < other.m_Part ||
78 (m_Part == other.m_Part && m_Seg < other.m_Seg) ||
79 (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap < other.m_Gap) ||
80 (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap && m_Hit < other.m_Hit)) {
81 return true;
82 }
83 else {
84 return false;
85 }
86}
87
88bool
90{
91 if (m_Part > other.m_Part ||
92 (m_Part == other.m_Part && m_Seg > other.m_Seg) ||
93 (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap > other.m_Gap) ||
94 (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap && m_Hit > other.m_Hit)) {
95 return true;
96 }
97 else {
98 return false;
99 }
100}
101
102// Set the identifier variables.
103void
104MucRecHitID::SetID(const int part,
105 const int seg,
106 const int gap,
107 const int hit)
108{
109 m_Part = part;
110 m_Seg = seg;
111 m_Gap = gap;
112 m_Hit = hit;
113}
114
115// Output to a stream.
116//ostream& operator << (ostream& s, const MucRecHitID& hitID)
117 //{
118 //return s << " Part " << hitID.Part() << " Seg " << hitID.Seg()
119 // << " Gap " << hitID.Gap() << " Hit " << hitID.Hit();
120 //}
bool operator!=(const MucRecHitID &other) const
Definition: MucRecHitID.cxx:63
bool operator>(const MucRecHitID &other) const
Definition: MucRecHitID.cxx:89
bool operator<(const MucRecHitID &other) const
Definition: MucRecHitID.cxx:75
MucRecHitID(const int part=-1, const int seg=-1, const int gap=-1, const int hit=-1)
Constructor.
Definition: MucRecHitID.cxx:17
~MucRecHitID()
Destructor.
Definition: MucRecHitID.cxx:33
MucRecHitID & operator=(const MucRecHitID &orig)
Assignment operator.
Definition: MucRecHitID.cxx:38
bool operator==(const MucRecHitID &other) const
Comparison operators.
Definition: MucRecHitID.cxx:51
void SetID(const int part=-1, const int seg=-1, const int gap=-1, const int hit=-1)
Set the identifier.