StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rdMuDstAndGeant2Lcp.C
1 // read muDst & geant.root in sync
2 
3 class StChain;
4 StChain *chain=0;
5 class St_particle ;
6 class particle_st;
7 
8 //================================================
9 //================================================
10 int rdMuDstAndGeant2Lcp( int maxEve=2, int subSet=2721, char * wrkDir="./wrkLcpX/"){
11  float maxEta=1.0;
12 
13  char * evePath="/star/data26/reco/pp200/pythia_6.203/default/minbias/year2003/hadronic_on/trs_ic/";
14  TString coreFile="rcf1200_";
15  coreFile+=subSet;
16  coreFile+="_2000evts";
17  printf("Working on subSet '%s'\n",coreFile.Data());
18 
19  TString muDstFile=evePath+coreFile+".MuDst.root";
20  TString geantFile =evePath+coreFile+".geant.root";
21 
22 
23  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
24  loadSharedLibraries();
25  cout << " loading done " << endl;
26 
27  // Load my maker
28  assert(gSystem->Load("StEEmcPoolLCP")==0 );
29 
30  // create chain
31  chain = new StChain("StChain");
32  //chain->SetDebug();
33  //chain->PrintInfo();
34 
35  // set up maker in read mode
36  StIOMaker* IOMk = new StIOMaker("IO","r",geantFile,"bfcTree");
37  IOMk->SetDebug();
38  IOMk->SetIOMode("r");
39  IOMk->SetBranch("*",0,"0");
40  IOMk->SetBranch("geantBranch",0,"r");
41 
42 
43  int maxList=1;
44  muMk = new StMuDstMaker(0,0,"/",muDstFile,"MuDst.root",maxList);
45  // Now we add Makers to the chain...
46 
47  StGeant2LcpTreeMaker *myMk2 = new StGeant2LcpTreeMaker("jasGG","MuDst");
48  myMk2->SetOutDir(wrkDir);
49  myMk2->InitRunFromMake(888999);
50 
51 
52  StMuLcp2TreeMaker *myMk = new StMuLcp2TreeMaker("jasEE","MuDst");
53  myMk->SetOutDir(wrkDir);
54  myMk->SetMaxEta(maxEta);
55  myMk->InitRunFromMake(888999);
56 
57  chain->Init();
58  chain->ls(3);
59 
60  // StMuDebug::setLevel(1); // switch of some debug output
61 
62  int eventCounter=0;
63 
64  printf(" requested maxEve=%d\n",maxEve);
65  //---------------------------------------------------
66  while ( 1) {// loop over events
67  eventCounter++;;
68  if(eventCounter >maxEve) break;
69  chain->Clear();
70  int stat = chain->Make();
71  if(stat) break;
72  //continue;
73  // Access to muDst .......................
74  StMuEvent* muEve = muMk->muDst()->event();
75  int n = muMk->muDst()->primaryTracks()->GetEntries(); // get number of primary tracks
76  StEventInfo &info=muEve->eventInfo();
77 
78  printf("eve=%d Nprim=%d ID=%d runID=%d\n",eventCounter,n,info.id(),info.runId());
79 
80  }
81  return;
82 }
83 
84 
85 
86 // /star/data31/reco/ppMinBias/FullField/P03if/2002/...
87 // /star/data31/reco/ppMinBias/ReversedFullField/P03if/2002/...
88 
StMuDst * muDst()
Definition: StMuDstMaker.h:425
virtual void SetIOMode(Option_t *iomode="w")
number of transactions
Definition: StIOInterFace.h:35
This commented block at the top ...
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 ...