StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
exampleInChain.C
1 // NOTE - chain needs to be declared global so for StHbtEventReader
2 //==========================================================================================
3 class StMuDstMaker;
4 
5 
6 void exampleInChain() {
7  gROOT->LoadMacro("StRoot/StMuDSTMaker/COMMON/macros/loadSharedLibraries.C");
8  loadSharedLibraries();
9 
10  StChain* chain = new StChain("StChain");
11  chain->SetDebug(1);
12 
13  StMuDebug::setLevel(0); // switch of some debug output
14  StMuDstMaker* muDstMaker = new StMuDstMaker(0,0,"","auau200.lis","MuDst.root",20,"MuDst"); // set up maker in read mode
15  StMuDst2StEventMaker* eventMaker = new StMuDst2StEventMaker("MuDst2StEvent");
16 
17 
18  StMuDebug::setLevel(1); // switch on some debug output
19 
20  chain->Init(); // This should call the Init() method in ALL makers
21  chain->PrintInfo();
22  int nevents =1000;
23  for (Int_t iev=0;iev<nevents; iev++) {
24  cout << "Working on eventNumber " << iev << endl;
25  chain->Clear();
26  int iret = chain->Make(iev); // This should call the Make() method in ALL makers
27  if (iret) {
28  // cout << "Bad return code!" << endl;
29  break;
30  }
31  } // Event Loop
32  chain->Finish(); // This should call the Finish() method in ALL makers
33 
34 }
35 
36 
37 
StMuDstMaker(const char *name="MuDst")
Default constructor.
virtual void Clear(Option_t *option="")
User defined functions.
Definition: StChain.cxx:77
static void setLevel(unsigned int level)
sets the debug level
Definition: StMuDebug.h:74
virtual Int_t Finish()
Definition: StChain.cxx:85
virtual Int_t Make()
Definition: StChain.cxx:110
TChain * chain()
In read mode, returns pointer to the chain of .MuDst.root files that where selected.
Definition: StMuDstMaker.h:426