CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemAlignPar Class Reference

#include <CgemAlignPar.h>

Public Member Functions

 CgemAlignPar ()
 
 ~CgemAlignPar ()
 
void initAlignPar ()
 
bool rdAlignPar (std::string alignFile)
 
void wrtAlignPar ()
 
void setDx (int iEP, double val)
 
void setDy (int iEP, double val)
 
void setDz (int iEP, double val)
 
void setRx (int iEP, double val)
 
void setRy (int iEP, double val)
 
void setRz (int iEP, double val)
 
void setDelDx (int iEP, double val)
 
void setDelDy (int iEP, double val)
 
void setDelDz (int iEP, double val)
 
void setDelRx (int iEP, double val)
 
void setDelRy (int iEP, double val)
 
void setDelRz (int iEP, double val)
 
void setErrDx (int iEP, double val)
 
void setErrDy (int iEP, double val)
 
void setErrDz (int iEP, double val)
 
void setErrRx (int iEP, double val)
 
void setErrRy (int iEP, double val)
 
void setErrRz (int iEP, double val)
 
double getDx (int iEP)
 
double getDy (int iEP)
 
double getDz (int iEP)
 
double getRx (int iEP)
 
double getRy (int iEP)
 
double getRz (int iEP)
 
double getDx (int iEP_Phy, int iSh_Phy)
 
double getDy (int iEP_Phy, int iSh_Phy)
 
double getDz (int iEP_Phy, int iSh_Phy)
 
double getRx (int iEP_Phy, int iSh_Phy)
 
double getRy (int iEP_Phy, int iSh_Phy)
 
double getRz (int iEP_Phy, int iSh_Phy)
 

Detailed Description

Definition at line 11 of file CgemAlignPar.h.

Constructor & Destructor Documentation

◆ CgemAlignPar()

CgemAlignPar::CgemAlignPar ( )

Definition at line 23 of file CgemAlignPar.cxx.

23 {
24 for(int iEP=0; iEP<NEP; iEP++){
25 m_delDx[iEP] = 0.0;
26 m_delDy[iEP] = 0.0;
27 m_delDz[iEP] = 0.0;
28 m_delRx[iEP] = 0.0;
29 m_delRy[iEP] = 0.0;
30 m_delRz[iEP] = 0.0;
31 }
32}
const int NEP

◆ ~CgemAlignPar()

CgemAlignPar::~CgemAlignPar ( )

Definition at line 34 of file CgemAlignPar.cxx.

34 {
35}

Member Function Documentation

◆ getDx() [1/2]

double CgemAlignPar::getDx ( int iEP)
inline

Definition at line 42 of file CgemAlignPar.h.

