StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleJan.C
1 // NOTE - chain needs to be declared global so for StHbtEventReader
2 //==========================================================================================
3 #include "/afs/rhic.bnl.gov/star/packages/DEV/StRoot/StarClassLibrary/StTimer.hh"
4 
5 class StMuDstMaker;
6 
7 StMuDstMaker* maker;
8 
9 void exampleJan() {
10  gROOT->LoadMacro("$STAR/StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
11  loadSharedLibraries();
12 
13  cout << " loading done " << endl;
14 
15  StMuDebug::setLevel(0); // switch of some debug output
16 
17  int iret=0;
18  maker = new StMuDstMaker(0,0,"MuDstCommon/central/ReversedFullField/runs/","","MuDst"); // set up maker in read mode
19  for (int i=0; i<100; i++) {
20  cout << i << " ";
21  iret = maker->Make(); // read an event
22  if (iret) break;
23 
24  StMuEvent* e = maker->muDst()->event();
25  if (e) {
26  StL0Trigger &t=e->l0Trigger();
27  StEventInfo &info=e->eventInfo();
28  printf("EVENT id=%d, runId=%d unix time=%d trigWord=0x%0x bXing=%d spinBits=%d\n", info.id(), info.runId(), info.time(), t.triggerWord(),t.bunchCrossingId(), t.spinBits());
29  }
30  }
31 
32 }
33 
34 
35 
virtual int Make()
StMuDst * muDst()
Definition: StMuDstMaker.h:425
StMuDstMaker(const char *name="MuDst")
Default constructor.
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
static StMuEvent * event()
returns pointer to current StMuEvent (class holding the event wise information, e.g. event number, run number)
Definition: StMuDst.h:320