BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
MucRecHit.cxx
Go to the documentation of this file.
1//$id$
2//
3//$log$
4
5/*
6 * 2003/12/13 Zhengyun You Peking University
7 *
8 * 2004/09/12 Zhengyun You Peking University
9 * transplanted to Gaudi framework
10 */
11
13
14// IMPLEMENTATION OF MucRecHit METHODS. ================================
15
16// Constructors.
18 : m_MucID(id)
19{
20 m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap(m_MucID);
21 m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(m_MucID);
22 m_IsSeed = false;
23 if (m_pMucGeoGap && m_pMucGeoStrip) {
24 float x, y, z, sx, sy, sz;
25
26 m_pMucGeoStrip->GetCenterPos(x, y, z);
27 m_pMucGeoStrip->GetCenterSigma(sx, sy, sz);
28 HepPoint3D pos(x, y, z);
29 HepPoint3D sigma(sx, sy, sz);
30 m_CenterPos = m_pMucGeoGap->TransformToGlobal(pos);
31 m_CenterSigma = m_pMucGeoGap->RotateToGlobal(sigma);
32 }
33 else {
34 cout << "MucRecHit::MucRecHit(const Identifier&), gap or strip pointer lost" << endl;
35 }
36}
37
38MucRecHit::MucRecHit(const int part,
39 const int seg,
40 const int gap,
41 const int strip)
42{
43 m_MucID = MucID::channel_id(part, seg, gap, strip);
44 //cout << "part " << part << " seg " << seg << " gap " << gap << " strip " << strip << endl;
45
46 m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap(m_MucID);
47 m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(m_MucID);
48 m_recmode = -1;
49 m_IsSeed = false;
50 //m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap(part, seg, gap);
51 //m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(part, seg, gap, strip);
52 if (m_pMucGeoGap && m_pMucGeoStrip) {
53 float x, y, z, sx, sy, sz;
54
55 m_pMucGeoStrip->GetCenterPos(x, y, z);
56 m_pMucGeoStrip->GetCenterSigma(sx, sy, sz);
57 HepPoint3D pos(x, y, z);
58 HepPoint3D sigma(sx, sy, sz);
59 m_CenterPos = m_pMucGeoGap->TransformToGlobal(pos);
60 //m_CenterSigma = m_pMucGeoGap->RotateToGlobal(sigma); //comment out at 2006.11.30
61 m_CenterSigma = sigma; // do not transform
62 }
63 else {
64 cout << "MucRecHit::MucRecHit(), gap or strip pointer lost" << endl;
65 }
66
67}
68
69// Copy constructor.
71 : m_MucID(source.m_MucID),
72 m_pMucGeoGap(source.m_pMucGeoGap),
73 m_pMucGeoStrip(source.m_pMucGeoStrip),
74 m_CenterPos(source.m_CenterPos),
75 m_CenterSigma(source.m_CenterSigma)
76{ }
77
78// Assignment operator.
81{
82 // Assignment operator.
83 if (this != &orig) { // Watch out for self-assignment!
84 m_MucID = orig.m_MucID;
85 m_pMucGeoGap = orig.m_pMucGeoGap;
86 m_pMucGeoStrip = orig.m_pMucGeoStrip;
87 m_CenterPos = orig.m_CenterPos;
88 m_CenterSigma = orig.m_CenterSigma;
89 }
90 return *this;
91}
92
93// Destructor.
95{
96 // No need to delete MucGeo pointer objects; the allocation/deallocation
97 // is done elsewhere.
98 m_pMucGeoGap = 0L;
99 m_pMucGeoStrip = 0L;
100}
101
102// Get Center position of the strip (global coords).
103Hep3Vector
105{
106 Hep3Vector x(m_CenterPos.x(),
107 m_CenterPos.y(),
108 m_CenterPos.z());
109 return x;
110}
111
112// Get Center position uncertainty of the strip (global coords).
113Hep3Vector
115{
116 Hep3Vector s(m_CenterSigma.x(),
117 m_CenterSigma.y(),
118 m_CenterSigma.z());
119 return s;
120}
121
TTree * sigma
XmlRpcServer s
Definition: HelloServer.cpp:11
Hep3Vector RotateToGlobal(const Hep3Vector pVect) const
Rotate a vector from gap coordinate to global coordinate.
Definition: MucGeoGap.cxx:606
HepPoint3D TransformToGlobal(const HepPoint3D pPoint) const
Transform a point from gap coordinate to global coordinate.
Definition: MucGeoGap.cxx:620
MucGeoStrip * GetStrip(const int part, const int seg, const int gap, const int strip) const
Get a pointer to the strip identified by (part,seg,gap,strip).
MucGeoGap * GetGap(const int part, const int seg, const int gap) const
Get a pointer to the gap identified by (part,seg,gap).
static MucGeoGeneral * Instance()
Get a pointer to the single instance of MucGeoGeneral.
void GetCenterPos(float &x, float &y, float &z) const
Get center position of this strip (in the gap coordinate system).
Definition: MucGeoStrip.cxx:40
void GetCenterSigma(float &sx, float &sy, float &sz)
Get uncertainty in the position of this strip (in the gap coordinate system).
Definition: MucGeoStrip.cxx:51
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Definition: MucID.cxx:135
~MucRecHit()
Destructor.
Definition: MucRecHit.cxx:94
MucRecHit & operator=(const MucRecHit &orig)
Assignment operator.
Definition: MucRecHit.cxx:80
Hep3Vector GetCenterPos() const
Get Center position of the strip (global coords).
Definition: MucRecHit.cxx:104
Hep3Vector GetCenterSigma() const
Get Center position uncertainty of the strip (global coords).
Definition: MucRecHit.cxx:114
MucRecHit()
Constructor.
Definition: MucRecHit.h:42
double y[1000]
double x[1000]