/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Mdc/MdcAlignAlg/MdcAlignAlg-00-01-04/share/distAlign/src/MdcCosWire.cpp

Go to the documentation of this file.
00001 #include "include/MdcCosWire.h"
00002 #include "include/fun.h"
00003 
00004 #include <math.h>
00005 
00006 double MdcCosWire::getPhi(double z) const {
00007      double lx = m_wpos[0] - m_wpos[3];
00008      double ly = m_wpos[1] - m_wpos[4];
00009      double lz = m_wpos[2] - m_wpos[5];
00010 
00011      double xhit = (z - m_wpos[2]) * lx / lz + m_wpos[0];
00012      double yhit = (z - m_wpos[2]) * ly / lz + m_wpos[1];
00013 
00014      double r = sqrt( (xhit * xhit) + (yhit * yhit) );
00015      double phi = asin(yhit / r);
00016 
00017      if(xhit < 0) phi = PI - phi;
00018      if(phi < 0) phi += PI2;
00019 
00020      return phi;
00021 }
00022 
00023 void MdcCosWire::print(FILE* fout) const {
00024      fprintf(fout, "\n%10s %10s %10s %10s %10s %10s %10s\n", 
00025              "WireLabel", "Wire", "Layer", "Cell", 
00026              "Radius", "PhiF", "Ten");
00027      fprintf(fout, "%10s %10d %10d %10d\n\n", getWireLabel(),
00028              getWireId(), getLayerId(), getCellId() );
00029 
00030      fprintf(fout, "%10s %10s %10s %10s %10s %10s %10s\n", 
00031              "Xf", "Yf", "Zf", "Xb", "Yb", "Zb", "Sag");
00032      fprintf(fout, "%10.3f %10.3f %10.3f %10.3f %10.3f %10.3f\n\n", 
00033              getXf(), getYf(), getZf(), getXb(), getYb(), getZb() );
00034 
00035 }

Generated on Tue Nov 29 23:12:48 2016 for BOSS_7.0.2 by  doxygen 1.4.7