VMC Examples Version 6.6
Loading...
Searching...
No Matches
test_E03_multi.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_E03_multi.C
12/// \brief Example E03 Test macro for mixed engine run
13///
14/// Running Example03
15
16//#include "set_vis.C"
17
18void test_E03_multi(const TString& configMacro1, const TString& configMacro2, Int_t level=0)
19{
20/// Macro function for testing example E03c
21/// \param configMacro configuration macro loaded in initialization
22///
23/// Run 5 events with 20 primaries and print the calorimeter hits.
24
25#ifdef G4MULTITHREADED
26 std::cerr << "G4 compiled with multithreading enabled. Not running with multi-engines."
27 exit(0);
28#endif
29
30 // Create application if it does not yet exist
31 Bool_t needDelete = kFALSE;
32 if ( ! TVirtualMCApplication::Instance() ) {
33 new Ex03MCApplication("Example03", "The example03 MC application", kTRUE, kTRUE);
34 needDelete = kTRUE;
35 }
36
37 // MC application
39 = (Ex03MCApplication*)TVirtualMCApplication::Instance();
40 appl->SetVerboseLevel(level);
42 appl->SetPrintModulo(1);
43
44 if (configMacro1.IsNull() && configMacro2.IsNull()) {
45 appl->InitMC();
46 } else {
47 appl->InitMC({configMacro1.Data(), configMacro2.Data()});
48 }
49
50 // visualization setting
51 // set_vis();
52
53 TStopwatch timer;
54 timer.Start();
55 appl->RunMC(5);
56 timer.Stop();
57 timer.Print();
58
59 if ( needDelete ) delete appl;
60}
Ex03bMCApplication Ex03MCApplication
Implementation of the TVirtualMCApplication.
void SetVerboseLevel(Int_t verboseLevel)
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
void SetPrintModulo(Int_t value)
Ex03PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)
void test_E03_multi(const TString &configMacro1, const TString &configMacro2, Int_t level=0)