BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MdcPatRec/MdcGeom/include/MdcGeom/MdcSWire.h
Go to the documentation of this file.
1// $Id: MdcSWire.h,v 1.6 2011/12/05 00:46:23 zhangy Exp $ // -*-c++-*-
2// header file for a class called "MdcSWire"
3#ifndef MDCSWIRE_H
4#define MDCSWIRE_H
5
6#include "CLHEP/Geometry/Point3D.h"
7#include "CLHEP/Vector/ThreeVector.h"
8#include "MdcGeom/MdcSagTraj.h"
9#include <iostream>
10
11#ifndef ENABLE_BACKWARDS_COMPATIBILITY
12typedef HepGeom::Point3D<double> HepPoint3D;
13#endif
14
15using CLHEP::Hep3Vector;
16
17class MdcLayer;
18
19class MdcSWire {
20
21public:
22 // Constructor.
23 MdcSWire( HepPoint3D& eastP, HepPoint3D& westP, double sag = 0, int id = 0, int cell = 0 );
24 // Destructor
26
27public: // Extractors
28 // Selectors (const)
29 double getSag( void ) const { return _sag; }
30 const HepPoint3D* getEastPoint( void ) const { return &_east; }
31 const HepPoint3D* getWestPoint( void ) const { return &_west; }
32 const MdcSagTraj* getTraj( void ) const { return &_traj; }
33 double xEast( void ) const { return _east.x(); }
34 double yEast( void ) const { return _east.y(); }
35 double zEast( void ) const { return _east.z(); }
36 double xWest( void ) const { return _west.x(); }
37 double yWest( void ) const { return _west.y(); }
38 double zWest( void ) const { return _west.z(); }
39 double xMid( void ) const { return rMid() * cos( phi() ); }
40 double yMid( void ) const { return rMid() * sin( phi() ); }
41 double rEnd( void ) const { return _rend; }
42 const MdcLayer* layer( void ) const { return _lay; }
43 int Id( void ) const { return _id; } // wire number in Mdc
44 int cell( void ) const { return _cell; } // local cell number in layer
45 double zLength( void ) const { return getEastPoint()->z() - getWestPoint()->z(); }
46 double dPhiz( void ) const { return _twist; }
47 double zEndDC( void ) const { return 0.5 * zLength(); }
48 double rMid( void ) const { return rEnd() * cos( dPhiz() ); }
49 double phiE( void ) const { return _phiend; }
50 double phi( void ) const { return _phiend + _twist; }
51 double stereo( void ) const { return 2. * rEnd() * sin( dPhiz() ) / zLength(); }
52 double stDip( void ) const { return rEnd() - rMid(); }
53 // in the local MDC reference
54 double radiusDC( double z ) const {
55 return rEnd() - stDip() * ( 1. - z * z / ( zEndDC() * zEndDC() ) );
56 }
57 // double phiDC (double z) const { return phi() + dPhizDC(z); }//yzhang fix 2011-12-02
58 double phiDC( double z ) const { return phi() - dPhizDC( z ); }
59 double xWireDC( double z ) const { return radiusDC( z ) * cos( phiDC( z ) ); }
60 double yWireDC( double z ) const { return radiusDC( z ) * sin( phiDC( z ) ); }
61 double dPhizDC( double z ) const { return atan2( z * stereo(), rMid() ); }
62
63 // direction axis defining the local coordinate system of the sense
64 // wire (eventually needed by calibration)
65 Hep3Vector yAxis( double z = 0. );
66 const Hep3Vector& zAxis( void ) const { return _traj.rawDirection(); }
67
68 void print( std::ostream& o ) const;
69 void printInfo( std::ostream& o ) const;
70
71protected:
72 void setLayerPtr( const MdcLayer* lay ) { _lay = lay; }
73
74private:
75 friend class MdcLayer;
76 MdcSagTraj _traj; // wire trajectory
77 HepPoint3D _east; // wire position at backward endplate (mm)
78 HepPoint3D _west; // wire position at west endplate (mm)
79 const MdcLayer* _lay; // pointer to layer to which the wire belongs
80 double _rend; // radius at backward endplate(mm)
81 double _phiend; // phi angle at backward endplate
82 double _twist; // twist angle between mid and bakcward chamber=a/2
83 double _sag; // wire sagitta
84 int _id; // sense wire identifier in mdc
85 int _cell; // sense wire (cell) identifier (local)
86};
87
88#endif /* MdcSWire_CLASS */
HepGeom::Point3D< double > HepPoint3D
HepGeom::Point3D< double > HepPoint3D
void print(std::ostream &o) const
Hep3Vector yAxis(double z=0.)
MdcSWire(HepPoint3D &eastP, HepPoint3D &westP, double sag=0, int id=0, int cell=0)
void printInfo(std::ostream &o) const