57 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
58 MsgStream log(
msgSvc,
"CgemAlignPar");
59 log << MSG::WARNING <<
"read CgemAlignPar data directly from run directory"
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;
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];
82 Gaudi::svcLocator() -> service(
"MessageSvc",
msgSvc);
83 MsgStream log(
msgSvc,
"CgemAlignPar");
84 log << MSG::INFO <<
"CgemAlignPar::wrtAlignPar()" << endreq;
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) "};
92 ofstream fout(
"alignPar_new.txt");
93 fout.setf(ios::fixed);
94 fout.setf(ios::showpoint);
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];
98 for (iEnd=0; iEnd<
NEP; 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;
111 ofstream fdel(
"delAlign_new.txt");
112 fdel << setw(16) << name[0];
113 for(i=1; i<7; i++) fdel << setw(15) << name[i];
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;
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;