StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StEStructMCReader.h
1 /*********************************************************************
2  *
3  * $Id: StEStructMCReader.h,v 1.6 2012/11/16 21:19:07 prindle Exp $
4  *
5  * Author: Chunhui Han
6  *
7  *********************************************************************
8  *
9  * Discription:
10  * Read STAR standard MC rootuples, and apply track and
11  * event cuts on it. The output is StEStructEvent.
12  *
13  * Modified from the automatically generated files from ROOT.
14  *
15  ********************************************************************
16  *
17  * $Log: StEStructMCReader.h,v $
18  * Revision 1.6 2012/11/16 21:19:07 prindle
19  * Moved EventCuts, TrackCuts to EventReader. Affects most readers.
20  * Added support to write and read EStructEvents.
21  * Cuts: 3D histo support, switch to control filling of histogram for reading EStructEvents
22  * EventCuts: A few new cuts
23  * MuDstReader: Add 2D to some histograms, treat ToFCut, PrimaryCuts, VertexRadius histograms like other cut histograms.
24  * QAHists: Add refMult
25  * TrackCuts: Add some hijing cuts.
26  *
27  * Revision 1.5 2006/02/22 22:03:21 prindle
28  * Removed all references to multRef
29  *
30  * Revision 1.4 2004/03/18 18:35:17 chunhuih
31  *
32  * use const char * instead of char * for the constructor argument filelistfile.
33  *
34  * Revision 1.3 2004/03/03 23:17:10 chunhuih
35  *
36  * added mNentries to store the total entries in the rootuple, to reduce
37  * redundant code.
38  *
39  * Revision 1.2 2004/03/02 21:35:10 chunhuih
40  *
41  * added impact parameter information to the StEStructEvent
42  *
43  * Revision 1.1 2004/02/26 20:05:33 chunhuih
44  *
45  * initial import
46  *
47  *
48  ********************************************************************/
49 
51 // This class has been automatically generated
52 // (Thu Feb 12 19:19:06 2004 by ROOT version3.10/01)
53 // from TTree h999/HEPEVNT
54 // found on file: evgen.1.root
56 
57 #ifndef STESTRUCTMCREADER_H
58 #define STESTRUCTMCREADER_H
59 
60 #include "StEStructPool/AnalysisMaker/StEStructEventReader.h"
61 
62 #include <TROOT.h>
63 #include <TChain.h>
64 #include <TFile.h>
65 #include <TH1F.h>
66 class StEStructEventCuts;
67 class StEStructTrackCuts;
68 
70  private:
71  TTree *fChain;
72  Int_t fCurrent;
73  //Declaration of leaves types
74  Int_t itrac;
75  Int_t istat;
76  Int_t ipdg;
77  Int_t moth1;
78  Int_t moth2;
79  Int_t idau1;
80  Int_t idau2;
81  Float_t Pxyz[3];
82  Float_t ener;
83  Float_t mass;
84  Float_t Vxyz[3];
85  Float_t Vtime;
86 
87 //List of branches
88  TBranch *b_itrac;
89  TBranch *b_istat;
90  TBranch *b_ipdg;
91  TBranch *b_moth1;
92  TBranch *b_moth2;
93  TBranch *b_idau1;
94  TBranch *b_idau2;
95  TBranch *b_Pxyz;
96  TBranch *b_ener;
97  TBranch *b_mass;
98  TBranch *b_Vxyz;
99  TBranch *b_Vtime;
100 
101  int meventsToDo;
102  int meventCount;
103  int mloopIndex;
104  bool mAmDone;
105  int mnumTracks;
106  int mNentries;
107 
108  void fillTracks(StEStructEvent *estructEvent);
109  int getTotalEventCount();
110  int getCharge(int);
111 
112  const int mIPMAX;
113 
114  public:
115  StEStructMCReader(TTree *tree=0);
116  // I moved EventCuts and TrackCuts handling to StEStructEventReader which this inherits from.
117  // Think they should be removed from arguments to contructors here. Need to check xml code generating macro where these are used.
118  StEStructMCReader(int nevents, TTree *tree = 0, StEStructEventCuts *ecuts = 0, StEStructTrackCuts *tcuts = 0);
119  StEStructMCReader(int nevents, const char *fileListFile, StEStructEventCuts *ecuts = 0, StEStructTrackCuts *tcuts = 0);
121 
122  bool hasTree();
123  bool measureable(int pid);
124  float *globalDCA(float *p, float *v);
125 
126  virtual StEStructEvent* next();
127  virtual bool done();
128 
129  Int_t Cut(Int_t entry);
130  Int_t GetEntry(Int_t entry);
131  Int_t LoadTree(Int_t entry);
132  void Init(TTree *tree);
133  void Loop();
134  Bool_t Notify();
135  void Show(Int_t entry = -1);
136 
137  ClassDef(StEStructMCReader,1)
138 };
139 
140 inline bool StEStructMCReader::hasTree() {
141  return (fChain == 0);
142 }
143 
144 inline bool StEStructMCReader::done() { return mAmDone; }
145 
146 #endif
Definition: Cut.h:18