StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
mudst.C
1 //usr/bin/env root4star -l root -l -q $0; exit $?
2 // that is a valid shebang to run script as executable, but with only one arg
3 
4 void loadLibs();
5 void mudst( const Char_t * fileList = "mudst.lis", int nEvents = 5000, int nFiles = 1 ){
6  cout << "FileList: " << fileList << endl;
7  cout << "nFiles: " << nFiles << endl;
8  cout << "nEvents: " << nEvents << endl;
9 
10  // First load some shared libraries we need
11  loadLibs();
12 
13  // create the chain
14  StChain *chain = new StChain("StChain");
15 
16  // create the StMuDstMaker
17  StMuDstMaker *muDstMaker = new StMuDstMaker( 0,
18  0,
19  "",
20  fileList,
21  "MuDst.root",
22  nFiles
23  );
24 
25  // Initialize the database
26  // cout << endl << "============ Data Base =========" << endl;
27  // St_db_Maker *dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb","StarDb");
28 
29 
30  gSystem->Load("StFwdUtils.so");
31  StFwdAnalysisMaker * fwdAna = new StFwdAnalysisMaker();
32  fwdAna->setMuDstInput();
33  chain->AddMaker(fwdAna);
34 
35  StFcsDbMaker * fcsDb = new StFcsDbMaker();
36  chain->AddMaker(fcsDb);
37  fcsDb->SetDebug();
38 
39 
40  // Initialize chain
41  Int_t iInit = chain->Init();
42 
43  cout << "CHAIN INIT DONE?" << endl;
44  // ensure that the chain initializes
45  if ( iInit )
46  chain->Fatal(iInit,"on init");
47 
48  // print the chain status
49  // chain->PrintInfo();
50 
51  //_____________________________________________________________________________
52  //
53  // MAIN EVENT LOOP
54  //_____________________________________________________________________________
55  for (int i = 0; i < nEvents; i++) {
56  chain->Clear();
57  if (kStOK != chain->Make())
58  break;
59  }
60 
61  // Chain Finish
62  if (nEvents > 1) {
63  cout << "FINISH up" << endl;
64  chain->Finish();
65  }
66 
67  delete chain;
68 
69 
70 
71 }
72 
73 
74 
75 void loadLibs(){
76  // if (gClassTable->GetID("TTable") < 0) {
77  // gSystem->Load("libStar");
78  // gSystem->Load("libPhysics");
79  // }
80  cout << "LL0" << endl;
81  gSystem->Load("libStarClassLibrary.so");
82  gSystem->Load("libStarRoot.so");
83  cout << "LL1" << endl;
84  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
85  loadSharedLibraries();
86  cout << "LL2" << endl;
87 
88  gSystem->Load("StarMagField");
89  gSystem->Load("StMagF");
90  gSystem->Load("StDetectorDbMaker");
91  gSystem->Load("StTpcDb");
92  gSystem->Load("StDaqLib");
93  gSystem->Load("StDbBroker");
94  gSystem->Load("StDbUtilities");
95  gSystem->Load("St_db_Maker");
96 
97  gSystem->Load("StEvent");
98  gSystem->Load("StEventMaker");
99  gSystem->Load("StarMagField");
100 
101  gSystem->Load("libGeom");
102  gSystem->Load("St_g2t");
103 
104  // Added for Run16 And beyond
105  gSystem->Load("libGeom.so");
106 
107  gSystem->Load("St_base.so");
108  gSystem->Load("StUtilities.so");
109  gSystem->Load("libPhysics.so");
110  gSystem->Load("StarAgmlUtil.so");
111  gSystem->Load("StarAgmlLib.so");
112  gSystem->Load("libStarGeometry.so");
113  gSystem->Load("libGeometry.so");
114 
115  gSystem->Load("xgeometry");
116 
117  gSystem->Load("St_geant_Maker");
118 
119 
120  // needed since I use the StMuTrack
121  gSystem->Load("StarClassLibrary");
122  gSystem->Load("StStrangeMuDstMaker");
123  gSystem->Load("StMuDSTMaker");
124  gSystem->Load("StBTofCalibMaker");
125  gSystem->Load("StVpdCalibMaker");
126  gSystem->Load("StBTofMatchMaker");
127  gSystem->Load("StFcsDbMaker");
128 
129 
130 }
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110
Definition: Stypes.h:40