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

Example E03 Test macro 6. More...

Go to the source code of this file.

Functions

void test_E03_6 (const TString &configMacro="g4Config5.C", Bool_t oldGeometry=kFALSE)
 

Detailed Description

Example E03 Test macro 6.

Running Example03

Definition in file test_E03_6.C.

Function Documentation

◆ test_E03_6()

void test_E03_6 ( const TString & configMacro = "g4Config5.C",
Bool_t oldGeometry = kFALSE )

Macro function for testing example E03

Parameters
configMacroconfiguration macro loaded in initialization (g4Config5.C or g4tgeoConfig5.C)
oldGeometryif true - geometry is defined via VMC, otherwise via TGeo

Activate user defined magnetic field equation of motion and stepper and run an event of 5 muons.

Definition at line 19 of file test_E03_6.C.

20{
21/// Macro function for testing example E03
22/// \param configMacro configuration macro loaded in initialization
23/// (g4Config5.C or g4tgeoConfig5.C)
24/// \param oldGeometry if true - geometry is defined via VMC, otherwise
25/// via TGeo
26///
27/// Activate user defined magnetic field equation of motion and stepper
28/// and run an event of 5 muons.
29
30 // Create application if it does not yet exist
31 Bool_t needDelete = kFALSE;
32 if ( ! TVirtualMCApplication::Instance() ) {
33 new Ex03MCApplication("Example03", "The example03 MC application");
34 needDelete = kTRUE;
35 }
36
37 // MC application
39 = (Ex03MCApplication*)TVirtualMCApplication::Instance();
42 appl->SetField(20); // Set field value in z-direction to 20 kGauss (2tesla)
43
44 // Set geometry defined via VMC
45 appl->SetOldGeometry(oldGeometry);
46
47 appl->InitMC(configMacro);
48
49 // Visualization setting
50 // Activate this code to check curving of trajectories in field
51 //set_vis();
52
53 appl->RunMC(1);
54
55 // Inactivate this code to check curving of trajectories in field
56 if ( needDelete ) delete appl;
57}
Ex03bMCApplication Ex03MCApplication
Implementation of the TVirtualMCApplication.
void InitMC(const char *setup)
void RunMC(Int_t nofEvents)
void SetOldGeometry(Bool_t oldGeometry=kTRUE)
void SetField(Double_t bz)
Ex03PrimaryGenerator * GetPrimaryGenerator() const
void SetNofPrimaries(Int_t nofPrimaries)
@ kTestField
mu+ with a suitable energy to test magnetic field
void SetPrimaryType(Type primaryType)