00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 using namespace std;
00013
00014 #include <iostream>
00015
00016 #include "MucGeomSvc/MucSoftID.h"
00017
00018
00019
00020
00021
00022
00023
00024 const int
00025 MucSoftID::m_kSegInPart[MucSoftID::m_kPart] = {4, 8, 4};
00026
00027
00028
00029
00030 const int
00031 MucSoftID::m_kGapInPart[MucSoftID::m_kPart] = {8, 9, 8};
00032
00033
00034
00035
00036 const int
00037 MucSoftID::m_kStripInGap[MucSoftID::m_kPart][MucSoftID::m_kGapInSegMax] = { {64, 64, 64, 64, 64, 64, 64, 64},
00038 {48, 96, 48, 96, 48, 96, 48, 96, 48},
00039 {64, 64, 64, 64, 64, 64, 64, 64} };
00040
00041 const int
00042 MucSoftID::m_kSegTotal = MucSoftID::m_kSegInPartMax * MucSoftID::m_kPart;
00043
00044 const int
00045 MucSoftID::m_kGapTotal = MucSoftID::m_kGapInSegMax * MucSoftID::m_kSegTotal;
00046
00047 const int
00048 MucSoftID::m_kStripTotal = MucSoftID::m_kStripInGapMax * MucSoftID::m_kGapTotal;
00049
00050
00051 const int
00052 MucSoftID::m_kHitInGapMax = MucSoftID::m_kStripInGapMax;
00053
00054 const int
00055 MucSoftID::m_kHitTotalMax = MucSoftID::m_kStripTotal;
00056
00057
00058 MucSoftID::MucSoftID(const int part,
00059 const int seg,
00060 const int gap,
00061 const int strip)
00062 : m_Part(part),
00063 m_Seg(seg),
00064 m_Gap(gap),
00065 m_Strip(strip)
00066 {
00067
00068 }
00069
00070 MucSoftID&
00071 MucSoftID::operator=(const MucSoftID& orig)
00072 {
00073
00074 if (this != &orig) {
00075 m_Part = orig.m_Part;
00076 m_Seg = orig.m_Seg;
00077 m_Gap = orig.m_Gap;
00078 m_Strip = orig.m_Strip;
00079 }
00080 return *this;
00081 }
00082
00083 MucSoftID::MucSoftID(const MucSoftID& orig)
00084 : m_Part(orig.m_Part),
00085 m_Seg(orig.m_Seg),
00086 m_Gap(orig.m_Gap),
00087 m_Strip(orig.m_Strip)
00088 {
00089
00090 }
00091
00092 bool
00093 MucSoftID::operator == (const MucSoftID& id) const
00094 {
00095 if( m_Part == id.GetPart()
00096 && m_Seg == id.GetSeg()
00097 && m_Gap == id.GetGap()
00098 && m_Strip == id.GetStrip() ) {
00099 return true;
00100 }
00101 else {
00102 return false;
00103 }
00104 }
00105
00106 void
00107 MucSoftID::SetID(const int part,
00108 const int seg,
00109 const int gap,
00110 const int strip)
00111 {
00112
00113 m_Part = part;
00114 m_Seg = seg;
00115 m_Gap = gap;
00116 m_Strip = strip;
00117 }
00118
00119 ostream& operator << (ostream& s, const MucSoftID& id)
00120 {
00121
00122 s << " part " << id.GetPart()
00123 << " seg " << id.GetSeg()
00124 << " gap " << id.GetGap()
00125 << " strip " << id.GetStrip();
00126
00127 return s;
00128 }
00129
00130 size_t GapHash(const MucSoftID& id)
00131 {
00132
00133 return ( ( id.GetPart()
00134 *MucSoftID::m_kSegInPartMax + id.GetSeg() )
00135 *MucSoftID::m_kGapInSegMax + id.GetGap() );
00136 }
00137
00138 size_t StripHash(const MucSoftID& id)
00139 {
00140
00141 return ( ( ( id.GetPart()
00142 *MucSoftID::m_kSegInPartMax + id.GetSeg() )
00143 *MucSoftID::m_kGapInSegMax + id.GetGap() )
00144 *MucSoftID::m_kStripInGapMax + id.GetStrip() );
00145 }