SToGS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
SToGS_BaseROOTEventsActions.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 
27 #ifndef SToGS_BaseROOTEventsActions_h
28 #define SToGS_BaseROOTEventsActions_h 1
29 
30 #include "SToGS_BaseROOT.hh"
31 #include "SToGS_BaseROOTEvents.h"
32 
34 namespace SToGS {
36 
39  {
40  protected:
41  TTree *fTree;
42  protected:
43  // Events to be filled from G4 to ROOT
46 
47  public:
48  BaseROOTEventsRun(TTree *tree);
50  {;}
51 
52  virtual void RecordEvent(const G4Event* evt);
53  };
54 
56 
59  {
60  protected:
62  G4int fisOptical;
67 
68  public:
69  BaseROOTEventsUserAction(G4String conffile = "setup/SToGS_Tree_actions.conf");
71  {
72  delete fOpticalEventBeg;
73  delete fOpticalEventEnd;
74  }
75 
76  virtual G4Run* GenerateRun();
77 
78  // virtual void BeginOfRunAction(const G4Run * /*therun*/);
79  virtual void EndOfRunAction(const G4Run * /*therun*/);
80  virtual void BeginOfEventAction(const G4Event * /*event*/);
81  // virtual void EndOfEventAction(const G4Event * /*event*/);
82  virtual void PreUserTrackingAction(const G4Track * /*atrack*/);
83  virtual void PostUserTrackingAction(const G4Track * /*atrack*/);
84  };
85 
87 
89  class BaseROOTEvents : public SToGS::AllInOneUserActionInitialization<BaseROOTEventsUserAction>
90  {
91  public:
92  BaseROOTEvents(G4String conf = "setup/SToGS_tree_actions.conf", G4String which_gene = "GPS",
93  G4String which_gene_opt = "G4Macros/GPSPointLike.mac"):
94  AllInOneUserActionInitialization<BaseROOTEventsUserAction>(conf,which_gene,which_gene_opt)
95  {;}
96  virtual ~BaseROOTEvents()
97  {;}
98  };
99 
100 } // SToGS Namespace
101 
102 #endif
103 
a G4 user's action manage by a single AllAction class
SBROpticalEvent * fOpticalEventEnd
end of optical photons
BaseROOTEvents(G4String conf="setup/SToGS_tree_actions.conf", G4String which_gene="GPS", G4String which_gene_opt="G4Macros/GPSPointLike.mac")
virtual void PreUserTrackingAction(const G4Track *)
virtual void RecordEvent(const G4Event *evt)
BaseROOTEventsUserAction(G4String conffile="setup/SToGS_Tree_actions.conf")
virtual void EndOfRunAction(const G4Run *)
The BaseROOTEvents is use to init G4 kernel with the actions defined in BaseROOTEventsUserAction.
SBROpticalEvent * fOpticalEventBeg
emitted optical photons
G4int fisOptical
true if one has also photons from scintillations
virtual void BeginOfEventAction(const G4Event *)
The BaseROOTEventsUserAction Stores in a ROOT Tree BaseROOTEvents [SBREvent, SBRPEvent etc ...
virtual void PostUserTrackingAction(const G4Track *)