1 |
// $Id: run_g4.C,v 1.0 2007/06/01 |
2 |
// |
3 |
// Macro for running G4PAM_VMC with |
4 |
class TGeant3; |
5 |
|
6 |
void run_g3(const TString& configMacro = "g3Config.C") |
7 |
{ |
8 |
// Load basic libraries |
9 |
gROOT->LoadMacro("./macro/basiclibs.C"); |
10 |
basiclibs(); |
11 |
|
12 |
// Load PAMELA libs |
13 |
TString PAMLIB=gSystem->Getenv("PAM_LIB"); |
14 |
gSystem->Load(PAMLIB+"/libyoda.so"); |
15 |
gSystem->Load(PAMLIB+"/libDarthVader.so"); |
16 |
gSystem->Load(PAMLIB+"/libPamLevel2.so"); |
17 |
|
18 |
// Load Geant4 libraries |
19 |
|
20 |
// gROOT->LoadMacro("./macro/PamG4Libs.C"); |
21 |
//PamG4Libs(); |
22 |
|
23 |
// Load this example libraries |
24 |
TString G4WD=gSystem->Getenv("G4WORKDIR"); |
25 |
TString PLAT=gSystem->Getenv("PLATFORM"); |
26 |
gSystem->Load(G4WD+"/lib/tgt_"+PLAT+"/libPam_VMC"); |
27 |
|
28 |
// MC application |
29 |
PamVMCApplication* appl |
30 |
= new PamVMCApplication("PAMFLUKA_VMC", "PAMELA GEANT4 VMC application"); |
31 |
|
32 |
gSystem->Load("/cern/geant3/lib/tgt_linux/libgeant321"); |
33 |
new TGeant3TGeo("pamg3",0); |
34 |
// gMC->Init(); |
35 |
// appl->GetPrimaryGenerator()->SetNofPrimaries(1); |
36 |
appl->SetVerboseLevel(4); |
37 |
// appl->ConstructGeometry(); |
38 |
// Macro to run with primary = polarized optical photon |
39 |
//gROOT->LoadMacro("optPhoton.C"); |
40 |
//optPhoton(); |
41 |
|
42 |
// Initialize MC |
43 |
appl->InitMC(configMacro); |
44 |
|
45 |
// Customise Geant4 setting after initialization: |
46 |
// Physics list |
47 |
// ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in"); |
48 |
// Visualization settings |
49 |
// ((TGeant4*)gMC)->ProcessGeantMacro("g4vis.in"); |
50 |
|
51 |
// Run MC |
52 |
appl->RunMC(1); |
53 |
|
54 |
// delete appl; |
55 |
|
56 |
// return |
57 |
|
58 |
} |