StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
fwdqa.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 fwdqa( 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  gSystem->Load("libStarGeneratorUtil.so");
40  gSystem->Load("libgenfit2");
41  gSystem->Load("libKiTrack");
42  gSystem->Load( "StFwdTrackMaker.so" );
43  gSystem->Load("libStEpdUtil.so");
44  StFwdQAMaker *fwdQAMk = new StFwdQAMaker();
45  fwdQAMk->SetDebug(2);
46 
47  // Initialize chain
48  Int_t iInit = chain->Init();
49 
50  cout << "CHAIN INIT DONE?" << endl;
51  // ensure that the chain initializes
52  if ( iInit )
53  chain->Fatal(iInit,"on init");
54 
55  // print the chain status
56  // chain->PrintInfo();
57 
58  //_____________________________________________________________________________
59  //
60  // MAIN EVENT LOOP
61  //_____________________________________________________________________________
62  for (int i = 0; i < nEvents; i++) {
63  chain->Clear();
64  if (kStOK != chain->Make())
65  break;
66  }
67 
68  // Chain Finish
69  if (nEvents > 1) {
70  cout << "FINISH up" << endl;
71  chain->Finish();
72  }
73 
74  delete chain;
75 
76 
77 
78 }
79 
80 
81 
82 void loadLibs(){
83  // if (gClassTable->GetID("TTable") < 0) {
84  // gSystem->Load("libStar");
85  // gSystem->Load("libPhysics");
86  // }
87  cout << "LL0" << endl;
88  gSystem->Load("libStarClassLibrary.so");
89  gSystem->Load("libStarRoot.so");
90  cout << "LL1" << endl;
91  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
92  loadSharedLibraries();
93  cout << "LL2" << endl;
94 
95  gSystem->Load("StarMagField");
96  gSystem->Load("StMagF");
97  gSystem->Load("StDetectorDbMaker");
98  gSystem->Load("StTpcDb");
99  gSystem->Load("StDaqLib");
100  gSystem->Load("StDbBroker");
101  gSystem->Load("StDbUtilities");
102  gSystem->Load("St_db_Maker");
103 
104  gSystem->Load("StEvent");
105  gSystem->Load("StEventMaker");
106  gSystem->Load("StarMagField");
107 
108  gSystem->Load("libGeom");
109  gSystem->Load("St_g2t");
110 
111  // Added for Run16 And beyond
112  gSystem->Load("libGeom.so");
113 
114  gSystem->Load("St_base.so");
115  gSystem->Load("StUtilities.so");
116  gSystem->Load("libPhysics.so");
117  gSystem->Load("StarAgmlUtil.so");
118  gSystem->Load("StarAgmlLib.so");
119  gSystem->Load("libStarGeometry.so");
120  gSystem->Load("libGeometry.so");
121 
122  gSystem->Load("xgeometry");
123 
124  gSystem->Load("St_geant_Maker");
125 
126 
127  // needed since I use the StMuTrack
128  gSystem->Load("StarClassLibrary");
129  gSystem->Load("StStrangeMuDstMaker");
130  gSystem->Load("StMuDSTMaker");
131  gSystem->Load("StBTofCalibMaker");
132  gSystem->Load("StVpdCalibMaker");
133  gSystem->Load("StBTofMatchMaker");
134  gSystem->Load("StFcsDbMaker");
135 
136 
137 }
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