10 Int_t iEvt=0,istat=0,nEvents=0;
13 void doEvents(
const Char_t *file=
"StRoot/StTofPool/StTofMuDstReader/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");
45 gSystem->Load(
"StTofMaker");
47 gSystem->Load(
"libtpc_Tables");
48 gSystem->Load(
"libGeom");
49 gSystem->Load(
"St_g2t");
50 gSystem->Load(
"geometry");
51 gSystem->Load(
"St_geant_Maker");
53 gSystem->Load(
"StTofMuDstReader");
60 int NwGeant=5000000, IwType=0, NwPaw=0;
66 delete setFiles; setFiles =0;
72 ifstream* inputStream =
new ifstream;
73 inputStream->open(fileList);
75 cout <<
"can not open list file" << endl;
78 cout<<
"Open file list: --- "<<fileList<<endl;
81 for (;inputStream->good();) {
82 inputStream->getline(line,512);
83 if ( inputStream->good() ) {
85 TFile *ftmp =
new TFile(line);
87 if (!(ftmp->IsOpen())) {
88 cout<<line<<
" open failed ! not chained"<<endl;
91 if (ftmp->IsZombie()) {
92 cout<<
"sth. very wrong with "<<line<<
", not chained "<<endl;
95 if (ftmp->TestBit(1024)) {
96 cout<<
"revocer procedure applied to "<<line<<endl;
100 if( ftmp && ftmp->IsOpen() && ftmp->GetNkeys()) {
101 cout <<
"add file " << line << endl;
102 setFiles->AddFile(line);
104 cout <<
" cannot open file " << line << endl;
113 muDstMaker->
SetStatus(
"PrimaryVertices",1);
114 muDstMaker->
SetStatus(
"PrimaryTracks",1);
119 gSystem->Load(
"StTofMuDstReader");
128 Int_t iInit = chain->Init();
129 if (iInit) chain->Fatal(iInit,
"on init");
135 int istat = 0, i = 1;
136 EventLoop:
if (i <= nEvents && istat != 2) {
138 cout << endl <<
"============================ Event " << i
139 <<
" start ============================" << endl;
142 istat = chain->
Make(i);
144 {cout <<
"Last event processed. Status = " << istat << endl;}
146 {cout <<
"Error event processed. Status = " << istat << endl;}
154 cout<<endl<<
"============================ Event "<<i<<
" finish ============================"<<endl;
virtual void Clear(Option_t *option="")
User defined functions.
void SetStatus(const char *arrType, int status)
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.
virtual void LoadGeometry(const Char_t *option="detp geometry field_only")
Specifies GEANT3 geometry command.