VMC Examples Version 6.6
Loading...
Searching...
No Matches
test_A01_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 A01/test_A01_2.C
12/// \brief Example A01 Test macro
13///
14/// Running A01 example
15
16void test_A01_2(const TString& configMacro, Bool_t oldGeometry)
17{
18/// Macro function for testing example A01 with local magnetic field
19/// (can be used with Geant4 only).
20/// \param configMacro configuration macro loaded in initialization
21/// \param oldGeometry if true - geometry is defined via VMC, otherwise
22/// via TGeo (not used)
23
24 // Create application if it does not yet exist
25 Bool_t needDelete = kFALSE;
26 if ( ! TVirtualMCApplication::Instance() ) {
27 new A01MCApplication("ExampleA01", "The exampleA01 MC application");
28 needDelete = kTRUE;
29 }
30
31 // MC application
33 = (A01MCApplication*)TVirtualMCApplication::Instance();
35 appl->SetWriteStack(true);
36 appl->SetWriteHits(true);
37 appl->SetUseLocalMagField(true);
38
39 appl->InitMC(configMacro);
40
41 TStopwatch timer;
42 timer.Start();
43 appl->RunMC(5);
44 timer.Stop();
45 timer.Print();
46
47 if ( needDelete ) delete appl;
48}
Implementation of the TVirtualMCApplication.
void SetWriteHits(Bool_t writeHits)
void RunMC(Int_t nofEvents)
void SetWriteStack(Bool_t writeStack)
A01PrimaryGenerator * GetPrimaryGenerator() const
void InitMC(const char *setup)
void SetUseLocalMagField(Bool_t localMagField)
void SetNofPrimaries(Int_t nofPrimaries)
void test_A01_2(const TString &configMacro, Bool_t oldGeometry)
Definition test_A01_2.C:16