42{ return m_dx[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getDx() [2/2]

double CgemAlignPar::getDx ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 49 of file CgemAlignPar.h.

49{ int iEP = iEP_Phy*2 + iSh_Phy; return m_dx[iEP]; }

◆ getDy() [1/2]

double CgemAlignPar::getDy ( int iEP)
inline

Definition at line 43 of file CgemAlignPar.h.

43{ return m_dy[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getDy() [2/2]

double CgemAlignPar::getDy ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 50 of file CgemAlignPar.h.

50{ int iEP = iEP_Phy*2 + iSh_Phy; return m_dy[iEP]; }

◆ getDz() [1/2]

double CgemAlignPar::getDz ( int iEP)
inline

Definition at line 44 of file CgemAlignPar.h.

44{ return m_dz[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getDz() [2/2]

double CgemAlignPar::getDz ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 51 of file CgemAlignPar.h.

51{ int iEP = iEP_Phy*2 + iSh_Phy; return m_dz[iEP]; }

◆ getRx() [1/2]

double CgemAlignPar::getRx ( int iEP)
inline

Definition at line 45 of file CgemAlignPar.h.

45{ return m_rx[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getRx() [2/2]

double CgemAlignPar::getRx ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 52 of file CgemAlignPar.h.

52{ int iEP = iEP_Phy*2 + iSh_Phy; return m_rx[iEP]; }

◆ getRy() [1/2]

double CgemAlignPar::getRy ( int iEP)
inline

Definition at line 46 of file CgemAlignPar.h.

46{ return m_ry[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getRy() [2/2]

double CgemAlignPar::getRy ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 53 of file CgemAlignPar.h.

53{ int iEP = iEP_Phy*2 + iSh_Phy; return m_ry[iEP]; }

◆ getRz() [1/2]

double CgemAlignPar::getRz ( int iEP)
inline

Definition at line 47 of file CgemAlignPar.h.

47{ return m_rz[iEP]; }

Referenced by CgemMilleAlign::fillHist(), and CgemAlignAlg::initialize().

◆ getRz() [2/2]

double CgemAlignPar::getRz ( int iEP_Phy,
int iSh_Phy )
inline

Definition at line 54 of file CgemAlignPar.h.

54{ int iEP = iEP_Phy*2 + iSh_Phy; return m_rz[iEP]; }

◆ initAlignPar()

void CgemAlignPar::initAlignPar ( )

Definition at line 37 of file CgemAlignPar.cxx.

37 {
38 for(int iEP=0; iEP<NEP; iEP++){
39 m_dx[iEP] = 0.0;
40 m_dy[iEP] = 0.0;
41 m_dz[iEP] = 0.0;
42 m_rx[iEP] = 0.0;
43 m_ry[iEP] = 0.0;
44 m_rz[iEP] = 0.0;
45
46 m_errDx[iEP] = 0.0;
47 m_errDy[iEP] = 0.0;
48 m_errDz[iEP] = 0.0;
49 m_errRx[iEP] = 0.0;
50 m_errRy[iEP] = 0.0;
51 m_errRz[iEP] = 0.0;
52 }
53}

◆ rdAlignPar()

bool CgemAlignPar::rdAlignPar ( std::string alignFile)

Definition at line 55 of file CgemAlignPar.cxx.

55 {
56 IMessageSvc* msgSvc;
57 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
58 MsgStream log(msgSvc, "CgemAlignPar");
59 log << MSG::WARNING << "read CgemAlignPar data directly from run directory"
60 << endreq;
61
62 ifstream fpar(alignFile.c_str());
63 log << MSG::INFO << "open file" << endreq;
64 if( ! fpar.is_open() ){
65 log << MSG::FATAL << "can not open alignment file " << alignFile.c_str() << endreq;
66 return false;
67 }
68
69 int i;
70 string strtmp;
71 for(i=0; i<7; i++) fpar >> strtmp;
72 for(int iEP=0; iEP<NEP; iEP++){
73 fpar >> strtmp >> m_dx[iEP] >> m_dy[iEP] >> m_dz[iEP]
74 >> m_rx[iEP] >> m_ry[iEP] >> m_rz[iEP];
75 }
76 fpar.close();
77 return true;
78}
IMessageSvc * msgSvc()

◆ setDelDx()

void CgemAlignPar::setDelDx ( int iEP,
double val )
inline

Definition at line 28 of file CgemAlignPar.h.

28{ m_delDx[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDelDy()

void CgemAlignPar::setDelDy ( int iEP,
double val )
inline

Definition at line 29 of file CgemAlignPar.h.

29{ m_delDy[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDelDz()

void CgemAlignPar::setDelDz ( int iEP,
double val )
inline

Definition at line 30 of file CgemAlignPar.h.

30{ m_delDz[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDelRx()

void CgemAlignPar::setDelRx ( int iEP,
double val )
inline

Definition at line 31 of file CgemAlignPar.h.

31{ m_delRx[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDelRy()

void CgemAlignPar::setDelRy ( int iEP,
double val )
inline

Definition at line 32 of file CgemAlignPar.h.

32{ m_delRy[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDelRz()

void CgemAlignPar::setDelRz ( int iEP,
double val )
inline

Definition at line 33 of file CgemAlignPar.h.

33{ m_delRz[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setDx()

void CgemAlignPar::setDx ( int iEP,
double val )
inline

Definition at line 21 of file CgemAlignPar.h.

21{ m_dx[iEP] = val; }

◆ setDy()

void CgemAlignPar::setDy ( int iEP,
double val )
inline

Definition at line 22 of file CgemAlignPar.h.

22{ m_dy[iEP] = val; }

◆ setDz()

void CgemAlignPar::setDz ( int iEP,
double val )
inline

Definition at line 23 of file CgemAlignPar.h.

23{ m_dz[iEP] = val; }

◆ setErrDx()

void CgemAlignPar::setErrDx ( int iEP,
double val )
inline

Definition at line 35 of file CgemAlignPar.h.

35{ m_errDx[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setErrDy()

void CgemAlignPar::setErrDy ( int iEP,
double val )
inline

Definition at line 36 of file CgemAlignPar.h.

36{ m_errDy[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setErrDz()

void CgemAlignPar::setErrDz ( int iEP,
double val )
inline

Definition at line 37 of file CgemAlignPar.h.

37{ m_errDz[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setErrRx()

void CgemAlignPar::setErrRx ( int iEP,
double val )
inline

Definition at line 38 of file CgemAlignPar.h.

38{ m_errRx[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setErrRy()

void CgemAlignPar::setErrRy ( int iEP,
double val )
inline

Definition at line 39 of file CgemAlignPar.h.

39{ m_errRy[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setErrRz()

void CgemAlignPar::setErrRz ( int iEP,
double val )
inline

Definition at line 40 of file CgemAlignPar.h.

40{ m_errRz[iEP] = val; }

Referenced by CgemMilleAlign::updateAlignPar().

◆ setRx()

void CgemAlignPar::setRx ( int iEP,
double val )
inline

Definition at line 24 of file CgemAlignPar.h.

24{ m_rx[iEP] = val; }

◆ setRy()

void CgemAlignPar::setRy ( int iEP,
double val )
inline

Definition at line 25 of file CgemAlignPar.h.

25{ m_ry[iEP] = val; }

◆ setRz()

void CgemAlignPar::setRz ( int iEP,
double val )
inline

Definition at line 26 of file CgemAlignPar.h.

26{ m_rz[iEP] = val; }

◆ wrtAlignPar()

void CgemAlignPar::wrtAlignPar ( )

Definition at line 80 of file CgemAlignPar.cxx.

80 {
81 IMessageSvc* msgSvc;
82 Gaudi::svcLocator() -> service("MessageSvc", msgSvc);
83 MsgStream log(msgSvc, "CgemAlignPar");
84 log << MSG::INFO << "CgemAlignPar::wrtAlignPar()" << endreq;
85
86 int i;
87 int iEnd;
88 string str[] = {" L0", " L1", " L2", " L3", " L4", " L5"};
89 string name[] = {" Layer", "DeltaX(mm)", "DeltaY(mm)",
90 "DeltaZ(mm)", "RX(rad) ", "RY(rad) ", "RZ(rad) "};
91
92 ofstream fout("alignPar_new.txt");
93 fout.setf(ios::fixed);
94 fout.setf(ios::showpoint);
95 fout.precision(7);
96 fout << name[0] << setw(14) << name[1] << setw(16) << name[2] << setw(16) << name[3] << setw(16) << name[4] << setw(16) << name[5] << setw(16) << name[6];
97 fout << endl;
98 for (iEnd=0; iEnd<NEP; iEnd++){
99 //fout << setw(14) << str[iEnd]
100 fout << str[iEnd]
101 << setw(16) << m_dx[iEnd] + m_delDx[iEnd]
102 << setw(16) << m_dy[iEnd] + m_delDy[iEnd]
103 << setw(16) << m_dz[iEnd] + m_delDz[iEnd]
104 << setw(16) << m_rx[iEnd] + m_delRx[iEnd]
105 << setw(16) << m_ry[iEnd] + m_delRy[iEnd]
106 << setw(16) << m_rz[iEnd] + m_delRz[iEnd] << endl;
107 if(7 == iEnd) fout << endl;
108 }
109 fout.close();
110
111 ofstream fdel("delAlign_new.txt");
112 fdel << setw(16) << name[0];
113 for(i=1; i<7; i++) fdel << setw(15) << name[i];
114 fdel << endl;
115 for (iEnd=0; iEnd<NEP; iEnd++){
116 fdel << setw(15) << str[iEnd] << setw(15) << m_delDx[iEnd]
117 << setw(15) << m_delDy[iEnd] << setw(15) << m_delDz[iEnd]
118 << setw(15) << m_delRx[iEnd] << setw(15) << m_delRy[iEnd]
119 << setw(15) << m_delRz[iEnd] << endl;
120 if(7 == iEnd) fdel << endl;
121 }
122
123 fdel << endl <<setw(19)<< "Fit error:" << endl;
124 for (iEnd=0; iEnd<NEP; iEnd++){
125 fdel << setw(15) << str[iEnd] << setw(15) << m_errDx[iEnd]
126 << setw(15) << m_errDy[iEnd] << setw(15) << m_errDz[iEnd]
127 << setw(15) << m_errRx[iEnd] << setw(15) << m_errRy[iEnd]
128 << setw(15) << m_errRz[iEnd] << endl;
129 if(7 == iEnd) fdel << endl;
130 }
131 fdel.close();
132}

Referenced by CgemAlignAlg::finalize().


The documentation for this class was generated from the following files: