StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunTbyT.C
1 #if 0
2 #include "Ask.h"
3 #endif
4 //________________________________________________________________________________
5 void RunTbyT(Int_t nevents=999,
6  const char *eventFile1="/star/data98/reco/AuAu200_production/FullField/eval_Sti/2010/030/11030018/st_physics_11030018_raw_1020001.event.root",
7  //"./old/st_physics_11035026_raw_2010001.event.root",
8  const char *eventFile2="/star/data99/reco/AuAu200_production/FullField/eval_Stv/2010/030/11030018/st_physics_11030018_raw_1020001.event.root",
9  //"./new/st_physics_11035026_raw_2010001_1_200.event.root",
10  const char* tFile="TbyT.root") {
11  gROOT->LoadMacro("bfc.C");
12  TString Chain("StEvent,nodefault");
13  bfc(-2,Chain.Data(),0,0,tFile);
14  gSystem->Load("StTrackMateMaker");
15  cout << "Job will run on File: " << eventFile1 << endl;
16  cout << "Correspondibg new File: " << eventFile2 << endl;
17  gSystem->Load("StIOMaker");
18  // 1st IOMaker, for tpt file
19  StIOMaker* ioMaker1 = new StIOMaker("IO1","r",eventFile1);//,"bfcTree");
20  // 2nd IOMaker, for ittf file
21  StIOMaker* ioMaker2 = new StIOMaker("IO2","r",eventFile2);//,"bfcTree");
22 
23  StTrackMateMaker* goodStuff = new StTrackMateMaker;
24  // chain->SetDEBUG(2);
25  // now execute the chain member functions
26 
27  chain->PrintInfo();
28  Int_t initStat = chain->Init(); // This should call the Init() method in ALL makers
29  if (initStat) chain->Fatal(initStat, "during Init()");
30  // if (nevents > 0) chain->EventLoop(1,nevents);
31  Int_t iMake = 0;
32  StIOMaker *makers[2] = {ioMaker1, ioMaker2};
33  StEvent *events[2] = {0,0};
34  for (Int_t ev = 0; ev < nevents; ev++) {
35  chain->Clear();
36  StUKey ukey;
37  while ((! events[0] || ! events[1])) {
38  for (Int_t m = 0; m < 2; m++) {
39  if (! events[m]) {
40  makers[m]->Clear();
41  iMake = makers[m]->MakeRead(ukey);
42  if (iMake%10 == kStEOF || iMake%10==kStFatal) goto ENDofLOOP;
43  events[m] = (StEvent *) makers[m]->GetDataSet("StEvent");
44  }
45  }
46  if (! (events[0] && events[1])) continue;
47  if (events[0]->runId() != events[1]->runId() ||
48  events[0]->id() != events[1]->id()) {
49  cout << "MisMatched runId/Event\t"
50  << events[0]->runId() << "/" << events[0]->id() << "\t"
51  << events[1]->runId() << "/" << events[1]->id() << endl;
52  if (events[0]->runId() < events[1]->runId() ||
53  events[0]->runId() == events[1]->runId() &&
54  events[0]->id() < events[1]->id()) {
55  events[0] = 0; ukey = StUKey(events[1]->runId(),events[1]->id());
56  } else {
57  events[1] = 0; ukey = StUKey(events[0]->runId(),events[0]->id());
58  }
59  continue;
60  }
61  }
62 #if 0
63  if (! gROOT->IsBatch()) {
64  if (Ask()) return;
65  } else {_debugAsk = 0;}
66 #endif
67  goodStuff->Make();
68  events[0] = events[1] = 0;
69  }
70  ENDofLOOP:
71 }
virtual void Clear(Option_t *opt)
User defined functions.
Definition: StIOMaker.cxx:252
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
Definition: Stypes.h:43
Definition: StFileI.h:13