geant4-B1-example  1.0
 All Classes Files Functions Variables Pages
B1EventAction.hh
Go to the documentation of this file.
1 /// \file B1EventAction.hh
2 /// \brief Definition of the B1EventAction class
3 
4 #ifndef B1EventAction_h
5 #define B1EventAction_h 1
6 
7 #include "G4UserEventAction.hh"
8 #include "globals.hh"
9 
10 class B1RunAction;
11 
12 /*!
13  @brief user event class
14 
15  + BeginOfEventAction(): set fEdep = 0
16  + EndOfEventAction(): call AddEdep()
17  + AddEdep(): use our "run" obj to update its deposit energy accumulator.
18 */
19 class B1EventAction : public G4UserEventAction
20 {
21  public:
22  B1EventAction(B1RunAction* runAction);
23  virtual ~B1EventAction();
24 
25 
26  virtual void BeginOfEventAction(const G4Event* event);
27  virtual void EndOfEventAction(const G4Event* event);
28 
29  /*!
30  @brief for user stepping action object to update the B1EventAction::fEdep.
31  */
32  void AddEdep(G4double edep) { fEdep += edep; }
33 
34 
35 
36  private:
37 
38  B1RunAction* fRunAction;
39 
40  G4double fEdep;
41 };
42 
43 
44 
45 #endif
46 
47 
Run action class ( run is the biggest unit)
Definition: B1RunAction.hh:25
virtual void BeginOfEventAction(const G4Event *event)
reset B1EventAction::fEdep to 0
B1EventAction(B1RunAction *runAction)
virtual void EndOfEventAction(const G4Event *event)
void AddEdep(G4double edep)
for user stepping action object to update the B1EventAction::fEdep.
user event class
virtual ~B1EventAction()
do nothing.