/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucGeomSvc/MucGeomSvc-00-02-25/src/tmp/MucSoftID.cxx

Go to the documentation of this file.
00001 //$id$
00002 //
00003 //$log$
00004 
00005 /*
00006  *    2003/08/30   Zhengyun You     Peking University
00007  * 
00008  *    2004/09/09   Zhengyun You     Peking University
00009  *                 transplanted to Gaudi framework
00010  */
00011 
00012 using namespace std;
00013 
00014 #include <iostream>
00015 
00016 #include "MucGeomSvc/MucSoftID.h"
00017 
00018 //const int 
00019 //MucSoftID::m_kPart = 3;
00020 
00021 //const int 
00022 //MucSoftID::m_kSegInPartMax = 8;
00023 
00024 const int 
00025 MucSoftID::m_kSegInPart[MucSoftID::m_kPart] = {4, 8, 4};
00026 
00027 //const int 
00028 //MucSoftID::m_kGapInSegMax = 9;
00029 
00030 const int 
00031 MucSoftID::m_kGapInPart[MucSoftID::m_kPart] = {8, 9, 8};
00032 
00033 //const int 
00034 //MucSoftID::m_kStripInGapMax = 96;
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 // Assume a maximum occupancy of 100% for now.
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   // Constructor.
00068 }
00069 
00070 MucSoftID& 
00071 MucSoftID::operator=(const MucSoftID& orig)
00072 {
00073   // Assignment operator.
00074   if (this != &orig) {             // Watch out for self-assignment!
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   // Copy constructor.
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   // Set the sub-identifier, m_GapID and m_StripID.
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   // Print MucSoftID information to a stream.
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   // Return the position of a MucSoftID object in the GapGeo hash table.
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   // Return the position of a MucSoftID object in the StripGeo hash table.
00141   return ( ( ( id.GetPart()
00142                *MucSoftID::m_kSegInPartMax + id.GetSeg() )
00143              *MucSoftID::m_kGapInSegMax + id.GetGap() )
00144            *MucSoftID::m_kStripInGapMax + id.GetStrip() ); 
00145 }

Generated on Tue Nov 29 23:12:57 2016 for BOSS_7.0.2 by  doxygen 1.4.7