10 Int_t iEvt=0,istat=0,nEvents=0;
13 void doEvents(
const Char_t *file=
"StRoot/StTofPool/StVpdAnalysisMaker/macros/test.lis",
const Char_t *outputname=
"test.root");
17 void doEvents(
const Char_t *fileList,
const Char_t *outputname)
25 if (gClassTable->GetID(
"TTable") < 0) {
26 gSystem->Load(
"libStar");
27 gSystem->Load(
"libPhysics");
29 gROOT->LoadMacro(
"$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
30 loadSharedLibraries();
31 gSystem->Load(
"StarMagField");
32 gSystem->Load(
"StMagF");
33 gSystem->Load(
"StTpcDb");
35 gSystem->Load(
"StDaqLib");
36 gSystem->Load(
"StDbBroker");
37 gSystem->Load(
"StDetectorDbMaker");
38 gSystem->Load(
"StDbUtilities");
39 gSystem->Load(
"St_db_Maker");
41 gSystem->Load(
"StEvent");
42 gSystem->Load(
"StEventMaker");
43 gSystem->Load(
"StarMagField");
44 gSystem->Load(
"StTofUtil");
46 gSystem->Load(
"StVpdAnalysisMaker");
53 delete setFiles; setFiles =0;
59 ifstream* inputStream =
new ifstream;
60 inputStream->open(fileList);
62 cout <<
"can not open list file" << endl;
65 cout<<
"Open file list: --- "<<fileList<<endl;
68 for (;inputStream->good();) {
69 inputStream->getline(line,512);
70 if ( inputStream->good() ) {
72 TFile *ftmp =
new TFile(line);
74 if (!(ftmp->IsOpen())) {
75 cout<<line<<
" open failed ! not chained"<<endl;
78 if (ftmp->IsZombie()) {
79 cout<<
"sth. very wrong with "<<line<<
", not chained "<<endl;
82 if (ftmp->TestBit(1024)) {
83 cout<<
"revocer procedure applied to "<<line<<endl;
87 if( ftmp && ftmp->IsOpen() && ftmp->GetNkeys()) {
88 cout <<
"add file " << line << endl;
89 setFiles->AddFile(line);
91 cout <<
" cannot open file " << line << endl;
103 cout<<endl<<
"============ Data Base ========="<<endl;
104 dbMk =
new St_db_Maker(
"db",
"MySQL:StarDb",
"$STAR/StarDb",
"StarDb");
112 Int_t iInit = chain->Init();
113 if (iInit) chain->Fatal(iInit,
"on init");
119 int istat = 0, i = 1;
120 EventLoop:
if (i <= nEvents && istat != 2) {
122 cout << endl <<
"============================ Event " << i
123 <<
" start ============================" << endl;
126 istat = chain->
Make(i);
128 {cout <<
"Last event processed. Status = " << istat << endl;}
130 {cout <<
"Error event processed. Status = " << istat << endl;}
138 cout<<endl<<
"============================ Event "<<i<<
" finish ============================"<<endl;
virtual void Clear(Option_t *option="")
User defined functions.
void SetStatus(const char *arrType, int status)