VMC Examples Version 6.6
Loading...
Searching...
No Matches
run_g4.C File Reference

Macro for running Example A01 with Geant4. More...

#include "set_g4_vis.C"
Include dependency graph for run_g4.C:

Go to the source code of this file.

Functions

void run_g4 (const TString &configMacro="g4Config.C")
 

Detailed Description

Macro for running Example A01 with Geant4.

Definition in file run_g4.C.

Function Documentation

◆ run_g4()

void run_g4 ( const TString & configMacro = "g4Config.C")

Macro function for running Example A01 with Geant4 from Root interactive session Note that since Root 6 the libraries have to be loaded first via load_g4.C.

Parameters
configMacroconfiguration macro name, default E03/g4Config.C

Definition at line 16 of file run_g4.C.

17{
18/// Macro function for running Example A01 with Geant4 from
19/// Root interactive session
20/// Note that since Root 6 the libraries have to be loaded first
21/// via load_g4.C.
22/// \param configMacro configuration macro name, default \ref E03/g4Config.C
23
24 // MC application
26 = new A01MCApplication("ExampleA01", "The exampleA01 MC application");
27 appl->GetPrimaryGenerator()->SetRandomize(false);
28 appl->SetWriteStack(true);
29 appl->SetWriteHits(true);
30 // Activate use of local magnetic field (available only with Geant4);
31 // requires to run with g4[tgeo]Config2.C
32 // appl->SetUseLocalMagField(true);
33
34 appl->InitMC(configMacro);
35
36 // visualization setting
37 set_g4_vis();
38
39 // Enter in Geant4 interactive session
40 //((TGeant4*)gMC)->StartGeantUI();
41
42 TStopwatch timer;
43 timer.Start();
44 appl->RunMC(5);
45 timer.Stop();
46 timer.Print();
47
48 delete appl;
49}
void set_g4_vis()
Definition set_g4_vis.C:15
Implementation of the TVirtualMCApplication.
void SetWriteHits(Bool_t writeHits)
void RunMC(Int_t nofEvents)
void SetWriteStack(Bool_t writeStack)
A01PrimaryGenerator * GetPrimaryGenerator() const
void InitMC(const char *setup)
void SetRandomize(Bool_t val)