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