Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
exampleRMC01.cc File Reference

Main program of the biasing/ReverseMC01 example. More...

Include dependency graph for exampleRMC01.cc:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Main program of the biasing/ReverseMC01 example.

Definition in file exampleRMC01.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 71 of file exampleRMC01.cc.

71  {
72 
73 
74 
75  // Construct the default run manager
76  G4RunManager * theRunManager = new G4RunManager;
77 
78 
80 
81  //Physics and geometry are declared as in a normal G4 application
82  //--------------------------------------------
83  theRunManager->SetUserInitialization(detector);
84  theRunManager->SetUserInitialization(new G4AdjointPhysicsList);
85 
86  theRunManager->SetUserAction(new RMC01PrimaryGeneratorAction);
87  theRunManager->SetUserAction(new RMC01EventAction);
88  RMC01RunAction* theRunAction = new RMC01RunAction;
89  theRunManager->SetUserAction(theRunAction);
90 
91  //The adjoint simulation manager will control the Reverse MC mode
92  //---------------------------------------------------------------
93 
94  G4AdjointSimManager* theAdjointSimManager
96 
97  //It is possible to define action that will be used during
98  // the adjoint tracking phase
99 
100  theAdjointSimManager->SetAdjointRunAction(theRunAction);
101  //theAdjointSimManager->SetAdjointEventAction(new RMC01AdjointEventAction);
102  theAdjointSimManager->SetAdjointEventAction(new RMC01EventAction);
103 
104 #ifdef G4VIS_USE
105  // visualization manager
106  G4VisManager* visManager = new G4VisExecutive;
107  visManager->Initialize();
108 
109 #endif
110 
111  // get the pointer to the User Interface manager
112  G4UImanager* UImanager = G4UImanager::GetUIpointer();
113 
114  if (argc!=1) // batch mode
115  {
116  G4String command = "/control/execute ";
117  G4String fileName = argv[1];
118  UImanager->ApplyCommand(command+fileName);
119  }
120  else
121  { // interactive mode : define UI session
122 #ifdef G4UI_USE
123  G4UIExecutive* ui = new G4UIExecutive(argc, argv);
124  ui->SessionStart();
125  delete ui;
126 #endif
127  }
128 
129  // job termination
130 #ifdef G4VIS_USE
131  delete visManager;
132 #endif
133  delete theRunManager;
134 
135  return 0;
136 }
static G4AdjointSimManager * GetInstance()
virtual void SetUserInitialization(G4VUserDetectorConstruction *userInit)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
void Initialize()
void SetAdjointRunAction(G4UserRunAction *anAction)
void SetAdjointEventAction(G4UserEventAction *anAction)
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:447
virtual void SetUserAction(G4UserRunAction *userAction)

Here is the call graph for this function: