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

Example E03 Test macro for mixed engine run. More...

Go to the source code of this file.

Functions

void test_E03_multi (const TString &configMacro1, const TString &configMacro2, Int_t level=0)
 

Detailed Description

Example E03 Test macro for mixed engine run.

Running Example03

Definition in file test_E03_multi.C.

Function Documentation

◆ test_E03_multi()

void test_E03_multi ( const TString & configMacro1,
const TString & configMacro2,
Int_t level = 0 )

Macro function for testing example E03c

Parameters
configMacroconfiguration macro loaded in initialization

Run 5 events with 20 primaries and print the calorimeter hits.

Definition at line 18 of file test_E03_multi.C.

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)