BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcAlignAlg/MdcAlignAlg-00-01-04/share/distAlign/src/MdcCosWire.cpp
Go to the documentation of this file.
1#include "include/MdcCosWire.h"
2#include "include/fun.h"
3
4#include <math.h>
5
6double MdcCosWire::getPhi(double z) const {
7 double lx = m_wpos[0] - m_wpos[3];
8 double ly = m_wpos[1] - m_wpos[4];
9 double lz = m_wpos[2] - m_wpos[5];
10
11 double xhit = (z - m_wpos[2]) * lx / lz + m_wpos[0];
12 double yhit = (z - m_wpos[2]) * ly / lz + m_wpos[1];
13
14 double r = sqrt( (xhit * xhit) + (yhit * yhit) );
15 double phi = asin(yhit / r);
16
17 if(xhit < 0) phi = PI - phi;
18 if(phi < 0) phi += PI2;
19
20 return phi;
21}
22
23void MdcCosWire::print(FILE* fout) const {
24 fprintf(fout, "\n%10s %10s %10s %10s %10s %10s %10s\n",
25 "WireLabel", "Wire", "Layer", "Cell",
26 "Radius", "PhiF", "Ten");
27 fprintf(fout, "%10s %10d %10d %10d\n\n", getWireLabel(),
29
30 fprintf(fout, "%10s %10s %10s %10s %10s %10s %10s\n",
31 "Xf", "Yf", "Zf", "Xb", "Yb", "Zb", "Sag");
32 fprintf(fout, "%10.3f %10.3f %10.3f %10.3f %10.3f %10.3f\n\n",
33 getXf(), getYf(), getZf(), getXb(), getYb(), getZb() );
34
35}
const double PI
Definition: PipiJpsi.cxx:55