1 #ifndef ST_FWD_TREE_MAKER_H
2 #define ST_FWD_TREE_MAKER_H
4 #include "TClonesArray.h"
6 #include "GenFit/Track.h"
7 #include "StFwdTrackMaker/include/Tracker/FwdHit.h"
8 #include "StMuDSTMaker/COMMON/StMuFwdTrack.h"
11 #include "StChain/StMaker.h"
14 #include "TLorentzVector.h"
16 #include "StThreeVectorD.hh"
29 template<
class BranchType>
35 void createBranch( TTree *tree,
const char* name,
int buffSize = 256000,
int splitLevel = 99){
36 _tca =
new TClonesArray( BranchType::Class_Name() );
37 tree->Branch( name, &this->_tca, buffSize, splitLevel );
40 void add( BranchType &branch ){
41 if (
nullptr == this->_tca )
return;
42 BranchType *new_branch =
new ((*this->_tca)[this->_n]) BranchType( );
47 void add( BranchType *branch ){
48 if (
nullptr == this->_tca ||
nullptr == branch)
return;
49 BranchType *new_branch =
new ((*this->_tca)[this->_n]) BranchType( );
50 *new_branch = *branch;
56 if(
nullptr != this->_tca )
60 UInt_t N()
const {
return _n; }
61 BranchType *at( UInt_t i ){
62 if (
nullptr == _tca )
64 return (BranchType*)_tca->At( i );
68 TClonesArray * _tca =
nullptr;
82 void set(
int r,
int e,
int t, TVector3 &p ){
93 TVector3 pv(-999, -999, -999);
98 int run, event, tofmult;
122 mXYZ.SetXYZ(0, 0, 0);
138 mXYZ.SetXYZ(0, 0, 0);
194 void Clear(
const Option_t *opts =
"");
196 void FillFttClusters();
197 void FillFstPoints();
198 void FillFcsStEvent();
199 void FillFcsStMuDst();
203 void ProcessFwdTracks();
204 void ProcessFwdMuTracks();
207 void setLocalOutputFile( TString f ) { mLocalOutputFile = f; }
208 void setTreeFilename( TString f ) {mTreeFilename = f;}
211 TFile *mTreeFile =
nullptr;
212 TTree *mTree =
nullptr;
225 std::map<TString, TH1*> mHists;
236 LOG_ERROR <<
"Attempting to access non-existing histogram" << endm;
237 return new TH1F(
"NULL",
"NULL", 1, 0, 1 );
245 TString mLocalOutputFile;
246 TString mTreeFilename;
FwdTreeHeader header
Primary event vertex.
TClonesArrayWriter< StMuMcTrack > mcTracks
MC tracks.
bool mAnalyzeMuDst
Control whether the analysis uses StEvent (default) or MuDst as input.
TH1 * getHist(TString n)
Get the Hist object from the map.
Store Cluster with STAR XYZ position.
TClonesArray writer Helper class for writing TClonesArrays to TTree of custom class type...
This class is a container for the data that will be written to the output tree.
Store Hit with STAR XYZ position.