StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StjTrgWriter.h
1 // -*- mode: c++;-*-
2 // $Id: StjTrgWriter.h,v 1.3 2008/09/21 19:11:41 tai Exp $
3 #ifndef STJTRGWRITER_H
4 #define STJTRGWRITER_H
5 
6 #include <TObject.h>
7 
8 #include "StjTrgPassCondition.h"
9 
10 #include <Rtypes.h>
11 
12 #include <string>
13 
14 class TDirectory;
15 class TTree;
16 
17 class StjTrg;
18 
19 class StjTrgWriter : public TObject {
20 
21 public:
22 
23  StjTrgWriter(const char *treeName, const char* treeTitle,
24  TDirectory* file, StjTrg* trg,
25  StjTrgPassCondition* fillCondition)
26  : _treeName(treeName), _treeTitle(treeName)
27  , _file(file)
28  , _trg(trg)
29  , _fillCondition(fillCondition)
30  { }
31  virtual ~StjTrgWriter() { }
32 
33  virtual void Init();
34  virtual void Make();
35  virtual void Finish();
36 
37 private:
38 
39  virtual TTree* createTree();
40  virtual void createBranch_general(TTree* tree);
41  virtual void createBranch_trgSpecific(TTree* tree) = 0;
42 
43  virtual void fillBranch_general();
44  virtual void fillBranch_trgSpecific() = 0;
45 
46  std::string _treeName;
47  std::string _treeTitle;
48 
49  TDirectory* _file;
50  TTree* _tree;
51 
52  StjTrg* _trg;
53 
54  Int_t _runNumber;
55  Int_t _eventId;
56  Double_t _vertexZ;
57  Int_t _trigID;
58  Double_t _prescale;
59  Int_t _passed;
60  Int_t _hard;
61  Int_t _soft;
62 
63  StjTrgPassCondition* _fillCondition;
64 
65  ClassDef(StjTrgWriter, 1)
66 
67 };
68 
69 #endif // STJTRGWRITER_H
Definition: StjTrg.h:11