StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdMuDstEEmcDemo.C
1 //Now in order to read microDST use the DoMicroDst.
2 class StChain;
3  StChain *chain=0;
4 
5 
6 int rdMuDstEEmcDemo(
7  char* file = "rcf1202_2178_1000evts.MuDst.root",
8  Int_t nFiles = 1,
9  char* inDir = "/star/data29/reco/pp200/pythia6_203/default/pt5/year2003/gheisha_on/trs_if/",
10  int nEve=10)
11 {
12 
13 
14  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
15  loadSharedLibraries();
16  cout << " loading done " << endl;
17 
18  gSystem->Load("StDbLib");
19  gSystem->Load("StDbBroker");
20  gSystem->Load("St_db_Maker");
21 
22 // Load my maker
23  assert(gSystem->Load("StEEmcUtil")==0);
24  assert(gSystem->Load("StEEmcPoolmuDst")==0 );
25  assert(gSystem->Load("StEEmcDbMaker")==0);
26 
27 
28 // create chain
29  chain = new StChain("StChain");
30 
31 // Now we add Makers to the chain...
32  maker = new StMuDstMaker(0,0,inDir,file,"MuDst.root",nFiles);
33  StMuDbReader* db = StMuDbReader::instance();
34 
35 
36  // instantiate your maker here
37  /* #1 */ St_db_Maker *dbMk = new St_db_Maker("StarDb", "MySQL:StarDb");
38  /* #2 */ StEEmcDbMaker *myMk=new StEEmcDbMaker("eemcDb");
39 
40  // request DB for sectors you need (dafault:1-12)
41  // myMk->setSectors(5,8);
42 
43  // to overwritte the time stamp
44  // reverse order of the above makers: first #2, then #1
45  // activate the line below
46  //myMk->setTimeStampDay(20030514); // format: yyyymmdd
47 
48  // change DB-server name (if needed)
49  // myMk->setDBname("TestScheme/eemc");
50 
51  // request alternative flavor of DB table (if needed)
52  // myMk->setPreferedFlavor("set430","eemcPMTcal");
53 
54  StMuEEDemoMaker *m = new StMuEEDemoMaker("jasEE","MuDst");
55 
56  chain->Init();
57  chain->ls(3);
58 
59  int eventCounter=0;
60  int stat=0;
61 
62  //---------------------------------------------------
63  while ( stat==0 ) {// loop over events
64  if(eventCounter>=nEve) break;
65  chain->Clear();
66  stat = chain->Make();
67  printf(" event# %d done\n", eventCounter++);
68 
69  }
70 
71 
72  // chain->Finish();
73 
74 }
virtual base class for Maker