StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEventChain.C
1 class StChain;
2 StChain *chain;
3 
4 void StEventChain( char *fname ="/star/data35/reco/productionPP/ReversedFullField/DEV/2004/117/st_physics_5117072_raw_2010005.event.root"){
5 
6  fname ="/star/data05/scratch/balewski/mcMinB/minB-P00-1001+.event.root";
7  int nevents =2000;
8  int total=0;
9 
10  if (gClassTable->GetID("TTable") < 0) {
11  gSystem->Load("libStar");
12  gSystem->Load("libPhysics");
13  }
14 
15  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
16  loadSharedLibraries();
17  assert(gSystem->Load("StRFEmcTrigger")==0);
18 
19  chain= new StChain("StChain");
20  // chain->SetDebug(1);
21 
22  // StIOMaker - to read files ...
23  StIOMaker* ioMaker = new StIOMaker();
24  ioMaker->SetFile(fname);
25  //ioMaker->SetDebug();
26  ioMaker->SetIOMode("r");
27  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
28  ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
29  ioMaker->SetBranch("eventBranch",0,"r"); //activate Event Branch
30  ioMaker->SetIOMode("r");
31 
32 
33  StRFEmcTrigMaker *trig = new StRFEmcTrigMaker("RFTrigA");
34  // trig->useMuDst();// or ..
35  trig->useStEvent();
36 
37  // use filtering capabilities
38  //trig->requireBBC();
39 
40  trig = new StRFEmcTrigMaker("RFTrigB");
41  trig->useStEvent();
42  trig->requireBBC();
43 
44 
45  char *outHistFile="aa2";
46  StTreeMaker* treeMk = new StTreeMaker("tree",outHistFile);
47  treeMk->SetIOMode("w");
48  treeMk->SetBranch("histBranch");
49  chain->ls(3);
50  //chain->PrintInfo();
51  chain->Init();
52  for (Int_t iev=0;iev<nevents; iev++) {
53  if(iev%50==0)cout << "Working on eventNumber " << iev << endl;
54  chain->Clear();
55  int iret = chain->Make(iev);
56  total++;
57  if (iret && iret!=kStErr) {
58  cout << "Bad return code!" << endl;
59  break;
60  }
61  }
62  chain->Finish();
63  cout << "****************************************** " << endl;
64  cout << "total number of events " << total << endl;
65  cout << "****************************************** " << endl;
66 }
67 
68 
69 
70 
71 
72 
73 
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
Definition: Stypes.h:44