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