Warning, /geant4/examples/extended/eventgenerator/HepMC/README.md is written in an unsupported language. File is not indexed.
0001 \page Examples_HepMC Category "eventgenerator/HepMC"
0002
0003 This directory contains examples for using HepMC as an interface with
0004 various Monte Carlo event generators, such as PYTHIA.
0005 It also include an example for demonstrating MC truth handling with HepMC.
0006
0007 ## Requirements for external software packages
0008
0009 ### HepMC
0010 - Tested version : 2.06.09
0011 - http://lcgapp.cern.ch/project/simu/HepMC/
0012
0013 Note: examples were tested only on Linux with gcc.
0014
0015 ### PYTHIA
0016 - Tested version 6.4.26
0017 - URL: http://www.thep.lu.se/~torbjorn/Pythia.html
0018
0019
0020 ## Examples HepMCEx01 and HepMCEx02
0021
0022 ### class HepMCG4Interface
0023 This class is derived from G4VPrimaryGenerator, and is a base class
0024 for primary generation via HepMC object.
0025
0026 protected members:
0027
0028 - virtual HepMC::GenEvent* GenerateHepMCEvent() \n
0029 Implement this method in his/her own concrete class.
0030 An empty event will be created in default.
0031
0032 - void HepMC2G4(const HepMC::GenEvent* hepmcevt, G4Event* g4event) \n
0033 service method for conversion from HepMC::GenEvent to G4Event
0034
0035 - virtual G4bool CheckVertexInsideWorld(const G4ThreeVector& pos) const \n
0036 We have to take care for the position of primaries because
0037 primary vertices outside the world volume give rise to G4Exception.
0038 If the default implementation is not adequate, an alternative
0039 can be implemented in your own class.
0040
0041 public members:
0042 - virtual void GeneratePrimaryVertex(G4Event* anEvent) \n
0043 The default behavior is that a single HepMC event generated by
0044 GenerateHepMCEvent() will be converted to G4Event through HepMC2G4().
0045
0046 ### class HepMCG4AsciiReader / HepMCG4AsciiReaderMessenger (derived from HepMCG4Interface)
0047 This derived class is for reading primary information from
0048 an Ascii file generated by HepMC.
0049
0050 ### class HepMCG4PythiaInterface / HepMCG4AsciiReaderMessenger (derived from HepMCG4Interface)
0051 This derived class is for directly calling PYTHIA functions.
0052 Users can set parameters, initialize, generate, and terminate
0053 by command line operation.
0054
0055 ### Macros in examples
0056
0057 - hepmc_pygen.in \n
0058 process PYTHIA events(H->4mu) generated at every event.
0059
0060 - hepmc_ascii.in \n
0061 read pregenerated events from HepMC Ascii file (data/example_MyPythia.dat).
0062
0063 ### Installation
0064
0065 - 1. Download and install HepMC from: \n
0066 http://lcgapp.cern.ch/project/simu/HepMC/ \n
0067 and define the environment variable:
0068 ```
0069 HEPMC_DIR the path to HepMC installation.
0070 ```
0071
0072 - 2. Download the PYTHIA6 source file from the PYTHIA6 download site:\n
0073 http://www.hepforge.org/downloads/pythia6
0074
0075 - 2A. With CMake: Build pythia6 library
0076
0077 For a convenience a CMake file for building Pythia6 library from
0078 the source is provided in
0079 examples/extended/eventgenerator/CMakeLists.txt.pythia6.
0080 Build the pythia6 library following the instructions in this file
0081 and then define the environment variables:
0082 ```
0083 PYTHIA6 the path where pythia6 library is installed
0084 PYTHIA6_VERSION the pythia version
0085 ```
0086
0087 - 2B. With GNUmake: Define the environment variables: \n
0088 ```
0089 PYTHIA6 the path to pythia-versionX.f source code
0090 PYTHIA6_VERSION the pythia version
0091 ```
0092
0093 e.g. If you download pythia-6.4.26.f.gz and unzip it in $HOME,
0094 then you have to set:
0095 export PYTHIA6=$HOME
0096 export PYTHIA6_VERSION="6.4.26"
0097
0098 pythia6 will be then compiled together with example code.
0099
0100 - 3. Compilation:\n
0101 Then the examples are compiled in a standard way, see \ref README_HowToRun.
0102
0103 ### Examples
0104
0105 See more details in \ref ExampleHepMCEx01 and \ref ExampleHepMCEx02.
0106
0107 ### Notes
0108
0109 We attached a sample HepMC Ascii data file, "data/example_MyPythia.dat",
0110 which contains 10 PYTHIA events created by "data/example_MyPythia.cxx".
0111
0112 ## Example MCTruth
0113
0114 Application \ref ExampleMCTruth demonstrating handling of Monte-Carlo truth information through the HepMC package.