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

Example E06 Test macro. More...

Go to the source code of this file.

Functions

void test_E06 (const TString &configMacro, Bool_t oldGeometry)
 

Detailed Description

Example E06 Test macro.

Definition in file test_E06.C.

Function Documentation

◆ test_E06()

void test_E06 ( const TString & configMacro,
Bool_t oldGeometry )

Macro function for testing example E06

Parameters
configMacroconfiguration macro loaded in initialization
oldGeometryif true - geometry is defined via VMC, otherwise via TGeo

Definition at line 14 of file test_E06.C.

15{
16/// Macro function for testing example E06
17/// \param configMacro configuration macro loaded in initialization
18/// \param oldGeometry if true - geometry is defined via VMC, otherwise
19/// via TGeo
20
21
22 // Create application if it does not yet exist
23 Bool_t needDelete = kFALSE;
24 if ( ! TVirtualMCApplication::Instance() ) {
25 new Ex06MCApplication("Example06", "The example06 MC application");
26 needDelete = kTRUE;
27 }
28
29 // MC application
31 = (Ex06MCApplication*)TVirtualMCApplication::Instance();
33
34 // Set geometry defined via VMC
35 appl->SetOldGeometry(oldGeometry);
36
37
38 // Initialize MC
39 appl->InitMC(configMacro);
40
41 if ( TString(gMC->GetName()) == "TGeant4" ) {
42 // Customise Geant4 setting after initialization:
43 gROOT->LoadMacro("g4Config2.C");
44 gInterpreter->ProcessLine("g4Config2()");
45 }
46
47 // Run MC
48 appl->RunMC(10);
49
50 if ( needDelete ) delete appl;
51}
Implementation of the TVirtualMCApplication.
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
Ex06PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)