StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
RunAssocReader.C
1 void RunAssocReader(int nevents=2,
2  const char* infile = "assoc.root"
3  )
4 {
5  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
6  loadSharedLibraries();
7  gSystem->Load("StMagF");
8  gSystem->Load("StTpcDb");
9  gSystem->Load("StDbUtilities");
10  gSystem->Load("StMcEvent");
11  gSystem->Load("StMcEventMaker");
12  gSystem->Load("StDaqLib");
13  gSystem->Load("StEmcRawMaker");
14  gSystem->Load("StEmcADCtoEMaker");
15  gSystem->Load("StEmcUtil");
16  gSystem->Load("StDbLib");
17  gSystem->Load("StDbBroker");
18  gSystem->Load("St_db_Maker");
19  gSystem->Load("StEEmcUtil");// needed by EEMC-Db
20  gSystem->Load("StEEmcDbMaker");
21  gSystem->Load("StJetFinder");
22  gSystem->Load("StJetMaker");
23 
24  IoManager* myio = new IoManager();
25  myio->openRead(infile);
26 
27  int ntotal = myio->recoTree()->GetEntries();
28  cout <<"ntotal:\t"<<ntotal<<endl;
29 
30  TClonesArray* pairArray = myio->assocArray()->mArray;
31  TClonesArray* recoArray = myio->recoArray()->mArray;
32  TClonesArray* pythiaArray = myio->pythiaArray()->mArray;
33 
34 
35  for (int i=0; i<nevents && i<ntotal; ++i) {
36 
37  cout <<"try to get an event"<<endl;
38  myio->getEvent(i);
39 
40  int nreco = recoArray->GetLast()+1;
41  cout <<"reco jets:\t"<<nreco<<endl;
42 
43  /*
44  for (int j=0; nreco; ++j) {
45  TObject* temp = (*recoArray)[j];
46  StJet* rj = dynamic_cast<StJet*>(temp );
47  cout <<rj<<endl;
48  //cout <<rj->Pt()<<"\t"<<rj->Phi()<<endl;
49  }
50  */
51  }
52 }