19 #include "TClassTable.h"
21 #include "TDataSetIter.h"
22 #include "StBFChain.h"
23 #include "StIOMaker.h"
24 void bfc (
const Int_t Last,
27 const Char_t *outfile,
28 const Char_t *TreeFile);
38 void bfcZ(
const Int_t
First,
40 const Char_t *Chain=
"gstar Cy2b tfs -NoHits TpcHitFilter",
41 const Char_t *infile=0,
42 const Double_t zmin=-200,
const Double_t zmax=-100,
43 const Char_t *outfile=0,
44 const Char_t *TreeFile=0){
45 gROOT->LoadMacro(
"bfc.C");
46 bfc(-1,Chain,infile,outfile,TreeFile);
47 if (chain->GetOption(
"TpcHitFilter")) {
48 StTpcHitFilterMaker *filtMk = (StTpcHitFilterMaker *) chain->GetMaker(
"tpc_hit_filter");
51 if (zmin < 0 && zmax < 0) filtMk->WestOff();
52 if (zmin > 0 && zmax > 0) filtMk->EastOff();
53 filtMk->SetZrange(zmin,zmax);
58 printf (
"QAInfo:Run is started at Date/Time %i/%i\n",t.GetDate(),t.GetTime());
59 printf (
"QAInfo:Run on %s in %s\n",
61 gSystem->WorkingDirectory());
62 printf (
"QAInfo: with %s\n", chain->GetCVS());
65 Int_t iTotal = 0, iBad = 0;
66 St_XDFFile *xdf_out = 0;
68 Int_t iMake = 0, i =
First;
70 Int_t iInit = chain->Init();
72 chain->Fatal(iInit,
"on init");
76 if (hd) hd->SetRunNumber(-2);
79 if (chain->GetOption(
"fzin")) {
82 if (geant->IsActive()) geant->Skip(First-1);
87 if (inpMk) {printf (
"Skip %i Events\n",First-1);inpMk->Skip(First-1);}
91 xdf_out = chain->GetXdfOut();
92 if (chain->GetOption(
"Event")) evMk = (
StEventMaker *) chain->GetMaker(
"StEventMaker");
93 treeMk = chain->GetMaker(
"OutputStream");
94 EventLoop:
if (i <= Last && iMake !=
kStEOF && iMake !=
kStFatal) {
96 evnt.Start(
"QAInfo:");
98 iMake = chain->Make(i);
101 St_DataSet *dstSet = chain->GetInputDS(
"dst");
102 if (dstSet) xdf_out->NextEventPut(dstSet);
105 if (treeMk && iMake ==
kStErr) {treeMk->
Make(i); iBad++;}
107 evnt.Stop(
"QAInfo:");
109 printf (
"QAInfo: Done with Event [no. %d/run %d/evt. %d/Date.Time %d.%d/sta %d] Real Time = %10.2f seconds Cpu Time = %10.2f seconds \n",
110 i,chain->
GetRunNumber(),chain->GetEventNumber(),chain->GetDate(), chain->GetTime(),
111 iMake,evnt.GetRealTime(
"QAInfo:"),evnt.GetCpuTime(
"QAInfo:"));
117 printf (
"QAInfo:Run completed ");
118 gSystem->Exec(
"date");
119 if (evMk)
Event = (
StEvent *) chain->GetInputDS(
"StEvent");
122 printf (
"\nQAInfo:Run is finished at Date/Time %i/%i; Total events processed :%i and not completed: %i\n",
123 t.GetDate(),t.GetTime(),iTotal,iBad);
127 void bfcZ (
const Int_t Last,
128 const Char_t *Chain=
"gstar Cy2b tfs evout TpcHitFilter -NoHits",
129 const Char_t *infile=0,
130 const Double_t zmin=-200,
const Double_t zmax=-100,
131 const Char_t *outfile=0,
132 const Char_t *TreeFile=0)
134 bfcZ(1,Last,Chain,infile,zmin,zmax,outfile,TreeFile);
virtual TDataSet * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual TDataSet * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void Clear(Option_t *option="")
User defined functions.
virtual Int_t GetRunNumber() const
Returns the current RunNumber.