StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
DoTrigSimu.C
1 //******************************************************************************
2 
3 class StChain;
4 StChain *chain=0;
5 
6 void DoTrigSimu(Int_t nevents=5,char *fname="minb200-10k.event.root")
7 {
8  char *fname="st_physics_4095050_raw_0010002.event.root";
9  //
10  // First load some shared libraries we need
11  //
12  gSystem->Load("St_base");
13  gSystem->Load("StChain");
14  gSystem->Load("libglobal_Tables");
15  gSystem->Load("libsim_Tables");
16  gSystem->Load("libgen_Tables");
17  gSystem->Load("St_Tables");
18  gSystem->Load("StDbLib");
19  gSystem->Load("StDbBroker");
20  gSystem->Load("St_db_Maker");
21  gSystem->Load("StUtilities");
22  gSystem->Load("StIOMaker");
23  gSystem->Load("StMagF");
24  gSystem->Load("StarClassLibrary");
25  gSystem->Load("StAnalysisUtilities");
26  gSystem->Load("StEvent");
27  gSystem->Load("StTpcDb");
28  gSystem->Load("StEventMaker");
29  gSystem->Load("StMcEvent");
30  gSystem->Load("StMcEventMaker");
31  gSystem->Load("libgeometry_Tables");
32  gSystem->Load("StEmcUtil");
33 
34  // Load my makers
35  gSystem->Load("StEEmcDbMaker");
36  gSystem->Load("StEEmcUtil");
37  gSystem->Load("StEEmcSimulatorMaker");
38 
39  // create chain
40  chain = new StChain("bfc");
41  //chain->SetDebug();
42 
43  // Now we add Makers to the chain...
44 
45  // StIOMaker - to read files ...
46  StIOMaker* ioMaker = new StIOMaker();
47  //ioMaker->SetFile("photon_bemc.event.root");
48  ioMaker->SetFile(fname);
49  //ioMaker->SetDebug();
50  ioMaker->SetIOMode("r");
51  ioMaker->SetBranch("*",0,"0"); //deactivate all branches
52  ioMaker->SetBranch("geantBranch",0,"r"); //activate geant Branch
53  ioMaker->SetBranch("eventBranch",0,"r"); //activate Event Branch
54  ioMaker->SetIOMode("r");
55 
56  // StMcEventMaker
57  StMcEventMaker *mcEventMaker = new StMcEventMaker();
58 
59  // My Makers
60  // SteemcDbMaker *myMk1=new SteemcDbMaker("eemcDBio");
61  StEEmcTrigSimuMaker *myMk2=new StEEmcTrigSimuMaker("eemcTrigMaker");
62 
63  // Now execute the chain Init functions
64  chain->PrintInfo();
65  chain->ls(3);
66  Int_t initStat = chain->Init(); // This should call the Init() method in ALL makers
67  if (initStat) chain->Fatal(initStat, "during Init()");
68 
69  int istat=0,iev=1;
70 
71  // Do the event loop
72  EventLoop:
73  if (iev<=nevents && istat!=2)
74  {
75  chain->Clear();
76  cout << "---------------------- Processing Event : " << iev << " ----------------------" << endl;
77  istat = chain->Make(iev); // This should call the Make() method in ALL makers
78  if (istat == 2) { cout << "Last Event Processed. Status = " << istat << endl; }
79  if (istat == 3) { cout << "Error Event Processed. Status = " << istat << endl; }
80  iev++;
81 
82 
83  goto EventLoop;
84  } // Event Loop
85  chain->Finish();
86 
87  delete myMk2;
88  delete myMk1;
89 
90  f.Write();
91 
92 
93  printf("\n\n============== and of fill for EEMC FEE tree=========\n\n");
94 
95 }
96 //******************************************************************************
97 
98 
99 
100 
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
virtual Int_t Finish()
Definition: StChain.cxx:85
Filling of all StMcEvent classes from g2t tables Transform all the data in the g2t tables into the co...
virtual void ls(Option_t *option="") const
Definition: TDataSet.cxx:495
virtual Int_t Make()
Definition: StChain.cxx:110