BOSS 8.0.0
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
12#include "MucRecEvent/MucRecHitID.h"
13
14// IMPLEMENTATION OF MucRecHitID METHODS. ================================
15
16// Constructor.
17MucRecHitID::MucRecHitID( const int part, const int seg, const int gap, const int hit )
18 : m_Part( part ), m_Seg( seg ), m_Gap( gap ), m_Hit( hit ) {}
19
20// Copy constructor.
22 : m_Part( source.m_Part )
23 , m_Seg( source.m_Seg )
24 , m_Gap( source.m_Gap )
25 , m_Hit( source.m_Hit ) {}
26
27// Destructor.
29
30// Assignment operator.
32 // Assignment operator.
33 if ( this != &orig )
34 { // Watch out for self-assignment!
35 m_Part = orig.m_Part;
36 m_Seg = orig.m_Seg;
37 m_Gap = orig.m_Gap;
38 m_Hit = orig.m_Hit;
39 }
40 return *this;
41}
42
43bool MucRecHitID::operator==( const MucRecHitID& other ) const {
44 if ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap &&
45 m_Hit == other.m_Hit )
46 return true;
47 else return false;
48}
49
50bool MucRecHitID::operator!=( const MucRecHitID& other ) const {
51 if ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap &&
52 m_Hit == other.m_Hit )
53 return false;
54 else return true;
55}
56
57bool MucRecHitID::operator<( const MucRecHitID& other ) const {
58 if ( m_Part < other.m_Part || ( m_Part == other.m_Part && m_Seg < other.m_Seg ) ||
59 ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap < other.m_Gap ) ||
60 ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap &&
61 m_Hit < other.m_Hit ) )
62 { return true; }
63 else { return false; }
64}
65
66bool MucRecHitID::operator>( const MucRecHitID& other ) const {
67 if ( m_Part > other.m_Part || ( m_Part == other.m_Part && m_Seg > other.m_Seg ) ||
68 ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap > other.m_Gap ) ||
69 ( m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap &&
70 m_Hit > other.m_Hit ) )
71 { return true; }
72 else { return false; }
73}
74
75// Set the identifier variables.
76void MucRecHitID::SetID( const int part, const int seg, const int gap, const int hit ) {
77 m_Part = part;
78 m_Seg = seg;
79 m_Gap = gap;
80 m_Hit = hit;
81}
82
83// Output to a stream.
84// ostream& operator << (ostream& s, const MucRecHitID& hitID)
85//{
86// return s << " Part " << hitID.Part() << " Seg " << hitID.Seg()
87// << " Gap " << hitID.Gap() << " Hit " << hitID.Hit();
88//}
bool operator!=(const MucRecHitID &other) const
bool operator>(const MucRecHitID &other) const
bool operator<(const MucRecHitID &other) const
MucRecHitID(const int part=-1, const int seg=-1, const int gap=-1, const int hit=-1)
Constructor.
~MucRecHitID()
Destructor.
MucRecHitID & operator=(const MucRecHitID &orig)
Assignment operator.
bool operator==(const MucRecHitID &other) const
Comparison operators.
void SetID(const int part=-1, const int seg=-1, const int gap=-1, const int hit=-1)
Set the identifier.