BOSS 8.0.0
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
12#include "MucRecEvent/MucRecHit.h"
13#include "MucGeomSvc/MucGeoGeneral.h"
14
15// IMPLEMENTATION OF MucRecHit METHODS. ================================
16
17// Constructors.
18MucRecHit::MucRecHit( const Identifier& id ) : m_MucID( id ) {
19 m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap( m_MucID );
20 m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip( m_MucID );
21 m_IsSeed = false;
22 if ( m_pMucGeoGap && m_pMucGeoStrip )
23 {
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
37MucRecHit::MucRecHit( const int part, const int seg, const int gap, const int strip ) {
38 m_MucID = MucID::channel_id( part, seg, gap, strip );
39 // cout << "part " << part << " seg " << seg << " gap " << gap << " strip " << strip << endl;
40
41 m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap( m_MucID );
42 m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip( m_MucID );
43 m_recmode = -1;
44 m_IsSeed = false;
45 // m_pMucGeoGap = MucGeoGeneral::Instance()->GetGap(part, seg, gap);
46 // m_pMucGeoStrip = MucGeoGeneral::Instance()->GetStrip(part, seg, gap, strip);
47 if ( m_pMucGeoGap && m_pMucGeoStrip )
48 {
49 float x, y, z, sx, sy, sz;
50
51 m_pMucGeoStrip->GetCenterPos( x, y, z );
52 m_pMucGeoStrip->GetCenterSigma( sx, sy, sz );
53 HepPoint3D pos( x, y, z );
54 HepPoint3D sigma( sx, sy, sz );
55 m_CenterPos = m_pMucGeoGap->TransformToGlobal( pos );
56 // m_CenterSigma = m_pMucGeoGap->RotateToGlobal(sigma); //comment out at 2006.11.30
57 m_CenterSigma = sigma; // do not transform
58 }
59 else { cout << "MucRecHit::MucRecHit(), gap or strip pointer lost" << endl; }
60}
61
62// Copy constructor.
64 : m_MucID( source.m_MucID )
65 , m_pMucGeoGap( source.m_pMucGeoGap )
66 , m_pMucGeoStrip( source.m_pMucGeoStrip )
67 , m_CenterPos( source.m_CenterPos )
68 , m_CenterSigma( source.m_CenterSigma ) {}
69
70// Assignment operator.
72 // Assignment operator.
73 if ( this != &orig )
74 { // Watch out for self-assignment!
75 m_MucID = orig.m_MucID;
76 m_pMucGeoGap = orig.m_pMucGeoGap;
77 m_pMucGeoStrip = orig.m_pMucGeoStrip;
78 m_CenterPos = orig.m_CenterPos;
79 m_CenterSigma = orig.m_CenterSigma;
80 }
81 return *this;
82}
83
84// Destructor.
86 // No need to delete MucGeo pointer objects; the allocation/deallocation
87 // is done elsewhere.
88 m_pMucGeoGap = 0L;
89 m_pMucGeoStrip = 0L;
90}
91
92// Get Center position of the strip (global coords).
93Hep3Vector MucRecHit::GetCenterPos() const {
94 Hep3Vector x( m_CenterPos.x(), m_CenterPos.y(), m_CenterPos.z() );
95 return x;
96}
97
98// Get Center position uncertainty of the strip (global coords).
99Hep3Vector MucRecHit::GetCenterSigma() const {
100 Hep3Vector s( m_CenterSigma.x(), m_CenterSigma.y(), m_CenterSigma.z() );
101 return s;
102}
Double_t x[10]
XmlRpcServer s
HepGeom::Point3D< double > HepPoint3D
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.
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Definition MucID.cxx:114
~MucRecHit()
Destructor.
Definition MucRecHit.cxx:85
MucRecHit & operator=(const MucRecHit &orig)
Assignment operator.
Definition MucRecHit.cxx:71
Hep3Vector GetCenterPos() const
Get Center position of the strip (global coords).
Definition MucRecHit.cxx:93
Hep3Vector GetCenterSigma() const
Get Center position uncertainty of the strip (global coords).
Definition MucRecHit.cxx:99