44 {
45 MsgStream log(
msgSvc(), name() );
46 log << MSG::INFO << "MdcAlignAlg initialze() ..." << endreq;
47 log << MSG::INFO << "MdcAlignFlg = " << m_alignMeth << endreq;
48
49 StatusCode sc = service("MdcGeomSvc", m_mdcGeomSvc);
50 if(sc != StatusCode::SUCCESS){
51 log << MSG::ERROR << "can not use MdcGeomSvc" << endreq;
52 }
53
54 sc = service("MdcCalibFunSvc", m_mdcFunSvc);
55 if( sc != StatusCode::SUCCESS ){
56 log << MSG::FATAL << "can not use MdcCalibFunSvc" << endreq;
57 }
58
59 sc = service("MdcUtilitySvc", m_mdcUtilitySvc);
60 if( sc != StatusCode::SUCCESS ){
61 log << MSG::FATAL << "can not use MdcUtilitySvc" << endreq;
62 }
63
64
65 initParam();
66
67
68 int i;
69 std::string strconfig;
70 std::string strcomment;
71 std::string strTes;
72 int fgTes[50];
73 for(i=0; i<50; i++) fgTes[i] = -999;
74 ifstream fconfig( m_configFile.c_str() );
75 if( ! fconfig.is_open() ){
76 log << MSG::WARNING << "can not open config file " << m_configFile
77 << ". Use defalt config parameters" << endreq;
78 } else {
79 log << MSG::INFO << "Open config file " << m_configFile << endreq;
80 while( fconfig >> strconfig ){
81 if('#' == strconfig[0]){
82 getline(fconfig, strcomment);
83 } else if("EsTimeFlag" == strconfig){
84 getline(fconfig, strTes);
85 int n = sscanf(strTes.c_str(),
"%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d%d",
86 fgTes+0, fgTes+1, fgTes+2, fgTes+3, fgTes+4,
87 fgTes+5, fgTes+6, fgTes+7, fgTes+8, fgTes+9,
88 fgTes+10, fgTes+11, fgTes+12, fgTes+13, fgTes+14,
89 fgTes+15, fgTes+16, fgTes+17, fgTes+18, fgTes+19);
90 for(i=0; i<
n; i++) m_param.
esFlag[i] = fgTes[i];
92 } else if("TesMin" == strconfig){
94 } else if("TesMax" == strconfig){
96 } else if("ResidualType" == strconfig){
98 } else if("FlagAdjacLayerCut" == strconfig){
100 } else if("FlagBoundLayerCut" == strconfig){
102 } else if("hitStatCut" == strconfig){
104 } else if("nTrkCut" == strconfig){
106 } else if("nHitLayCut" == strconfig){
108 } else if("nHitCut" == strconfig){
110 } else if("ptCut" == strconfig){
111 fconfig >> m_param.
ptCut[0] >> m_param.
ptCut[1];
112 } else if("cosThetaCut" == strconfig){
114 } else if("DrCut" == strconfig){
115 fconfig >> m_param.
drCut;
116 } else if("DzCut" == strconfig){
117 fconfig >> m_param.
dzCut;
118 } else if("MaximalDocaInner" == strconfig){
120 }else if("MaximalDocaOuter" == strconfig){
122 }else if("MaximalResidual" == strconfig){
124 }
125 }
126 fconfig.close();
127 }
128
129
131
132 cout << "EsFlag for Mdc Alignment: ";
133 for(
int iEs=0; iEs<m_param.
nEsFlag; iEs++) cout << setw(6) << m_param.
esFlag[iEs];
134 cout << endl;
135
138
140 m_alignPar -> rdAlignPar(m_alignFile);
141
143 m_mdcevt -> setParam(m_param);
144
145 m_hlist = new TObjArray();
146
147 if( 0 == m_alignMeth ){
149 } else if( 1 == m_alignMeth ){
152 }
154 m_pAlign ->
initialize(m_hlist, m_mdcGeomSvc, m_mdcFunSvc, m_mdcUtilitySvc);
155
156 return StatusCode::SUCCESS;
157}
virtual void setParam(MdcAliParams ¶m)=0