/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucRecEvent/MucRecEvent-00-02-52/src/MucRecHitID.cxx

Go to the documentation of this file.
00001 //$id$
00002 //
00003 //$log$
00004 
00005 /*
00006  *    2003/12/13   Zhengyun You     Peking University
00007  * 
00008  *    2004/09/12   Zhengyun You     Peking University
00009  *                 transplanted to Gaudi framework
00010  */
00011 
00012 #include "MucRecEvent/MucRecHitID.h"
00013 
00014 // IMPLEMENTATION OF MucRecHitID METHODS.  ================================
00015 
00016 // Constructor.
00017 MucRecHitID::MucRecHitID(const int part,
00018                          const int seg,
00019                          const int gap,
00020                          const int hit)
00021   : m_Part(part), m_Seg(seg), m_Gap(gap), m_Hit(hit)
00022 { }
00023 
00024 // Copy constructor.
00025 MucRecHitID::MucRecHitID(const MucRecHitID& source)
00026   : m_Part(source.m_Part),
00027     m_Seg(source.m_Seg),
00028     m_Gap(source.m_Gap),
00029     m_Hit(source.m_Hit)
00030 { }
00031 
00032 // Destructor.
00033 MucRecHitID::~MucRecHitID()
00034 { }
00035 
00036 // Assignment operator.
00037 MucRecHitID&
00038 MucRecHitID::operator=(const MucRecHitID& orig)
00039 {
00040   // Assignment operator.
00041   if (this != &orig) {             // Watch out for self-assignment!
00042     m_Part = orig.m_Part;
00043     m_Seg  = orig.m_Seg;
00044     m_Gap  = orig.m_Gap;
00045     m_Hit  = orig.m_Hit;
00046   }
00047   return *this;
00048 }
00049 
00050 bool
00051 MucRecHitID::operator == (const MucRecHitID& other) const
00052 {
00053   if ( m_Part == other.m_Part && 
00054        m_Seg  == other.m_Seg  &&
00055        m_Gap  == other.m_Gap  &&
00056        m_Hit  == other.m_Hit )
00057     return true;
00058   else 
00059     return false;
00060 }
00061 
00062 bool
00063 MucRecHitID::operator != (const MucRecHitID& other) const
00064 {
00065   if ( m_Part == other.m_Part && 
00066        m_Seg  == other.m_Seg  &&
00067        m_Gap  == other.m_Gap  &&
00068        m_Hit  == other.m_Hit )
00069     return false;
00070   else 
00071     return true;
00072 }
00073 
00074 bool
00075 MucRecHitID::operator < (const MucRecHitID& other) const
00076 {
00077   if (m_Part < other.m_Part ||
00078       (m_Part == other.m_Part && m_Seg <  other.m_Seg) ||
00079       (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap <  other.m_Gap) ||
00080       (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap && m_Hit < other.m_Hit)) {
00081     return true;
00082   }
00083   else {
00084     return false;
00085   }
00086 }
00087 
00088 bool
00089 MucRecHitID::operator > (const MucRecHitID& other) const
00090 {
00091   if (m_Part > other.m_Part ||
00092       (m_Part == other.m_Part && m_Seg >  other.m_Seg) ||
00093       (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap >  other.m_Gap) ||
00094       (m_Part == other.m_Part && m_Seg == other.m_Seg && m_Gap == other.m_Gap && m_Hit > other.m_Hit)) {
00095     return true;
00096   }
00097   else {
00098     return false;
00099   }
00100 }
00101 
00102 // Set the identifier variables.
00103 void
00104 MucRecHitID::SetID(const int part,
00105                    const int seg,
00106                    const int gap,
00107                    const int hit)
00108 {
00109   m_Part = part;
00110   m_Seg  = seg;
00111   m_Gap  = gap;
00112   m_Hit  = hit;
00113 }
00114 
00115 // Output to a stream.
00116 //ostream& operator << (ostream& s, const MucRecHitID& hitID)
00117   //{
00118   //return s << " Part " << hitID.Part() << " Seg " << hitID.Seg()
00119     //   << " Gap "  << hitID.Gap()  << " Hit " << hitID.Hit();
00120   //}

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