/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Muc/MucRecEvent/MucRecEvent-00-02-52/src/MucRecHit.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/MucRecHit.h"
00013 
00014 // IMPLEMENTATION OF MucRecHit METHODS.  ================================
00015 
00016 // Constructors.
00017 MucRecHit::MucRecHit(const Identifier &id)
00018   : m_MucID(id)
00019 {
00020   m_pMucGeoGap   = MucGeoGeneral::Instance()->GetGap(m_MucID);
00021   m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(m_MucID);
00022   m_IsSeed = false;
00023   if (m_pMucGeoGap && m_pMucGeoStrip) {
00024     float x, y, z, sx, sy, sz;
00025     
00026     m_pMucGeoStrip->GetCenterPos(x, y, z);
00027     m_pMucGeoStrip->GetCenterSigma(sx, sy, sz);
00028     HepPoint3D pos(x, y, z);
00029     HepPoint3D sigma(sx, sy, sz);
00030     m_CenterPos   = m_pMucGeoGap->TransformToGlobal(pos);
00031     m_CenterSigma = m_pMucGeoGap->RotateToGlobal(sigma);
00032   }
00033   else {
00034     cout << "MucRecHit::MucRecHit(const Identifier&), gap or strip pointer lost" << endl;
00035   }
00036 }
00037 
00038 MucRecHit::MucRecHit(const int part,
00039                      const int seg,
00040                      const int gap,
00041                      const int strip)
00042 {
00043   m_MucID = MucID::channel_id(part, seg, gap, strip);
00044   //cout << "part " << part << " seg " << seg << " gap " << gap << " strip " << strip << endl;
00045 
00046   m_pMucGeoGap   = MucGeoGeneral::Instance()->GetGap(m_MucID);
00047   m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(m_MucID);
00048   m_recmode      = -1;
00049   m_IsSeed = false;
00050   //m_pMucGeoGap   = MucGeoGeneral::Instance()->GetGap(part, seg, gap);
00051   //m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(part, seg, gap, strip);
00052   if (m_pMucGeoGap && m_pMucGeoStrip) {
00053     float x, y, z, sx, sy, sz;
00054     
00055     m_pMucGeoStrip->GetCenterPos(x, y, z);
00056     m_pMucGeoStrip->GetCenterSigma(sx, sy, sz);
00057     HepPoint3D pos(x, y, z);
00058     HepPoint3D sigma(sx, sy, sz);
00059     m_CenterPos   = m_pMucGeoGap->TransformToGlobal(pos);
00060     //m_CenterSigma = m_pMucGeoGap->RotateToGlobal(sigma); //comment out at 2006.11.30
00061     m_CenterSigma = sigma; // do not transform
00062   }
00063   else {
00064     cout << "MucRecHit::MucRecHit(), gap or strip pointer lost" << endl;
00065   }
00066 
00067 }
00068 
00069 // Copy constructor.
00070 MucRecHit::MucRecHit(const MucRecHit& source)
00071   : m_MucID(source.m_MucID), 
00072   m_pMucGeoGap(source.m_pMucGeoGap),
00073   m_pMucGeoStrip(source.m_pMucGeoStrip),
00074   m_CenterPos(source.m_CenterPos),
00075   m_CenterSigma(source.m_CenterSigma)
00076 { }
00077 
00078 // Assignment operator.
00079 MucRecHit& 
00080 MucRecHit::operator=(const MucRecHit& orig)
00081 {
00082   // Assignment operator.
00083   if (this != &orig) {             // Watch out for self-assignment!
00084     m_MucID        = orig.m_MucID;
00085     m_pMucGeoGap   = orig.m_pMucGeoGap;
00086     m_pMucGeoStrip = orig.m_pMucGeoStrip;
00087     m_CenterPos    = orig.m_CenterPos;
00088     m_CenterSigma  = orig.m_CenterSigma;
00089   }
00090   return *this;
00091 }
00092 
00093 // Destructor.
00094 MucRecHit::~MucRecHit()
00095 { 
00096   // No need to delete MucGeo pointer objects; the allocation/deallocation
00097   // is done elsewhere.
00098   m_pMucGeoGap   = 0L;
00099   m_pMucGeoStrip = 0L;
00100 }
00101 
00102 // Get Center position of the strip (global coords).
00103 Hep3Vector
00104 MucRecHit::GetCenterPos() const
00105 {
00106   Hep3Vector x(m_CenterPos.x(),
00107                m_CenterPos.y(),
00108                m_CenterPos.z());
00109   return x;
00110 }
00111 
00112 // Get Center position uncertainty of the strip (global coords).
00113 Hep3Vector
00114 MucRecHit::GetCenterSigma() const
00115 {
00116   Hep3Vector s(m_CenterSigma.x(),
00117                m_CenterSigma.y(),
00118                m_CenterSigma.z());
00119   return s;
00120 }
00121 

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