StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFwdQAMaker.h
1 #ifndef ST_FWD_TREE_MAKER_H
2 #define ST_FWD_TREE_MAKER_H
3 
4 #include "TClonesArray.h"
5 #ifndef __CINT__
6 #include "GenFit/Track.h"
7 #include "StFwdTrackMaker/include/Tracker/FwdHit.h"
8 #include "StMuDSTMaker/COMMON/StMuFwdTrack.h"
9 #endif
10 
11 #include "StChain/StMaker.h"
12 #include "TTree.h"
13 #include "TVector3.h"
14 #include "TLorentzVector.h"
15 #include "StEvent/StEnumerations.h"
16 #include "StThreeVectorD.hh"
17 
18 class StMuFwdTrack;
20 class ForwardTracker;
21 class StFwdTrack;
22 class StMuMcTrack;
23 
27 template<class BranchType>
29  public:
31  ~TClonesArrayWriter() {}
32 
33  void createBranch( TTree *tree, const char* name, int buffSize = 256000, int splitLevel = 99){
34  _tca = new TClonesArray( BranchType::Class_Name() );
35  tree->Branch( name, &this->_tca, buffSize, splitLevel );
36  }
37 
38  void add( BranchType &branch ){
39  if ( nullptr == this->_tca ) return;
40  BranchType *new_branch = new ((*this->_tca)[this->_n]) BranchType( );
41  *new_branch = branch;
42  this->_n++;
43  }
44 
45  void add( BranchType *branch ){
46  if ( nullptr == this->_tca || nullptr == branch) return;
47  BranchType *new_branch = new ((*this->_tca)[this->_n]) BranchType( );
48  *new_branch = *branch;
49  this->_n++;
50  }
51 
52  void reset(){
53  this->_n = 0;
54  if( nullptr != this->_tca )
55  this->_tca->Clear();
56  }
57 
58  UInt_t N() const { return _n; }
59  BranchType *at( UInt_t i ){
60  if ( nullptr == _tca )
61  return nullptr;
62  return (BranchType*)_tca->At( i );
63  }
64 
65  protected:
66  TClonesArray * _tca = nullptr;
67  UInt_t _n = 0;
68 };
69 
70 class FwdTreeHeader : public TObject {
71  public:
72  FwdTreeHeader() : TObject() {
73  run = 0;
74  event = 0;
75  tofmult = 0;
76  vpdVz = -999;
77  pv.SetXYZ(0, 0, 0);
78  }
79 
80  void set( int r, int e, int t, TVector3 &p ){
81  run = r;
82  event = e;
83  tofmult = t;
84  pv = p;
85  }
86 
87  void clear() {
88  run = 0;
89  event = 0;
90  tofmult = 0;
91  TVector3 pv(-999, -999, -999);
92  vpdVz = -999;
93  }
94 
95  TVector3 pv;
96  int run, event, tofmult;
97  float vpdVz;
98 
99  ClassDef(FwdTreeHeader, 1)
100 };
101 
102 class StFcsDb;
103 class StFcsCluster;
104 class StFcsHit;
105 class StMuFcsCluster;
106 class StMuFcsHit;
107 class StMuFttCluster;
108 class StMuFttPoint;
109 class StMuFstHit;
111 
112 
117 class FcsClusterWithStarXYZ: public TObject {
118  public:
120  mXYZ.SetXYZ(0, 0, 0);
121  mClu = nullptr;
122  }
124  TVector3 mXYZ;
125  StMuFcsCluster *mClu;
126  ClassDef(FcsClusterWithStarXYZ, 1);
127 };
128 
133 class FcsHitWithStarXYZ: public TObject {
134  public:
136  mXYZ.SetXYZ(0, 0, 0);
137  mHit = nullptr;
138  }
140  TVector3 mXYZ;
141  StMuFcsHit *mHit;
142  ClassDef(FcsHitWithStarXYZ, 1);
143 };
144 
145 
150 
158 
165 
166  int nSeedTracks;
168 
169 
170  void clear();
171 };
172 
173 
174 class StMuDstMaker;
175 class StMuDst;
177 class StMuFcsCollection;
178 class StFwdTrackMaker;
179 class StEvent;
180 
181 class StFwdQAMaker : public StMaker {
182 
183  ClassDef(StFwdQAMaker, 0);
184 
185  public:
186  StFwdQAMaker();
187  ~StFwdQAMaker(){/* nada */};
188 
189  int Init();
190  int Finish();
191  int Make();
192  void Clear(const Option_t *opts = "");
193 
194  void FillFttClusters();
195  void FillFstPoints();
196  void FillFcsStEvent();
197  void FillFcsStMuDst();
198  void FillTracks();
199  void FillMcTracks();
200 
201  protected:
202  TFile *mTreeFile = nullptr;
203  TTree *mTree = nullptr;
204  FwdQATreeData mTreeData;
205 
206  StEvent *mStEvent = nullptr;
207  StMuDstMaker *mMuDstMaker = nullptr;
208  StMuDst *mMuDst = nullptr;
209  StMuFwdTrackCollection * mMuForwardTrackCollection = nullptr;
210  StMuFcsCollection *mMuFcsCollection = nullptr;
211  StFwdTrackMaker *mFwdTrackMaker = nullptr;
212  StFcsDb *mFcsDb = nullptr;
213 
214 };
215 
216 
217 #endif
FwdTreeHeader header
Primary event vertex.
Definition: StFwdQAMaker.h:152
TClonesArrayWriter< StMuMcTrack > mcTracks
MC tracks.
Definition: StFwdQAMaker.h:154
Store Cluster with STAR XYZ position.
Definition: StFwdQAMaker.h:117
TClonesArray writer Helper class for writing TClonesArrays to TTree of custom class type...
Definition: StFwdQAMaker.h:28
This class is a container for the data that will be written to the output tree.
Definition: StFwdQAMaker.h:149
Store Hit with STAR XYZ position.
Definition: StFwdQAMaker.h:133