VMC Examples Version 6.6
Loading...
Searching...
No Matches
test_Monopole.C
Go to the documentation of this file.
1//------------------------------------------------
2// The Virtual Monte Carlo examples
3// Copyright (C) 2007 - 2019 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_Monopole.C
12/// \brief Example Monopole Test macro
13
14void test_Monopole(const TString& configMacro)
15{
16/// Macro function for testing example Monopole
17/// \param configMacro configuration macro loaded in initialization
18
19 // Create application if it does not yet exist
20 Bool_t needDelete = kFALSE;
21 if ( ! TVirtualMCApplication::Instance() ) {
22 new VMC::Monopole::MCApplication("Example06", "The example06 MC application");
23 needDelete = kTRUE;
24 }
25
26 // MC application
28 = (VMC::Monopole::MCApplication*)TVirtualMCApplication::Instance();
29
30 // Set detector parameters
31 // /testex/det/setMat G4_Si
32 // /testex/det/setSizeX 10 cm
33 // /testex/det/setSizeYZ 20 cm
34 // /testex/det/setStepSize 0.2 mm
35 // /testex/run/binSize 0.2 mm
37 detector->SetAbsorberMaterial("Si");
38 detector->SetAbsorberSizeX(10);
39 detector->SetAbsorberSizeYZ(20);
40 detector->SetMaxStepSize(0.02);
41 appl->SetBinSize(0.02);
42
43 // Initialize MC
44 appl->InitMC(configMacro);
45
46 if ( TString(gMC->GetName()) == "TGeant4" ) {
47 // Customise Geant4 setting after initialization:
48 // Physics list
49 ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in");
50 }
51
52 // Run MC
53 appl->RunMC(100);
54
55 if ( needDelete ) delete appl;
56}
The detector construction (via TGeo )
void SetAbsorberMaterial(const TString &name)
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void SetBinSize(Double_t binSize)
void RunMC(Int_t nofEvents)
DetectorConstruction * GetDetectorConstruction() const
void test_Monopole(const TString &configMacro)