00001 #include "MdcGeom/MdcSWire.h"
00002 #include "MdcGeom/BesAngle.h"
00003 #include "MdcGeom/MdcLayer.h"
00004 #include <iomanip>
00005 #include <iostream>
00006 using namespace std;
00007
00008
00009 MdcSWire::MdcSWire(HepPoint3D &eastP, HepPoint3D &westP, double sag, int id, int cell)
00010 : _traj(sag,eastP,westP), _east(eastP), _west(westP), _sag(sag), _id(id), _cell(cell)
00011 {
00012 _rend = sqrt(xEast()*xEast() + yEast()*yEast());
00013 _phiend = _east.phi();
00014 BesAngle westPphi(westP.phi());
00015 BesAngle eastPphi(eastP.phi());
00016 _twist = ( westPphi - eastPphi)* 0.5;
00017 }
00018
00019 Hep3Vector
00020 MdcSWire::yAxis( double z )
00021 {
00022 Hep3Vector vec( xWireDC(z), yWireDC(z), z);
00023 return vec.unit();
00024 }
00025
00026 void MdcSWire::print(std::ostream &o) const
00027 {
00028 o<< setw(6)<<Id()<<
00029 setw(10)<<xEast()<<
00030 setw(10)<<yEast()<<
00031 setw(10)<<zEast()<<
00032 setw(10)<<xWest()<<
00033 setw(10)<<yWest()<<
00034 setw(10)<<zWest()<<
00035 setw(10)<<xMid()<<
00036 setw(10)<<yMid()<<
00037 setw(10)<<rEnd()<<
00038 setw(10)<<getSag()<<
00039 setw(10)<<cell()<<
00040 setw(10)<<zLength()<<
00041 setw(10)<<dPhiz()<<
00042 setw(10)<<zEndDC()<<
00043 setw(10)<<rMid()<<
00044 setw(10)<<phiE()<<
00045 setw(10)<<phi()<<
00046 setw(10)<<stereo()<<
00047 setw(10)<<stDip()<<
00048 setw(10)<<radiusDC(0.)<<
00049 setw(10)<<phiDC(0.)<<
00050 setw(10)<<xWireDC(0.)<<
00051 setw(10)<<yWireDC(0.)<<
00052 setw(10)<<dPhizDC(0.)<<
00053 setw(10)<<getTraj()->sag()<<
00054 setw(10)<<getTraj()->position(0.)<<
00055 setw(10)<<getTraj()->direction(0.)<<
00056 setw(10)<<getTraj()->curvature()<<
00057 setw(10)<<getTraj()->rawDirection()<<
00058 std::endl;
00059 }
00060
00061 void MdcSWire::printInfo(std::ostream &o) const
00062 {
00063 o << "east " << getEastPoint()->x() << " " << getEastPoint()->y() << " "
00064 << getEastPoint()->z() <<"\n"
00065 << "west " << getWestPoint()->x() <<" " << getWestPoint()->y()
00066 << " " << getWestPoint()->z() << "\n"
00067 << "sagitta: " << getSag()
00068 << " z length: " << zLength()
00069 << " twist: " << dPhiz()
00070 << " stereo: " << stereo() <<"\n"
00071 << "x-y mid: " << xMid() << " - " << yMid() << std::endl;
00072
00073 }
00074
00075 std::ostream& operator << (std::ostream& o, const MdcSWire& w)
00076 {
00077 w.print(o);
00078 return o;
00079 }
00080