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

Example A01 Test macro. More...

Go to the source code of this file.

Functions

void test_A01_2 (const TString &configMacro, Bool_t oldGeometry)
 

Detailed Description

Example A01 Test macro.

Running A01 example

Definition in file test_A01_2.C.

Function Documentation

◆ test_A01_2()

void test_A01_2 ( const TString & configMacro,
Bool_t oldGeometry )

Macro function for testing example A01 with local magnetic field (can be used with Geant4 only).

Parameters
configMacroconfiguration macro loaded in initialization
oldGeometryif true - geometry is defined via VMC, otherwise via TGeo (not used)

Definition at line 16 of file test_A01_2.C.

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)