00001
00002
00003
00004
00005 class StChain;
00006 StChain *chain=0;
00007
00008 void TestIOMaker(Int_t nevents=3,
00009
00010 const char* MainFile="/star/data22/ITTF/data/simple_geant/DEV_10_8_01/*.event.root")
00011
00012
00013
00014
00015
00016
00017
00018
00019 {
00020
00021 cout <<"Loading St_base"<<endl;
00022 gSystem->Load("St_base");
00023
00024 cout <<"Loading StChain"<<endl;
00025 gSystem->Load("StChain");
00026
00027 cout <<"Loading St_Tables"<<endl;
00028 gSystem->Load("St_Tables");
00029
00030 cout <<"Loading StUtilities"<<endl;
00031 gSystem->Load("StUtilities");
00032
00033 cout <<"Loading StIOMaker"<<endl;
00034 gSystem->Load("StIOMaker");
00035
00036 cout <<"Loading StarClassLibrary"<<endl;
00037 gSystem->Load("StarClassLibrary");
00038
00039 cout <<"Loading DataBase"<<endl;
00040 gSystem->Load("StDbUtilities");
00041 gSystem->Load("StDbLib");
00042 gSystem->Load("StDbBroker");
00043 gSystem->Load("St_db_Maker");
00044 gSystem->Load("StTpcDb");
00045
00046 cout <<"Loading StEvent"<<endl;
00047 gSystem->Load("StEvent");
00048
00049 cout <<"Loading StEventMaker"<<endl;
00050 gSystem->Load("StEventMaker");
00051
00052 cout <<"Loading StEmcUtil"<<endl;
00053 gSystem->Load("StEmcUtil");
00054
00055 cout <<"Loading StMcEvent"<<endl;
00056 gSystem->Load("StMcEvent");
00057
00058 cout <<"Loading StMcEventMaker"<<endl;
00059 gSystem->Load("StMcEventMaker");
00060
00061 cout <<"Loading AssociationMaker"<<endl;
00062 gSystem->Load("StAssociationMaker");
00063
00064
00065
00066 chain = new StChain("StChain");
00067 chain->SetDebug();
00068
00069
00070
00071 StIOMaker* ioMaker = new StIOMaker("IO","r",MainFile,"bfcTree");
00072 ioMaker->SetDebug();
00073 ioMaker->SetIOMode("r");
00074 ioMaker->SetBranch("*",0,"0");
00075 ioMaker->SetBranch("geantBranch",0,"r");
00076 ioMaker->SetBranch("dstBranch",0,"r");
00077 ioMaker->SetBranch("runcoBranch",0,"r");
00078
00079
00080 const char* calibDB = "MySQL:StarDb";
00081 const char* paramsDB = "$STAR/StarDb";
00082 St_db_Maker* calibMk = new St_db_Maker("StarDb",calibDB,paramsDB);
00083 calibMk->SetDateTime("year_2b");
00084
00085 calibMk->SetDebug();
00086
00087
00088 StTpcDbMaker *tpcDbMk = new StTpcDbMaker("tpcDb");
00089
00090
00091 StEventMaker* eventReader = new StEventMaker("events","title");
00092 eventReader->doPrintEventInfo = 0;
00093
00094
00095 StMcEventMaker* mcEventReader = new StMcEventMaker();
00096
00097
00098 StAssociationMaker* assocMaker = new StAssociationMaker();
00099
00100 cout <<"Calling Init() Methods "<<endl;
00101 chain->Init();
00102
00103 cout <<"Starting Event Loop"<<endl;
00104
00105 int istat=0,iev=1;
00106 EventLoop: if (iev<=nevents && !istat) {
00107 chain->Clear();
00108 cout << "---------------------- Processing Event : " << iev << endl;
00109 istat = chain->Make(iev);
00110 if (istat) {
00111 cout << "Last Event Processed. Status = " << istat << endl;
00112 }
00113 iev++; goto EventLoop;
00114 }
00115
00116 return;
00117 }
00118