00001 class StChain;
00002 StChain *chain;
00003
00004 void StEventChain( char *fname ="/star/data35/reco/productionPP/ReversedFullField/DEV/2004/117/st_physics_5117072_raw_2010005.event.root"){
00005
00006 fname ="/star/data05/scratch/balewski/mcMinB/minB-P00-1001+.event.root";
00007 int nevents =2000;
00008 int total=0;
00009
00010 if (gClassTable->GetID("TTable") < 0) {
00011 gSystem->Load("libStar");
00012 gSystem->Load("libPhysics");
00013 }
00014
00015 gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
00016 loadSharedLibraries();
00017 assert(gSystem->Load("StRFEmcTrigger")==0);
00018
00019 chain= new StChain("StChain");
00020
00021
00022
00023 StIOMaker* ioMaker = new StIOMaker();
00024 ioMaker->SetFile(fname);
00025
00026 ioMaker->SetIOMode("r");
00027 ioMaker->SetBranch("*",0,"0");
00028 ioMaker->SetBranch("geantBranch",0,"r");
00029 ioMaker->SetBranch("eventBranch",0,"r");
00030 ioMaker->SetIOMode("r");
00031
00032
00033 StRFEmcTrigMaker *trig = new StRFEmcTrigMaker("RFTrigA");
00034
00035 trig->useStEvent();
00036
00037
00038
00039
00040 trig = new StRFEmcTrigMaker("RFTrigB");
00041 trig->useStEvent();
00042 trig->requireBBC();
00043
00044
00045 char *outHistFile="aa2";
00046 StTreeMaker* treeMk = new StTreeMaker("tree",outHistFile);
00047 treeMk->SetIOMode("w");
00048 treeMk->SetBranch("histBranch");
00049 chain->ls(3);
00050
00051 chain->Init();
00052 for (Int_t iev=0;iev<nevents; iev++) {
00053 if(iev%50==0)cout << "Working on eventNumber " << iev << endl;
00054 chain->Clear();
00055 int iret = chain->Make(iev);
00056 total++;
00057 if (iret && iret!=kStErr) {
00058 cout << "Bad return code!" << endl;
00059 break;
00060 }
00061 }
00062 chain->Finish();
00063 cout << "****************************************** " << endl;
00064 cout << "total number of events " << total << endl;
00065 cout << "****************************************** " << endl;
00066 }
00067
00068
00069
00070
00071
00072
00073