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