VMC Examples Version 6.6
Loading...
Searching...
No Matches
test_E06_2.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_2(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/// Stack popper test.
22
23
24 // Create application if it does not yet exist
25 Bool_t needDelete = kFALSE;
26 if ( ! TVirtualMCApplication::Instance() ) {
27 new Ex06MCApplication("Example06", "The example06 MC application");
28 needDelete = kTRUE;
29 }
30
31 // MC application
33 = (Ex06MCApplication*)TVirtualMCApplication::Instance();
35 appl->SetTestStackPopper(true);
36
37 // Set geometry defined via VMC
38 appl->SetOldGeometry(oldGeometry);
39
40
41 // Initialize MC
42 appl->InitMC(configMacro);
43
44 if ( TString(gMC->GetName()) == "TGeant4" ) {
45 // Customise Geant4 setting after initialization:
46 gROOT->LoadMacro("g4Config2.C");
47 gInterpreter->ProcessLine("g4Config2()");
48 }
49
50 // Run MC
51 appl->RunMC(10);
52
53 if ( needDelete ) delete appl;
54}
Implementation of the TVirtualMCApplication.
void RunMC(Int_t nofEvents)
void InitMC(const char *setup)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
void SetTestStackPopper(Bool_t option=kFALSE)
Ex06PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)
void test_E06_2(const TString &configMacro, Bool_t oldGeometry)
Definition test_E06_2.C:14