51 MsgStream log(
msgSvc(), name() );
53 std::cout<<
" "<<std::endl;
54 std::cout<<
" ██████╗ ███████╗███████╗██╗██╗██╗ ██████╗ ██████╗ ███████╗███╗ ███╗ █████╗ ██╗ ██╗ ██████╗ ███╗ ██╗███╗ ███╗███████╗███╗ ██╗████████╗ "<<std::endl;
55 std::cout<<
" ██╔══██╗██╔════╝██╔════╝██║██║██║ ██╔════╝██╔════╝ ██╔════╝████╗ ████║ ██╔══██╗██║ ██║██╔════╝ ████╗ ██║████╗ ████║██╔════╝████╗ ██║╚══██╔══╝ "<<std::endl;
56 std::cout<<
" ██████╔╝█████╗ ███████╗██║██║██║ ██║ ██║ ███╗█████╗ ██╔████╔██║ ███████║██║ ██║██║ ███╗██╔██╗ ██║██╔████╔██║█████╗ ██╔██╗ ██║ ██║ "<<std::endl;
57 std::cout<<
" ██╔══██╗██╔══╝ ╚════██║██║██║██║ ██║ ██║ ██║██╔══╝ ██║╚██╔╝██║ ██╔══██║██║ ██║██║ ██║██║╚██╗██║██║╚██╔╝██║██╔══╝ ██║╚██╗██║ ██║ "<<std::endl;
58 std::cout<<
" ██████╔╝███████╗███████║██║██║██║ ╚██████╗╚██████╔╝███████╗██║ ╚═╝ ██║ ██║ ██║███████╗██║╚██████╔╝██║ ╚████║██║ ╚═╝ ██║███████╗██║ ╚████║ ██║ "<<std::endl;
59 std::cout<<
" ╚═════╝ ╚══════╝╚══════╝╚═╝╚═╝╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ ╚═╝ "<<std::endl;
60 std::cout<<
" "<<std::endl;
62 log << MSG::INFO <<
"CgemAlignAlg initialze() ..." << endreq;
64 if(
"NULL"==m_histname){
65 log << MSG::ERROR <<
"not defined histogram file." << endreq;
66 return StatusCode::FAILURE;
69 StatusCode sc = service(
"CgemGeomSvc", m_cgemGeomSvc);
70 if(sc != StatusCode::SUCCESS){
71 log << MSG::ERROR <<
"can not use CgemGeomSvc" << endreq;
74 sc = service(
"CgemCalibFunSvc", m_cgemFunSvc);
75 if( sc != StatusCode::SUCCESS ){
76 log << MSG::FATAL <<
"can not use CgemCalibFunSvc" << endreq;
84 std::string strconfig;
85 std::string strcomment;
88 for(i=0; i<50; i++) fgTes[i] = -999;
89 ifstream fconfig( m_configFile.c_str() );
90 if( ! fconfig.is_open() ){
91 log << MSG::WARNING <<
"can not open config file " << m_configFile
92 <<
". Use defalt config parameters" << endreq;
94 log << MSG::INFO <<
"Open config file " << m_configFile << endreq;
95 while( fconfig >> strconfig ){
96 if(
'#' == strconfig[0]){
97 getline(fconfig, strcomment);
98 }
else if(
"TesMin" == strconfig){
110 m_alignPar -> rdAlignPar(m_alignFile);
111 cout << std::setprecision(4) << std::fixed;
112 cout<<
" The parameters are:"<<endl;
113 cout<<
" Layer Dx(mm) Dy(mm) Dz(mm) Rx(mrad) Ry(mrad) Rz(mrad) "<<endl;
114 cout<<
" =============================================================================================== "<<endl;
115 cout<<
" 0 "<<std::setw(15)<<m_alignPar->
getDx(0)<<std::setw(15)<<m_alignPar->
getDy(0)<<std::setw(15)<<m_alignPar->
getDz(0)<<std::setw(15)<<m_alignPar->
getRx(0)*1000.<<std::setw(15)<<m_alignPar->
getRy(0)*1000.<<std::setw(15)<<m_alignPar->
getRz(0)*1000.<<endl;
116 cout<<
" 1 "<<std::setw(15)<<m_alignPar->
getDx(1)<<std::setw(15)<<m_alignPar->
getDy(1)<<std::setw(15)<<m_alignPar->
getDz(1)<<std::setw(15)<<m_alignPar->
getRx(1)*1000.<<std::setw(15)<<m_alignPar->
getRy(1)*1000.<<std::setw(15)<<m_alignPar->
getRz(1)*1000.<<endl;
117 cout<<
" 2 "<<std::setw(15)<<m_alignPar->
getDx(2)<<std::setw(15)<<m_alignPar->
getDy(2)<<std::setw(15)<<m_alignPar->
getDz(2)<<std::setw(15)<<m_alignPar->
getRx(2)*1000.<<std::setw(15)<<m_alignPar->
getRy(2)*1000.<<std::setw(15)<<m_alignPar->
getRz(2)*1000.<<endl;
118 cout<<
" 3 "<<std::setw(15)<<m_alignPar->
getDx(3)<<std::setw(15)<<m_alignPar->
getDy(3)<<std::setw(15)<<m_alignPar->
getDz(3)<<std::setw(15)<<m_alignPar->
getRx(3)*1000.<<std::setw(15)<<m_alignPar->
getRy(3)*1000.<<std::setw(15)<<m_alignPar->
getRz(3)*1000.<<endl;
119 cout<<
" 4 "<<std::setw(15)<<m_alignPar->
getDx(4)<<std::setw(15)<<m_alignPar->
getDy(4)<<std::setw(15)<<m_alignPar->
getDz(4)<<std::setw(15)<<m_alignPar->
getRx(4)*1000.<<std::setw(15)<<m_alignPar->
getRy(4)*1000.<<std::setw(15)<<m_alignPar->
getRz(4)*1000.<<endl;
120 cout<<
" 5 "<<std::setw(15)<<m_alignPar->
getDx(5)<<std::setw(15)<<m_alignPar->
getDy(5)<<std::setw(15)<<m_alignPar->
getDz(5)<<std::setw(15)<<m_alignPar->
getRx(5)*1000.<<std::setw(15)<<m_alignPar->
getRy(5)*1000.<<std::setw(15)<<m_alignPar->
getRz(5)*1000.<<endl;
121 cout<<
" =============================================================================================== "<<endl;
125 m_cgemevt -> setParam(m_param);
128 m_hlist =
new TObjArray(0);
130 if( 0 == m_alignMethod ){
134 m_align->
initialize(m_hlist, m_cgemGeomSvc, m_cgemFunSvc);
136 log << MSG::INFO <<
"CgemAlignAlg initialze() successfully !!" << endreq;
140 return StatusCode::SUCCESS;
144 MsgStream log(
msgSvc(), name());
145 log << MSG::INFO <<
"CgemAlignAlg execute()" << endreq;
148 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),
"/Event/EventHeader");
150 log << MSG::FATAL <<
"Could not find Event Header" << endreq;
151 return( StatusCode::FAILURE);
153 int iRun = eventHeader->runNumber();
154 int iEvt = eventHeader->eventNumber();
155 if(0 == (m_nEvt % m_nEvtDisp)){
156 std::cout <<
"Run " << iRun <<
", Event " << iEvt <<
", Total Event number " << m_nEvt << endl;
159 if(m_nEvt<EventStart||m_nEvt>EventEnd)
161 cout<<
"Skim the event!!"<<endl;
163 return StatusCode::SUCCESS;
168 if( ! m_initAlignParFlg ){
169 m_initAlignParFlg =
true;
172 m_cgemevt -> setRecEvent();
174 if (!(m_align->
fillHist(m_cgemevt, m_alignPar))) {
176 return(StatusCode::SUCCESS);
181 return StatusCode::SUCCESS;