StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEEmcPi0Reader.cxx
1 #include "StEEmcPi0Reader.h"
2 
3 #include "TString.h"
4 
5 ClassImp(StEEmcPi0Reader);
6 
7 // ----------------------------------------------------------------------------
8 StEEmcPi0Reader::StEEmcPi0Reader(const Char_t *name,const Char_t *bname):StMaker(name)
9 {
10  mChain=new TChain(name,"pi0 tree");
11  mBranchName=bname;
12  index=0;
13 }
14 
15 // ----------------------------------------------------------------------------
16 Int_t StEEmcPi0Reader::Init()
17 {
18  mEvent=new StEEmcMixEvent();
19  mChain-> SetBranchAddress(mBranchName,&mEvent);
20  return StMaker::Init();
21 }
22 
23 // ----------------------------------------------------------------------------
25 {
26  return getEvent(index++);
27 }
28 
29 // ----------------------------------------------------------------------------
30 Int_t StEEmcPi0Reader::getEvent(Int_t i)
31 {
32  Int_t stat=mChain->GetEntry(i);
33  if (!stat)return kStEOF;
34  return kStOK;
35 }
36 
37 // ----------------------------------------------------------------------------
38 void StEEmcPi0Reader::Clear(Option_t *opts)
39 {
40 }
41 
42 // ----------------------------------------------------------------------------
43 void StEEmcPi0Reader::chainFile( const Char_t *file )
44 {
45 
46  TString fname=file;
47  if ( !fname.Contains("root") ) return;
48  std::cout << "+ " << fname << std::endl;
49  mChain->Add(fname);
50 
51 }
copied from muDst
StEEmcMixEvent * mEvent
Definition: Stypes.h:43
Definition: Stypes.h:40
void Clear(Option_t *opts="")
User defined functions.