StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TestIOMaker.C
1 // TestIOMaker.C
2 // M.L. Miller
3 // 5/00
4 
5 class StChain;
6 StChain *chain=0;
7 
8 void TestIOMaker(Int_t nevents=3,
9  //This file points to 30 events of 10 neg muons w/ pt=.9
10  const char* MainFile="/star/data22/ITTF/data/simple_geant/DEV_10_8_01/*.event.root")
11  //This file points to 5 muons /event
12  //const char* MainFile="/star/data22/ITTF/EvalData/MCNtuple/muon_100_neg.event.root")
13 
14  //This file points to 110 events from mevsim (homebrew had. cocktail)
15  //const char* MainFile="/star/data22/ITTF/data/mevsim/10_9_01/*.event.root")
16 
17  //This file points to a nightly low density hadronic cocktail reconstruction.
18  //const char* MainFile="/star/rcf/test/dev/trs_redhat61/Tue/year_2001/hc_lowdensity/*.event.root")
19 {
20  // Dynamically link needed shared libs
21  cout <<"Loading St_base"<<endl;
22  gSystem->Load("St_base");
23 
24  cout <<"Loading StChain"<<endl;
25  gSystem->Load("StChain");
26 
27  cout <<"Loading St_Tables"<<endl;
28  gSystem->Load("St_Tables");
29 
30  cout <<"Loading StUtilities"<<endl;
31  gSystem->Load("StUtilities");
32 
33  cout <<"Loading StIOMaker"<<endl;
34  gSystem->Load("StIOMaker");
35 
36  cout <<"Loading StarClassLibrary"<<endl;
37  gSystem->Load("StarClassLibrary");
38 
39  cout <<"Loading DataBase"<<endl;
40  gSystem->Load("StDbUtilities");
41  gSystem->Load("StDbLib");
42  gSystem->Load("StDbBroker");
43  gSystem->Load("St_db_Maker");
44  gSystem->Load("StTpcDb");
45 
46  cout <<"Loading StEvent"<<endl;
47  gSystem->Load("StEvent");
48 
49  cout <<"Loading StEventMaker"<<endl;
50  gSystem->Load("StEventMaker");
51 
52  cout <<"Loading StEmcUtil"<<endl;
53  gSystem->Load("StEmcUtil");
54 
55  cout <<"Loading StMcEvent"<<endl;
56  gSystem->Load("StMcEvent");
57 
58  cout <<"Loading StMcEventMaker"<<endl;
59  gSystem->Load("StMcEventMaker");
60 
61  cout <<"Loading AssociationMaker"<<endl;
62  gSystem->Load("StAssociationMaker");
63 
64  // create a new instance of the chain
65 
66  chain = new StChain("StChain");
67  chain->SetDebug();
68 
69  // add makers to the chain
70 
71  StIOMaker* ioMaker = new StIOMaker("IO","r",MainFile,"bfcTree");
72  ioMaker->SetDebug();
73  ioMaker->SetIOMode("r");
74  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
75  ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
76  ioMaker->SetBranch("dstBranch",0,"r"); //activate Event Branch
77  ioMaker->SetBranch("runcoBranch",0,"r"); //activate runco Branch
78 
79  //Calibration Maker (StarDB,not a real Database!)
80  const char* calibDB = "MySQL:StarDb";
81  const char* paramsDB = "$STAR/StarDb";
82  St_db_Maker* calibMk = new St_db_Maker("StarDb",calibDB,paramsDB);
83  calibMk->SetDateTime("year_2b");
84  //calibMk->SetDateTime("year_1h");
85  calibMk->SetDebug();
86 
87  //Read Tpc Database access
88  StTpcDbMaker *tpcDbMk = new StTpcDbMaker("tpcDb");
89 
90  //StEventMaker
91  StEventMaker* eventReader = new StEventMaker("events","title");
92  eventReader->doPrintEventInfo = 0;
93 
94  //StMcEventMaker
95  StMcEventMaker* mcEventReader = new StMcEventMaker();
96 
97  //Association
98  StAssociationMaker* assocMaker = new StAssociationMaker();
99 
100  cout <<"Calling Init() Methods "<<endl;
101  chain->Init();
102 
103  cout <<"Starting Event Loop"<<endl;
104 
105  int istat=0,iev=1;
106  EventLoop: if (iev<=nevents && !istat) {
107  chain->Clear();
108  cout << "---------------------- Processing Event : " << iev << endl;
109  istat = chain->Make(iev);
110  if (istat) {
111  cout << "Last Event Processed. Status = " << istat << endl;
112  }
113  iev++; goto EventLoop;
114  }
115 
116  return;
117 }
118 
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
virtual Int_t Make()
Definition: StChain.cxx:110