BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
MdcCalibAlg/share/distcalib/src/MdcCosWire.cpp
Go to the documentation of this file.
2#include "include/const.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", "WireLabel", "Wire", "Layer",
25 "Cell", "Radius", "PhiF", "Ten" );
26 fprintf( fout, "%10s %10d %10d %10d\n\n", getWireLabel(), getWireId(), getLayerId(),
27 getCellId() );
28
29 fprintf( fout, "%10s %10s %10s %10s %10s %10s %10s\n", "Xf", "Yf", "Zf", "Xb", "Yb", "Zb",
30 "Sag" );
31 fprintf( fout, "%10.3f %10.3f %10.3f %10.3f %10.3f %10.3f\n\n", getXf(), getYf(), getZf(),
32 getXb(), getYb(), getZb() );
33}
#define PI
void print(FILE *fout=stdout) const