]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4VRunConfiguration.cxx
Default is no shunting.
[u/mrichter/AliRoot.git] / TGeant4 / TG4VRunConfiguration.cxx
CommitLineData
2817d3e2 1// $Id$
2// Category: run
3//
4// See the class description in the header file.
5
6#include "TG4VRunConfiguration.h"
7#include "TG4Globals.h"
8
9#include <G4VUserDetectorConstruction.hh>
20bf4ef5 10#include <G4VModularPhysicsList.hh>
2817d3e2 11#include <G4VUserPrimaryGeneratorAction.hh>
12#include <G4UserRunAction.hh>
13#include <G4UserEventAction.hh>
14#include <G4UserTrackingAction.hh>
15#include <G4UserSteppingAction.hh>
16#include <G4UserStackingAction.hh>
17#include <G4RunManager.hh>
18
19TG4VRunConfiguration::TG4VRunConfiguration()
20 : fDetectorConstruction(0),
21 fPhysicsList(0),
22 fPrimaryGenerator(0),
23 fRunAction(0),
24 fEventAction(0),
25 fTrackingAction(0),
26 fSteppingAction(0),
27 fStackingAction(0)
28{
29//
30}
31
32TG4VRunConfiguration::TG4VRunConfiguration(const TG4VRunConfiguration& right)
33{
34//
35 TG4Globals::Exception("TG4VRunConfiguration is protected from copying.");
36}
37
38TG4VRunConfiguration::~TG4VRunConfiguration(){
39//
40}
41
42// operators
43
44TG4VRunConfiguration& TG4VRunConfiguration::operator=(
45 const TG4VRunConfiguration& right)
46{
47 // check assignement to self
48 if (this == &right) return *this;
49
50 TG4Globals::Exception("TG4VRunConfiguration is protected from assigning.");
51
52 return *this;
53}
54
20bf4ef5 55// public methods
2817d3e2 56
57void TG4VRunConfiguration::ConfigureRunManager(G4RunManager* runManager)
58{
59// Sets the user action classes to G4RunManager.
60// ---
61
62 //if (!fDetectorConstruction || !fPhysicsList || !fPrimaryGenerator)
63 //TG4Globals::Exception("Mandatory user classes are missing.");
64
65 // set mandatory classes
66 runManager->SetUserInitialization(fDetectorConstruction);
67 runManager->SetUserInitialization(fPhysicsList);
68 runManager->SetUserAction(fPrimaryGenerator);
69
70 // user other action classes
71 if (fRunAction) runManager->SetUserAction(fRunAction);
72 if (fEventAction) runManager->SetUserAction(fEventAction);
73 if (fTrackingAction) runManager->SetUserAction(fTrackingAction);
74 if (fSteppingAction) runManager->SetUserAction(fSteppingAction);
75 if (fStackingAction) runManager->SetUserAction(fStackingAction);
76}
20bf4ef5 77
78G4VModularPhysicsList* TG4VRunConfiguration::GetPhysicsList() const
79{
80// Returns the modular physics list.
81// ---
82
83 return fPhysicsList;
84}
85