1 | // $Id: SimuRootFileManager.hh 2523 2006-03-01 20:55:57Z thea $ |
---|
2 | // Author: A.Thea Jun, 29 2004 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: SimuRootFileManager * |
---|
8 | * Package: Gui * |
---|
9 | * Coordinator: Alessandro.Thea, Marco.Pallavicini * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __SIMUROOTFILEMANAGER_HH_ |
---|
14 | #define __SIMUROOTFILEMANAGER_HH_ |
---|
15 | |
---|
16 | #include "euso.hh" |
---|
17 | #include "TString.h" |
---|
18 | #include "TRef.h" |
---|
19 | #include "TFile.h" |
---|
20 | #include "EsafConfigurable.hh" |
---|
21 | |
---|
22 | class TTree; |
---|
23 | class EEvent; |
---|
24 | class ERunParameters; |
---|
25 | |
---|
26 | //////////////////////////////////////////////////////////////////////////////// |
---|
27 | // // |
---|
28 | // SimuRootfileManager // |
---|
29 | // // |
---|
30 | // Simulation rootfile manager // |
---|
31 | // // |
---|
32 | //////////////////////////////////////////////////////////////////////////////// |
---|
33 | |
---|
34 | class SimuRootFileManager: public EsafConfigurable, public EsafMsgSource { |
---|
35 | public: |
---|
36 | SimuRootFileManager(); |
---|
37 | virtual ~SimuRootFileManager(); |
---|
38 | |
---|
39 | virtual Bool_t Build(); |
---|
40 | virtual void Clear(); |
---|
41 | virtual Bool_t Open( const char* = 0 ); |
---|
42 | virtual Bool_t Open( const string& ); |
---|
43 | virtual Bool_t Close(); |
---|
44 | |
---|
45 | inline TFile *GetFile() { return fFile; } |
---|
46 | inline EEvent *GetEvent() { return fEvent; } |
---|
47 | inline ERunParameters *GetRunPars() { return fRunPars; } |
---|
48 | |
---|
49 | Int_t FillEvent(); |
---|
50 | void ResetRunPars(); |
---|
51 | |
---|
52 | void LockEvent(); |
---|
53 | void UnlockEvent(); |
---|
54 | Bool_t IsEventLocked() {return kFALSE;} |
---|
55 | |
---|
56 | private: |
---|
57 | |
---|
58 | // events to handle |
---|
59 | EEvent *fEvent; |
---|
60 | ERunParameters *fRunPars; |
---|
61 | |
---|
62 | // trees |
---|
63 | TTree *fTree; |
---|
64 | |
---|
65 | TRef fRunParsRef; |
---|
66 | TFile *fFile; |
---|
67 | TString fFileName; |
---|
68 | |
---|
69 | Long64_t fMaxFileSize; |
---|
70 | Int_t fFileNumber; |
---|
71 | |
---|
72 | UInt_t fEventBranches; |
---|
73 | UInt_t fDetectorPhotonFillingMode; |
---|
74 | Bool_t fDetectorNightGlowFillable; |
---|
75 | Bool_t fNightGlowFillable; |
---|
76 | |
---|
77 | EsafConfigClass(General,SimuRootFileManager) |
---|
78 | |
---|
79 | ClassDef(SimuRootFileManager,0) |
---|
80 | }; |
---|
81 | |
---|
82 | inline Bool_t SimuRootFileManager::Open( const string& name ) { |
---|
83 | return Open(name.c_str()); |
---|
84 | } |
---|
85 | #endif /* __SIMUROOTFILEMANAGER_HH_ */ |
---|
86 | |
---|