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.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]
1
2 Examples for HepMC-Geant4 interface
3 -----------------------------------
4
5 This directory contains examples for using HepMC as an interface with
6 various Monte Carlo event generators, such as PYTHIA.
7 It also include an example for demonstrating MC truth handling with HepMC.
8
9 Requirements for external software packages
10 -------------------------------------------
11 HepMC:
12 Tested version : 2.06.09
13 http://lcgapp.cern.ch/project/simu/HepMC/
14
15 Note: examples were tested only on Linux with gcc.
16
17 PYTHIA
18 Tested version 6.4.26
19 URL: http://www.thep.lu.se/~torbjorn/Pythia.html
20
21
22 Examples HepMCEx01 and HepMCEx02
23 ================================
24
25 class HepMCG4Interface
26 This class is derived from G4VPrimaryGenerator, and is a base class
27 for primary generation via HepMC object.
28
29 protected members
30 + virtual HepMC::GenEvent* GenerateHepMCEvent()
31 Implement this method in his/her own concrete class.
32 An empty event will be created in default.
33
34 + void HepMC2G4(const HepMC::GenEvent* hepmcevt, G4Event* g4event)
35 service method for conversion from HepMC::GenEvent to G4Event
36
37 + virtual G4bool CheckVertexInsideWorld(const G4ThreeVector& pos) const
38 We have to take care for the position of primaries because
39 primary vertices outside the world volume give rise to G4Exception.
40 If the default implementation is not adequate, an alternative
41 can be implemented in your own class.
42
43 public members
44 + virtual void GeneratePrimaryVertex(G4Event* anEvent)
45 The default behavior is that a single HepMC event generated by
46 GenerateHepMCEvent() will be converted to G4Event through HepMC2G4().
47
48 class HepMCG4AsciiReader / HepMCG4AsciiReaderMessenger
49 (derived from HepMCG4Interface)
50 This derived class is for reading primary information from
51 an Ascii file generated by HepMC.
52
53 class HepMCG4PythiaInterface / HepMCG4AsciiReaderMessenger
54 (derived from HepMCG4Interface)
55 This derived class is for directly calling PYTHIA functions.
56 Users can set parameters, initialize, generate, and terminate
57 by command line operation.
58
59 Macros in examples
60 -----------------
61 hepmc_pygen.in
62 process PYTHIA events(H->4mu) generated at every event.
63
64 hepmc_ascii.in
65 read pregenerated events from HepMC Ascii file (data/example_MyPythia.dat).
66
67 Installation
68 --------------
69 1. Download and install HepMC from:
70 http://lcgapp.cern.ch/project/simu/HepMC/
71 (Last tested version : 2.06.09)
72
73 and define the environment variable:
74 HEPMC_DIR the path to HepMC installation.
75
76 2. Download the PYTHIA6 source file from the PYTHIA6 download site:
77 http://www.hepforge.org/downloads/pythia6
78
79 A) With CMake: Build pythia6 library
80
81 For a convenience a CMake file for building Pythia6 library from
82 the source is provided in
83 examples/extended/eventgenerator/CMakeLists.txt.pythia6.
84 Build the pythia6 library following the insytructions in this file
85 and then define the environment variables:
86 PYTHIA6 the path where pythia6 library is installed
87 PYTHIA6_VERSION the pythia version
88
89 B) With GNUmake: Define the environment variables
90
91 PYTHIA6 the path to pythia-versionX.f source code
92 PYTHIA6_VERSION the pythia version
93
94 e.g. If you download pythia-6.4.26.f.gz and unzip it in $HOME,
95 then you have to set:
96 export PYTHIA6=$HOME
97 export PYTHIA6_VERSION="6.4.26"
98
99 Pythia6 will be then compiled together with example code.
100
101 3. Compilation:
102 Then the examples are compiled in a standard way,
103 see examples/README_HowToRun.
104
105 Examples
106 ----------
107 See more details in HepMCEx01/README and HepMCEx02/README.
108
109 Notes
110 -----
111 We attached a sample HepMC Ascii data file, "data/example_MyPythia.dat",
112 which contains 10 PYTHIA events created by "data/example_MyPythia.cxx".
113
114 Example MCTruth
115 ===============
116
117 Application demonstrating handling of Monte-Carlo truth information through
118 the HepMC package.