QwGeant4
QweakSimAnalysis.hh
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 /**
7 
8  \file QweakSimAnalysis.hh
9  $Revision: 1.2 $
10  $Date: 2005/12/27 19:22:16 $
11  \author Klaus Hans Grimm
12 
13 */
14 //=============================================================================
15 //
16 //=============================================================================
17 //
18 // ---------------------------
19 // | Doxygen Class Information |
20 // ---------------------------
21 /**
22  \class QweakSimAnalysis
23 
24  \brief Handling of the output ROOT file
25 
26  Placeholder for a long explaination
27 
28  */
29 //=============================================================================
30 
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 #ifndef QweakSimAnalysis_h
33 #define QweakSimAnalysis_h
34 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
35 
36 // geant4 includes
37 #include "G4Types.hh"
38 #include "G4String.hh"
39 
40 // root includes
41 #include <TString.h>
42 #include <TFile.h>
43 #include <TTree.h>
44 #include <TBranch.h>
45 
46 // geant4 classes
47 class G4Run;
48 
49 // user classes
54 
55 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
57 public:
58 
60  virtual ~QweakSimAnalysis();
61 
62 public:
63 
64  void BeginOfRun(const G4Run* aRun);
65  void EndOfRun(const G4Run* aRun);
66  void EndOfEvent(G4int flag);
67 
68  // Get and set number of events in this run
69  void SetNumberOfEventToBeProcessed(G4int n);
70  G4int GetNumberOfEventToBeProcessed() const;
71 
72  // Set ROOT file stem or name
73  void SetRootFileStem(const G4String& stem) { fRootFileStem = stem; }
74  void SetRootFileName(const G4String& name) { fRootFileName = name; }
75 
76  void FillRootNtuple() { fRootNtuple->Fill(); }
77  void AutoSaveRootNtuple();
78 
80 
81 private:
82 
84 
86 
88 
89  G4String fRootFileStem;
90  G4String fRootFileName;
91 
92  void ConstructRootNtuple();
93 
94  TTree* fRootNtuple;
95  TBranch* fRootBranch;
96  TFile* fRootFile;
97 
98 };
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
102 #endif
103 
void EndOfEvent(G4int flag)
void SetRootFileName(const G4String &name)
void SetNumberOfEventToBeProcessed(G4int n)
QweakSimUserRunInformation * pUserRunInformation
void BeginOfRun(const G4Run *aRun)
Handling of the output ROOT file.
QweakSimUserMainEvent * fRootEvent
QweakSimAnalysisMessenger * pAnalysisMessenger
Defines Top ROOT Tree structure of the ROOT file for each event.
void SetRootFileStem(const G4String &stem)
virtual ~QweakSimAnalysis()
G4int GetNumberOfEventToBeProcessed() const
QweakSimUserInformation * myUserInfo
QweakSimAnalysis(QweakSimUserInformation *)
void EndOfRun(const G4Run *aRun)