26int main(
int argc,
char* argv[] ) {
28 if ( argc > 1 ) { jobname = argv[1]; }
31 cout <<
"bad argument" << endl;
36 string strJob = jobname;
37 cout <<
"strJob: " << strJob << endl;
38 string::size_type ilast = strJob.find_last_of(
"/" );
39 if ( string::npos != ilast ) { path = strJob.substr( 0, ilast ); }
46 ifstream fjob( jobname );
47 if ( !fjob.is_open() )
49 cout <<
"ERROR: can not read jobOption: " << jobname << endl;
54 cout <<
"Open jobOption: " << jobname << endl;
55 while ( getline( fjob, str ) )
57 if ( str.find(
"//", 0 ) != string::npos ) {
continue; }
58 else if ( str.find(
"MdcGeomSvc.alignFilePath", 0 ) != string::npos )
60 string::size_type i1 = str.find_first_of(
"\"" );
61 string::size_type i2 = str.find_last_of(
"\"" );
62 alignFile = str.substr( i1 + 1, i2 - i1 - 1 );
64 else if ( str.find(
"MdcAlignAlg.ConfigFile", 0 ) != string::npos )
66 string::size_type i1 = str.find_first_of(
"\"" );
67 string::size_type i2 = str.find_last_of(
"\"" );
68 confname = str.substr( i1 + 1, i2 - i1 - 1 );
70 else if ( str.find(
"MdcAlignAlg.MdcAlignMeth", 0 ) != string::npos )
72 string::size_type i1 = str.find_first_of(
"=" );
73 string::size_type i2 = str.find_last_of(
";" );
74 strtmp = str.substr( i1 + 1, i2 - i1 - 1 );
75 sscanf( strtmp.c_str(),
"%d", &alignMeth );
81 pGeom =
new MdcCosGeom(
"/home/bes/wulh/document/wireconf.txt",
82 "/home/bes/wulh/calibConst/MdcAlignPar_ini.txt" );
85 TObjArray* hlist =
new TObjArray( 0 );
87 if ( 0 == alignMeth ) pAlign =
new ResiAlign();
90 cout <<
"Error AlignType" << endl;
93 pAlign->
init( hlist, pGeom );
96 if ( 0 == fhistname.size() )
98 cout <<
"hist file path: " << path << endl;
101 for (
unsigned nf = 0; nf < fhistname.size(); nf++ )
103 TFile* fin =
new TFile( fhistname[nf].c_str() );
104 if ( !fin->IsOpen() ) {
continue; }
107 cout <<
"merge hist file " << nf <<
": " << fhistname[nf] << endl;
119 pAlign->
align( alignPar );
121 TFile fhist(
"histall.root",
"recreate" );