StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
runMudst.C
1 void runMudst(char* file="st_cosmic_adc_22326042_raw_0000005.MuDst.root",
2  int ifile=-1, Int_t nevt=-1, char* outdir=".", int readMuDst=1){
3  gROOT->Macro("Load.C");
4  gROOT->Macro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
5  gSystem->Load("StEventMaker");
6  gSystem->Load("StFcsDbMaker");
7  gSystem->Load("StFcsRawHitMaker");
8  gSystem->Load("StFcsWaveformFitMaker");
9  gSystem->Load("StFcsClusterMaker");
10  gSystem->Load("libMinuit");
11  gSystem->Load("StFcsPointMaker");
12 
13  StChain* chain = new StChain("StChain"); chain->SetDEBUG(0);
14  StMuDstMaker* muDstMaker = new StMuDstMaker(0, 0, "", file,".", 1000, "MuDst");
15  int n=muDstMaker->tree()->GetEntries();
16  printf("Found %d entries in Mudst\n",n);
17  int start=0, stop=n;
18  if(ifile>=0){
19  int start=ifile*nevt;
20  int stop=(ifile+1)*nevt-1;
21  if(n<start) {printf(" No event left. Exiting\n"); return;}
22  if(n<stop) {printf(" Overwriting end event# stop=%d\n",n); stop=n;}
23  }else if(nevt>=0 && nevt<n){
24  stop=nevt;
25  }else if(nevt==-2){
26  stop=2000000000;
27  }
28  printf("Doing Event=%d to %d\n",start,stop);
29 
30  St_db_Maker* dbMk = new St_db_Maker("db","MySQL:StarDb","$STAR/StarDb");
31  if(dbMk){
32  dbMk->SetAttr("blacklist", "tpc");
33  dbMk->SetAttr("blacklist", "svt");
34  dbMk->SetAttr("blacklist", "ssd");
35  dbMk->SetAttr("blacklist", "ist");
36  dbMk->SetAttr("blacklist", "pxl");
37  dbMk->SetAttr("blacklist", "pp2pp");
38  dbMk->SetAttr("blacklist", "ftpc");
39  dbMk->SetAttr("blacklist", "emc");
40  dbMk->SetAttr("blacklist", "eemc");
41  dbMk->SetAttr("blacklist", "mtd");
42  dbMk->SetAttr("blacklist", "pmd");
43  dbMk->SetAttr("blacklist", "tof");
44  dbMk->SetAttr("blacklist", "etof");
45  dbMk->SetAttr("blacklist", "rhicf");
46  }
47 
48  StFcsDbMaker *fcsDbMkr= new StFcsDbMaker();
49  StFcsDb* fcsDb = (StFcsDb*) chain->GetDataSet("fcsDb");
50  StEventMaker* eventMk = new StEventMaker();
52  hit->setReadMuDst(readMuDst);
55  StFcsPointMaker *poi= new StFcsPointMaker();
56  wff->SetDebug();
57  clu->SetDebug();
58  poi->SetDebug();
59 
60  chain->Init();
61  chain->EventLoop(start,stop);
62  chain->Finish();
63  delete chain;
64 }
TTree * tree()
Returns pointer to the current TTree, the top level io structure that holds the event, track, v0, etc. information in branches of that tree.
Definition: StMuDstMaker.h:427
virtual Int_t Finish()
Definition: StChain.cxx:85
void setReadMuDst(int v=1)
backward compatubility