00001
00002
00003 class StChain;
00004 StChain *chain=0;
00005
00006 void DoFeeTTreeSimu(Int_t nevents=100){
00007
00008 char *fname="minb200-100.event.root";
00009 char *fileT="myFeeMC-minb200-100.root";
00010
00011
00012
00013
00014 gSystem->Load("St_base");
00015 gSystem->Load("StChain");
00016 gSystem->Load("libglobal_Tables");
00017 gSystem->Load("libsim_Tables");
00018 gSystem->Load("libgen_Tables");
00019 gSystem->Load("St_Tables");
00020 gSystem->Load("StDbLib");
00021 gSystem->Load("StDbBroker");
00022 gSystem->Load("St_db_Maker");
00023 gSystem->Load("StUtilities");
00024 gSystem->Load("StIOMaker");
00025 gSystem->Load("StMagF");
00026 gSystem->Load("StarClassLibrary");
00027 gSystem->Load("StAnalysisUtilities");
00028 gSystem->Load("StEvent");
00029 gSystem->Load("StTpcDb");
00030 gSystem->Load("StEventMaker");
00031 gSystem->Load("StMcEvent");
00032 gSystem->Load("StMcEventMaker");
00033 gSystem->Load("libgeometry_Tables");
00034 gSystem->Load("StEmcUtil");
00035
00036 if (0){
00037 cout << " StDBLib mode enabled" << endl;
00038 gSystem->Load("StDbLib");
00039 gSystem->Load("StDbBroker");
00040 gSystem->Load("St_db_Maker");
00041 }
00042
00043
00044 gSystem->Load("EEmc");
00045 gSystem->Load("EEfeeRaw");
00046 gSystem->Load("SteemcDb");
00047
00048
00049 chain = new StChain("bfc");
00050
00051
00052
00053
00054
00055 StIOMaker* ioMaker = new StIOMaker();
00056 ioMaker->SetFile(fname);
00057
00058
00059 ioMaker->SetIOMode("r");
00060 ioMaker->SetBranch("*",0,"0");
00061 ioMaker->SetBranch("geantBranch",0,"r");
00062 ioMaker->SetBranch("eventBranch",0,"r");
00063 ioMaker->SetIOMode("r");
00064
00065
00066 StMcEventMaker *mcEventMaker = new StMcEventMaker();
00067
00068
00069 SteemcDbMaker *myMk1=new SteemcDbMaker("eemcDBio");
00070 myMk1->setSectors(1,12);
00071 myMk1->setTimeStampDay(20021215);
00072
00073
00074 St_db_Maker *dbMk = new St_db_Maker("StarDb","MySQL:StarDb");
00075
00076
00077 St2eemcFeeRawMaker * myMk3=new St2eemcFeeRawMaker("St2feeTTree");
00078
00079
00080
00081 TFile f(fileT,"RECREATE");
00082 TTree t("fee","A tree with FEE events");
00083 myMk3->setOutTTree(&t);
00084
00085
00086 chain->PrintInfo();
00087 chain->ls(3);
00088 Int_t initStat = chain->Init();
00089 if (initStat) chain->Fatal(initStat, "during Init()");
00090
00091 int istat=0,iev=1;
00092
00093
00094 EventLoop:
00095 if (iev<=nevents && istat!=2)
00096 {
00097 chain->Clear();
00098 cout << "---------------------- Processing Event : " << iev << " ----------------------" << endl;
00099 istat = chain->Make(iev);
00100 if (istat == 2) { cout << "Last Event Processed. Status = " << istat << endl; }
00101 if (istat == 3) { cout << "Error Event Processed. Status = " << istat << endl; }
00102 iev++;
00103
00104
00105 goto EventLoop;
00106 }
00107 chain->Finish();
00108 t.Print();
00109
00110 f.Write();
00111 printf("\n\n============== TTree closed =========\n\n");
00112
00113 delete myMk3;
00114
00115 delete myMk1;
00116
00117
00118 }
00119
00120
00121
00122
00123