VMC Examples Version 6.8
Loading...
Searching...
No Matches
test_E03_9.C
Go to the documentation of this file.
1//------------------------------------------------
2// The Virtual Monte Carlo examples
3// Copyright (C) 2007 - 2026 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_9.C
12/// \brief Example E03 test macro 9
13///
14/// Test hit accounting in reflected sensitive volumes (E03a and E03b).
15/// Use geomRootToGeant4 (g4Config.C) or, with oldGeometry=true,
16/// geomVMC+RootToGeant4 (g4ConfigMixed.C).
17
18void test_E03_9(const TString& configMacro = "g4Config.C", Bool_t oldGeometry = false)
19{
20 /// Macro function for testing reflected hits in examples E03a and E03b.
21 /// \param configMacro configuration macro loaded in initialization
22 /// \param oldGeometry If true, build with VMC calls and add reflections
23 /// with ROOT; requires geomVMC+RootToGeant4.
24
25 // Create application if it does not yet exist
26 Bool_t needDelete = kFALSE;
27 if (!TVirtualMCApplication::Instance()) {
28 new Ex03MCApplication("Example03", "The example03 MC application");
29 needDelete = kTRUE;
30 }
31
32 Ex03MCApplication* appl =
33 (Ex03MCApplication*)TVirtualMCApplication::Instance();
35 appl->SetPrintModulo(1);
36 appl->SetOldGeometry(oldGeometry);
38 // A centred muon crosses both half-slabs without relying on a shower.
40 appl->GetPrimaryGenerator()->SetIsRandom(kFALSE);
42
43 appl->InitMC(configMacro);
44 appl->RunMC(3);
45
46 if (needDelete) delete appl;
47}
Ex03bMCApplication Ex03MCApplication
void SetRequireReflectedHits(Bool_t value)
Require reflected hits in every event of the optional regression test.
void SetUseReflection(Bool_t value)
Split sensitive slabs into normal and reflected half-thickness placements.
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
Ex03DetectorConstruction * GetDetectorConstruction() const
void SetPrintModulo(Int_t value)
Ex03PrimaryGenerator * GetPrimaryGenerator() const
void SetIsRandom(Bool_t isRandomGenerator)
void SetNofPrimaries(Int_t nofPrimaries)
@ kTestField
mu+ with a suitable energy to test magnetic field
void SetPrimaryType(Type primaryType)
void test_E03_9(const TString &configMacro="g4Config.C", Bool_t oldGeometry=false)
Definition test_E03_9.C:18