00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "MucRecEvent/MucRecHit.h"
00013
00014
00015
00016
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
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
00051
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
00061 m_CenterSigma = sigma;
00062 }
00063 else {
00064 cout << "MucRecHit::MucRecHit(), gap or strip pointer lost" << endl;
00065 }
00066
00067 }
00068
00069
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
00079 MucRecHit&
00080 MucRecHit::operator=(const MucRecHit& orig)
00081 {
00082
00083 if (this != &orig) {
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
00094 MucRecHit::~MucRecHit()
00095 {
00096
00097
00098 m_pMucGeoGap = 0L;
00099 m_pMucGeoStrip = 0L;
00100 }
00101
00102
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
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