StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
readndst.C
1 
2 void
3 loadlibs()
4 {
5  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
6  loadSharedLibraries();
7  // load more libraries :)
8  gSystem->Load("libmysqlclient");
9  gSystem->Load("StEvent");
10  gSystem->Load("StDbLib");
11  gSystem->Load("StDbBroker");
12  gSystem->Load("St_db_Maker");
13  // load even more libraries (EEMC stuff)
14  gSystem->Load("StEEmcUtil");
15  gSystem->Load("StEEmcDbMaker");
16  gSystem->Load("StEEmcPoolTTM");
17 }
18 
19 
20 void
21 readndst(const char *fName="/star/current/ndst/run*.ndst.root")
22 {
23  loadlibs();
24  TChain *chain = new TChain("ttm");
25  chain->Add(fName);
26  Double_t nev = chain->GetEntries();
27 
28  cerr << nev << endl;
29 
30  TList *matchlist = new TList;
31  StEventInfo *evinfo = new StEventInfo();
32  StEventSummary *evsumm = new StEventSummary();
34 
35  chain->SetBranchAddress("matches",&matchlist);
36  chain->SetBranchAddress("info" ,&evinfo);
37  chain->SetBranchAddress("summary",&evsumm);
38  chain->SetBranchAddress("trigger",&evtrig);
39 
40  for(int i=0; i<nev; i++) {
41  EEmcTTMatch *tmatch;
42  chain->GetEntry(i);
43  if(matchlist->IsEmpty()) continue;
44  StTriggerId &trig = evtrig->nominal();
45  cerr << "<Event id=\"" << evinfo->id() << "\" run=\" " << evinfo->runId() << "\" >\n";
46  cerr << "<MagneticField b=\"" << evsumm->magneticField() << "\" >\n";
47  TIter nextMatch(matchlist);
48  while ((tmatch = (EEmcTTMatch *) nextMatch()))
49  tmatch->Out(cerr);
50  cerr << "</Event>\n" << endl;
51  }
52 }
EEmcTTMatch class contains results of TPC track to EEMC tower matching.
Definition: EEmcTTMatch.h:22
ostream & Out(ostream &out) const
Collection of trigger ids as stored in MuDst.