BOSS 6.6.4.p01
BESIII Offline Software System
Loading...
Searching...
No Matches
MucSoftID.cxx
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2003/08/30 Zhengyun You Peking University
7 *
8 * 2004/09/09 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
12using namespace std;
13
14#include <iostream>
15
16#include "MucGeomSvc/MucSoftID.h"
17
18//const int
19//MucSoftID::m_kPart = 3;
20
21//const int
22//MucSoftID::m_kSegInPartMax = 8;
23
24const int
26
27//const int
28//MucSoftID::m_kGapInSegMax = 9;
29
30const int
32
33//const int
34//MucSoftID::m_kStripInGapMax = 96;
35
36const int
37MucSoftID::m_kStripInGap[MucSoftID::m_kPart][MucSoftID::m_kGapInSegMax] = { {64, 64, 64, 64, 64, 64, 64, 64},
38 {48, 96, 48, 96, 48, 96, 48, 96, 48},
39 {64, 64, 64, 64, 64, 64, 64, 64} };
40
41const int
43
44const int
46
47const int
49
50// Assume a maximum occupancy of 100% for now.
51const int
53
54const int
56
57
58MucSoftID::MucSoftID(const int part,
59 const int seg,
60 const int gap,
61 const int strip)
62 : m_Part(part),
63 m_Seg(seg),
64 m_Gap(gap),
65 m_Strip(strip)
66{
67 // Constructor.
68}
69
72{
73 // Assignment operator.
74 if (this != &orig) { // Watch out for self-assignment!
75 m_Part = orig.m_Part;
76 m_Seg = orig.m_Seg;
77 m_Gap = orig.m_Gap;
78 m_Strip = orig.m_Strip;
79 }
80 return *this;
81}
82
84 : m_Part(orig.m_Part),
85 m_Seg(orig.m_Seg),
86 m_Gap(orig.m_Gap),
87 m_Strip(orig.m_Strip)
88{
89 // Copy constructor.
90}
91
92bool
94{
95 if( m_Part == id.GetPart()
96 && m_Seg == id.GetSeg()
97 && m_Gap == id.GetGap()
98 && m_Strip == id.GetStrip() ) {
99 return true;
100 }
101 else {
102 return false;
103 }
104}
105
106void
107MucSoftID::SetID(const int part,
108 const int seg,
109 const int gap,
110 const int strip)
111{
112 // Set the sub-identifier, m_GapID and m_StripID.
113 m_Part = part;
114 m_Seg = seg;
115 m_Gap = gap;
116 m_Strip = strip;
117}
118
119ostream& operator << (ostream& s, const MucSoftID& id)
120{
121 // Print MucSoftID information to a stream.
122 s << " part " << id.GetPart()
123 << " seg " << id.GetSeg()
124 << " gap " << id.GetGap()
125 << " strip " << id.GetStrip();
126
127 return s;
128}
129
130size_t GapHash(const MucSoftID& id)
131{
132 // Return the position of a MucSoftID object in the GapGeo hash table.
133 return ( ( id.GetPart()
134 *MucSoftID::m_kSegInPartMax + id.GetSeg() )
135 *MucSoftID::m_kGapInSegMax + id.GetGap() );
136}
137
138size_t StripHash(const MucSoftID& id)
139{
140 // Return the position of a MucSoftID object in the StripGeo hash table.
141 return ( ( ( id.GetPart()
142 *MucSoftID::m_kSegInPartMax + id.GetSeg() )
143 *MucSoftID::m_kGapInSegMax + id.GetGap() )
144 *MucSoftID::m_kStripInGapMax + id.GetStrip() );
145}
XmlRpcServer s
Definition: HelloServer.cpp:11
size_t GapHash(const MucSoftID &id)
Return the position of a MucSoftID object in the GapGeo hash table.
Definition: MucSoftID.cxx:130
size_t StripHash(const MucSoftID &id)
Return the position of a MucSoftID object in the StripGeo hash table.
Definition: MucSoftID.cxx:138
ostream & operator<<(ostream &s, const MucSoftID &id)
Print MucSoftID information to a stream.
Definition: MucSoftID.cxx:119
static const int m_kStripTotal
Number of strips total in the Bes MUC.
Definition: MucSoftID.h:58
static const int m_kSegTotal
Number of segments total in the Bes MUC.
Definition: MucSoftID.h:54
static const int m_kStripInGapMax
Number of strips in a gap max.
Definition: MucSoftID.h:49
static const int m_kGapInSegMax
Number of gaps in a segment max.
Definition: MucSoftID.h:44
static const int m_kSegInPart[m_kPart]
Number of segments in a part.
Definition: MucSoftID.h:41
int GetPart() const
Get part number. (0-east cap, 1-barrel, 2-west cap)
Definition: MucSoftID.h:85
int GetStrip() const
Get strip number. (barrel 0-47 for gap0,2,4,6,8, 0-95 for gap1,3,5,7, endcap 0-63)
Definition: MucSoftID.h:94
static const int m_kHitInGapMax
Maximum number of hits in a gap.
Definition: MucSoftID.h:61
int GetGap() const
Get gap number. (barrel 0-8, cap 0-7)
Definition: MucSoftID.h:91
MucSoftID(const int part=-1, const int seg=-1, const int gap=-1, const int strip=-1)
Constructor.
Definition: MucSoftID.cxx:58
static const int m_kSegInPartMax
Number of segments in a part max.
Definition: MucSoftID.h:39
static const int m_kGapTotal
Number of gaps total in the Bes MUC.
Definition: MucSoftID.h:56
void SetID(const int part=-1, const int seg=-1, const int gap=-1, const int strip=-1)
Set the sub-identifier.
Definition: MucSoftID.cxx:107
static const int m_kHitTotalMax
Maximum number of hits total in the Bes MUC.
Definition: MucSoftID.h:63
static const int m_kPart
Number of parts in Bes Muc.
Definition: MucSoftID.h:36
MucSoftID & operator=(const MucSoftID &orig)
Assignment constructor.
Definition: MucSoftID.cxx:71
int GetSeg() const
Get segment number. (barrel 0-3, cap 0-7)
Definition: MucSoftID.h:88
bool operator==(const MucSoftID &id) const
Compare whehter two MucSoftID is equal.
Definition: MucSoftID.cxx:93
static const int m_kStripInGap[m_kPart][m_kGapInSegMax]
Number of strips in a gap.
Definition: MucSoftID.h:51
static const int m_kGapInPart[m_kPart]
Number of gaps in a segment of part.
Definition: MucSoftID.h:46