1 |
// $Id: run_g4.C,v 1.0 2007/06/01 |
2 |
// |
3 |
// Macro for running G4PAM_VMC with |
4 |
class TFluka; |
5 |
|
6 |
void run_fluka(const TString& configMacro = "flukaConfig.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 |
|
19 |
// Load Geant4 libraries |
20 |
|
21 |
// gROOT->LoadMacro("./macro/PamG4Libs.C"); |
22 |
//PamG4Libs(); |
23 |
|
24 |
// Load this example libraries |
25 |
TString G4WD=gSystem->Getenv("G4WORKDIR"); |
26 |
TString PLAT=gSystem->Getenv("PLATFORM"); |
27 |
gSystem->Load(G4WD+"/lib/tgt_"+PLAT+"/libPamVMC"); |
28 |
|
29 |
// MC application |
30 |
PamVMCApplication* appl |
31 |
= new PamVMCApplication("PAMFLUKA_VMC", "PAMELA GEANT4 VMC application"); |
32 |
|
33 |
gSystem->Load("/home/nikolas/aliroot/v4-05-10/lib/tgt_linux/libTFluka"); |
34 |
new TFluka("pamfluka",4,1); |
35 |
// gMC->Init(); |
36 |
// appl->GetPrimaryGenerator()->SetNofPrimaries(1); |
37 |
appl->SetVerboseLevel(1); |
38 |
// appl->ConstructGeometry(); |
39 |
// Macro to run with primary = polarized optical photon |
40 |
//gROOT->LoadMacro("optPhoton.C"); |
41 |
//optPhoton(); |
42 |
|
43 |
// Initialize MC |
44 |
appl->InitMC(configMacro); |
45 |
|
46 |
// Customise Geant4 setting after initialization: |
47 |
// Physics list |
48 |
// ((TGeant4*)gMC)->ProcessGeantMacro("g4config2.in"); |
49 |
// Visualization settings |
50 |
// ((TGeant4*)gMC)->ProcessGeantMacro("g4vis.in"); |
51 |
|
52 |
// Run MC |
53 |
appl->RunMC(1); |
54 |
|
55 |
// delete appl; |
56 |
|
57 |
// return |
58 |
|
59 |
} |