VMC Examples Version 6.6
Loading...
Searching...
No Matches
test_E06.C
Go to the documentation of this file.
1//------------------------------------------------
2// The Virtual Monte Carlo examples
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
10/// \ingroup Tests
11/// \file test_E06.C
12/// \brief Example E06 Test macro
13
14void test_E06(const TString& configMacro, Bool_t oldGeometry)
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)
void test_E06(const TString &configMacro, Bool_t oldGeometry)
Definition test_E06.C:14