14#include "TPostScript.h"
20#include "include/MdcCosGeom.h"
21#include "include/fun.h"
26int main(
int argc,
char* argv[]){
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){
40 path = strJob.substr(0, ilast);
48 ifstream fjob(jobname);
49 if( ! fjob.is_open() ){
50 cout <<
"ERROR: can not read jobOption: " << jobname << endl;
53 cout <<
"Open jobOption: " << jobname << endl;
54 while( getline(fjob, str) ){
55 if(str.find(
"//", 0) != string::npos){
57 }
else if( str.find(
"MdcGeomSvc.alignFilePath", 0) != string::npos ){
58 string::size_type i1 = str.find_first_of(
"\"");
59 string::size_type i2 = str.find_last_of(
"\"");
60 alignFile = str.substr(i1+1, i2-i1-1);
61 }
else if(str.find(
"MdcAlignAlg.ConfigFile", 0) != string::npos){
62 string::size_type i1 = str.find_first_of(
"\"");
63 string::size_type i2 = str.find_last_of(
"\"");
64 confname = str.substr(i1+1, i2-i1-1);
65 }
else if(str.find(
"MdcAlignAlg.MdcAlignMeth", 0) != string::npos){
66 string::size_type i1 = str.find_first_of(
"=");
67 string::size_type i2 = str.find_last_of(
";");
68 strtmp = str.substr(i1+1, i2-i1-1);
69 sscanf(strtmp.c_str(),
"%d", &alignMeth);
75 pGeom =
new MdcCosGeom(
"/home/bes/wulh/document/wireconf.txt",
"/home/bes/wulh/calibConst/MdcAlignPar_ini.txt" );
76 pGeom -> initialize(0.0);
78 TObjArray* hlist =
new TObjArray(0);
80 if(0 == alignMeth) pAlign =
new ResiAlign();
81 else {cout <<
"Error AlignType" << endl;
return 0;}
82 pAlign->
init(hlist, pGeom);
85 if(0==fhistname.size()){
86 cout <<
"hist file path: " << path << endl;
89 for(
unsigned nf=0; nf<fhistname.size(); nf++){
90 TFile* fin =
new TFile(fhistname[nf].c_str());
94 cout <<
"merge hist file " << nf <<
": " << fhistname[nf] << endl;
106 pAlign->
align(alignPar);
108 TFile fhist(
"histall.root",
"recreate");
vector< string > getHistList()
virtual void align(MdcAlignPar *alignPar)=0
virtual void mergeHist(TFile *fhist)=0
virtual void init(TObjArray *hlist, MdcCosGeom *pGeom)=0
bool rdAlignPar(std::string alignFile)