StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdMuDst2LcpTree.C
1 class StChain;
2 StChain *chain=0;
3 
4 int rdMuDst2LcpTree( const char *muDstList="400K.lis", // sample of R3012008+10+12+13
5  int maxList=6,
6  char * wrkDir="./wrkLcpX/",
7  int off48=0,
8  int maxEve=3000,
9  float maxEta=1.0
10  ){
11 
12  if (gClassTable->GetID("TTable") < 0) {
13  gSystem->Load("libTable");
14  gSystem->Load("libPhysics");
15  }
16  printf("Use muDst list= '%s'\n",muDstList);
17 
18  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
19  loadSharedLibraries();
20  cout << " loading done " << endl;
21 
22  // Load my maker
23  assert(gSystem->Load("LCP")==0 );
24  //assert(gSystem->Load("MikesRejector")==0 );// Mike's rejector
25 
26  // create chain
27  chain = new StChain("StChain");
28 
29  StMuDbReader* db = StMuDbReader::instance();
30  muDstMk = new StMuDstMaker(0,0,"",muDstList,"MuDst.root",maxList);
31 
32  // Now we add Makers to the chain...
33 
34  StMuLcp2TreeMaker *myMk = new StMuLcp2TreeMaker("jasEE","MuDst");
35  myMk->SetOutDir(wrkDir);
36  myMk->SetOff48(off48);
37 
38  // avaliable switches
39  // myMk->SetMinNFitPoint(nFitP);
40  // myMk->SetMaxDCAxy(maxDCAxy);
41  myMk->SetMaxEta(maxEta);
42  // myMk->SetMinPt(minPt);
43  // myMk->SetMinFitPfrac(FitPfrac);
44  // myMk->InitRunFromMake(xRun); // if used turns off TTree, saves only histo, allows to add runs
45 
46  chain->Init();
47  chain->ls(3);
48  // StMuDebug::setLevel(4); // switch of some debug output
49 
50  int eventCounter=0;
51 
52  printf(" requested maxEve=%d\n",maxEve);
53  //---------------------------------------------------
54  while ( 1) {// loop over events
55  eventCounter++;;
56  if(eventCounter >maxEve) break;
57  chain->Clear();
58  int stat = chain->Make();
59  if(stat) break;
60  if(eventCounter%1000) continue;
61  StMuEvent* e = muDstMk->muDst()->event();
62 
63  int n = muDstMk->muDst()->primaryTracks()->GetEntries(); // get number of primary tracks
64  printf(".C: eve=%d Nprim=%d\n",eventCounter,n);
65 
66  }
67 
68 
69  // chain->Finish();
70 
71 }
72 
73 
74 
75 
76 
77 // /star/data31/reco/ppMinBias/FullField/P03if/2002/...
78 // /star/data31/reco/ppMinBias/ReversedFullField/P03if/2002/...
79 
StMuDst * muDst()
Definition: StMuDstMaker.h:425
static TObjArray * primaryTracks()
returns pointer to a list of tracks belonging to the selected primary vertex
Definition: StMuDst.h:301
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320
This commented block at the top ...