StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGammaTreeMaker.h
1 // //
3 // StGammaTreeMaker //
4 // //
5 // Store StGammaEvents in a tree //
6 // //
7 // Original concept and implementation by //
8 // Jason Webb (Valpo) //
9 // //
11 
12 #ifndef STAR_StGammaTreeMaker
13 #define STAR_StGammaTreeMaker
14 
15 #include <vector>
16 #include "StMaker.h"
17 #include "TString.h"
18 
19 class TTree;
20 class TFile;
21 class StGammaEvent;
22 class StGammaTreeMaker;
23 
24 class StGammaTreeVersion: public TNamed
25 {
26 
27  public:
28  StGammaTreeVersion(const char *name = "version", const char *title = "Versioning Info");
30 
31  void print();
32 
33  private:
34  protected:
35 
36  std::vector<TString> mMakerTags;
37  std::vector<TString> mStorageTags;
38 
39  friend class StGammaTreeMaker;
40 
41  ClassDef(StGammaTreeVersion, 2);
42 
43 };
44 
46 {
47 
48  public:
49 
50  StGammaTreeMaker(const char *name = "mGammaTreeMaker" );
52 
53  virtual const char* GetCVS() const
54  {static const char cvs[] = "Tag $Name: $ $Id: StGammaTreeMaker.h,v 1.6 2014/08/06 11:43:18 jeromel Exp $ built " __DATE__ " " __TIME__; return cvs; }
55 
56  // Required Maker Methods
57  Int_t Init();
58  Int_t Make();
59  void Clear(Option_t *opts="");
60  Int_t Finish();
61 
62  // Accessors
63  TFile *file() { return mGammaFile; }
64  TTree *tree() { return mGammaTree; }
65  StGammaEvent *event() { return mGammaEvent; }
66 
67  // Mutators
68 
70  void SetFile( TFile *file ) { mGammaFile = file; }
72  void SetTree( TTree *tree ) { mGammaTree = tree; }
74  void SetFilename( const Char_t *fname ) { mFilename = fname; }
75 
76  void skipEmptyEvents() { mSkipEmpty = true; }
77  void storeEmptyEvents() { mSkipEmpty = false; }
78 
79  private:
80 
81  bool mSkipEmpty;
82 
83  TTree *mGammaTree;
84  TFile *mGammaFile;
85 
86  StGammaEvent *mGammaEvent;
87  TString mFilename;
88 
89  StGammaTreeVersion mVersion;
90 
91  ClassDef(StGammaTreeMaker, 2);
92 
93 };
94 
95 #endif
void SetFile(TFile *file)
Sets the output file for the TTree. Defaults into .hist branch.
void SetFilename(const Char_t *fname)
Sets the filename (unless a file has been passed above)
void Clear(Option_t *opts="")
User defined functions.
void SetTree(TTree *tree)
Sets a pointer to an existing TTree. Default creates at Init().