CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
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
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)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
HepGeom::Point3D< double > HepPoint3D
Definition: MdcSWire.h:12
double xWest(void) const
Definition: MdcSWire.h:38
const MdcLayer * layer(void) const
Definition: MdcSWire.h:44
void print(std::ostream &o) const
Definition: MdcSWire.cxx:26
double yWest(void) const
Definition: MdcSWire.h:39
Hep3Vector yAxis(double z=0.)
Definition: MdcSWire.cxx:20
double stDip(void) const
Definition: MdcSWire.h:55
const Hep3Vector & zAxis(void) const
Definition: MdcSWire.h:68
double rEnd(void) const
Definition: MdcSWire.h:43
~MdcSWire()
Definition: MdcSWire.h:26
double phi(void) const
Definition: MdcSWire.h:52
double yMid(void) const
Definition: MdcSWire.h:42
double dPhizDC(double z) const
Definition: MdcSWire.h:63
int Id(void) const
Definition: MdcSWire.h:45
double phiE(void) const
Definition: MdcSWire.h:51
double zLength(void) const
Definition: MdcSWire.h:47
double yWireDC(double z) const
Definition: MdcSWire.h:62
double getSag(void) const
Definition: MdcSWire.h:31
double xWireDC(double z) const
Definition: MdcSWire.h:61
double zWest(void) const
Definition: MdcSWire.h:40
double phiDC(double z) const
Definition: MdcSWire.h:60
double rMid(void) const
Definition: MdcSWire.h:50
double zEndDC(void) const
Definition: MdcSWire.h:49
const HepPoint3D * getWestPoint(void) const
Definition: MdcSWire.h:33
void printInfo(std::ostream &o) const
Definition: MdcSWire.cxx:61
double zEast(void) const
Definition: MdcSWire.h:37
const MdcSagTraj * getTraj(void) const
Definition: MdcSWire.h:34
int cell(void) const
Definition: MdcSWire.h:46
double yEast(void) const
Definition: MdcSWire.h:36
double stereo(void) const
Definition: MdcSWire.h:53
void setLayerPtr(const MdcLayer *lay)
Definition: MdcSWire.h:74
double radiusDC(double z) const
Definition: MdcSWire.h:57
double xMid(void) const
Definition: MdcSWire.h:41
double xEast(void) const
Definition: MdcSWire.h:35
double dPhiz(void) const
Definition: MdcSWire.h:48
const HepPoint3D * getEastPoint(void) const
Definition: MdcSWire.h:32
const Hep3Vector & rawDirection(void) const
Definition: MdcSagTraj.h:87