geant4-B1-example  1.0
 All Classes Files Functions Variables Pages
B1ActionInitialization.hh
Go to the documentation of this file.
1 /// \file B1ActionInitialization.hh
2 /// \brief Definition of the B1ActionInitialization class
3 
4 #ifndef B1ActionInitialization_h
5 #define B1ActionInitialization_h 1
6 
7 #include "G4VUserActionInitialization.hh"
8 
9 
10 /*!
11  @brief a top-level class to control all the other user action objects.
12 
13  + Build(): call SetUserAction() to put in our Run, Event, Stepping objects.
14  + BuildForMaster(): setup for for multi-thread
15 
16  the runManager will use this object to control the run. <br>
17  runManager->SetUserInitialization(new B1ActionInitialization()); <br>
18 
19 */
20 class B1ActionInitialization : public G4VUserActionInitialization // a must base class
21 {
22  public:
23 
25 
26  virtual ~B1ActionInitialization();
27 
28 
29 
30 
31  // the virtual methods ( to replace the ones inthe base class. )
32 
33  virtual void BuildForMaster() const; // for the master thread.
34 
35  virtual void Build() const; // for the sequential mode.
36  /*
37 
38  here, we will use SetUserAction() method from G4VUserActionInitialization class
39 
40  to setup the several actions, in this Build() method.
41 
42  1. primary action.
43  2. run action.
44  3. event action
45  4. step action.
46 
47  ---------------------------------------------------------
48  B1RunAction* runAction = new B1RunAction;
49  B1EventAction* eventAction = new B1EventAction(runAction);
50 
51  SetUserAction(new B1PrimaryGeneratorAction);
52  SetUserAction(runAction);
53  SetUserAction(eventAction);
54  SetUserAction(new B1SteppingAction(eventAction));
55 
56  */
57 
58 
59 
60 };
61 
62 
63 #endif
64 
65 
B1ActionInitialization()
just implement the contructor from the G4VUserActionInitialization class.
virtual void Build() const
a top-level class to control all the other user action objects.
virtual void BuildForMaster() const
virtual ~B1ActionInitialization()
do nothing