00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00069 Int_t usePath = 0;
00070 Int_t nFile = 0;
00071 TString thePath;
00072 TString theFileName;
00073 TString originalPath;
00074 class StChain;
00075 StChain *chain=0;
00076
00077 const char *dstFile = 0;
00078 const char *xdfFile = 0;
00079 const char *mdcFile = 0;
00080 const char *fileList[] = {dstFile,xdfFile,mdcFile,0};
00081
00082
00083
00084
00085
00086
00087
00088
00089 void runPeCMaker(Int_t,const Char_t **,const char *qaflag = "");
00090
00091 void runPeCMaker(Int_t nevents=2,
00092 const Char_t *path="-",
00093 const Char_t *file="/afs/rhic.bnl.gov/star/data/samples/gstar.dst.root",
00094 const char *qaflag = "off");
00095
00096
00097 void runPeCMaker(Int_t nevents, const Char_t **fileList, const char *qaflag)
00098 {
00099
00100 gSystem->Load("St_base");
00101 gSystem->Load("StChain");
00102
00103 gSystem->Load("libgen_Tables");
00104 gSystem->Load("libsim_Tables");
00105 gSystem->Load("libglobal_Tables");
00106
00107
00108 gSystem->Load("StUtilities");
00109 gSystem->Load("StIOMaker");
00110 gSystem->Load("StarClassLibrary");
00111 gSystem->Load("StEvent");
00112 gSystem->Load("StarMagField");
00113 gSystem->Load("StMagF");
00114 gSystem->Load("StDetectorDbMaker");
00115 gSystem->Load("StTpcDb");
00116 gSystem->Load("StEventMaker");
00117 gSystem->Load("StPeCMaker");
00118 cout<<"Shared Libraries Loaded!"<<endl;
00119
00120 chain = new StChain("StChain");
00121
00122 StFileI *setFiles= new StFile();
00123
00124 for (int ifil=0; fileList[ifil]; ifil++){
00125 setFiles->AddFile(fileList[ifil]);
00126 }
00127 StIOMaker *IOMk = new StIOMaker("IO","r",setFiles,"bfcTree");
00128 IOMk->SetIOMode("r");
00129 IOMk->SetBranch("*",0,"0");
00130 IOMk->SetBranch("dstBranch",0,"r");
00131 IOMk->SetBranch("runcoBranch",0,"r");
00132 IOMk->SetDebug();
00133
00134
00135 StEventMaker *readerMaker = new StEventMaker("events","title");
00136
00137
00138 StPeCMaker *analysisMaker = new StPeCMaker("analysis");
00139
00140
00141 Int_t iInit = chain->Init();
00142 if (iInit) chain->Fatal(iInit,"on init");
00143 chain->PrintInfo();
00144
00145
00146 int istat=0,i=1;
00147 EventLoop: if (i <= nevents && istat!=2) {
00148 cout << "============================ Event " << i
00149 << " start ============================" << endl;
00150 chain->Clear();
00151 istat = chain->Make(i);
00152 if (istat==2) {cout << "Last event processed. Status = " << istat << endl;}
00153 if (istat==3) {cout << "Error event processed. Status = " << istat << endl;}
00154 i++;
00155 goto EventLoop;
00156 }
00157
00158 i--;
00159 cout << "============================ Event " << i
00160 << " finish ============================" << endl;
00161 chain->Clear();
00162 chain->Finish();
00163
00164 }
00165
00166 void runPeCMaker(const Int_t nevents, const Char_t *path, const Char_t *file,const char *qaflag)
00167 {
00168 const char *fileListQQ[]={0,0};
00169 if (path[0]=='-') {
00170 fileListQQ[0]=file;
00171 } else {
00172 fileListQQ[0] = gSystem->ConcatFileName(path,file);
00173 }
00174 runPeCMaker(nevents,fileListQQ,qaflag);
00175 }
00176
00177
00178
00179
00180
00181
00182
00183