Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
@@ -1,47 +0,0 @@
///\file "eventgenerator/.README.txt"
///\brief Examples eventgenerator README page
/*! \page Examples_eventgenerator Category "eventgenerator"
Examples in this directory demonstrate various ways of primary event
generation.
\link ExampleparticleGun particleGun \endlink
This example demonstrates 4 ways of the usage of G4ParticleGun shooting
primary particles in different cases.
\link Exampleexgps exgps \endlink
This example demonstrates the usage of G4GeneralParticleSource for generating
primary incident particle according to user defined distributions.
\link ExampleuserPrimaryGenerator userPrimaryGenerator \endlink
This example shows how to create a primary event including several vertices and
several primary particles per vertex.
\link Examples_HepMC HepMC \endlink
This directory contains examples for using HepMC as an interface with
various Monte Carlo event generators, such as PYTHIA.
It also include an example for demonstrating MC truth handling with HepMC.
\link Examples_pythia pythia \endlink
This directory contains the following examples:
a) use of Pythia6 as Monte Carlo event generator, interfaced with Geant4,
and showing how to implement an external decayer based on Pythia6.
The feature is activated by setting environment variable PYTHIA6 to point
to the Pythia6 installation area.
For details, please see \link Exampledecayer6 Example decayer6 \endlink.
b) use of Pythia8 as an external decayer to replace native Geant4 decay
tables for such resonances as tau+/- and B+/-, and to supplement Pythia8-based
decay tables to those resonances where Geant4 native decay features are not
implemented.
For details, please see \link Examplepy8decayer Example py8decayer \endlink.
*/
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/HepMCEx01.cc
/// \brief Main program of the eventgenerator/HepMC/HepMCEx01 example
//
//
/// \file HepMCEx01.cc
/// \brief Main program of the HepMC/HepMCEx01 example
// --------------------------------------------------------------
// GEANT 4 - example derived from novice exampleN04
// --------------------------------------------------------------
@@ -1,57 +0,0 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
HepMCEx01
---------
HepMCEx01 is based on ExampleN04, which has a simplified collider detector
geometry. Only part of the primary generator action is replaced with new one.
This example demonstrates the following features.
1. HepMC interface
ExN04PrimaryGeneratorAction has HepMCG4Interface as the generator.
There are two types of generators provided as samples. One generator reads
primary information from a HepMC Ascii file (data/example_MyPythia.dat).
The other one generates primaries directly invoking PYTHIA routines
in every event.
2. Readout geometry
ExN04DetectorConstruction defines a simplified collider detecor
geometry, tracker made of cylindrical tubes, calorimeter made of
cylindrical tubes, and muon trackers made of planes.
Cylindrical calorimeter is made of tubes of lead and scintirator
without cut in phi nor z direction. Energy deposition in scintirator
is accumulated by ExN04CalorimeterSD sensitive detector, which has
a readout geometry to find the phi-z cell.
3. Full set of "ordinary" physics processes
FTFP_BERT physics list defines almost all of leptons and hadrons which
Geant4 has dedicated classes for. Also almost all physics processes
Geant4 has are defined.
4. Event filtering by the stacking mechanism.
Higgs events in "pythia_event.data" have two lepton pairs produced
by the Higgs decay via Z0. At the first stage of each event, only the
primary muons are tracked without tracking secondaries. then the number
of hits on the muon trackers are examined. At the next stage, only
the primary charged particles are tracked only inside the barrel
tracking area and the isolation of the primary muons are examined.
At the third stage, all particles in the RoI (Region of Interest) along
the isolated muons are tracked. All these examinations are applied in
ExN04StackingAction.
5. Installation
See HepMC/README how to build this example.
6. Execution
% HepMCEx01 hepmc_pygen.in
@@ -1,14 +1,10 @@
///\file "eventgenerator/HepMC/HepMCEx01/.README.txt"
///\brief Example HepMCEx01 README page
/*! \page ExampleHepMCEx01 Example HepMCEx01
\page ExampleHepMCEx01 Example HepMCEx01
HepMCEx01 is based on Example N04, which has a simplified collider detector
geometry. Only part of the primary generator action is replaced with new one.
This example demonstrates the following features.
\section ExampleHepMCEx01_s1 HepMC interface
## HepMC interface
ExN04PrimaryGeneratorAction has HepMCG4Interface as the generator.
There are two types of generators provided as samples. One generator reads
@@ -16,7 +12,7 @@ primary information from a HepMC Ascii file (data/example_MyPythia.dat).
The other one generates primaries directly invoking PYTHIA routines
in every event.
\section ExampleHepMCEx01_s2 Readout geometry
## Readout geometry
ExN04DetectorConstruction defines a simplified collider detecor
geometry, tracker made of cylindrical tubes, calorimeter made of
@@ -26,13 +22,13 @@ without cut in phi nor z direction. Energy deposition in scintirator
is accumulated by ExN04CalorimeterSD sensitive detector, which has
a readout geometry to find the phi-z cell.
\section ExampleHepMCEx01_s3 Full set of "ordinary" physics processes
## Full set of "ordinary" physics processes
FTFP_BERT physics list defines almost all of leptons and hadrons which
Geant4 has dedicated classes for. Also almost all physics processes
Geant4 has are defined.
\section ExampleHepMCEx01_s4 Event filtering by the stacking mechanism.
## Event filtering by the stacking mechanism.
Higgs events in "pythia_event.data" have two lepton pairs produced
by the Higgs decay via Z0. At the first stage of each event, only the
@@ -44,13 +40,11 @@ At the third stage, all particles in the RoI (Region of Interest) along
the isolated muons are tracked. All these examinations are applied in
ExN04StackingAction.
\section ExampleHepMCEx01_s5 Installation
## Installation
See \ref Examples_HepMC how to build this example.
See ["eventgenerator/HepMC" page](../../html/Examples_HepMC.html) how to build this example.
\section ExampleHepMCEx01_s6 Execution
\verbatim
% HepMCEx01 hepmc_pygen.in
\endverbatim
*/
## Execution
```
% ./HepMCEx01 hepmc_pygen.in
```
@@ -23,8 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//////////////////////////////////////////////////////////////////////////
/// \file example_MyPythia.cxx
/// \brief Main program of the HepMCEx01/data example
// Matt.Dobbs@Cern.CH, December 1999
// November 2000, updated to use Pythia 6.1
// example of generating events with Pythia
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04CalorimeterHit.hh
/// \file ExN04CalorimeterHit.hh
/// \brief Definition of the ExN04CalorimeterHit class
//
//
#ifndef ExN04CalorimeterHit_h
#define ExN04CalorimeterHit_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04CalorimeterParametrisation.hh
/// \file ExN04CalorimeterParametrisation.hh
/// \brief Definition of the ExN04CalorimeterParametrisation class
//
//
#ifndef ExN04CalorimeterParametrisation_H
#define ExN04CalorimeterParametrisation_H 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04CalorimeterROGeometry.hh
/// \file ExN04CalorimeterROGeometry.hh
/// \brief Definition of the ExN04CalorimeterROGeometry class
//
//
#ifndef ExN04CalorimeterROGeometry_h
#define ExN04CalorimeterROGeometry_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04CalorimeterSD.hh
/// \file ExN04CalorimeterSD.hh
/// \brief Definition of the ExN04CalorimeterSD class
//
//
#ifndef ExN04CalorimeterSD_h
#define ExN04CalorimeterSD_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04DetectorConstruction.hh
/// \file ExN04DetectorConstruction.hh
/// \brief Definition of the ExN04DetectorConstruction class
//
//
#ifndef ExN04DetectorConstruction_h
#define ExN04DetectorConstruction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04DetectorParameterDef.hh
/// \file ExN04DetectorParameterDef.hh
/// \brief Definition of the ExN04DetectorParameterDef class
//
//
G4double fexpHall_x;
G4double fexpHall_y;
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04DummySD.hh
/// \file ExN04DummySD.hh
/// \brief Definition of the ExN04DummySD class
//
//
// Dummy sensitive used only to flag sensitivity
// in cells of RO geometry.
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04EventAction.hh
/// \file ExN04EventAction.hh
/// \brief Definition of the ExN04EventAction class
//
//
#ifndef ExN04EventAction_h
#define ExN04EventAction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04Field.hh
/// \file ExN04Field.hh
/// \brief Definition of the ExN04Field class
//
//
#ifndef ExN04Field_H
#define ExN04Field_H 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04MuonHit.hh
/// \file ExN04MuonHit.hh
/// \brief Definition of the ExN04MuonHit class
//
//
#ifndef ExN04MuonHit_h
#define ExN04MuonHit_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04MuonSD.hh
/// \file ExN04MuonSD.hh
/// \brief Definition of the ExN04MuonSD class
//
//
#ifndef ExN04MuonSD_h
#define ExN04MuonSD_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04PrimaryGeneratorAction.hh
/// \file ExN04PrimaryGeneratorAction.hh
/// \brief Definition of the ExN04PrimaryGeneratorAction class
//
//
#ifndef EXN04_PRIMARY_GENERATOR_ACTION_H
#define EXN04_PRIMARY_GENERATOR_ACTION_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04PrimaryGeneratorMessenger.hh
/// \file ExN04PrimaryGeneratorMessenger.hh
/// \brief Definition of the ExN04PrimaryGeneratorMessenger class
//
//
#ifndef EXN04_PRIMARY_GENERATOR_MESSENGER_H
#define EXN04_PRIMARY_GENERATOR_MESSENGER_H
@@ -23,12 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04RunAction.hh
/// \file ExN04RunAction.hh
/// \brief Definition of the ExN04RunAction class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifndef ExN04RunAction_h
#define ExN04RunAction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04StackingAction.hh
/// \file ExN04StackingAction.hh
/// \brief Definition of the ExN04StackingAction class
//
//
#ifndef ExN04StackingAction_H
#define ExN04StackingAction_H 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04StackingActionMessenger.hh
/// \file ExN04StackingActionMessenger.hh
/// \brief Definition of the ExN04StackingActionMessenger class
//
//
#ifndef ExN04StackingActionMessenger_h
#define ExN04StackingActionMessenger_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04SteppingAction.hh
/// \file ExN04SteppingAction.hh
/// \brief Definition of the ExN04SteppingAction class
//
//
#ifndef ExN04SteppingAction_H
#define ExN04SteppingAction_H 1
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04SteppingVerbose.hh
/// \file ExN04SteppingVerbose.hh
/// \brief Definition of the ExN04SteppingVerbose class
//
//
// This class manages the verbose outputs in G4SteppingManager.
// It inherits from G4SteppingVerbose.
// It shows how to extract informations during the tracking of a particle.
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04TrackerHit.hh
/// \file ExN04TrackerHit.hh
/// \brief Definition of the ExN04TrackerHit class
//
//
#ifndef ExN04TrackerHit_h
#define ExN04TrackerHit_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04TrackerParametrisation.hh
/// \file ExN04TrackerParametrisation.hh
/// \brief Definition of the ExN04TrackerParametrisation class
//
//
#ifndef ExN04TrackerParametrisation_H
#define ExN04TrackerParametrisation_H 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04TrackerSD.hh
/// \file ExN04TrackerSD.hh
/// \brief Definition of the ExN04TrackerSD class
//
//
#ifndef ExN04TrackerSD_h
#define ExN04TrackerSD_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/ExN04TrackingAction.hh
/// \file ExN04TrackingAction.hh
/// \brief Definition of the ExN04TrackingAction class
//
//
#ifndef ExN04TrackingAction_h
#define ExN04TrackingAction_h 1
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4AsciiReader.hh
/// \file HepMCG4AsciiReader.hh
/// \brief Definition of the HepMCG4AsciiReader class
//
//
#ifndef HEPMC_G4_ASCII_READER_H
#define HEPMC_G4_ASCII_READER_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4AsciiReaderMessenger.hh
/// \file HepMCG4AsciiReaderMessenger.hh
/// \brief Definition of the HepMCG4AsciiReaderMessenger class
//
//
#ifndef HEPMC_G4_ASCII_READER_MESSENGER_H
#define HEPMC_G4_ASCII_READER_MESSENGER_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4Interface.hh
/// \file HepMCG4Interface.hh
/// \brief Definition of the HepMCG4Interface class
//
//
#ifndef HEPMC_G4_INTERFACE_H
#define HEPMC_G4_INTERFACE_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4PythiaInterface.hh
/// \file HepMCG4PythiaInterface.hh
/// \brief Definition of the HepMCG4PythiaInterface class
//
//
#ifndef HEPMC_G4_PYTHIA_INTERFACE_H
#define HEPMC_G4_PYTHIA_INTERFACE_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4PythiaMessenger.hh
/// \file HepMCG4PythiaMessenger.hh
/// \brief Definition of the HepMCG4PythiaMessenger class
//
//
#ifndef HEPMC_G4_PYTHIA_MESSENGER_H
#define HEPMC_G4_PYTHIA_MESSENGER_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterHit.cc
/// \file ExN04CalorimeterHit.cc
/// \brief Implementation of the ExN04CalorimeterHit class
//
//
#include "ExN04CalorimeterHit.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterParametrisation.cc
/// \file ExN04CalorimeterParametrisation.cc
/// \brief Implementation of the ExN04CalorimeterParametrisation class
//
//
#include "ExN04CalorimeterParametrisation.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterROGeometry.cc
/// \file ExN04CalorimeterROGeometry.cc
/// \brief Implementation of the ExN04CalorimeterROGeometry class
//
//
#include "ExN04CalorimeterROGeometry.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04CalorimeterSD.cc
/// \file ExN04CalorimeterSD.cc
/// \brief Implementation of the ExN04CalorimeterSD class
//
//
#include "ExN04CalorimeterSD.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04DetectorConstruction.cc
/// \file ExN04DetectorConstruction.cc
/// \brief Implementation of the ExN04DetectorConstruction class
//
//
#include "ExN04DetectorConstruction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04EventAction.cc
/// \file ExN04EventAction.cc
/// \brief Implementation of the ExN04EventAction class
//
//
#include "ExN04EventAction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04Field.cc
/// \file ExN04Field.cc
/// \brief Implementation of the ExN04Field class
//
//
#include "ExN04Field.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonHit.cc
/// \file ExN04MuonHit.cc
/// \brief Implementation of the ExN04MuonHit class
//
//
#include "ExN04MuonHit.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04MuonSD.cc
/// \file ExN04MuonSD.cc
/// \brief Implementation of the ExN04MuonSD class
//
//
#include "ExN04MuonSD.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04PrimaryGeneratorAction.cc
/// \file ExN04PrimaryGeneratorAction.cc
/// \brief Implementation of the ExN04PrimaryGeneratorAction class
//
//
#include "ExN04PrimaryGeneratorAction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04PrimaryGeneratorMessenger.cc
/// \file ExN04PrimaryGeneratorMessenger.cc
/// \brief Implementation of the ExN04PrimaryGeneratorMessenger class
//
//
#include "ExN04PrimaryGeneratorMessenger.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04RunAction.cc
/// \file ExN04RunAction.cc
/// \brief Implementation of the ExN04RunAction class
//
//
#include "ExN04RunAction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04StackingAction.cc
/// \file ExN04StackingAction.cc
/// \brief Implementation of the ExN04StackingAction class
//
//
#include "ExN04StackingAction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04StackingActionMessenger.cc
/// \file ExN04StackingActionMessenger.cc
/// \brief Implementation of the ExN04StackingActionMessenger class
//
//
#include "ExN04StackingActionMessenger.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04SteppingAction.cc
/// \file ExN04SteppingAction.cc
/// \brief Implementation of the ExN04SteppingAction class
//
//
#include "ExN04SteppingAction.hh"
@@ -23,12 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04SteppingVerbose.cc
/// \file ExN04SteppingVerbose.cc
/// \brief Implementation of the ExN04SteppingVerbose class
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN04SteppingVerbose.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04TrackerHit.cc
/// \file ExN04TrackerHit.cc
/// \brief Implementation of the ExN04TrackerHit class
//
//
#include "ExN04TrackerHit.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04TrackerParametrisation.cc
/// \file ExN04TrackerParametrisation.cc
/// \brief Implementation of the ExN04TrackerParametrisation class
//
//
#include "ExN04TrackerParametrisation.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04TrackerSD.cc
/// \file ExN04TrackerSD.cc
/// \brief Implementation of the ExN04TrackerSD class
//
//
#include "ExN04TrackerSD.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/ExN04TrackingAction.cc
/// \file ExN04TrackingAction.cc
/// \brief Implementation of the ExN04TrackingAction class
//
//
#include "ExN04TrackingAction.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HEPEvtcom.cc
/// \file HEPEvtcom.cc
/// \brief Implementation of the HEPEvtcom class
//
//
// ======================================================================
// PARAMETER (NMXHEP=4000)
// COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4AsciiReader.cc
/// \file HepMCG4AsciiReader.cc
/// \brief Implementation of the HepMCG4AsciiReader class
//
//
#include "HepMCG4AsciiReader.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4AsciiReaderMessenger.cc
/// \file HepMCG4AsciiReaderMessenger.cc
/// \brief Implementation of the HepMCG4AsciiReaderMessenger class
//
//
#include "HepMCG4AsciiReaderMessenger.hh"
#include "HepMCG4AsciiReader.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4Interface.cc
/// \file HepMCG4Interface.cc
/// \brief Implementation of the HepMCG4Interface class
//
//
#include "HepMCG4Interface.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4PythiaInterface.cc
/// \file HepMCG4PythiaInterface.cc
/// \brief Implementation of the HepMCG4PythiaInterface class
//
//
#ifdef G4LIB_USE_PYTHIA
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4PythiaMessenger.cc
/// \file HepMCG4PythiaMessenger.cc
/// \brief Implementation of the HepMCG4PythiaMessenger class
//
//
#ifdef G4LIB_USE_PYTHIA
@@ -1,47 +0,0 @@
///\file "eventgenerator/HepMC/HepMCEx02/.README.txt"
///\brief Example HepMCEx02 README page
/*! \page ExampleHepMCEx02 Example HepMCEx02
This example demonstrates how to interface primary particles in Geant4
with various event generators via the HepMC Monte Carlo event interface.
This is another example having the same generator action as HepMCEx01,
but much simpler user control.
\section ExampleHepMCEx02_s1 Primary Generator
H02PrimaryGeneratorAction has HepMCG4Interface as the generator.
There are two types of generators provided as samples. One generator reads
primary information from a HepMC Ascii file (data/example_MyPythia.dat).
The other one generates primaries directly invoking PYTHIA routines
in every event.
\section ExampleHepMCEx02_s2 Geometry
A simplified collider-type geometry, which consists of
- endcap calorimeter (a set of tubes filled with lead),
- barrel calorimeter (tube filled with lead),
- barrel muon detector (8 sets of plates filled with Ar),
- endcap muon detecror, (a set of tubes filled with Ar) and
- uniform magnetic field along the z axis of 3 Tesla at the
central region.
\section ExampleHepMCEx02_s3 Physics List
FTFP_BERT predefined physics list
\section ExampleHepMCEx02_s4 User actions
All particles except muons are killed in the calorimeter section.
\section ExampleHepMCEx02_s5 Installation
See \ref Examples_HepMC how to build this example.
\section ExampleHepMCEx02_s6 Execution
\verbatim
% HepMCEx02 hepmc_pygen.in
\endverbatim
*/
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/HepMCEx02.cc
/// \brief Main program of the eventgenerator/HepMC/HepMCEx02 example
//
//
//
//
/// \file HepMCEx02.cc
/// \brief Main program of the HepMC/HepMCEx02 example
// --------------------------------------------------------------
// GEANT 4 - example of HepMC-interface
// --------------------------------------------------------------
@@ -1,18 +1,12 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
HepMCEx02
---------
\page ExampleHepMCEx02 Example HepMCEx02
This example demonstrates how to interface primary particles in Geant4
with various event generators via the HepMC Monte Carlo event interface.
This is another example having the same generator action as HepMCEx01,
This is another example having the same generator action as
[HepMCEx01](../../html_HepMCEx01/html/ExampleHepMCEx01.html),
but much simpler user control.
1. Primary Generator
## Primary Generator
H02PrimaryGeneratorAction has HepMCG4Interface as the generator.
There are two types of generators provided as samples. One generator reads
@@ -20,7 +14,7 @@ primary information from a HepMC Ascii file (data/example_MyPythia.dat).
The other one generates primaries directly invoking PYTHIA routines
in every event.
2. Geometry
## Geometry
A simplified collider-type geometry, which consists of
- endcap calorimeter (a set of tubes filled with lead),
@@ -30,19 +24,19 @@ in every event.
- uniform magnetic field along the z axis of 3 Tesla at the
central region.
3. Physics List
## Physics List
FTFP_BERT predefined physics list
4. User actions
## User actions
All particles except muons are killed in the calorimeter section.
5. Installation
See HepMC/README how to build this example.
## Installation
6. Execution
% HepMCEx02 hepmc_pygen.in
See ["eventgenerator/HepMC" page](../../html/Examples_HepMC.html) how to build this example.
## Execution
```
% /HepMCEx02 hepmc_pygen.in
```
@@ -23,8 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
//////////////////////////////////////////////////////////////////////////
/// \file example_MyPythia.cxx
/// \brief Main program of the HepMCEx02/data example
// Matt.Dobbs@Cern.CH, December 1999
// November 2000, updated to use Pythia 6.1
// example of generating events with Pythia
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02DetectorConstruction.hh
/// \file H02DetectorConstruction.hh
/// \brief Definition of the H02DetectorConstruction class
//
//
#ifndef H02_DETECTOR_CONSTRUCTION_H
#define H02_DETECTOR_CONSTRUCTION_H
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02EventAction.hh
/// \file H02EventAction.hh
/// \brief Definition of the H02EventAction class
//
//
#ifndef H02_EVENT_ACTION_H
#define H02_EVENT_ACTION_H
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02Field.hh
/// \file H02Field.hh
/// \brief Definition of the H02Field class
//
//
#ifndef H02_FIELD_H
#define H02_FIELD_H
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02MuonHit.hh
/// \file H02MuonHit.hh
/// \brief Definition of the H02MuonHit class
//
//
#ifndef H02_MUON_HIT_H
#define H02_MUON_HIT_H
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02MuonSD.hh
/// \file H02MuonSD.hh
/// \brief Definition of the H02MuonSD class
//
//
#ifndef H02_MUON_SD_H
#define H02_MUON_SD_H
@@ -23,9 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02PrimaryGeneratorAction.hh
/// \file H02PrimaryGeneratorAction.hh
/// \brief Definition of the H02PrimaryGeneratorAction class
//
// ====================================================================
//
// H02PrimaryGeneratorAction.hh
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02PrimaryGeneratorMessenger.hh
/// \file H02PrimaryGeneratorMessenger.hh
/// \brief Definition of the H02PrimaryGeneratorMessenger class
//
//
#ifndef H02_PRIMARY_GENERATOR_MESSENGER_H
#define H02_PRIMARY_GENERATOR_MESSENGER_H
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/include/H02SteppingAction.hh
/// \file H02SteppingAction.hh
/// \brief Definition of the H02SteppingAction class
//
//
#ifndef H02_STEPPING_ACTION_H
#define H02_STEPPING_ACTION_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4AsciiReader.hh
/// \file HepMCG4AsciiReader.hh
/// \brief Definition of the HepMCG4AsciiReader class
//
//
#ifndef HEPMC_G4_ASCII_READER_H
#define HEPMC_G4_ASCII_READER_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4AsciiReaderMessenger.hh
/// \file HepMCG4AsciiReaderMessenger.hh
/// \brief Definition of the HepMCG4AsciiReaderMessenger class
//
//
#ifndef HEPMC_G4_ASCII_READER_MESSENGER_H
#define HEPMC_G4_ASCII_READER_MESSENGER_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4Interface.hh
/// \file HepMCG4Interface.hh
/// \brief Definition of the HepMCG4Interface class
//
//
#ifndef HEPMC_G4_INTERFACE_H
#define HEPMC_G4_INTERFACE_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4PythiaInterface.hh
/// \file HepMCG4PythiaInterface.hh
/// \brief Definition of the HepMCG4PythiaInterface class
//
//
#ifndef HEPMC_G4_PYTHIA_INTERFACE_H
#define HEPMC_G4_PYTHIA_INTERFACE_H
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/include/HepMCG4PythiaMessenger.hh
/// \file HepMCG4PythiaMessenger.hh
/// \brief Definition of the HepMCG4PythiaMessenger class
//
//
#ifndef HEPMC_G4_PYTHIA_MESSENGER_H
#define HEPMC_G4_PYTHIA_MESSENGER_H
@@ -23,9 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02DetectorConstruction.cc
/// \file H02DetectorConstruction.cc
/// \brief Implementation of the H02DetectorConstruction class
//
#include "H02DetectorConstruction.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02EventAction.cc
/// \file H02EventAction.cc
/// \brief Implementation of the H02EventAction class
//
//
#include "H02EventAction.hh"
@@ -23,9 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02Field.cc
/// \file H02Field.cc
/// \brief Implementation of the H02Field class
//
// H02Field.hh
//
#include "H02Field.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02MuonHit.cc
/// \file H02MuonHit.cc
/// \brief Implementation of the H02MuonHit class
//
//
#include "H02MuonHit.hh"
#include "G4Circle.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02MuonSD.cc
/// \file H02MuonSD.cc
/// \brief Implementation of the H02MuonSD class
//
//
#include "H02MuonSD.hh"
#include "H02MuonHit.hh"
@@ -23,9 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02PrimaryGeneratorAction.cc
/// \file H02PrimaryGeneratorAction.cc
/// \brief Implementation of the H02PrimaryGeneratorAction class
//
#include "H02PrimaryGeneratorAction.hh"
#include "H02PrimaryGeneratorMessenger.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02PrimaryGeneratorMessenger.cc
/// \file H02PrimaryGeneratorMessenger.cc
/// \brief Implementation of the H02PrimaryGeneratorMessenger class
//
//
#include "H02PrimaryGeneratorMessenger.hh"
#include "H02PrimaryGeneratorAction.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/H02SteppingAction.cc
/// \file H02SteppingAction.cc
/// \brief Implementation of the H02SteppingAction class
//
//
#include "H02SteppingAction.hh"
#include "G4ParticleDefinition.hh"
@@ -23,9 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx02/src/HEPEvtcom.cc
/// \file HEPEvtcom.cc
/// \brief Implementation of the HEPEvtcom class
//
// ======================================================================
// PARAMETER (NMXHEP=4000)
// COMMON/HEPEVT/NEVHEP,NHEP,ISTHEP(NMXHEP),IDHEP(NMXHEP),
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4AsciiReader.cc
/// \file HepMCG4AsciiReader.cc
/// \brief Implementation of the HepMCG4AsciiReader class
//
//
#include "HepMCG4AsciiReader.hh"
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4AsciiReaderMessenger.cc
/// \file HepMCG4AsciiReaderMessenger.cc
/// \brief Implementation of the HepMCG4AsciiReaderMessenger class
//
//
#include "HepMCG4AsciiReaderMessenger.hh"
#include "HepMCG4AsciiReader.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4Interface.cc
/// \file HepMCG4Interface.cc
/// \brief Implementation of the HepMCG4Interface class
//
//
#include "HepMCG4Interface.hh"
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4PythiaInterface.cc
/// \file HepMCG4PythiaInterface.cc
/// \brief Implementation of the HepMCG4PythiaInterface class
//
//
#ifdef G4LIB_USE_PYTHIA
@@ -23,10 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/HepMCEx01/src/HepMCG4PythiaMessenger.cc
/// \file HepMCG4PythiaMessenger.cc
/// \brief Implementation of the HepMCG4PythiaMessenger class
//
//
#ifdef G4LIB_USE_PYTHIA
@@ -1,165 +0,0 @@
-------------------------------------------------------------------
=========================================================
Geant4 - an Object-Oriented Toolkit for Simulation in HEP
=========================================================
MCTRUTH using HepMC
-------------------
This example demonstrates a mechanism for Monte Carlo truth handling
using HepMC as the event record. The user does not interact directly
with the HepMC classes but with the MCTruthManager class which takes
care with storing all the necessary information about particles,
vertices and relations between them. A specialized tracking action is
used to test whether given particle is to be stored or not. The
decision criteria for storing particle are configurable via the
MCTruthConfig class.
HOW TO BUILD THE EXAMPLE ?
- if you do not have it yet, install HepMC event record (tested with version 2.06.08)
- set HEPMC_ROOT_DIR variable to point to the directory where HepMC is installed;
if the HepMC is installed in your system directory (/usr/local) you do not need to set anything
- run the CMake configuration and build mctruthex target in your build directory
- execute the application:
% your_binary_directory/mctruthex
DESCRIPTION OF THE MCTRUTH HANDLING MECHANISM
The main element of the MC truth handling machinery is the
MCTruthManager class. This class is responsible for all the
interaction with the HepMC event and does not depend on Geant4. It is
a singleton, therefore it is guaranteed to be instanciated only once
and the static 'GetInstance' method allows to access it from anywhere
in the code. It contains methods like 'NewEvent' to start a new event,
'AddParticle' to add particle to the current event, as well as
'PrintEvent' for the purpose of the debugging. The core of the
algorithm which deals with building up the MC truth event tree within
the HepMC event is implemented in AddParticle method.
The AddParticle method is called with the following arguments:
four-momentum, production position and 'end' position of the particle,
PDG code of the particle, as well as the particle ID (unique identifier,
as we will see later, corresponding to Geant4 TrackID) and the ID of
the mother. Finally, there is a boolean flag specifying whether the
direct mother of the given particle has been stored, or not.
The first step, which always takes place, is to instanciate a new
HepMC::GenParticle with the barcode corresponding to particle ID, as
well as to instanciate a new HepMC::GenVertex which will represent the
'end' vertex of the particle. The barcode of the 'end vertex' is equal
to minus the barcode of the particle.
We can now distinguish several cases:
1) the particle is a primary in the Geant4 language, i.e. its
mother ID is 0
This is the simplest case, we just instanciate a new 'primary'
(without any incoming particles) GenVertex, we add to it the
particle and we put it all in the event. Additionally we store the
ID of the particle in a special vector, where all the IDs of
primary particles will be stored, allowing quick access to each of
the main 'branches' of the event. We return from the method.
2) the particle is not a primary
We use the 'event->barcode_to_particle(motherID)' method to get the
pointer to its mother.
We check if the 'end vertex' of the mother corresponds to the
'production vertex' of the particle in question.
2.1) If the two vertices do match, we attach the new particle to
the 'end vertex' of the mother. We return from the method.
2.2) If the two vertices do not match, i.e. the new particle is not
a product of the 'end vertex' of the mother particle, we can
have two cases:
2.2.1) The boolean flag says that the direct mother of the
particle has _not_ been stored. This means that the
particle has been 'adopted' by one of its ancestors, or
in other words, the mother ID of the particle does not
correspond to its direct mother (so clearly the
vertices cannot match). This for instance could happen
if we decided not to store gamma coming from pi0 decay
but did decide to store e+/- coming from the gamma
conversion (so the gamma between pi0 and e+/- was
missing). In such a case we instanciate (or use one of
the existing ones, if vertices match) a 'dummy'
particle (with pdg = -999999) which then acts as the
link between the 'adopted' particle and the
(non-direct) mother. In such a way, the navigability up
in the event is still possible, but in the same time,
we can clearly see that the link is not a direct
one. We return from the method.
2.2.2) The boolean flag says that direct mother of the
particle _has_ been stored. Taking into account that
the vertices do not match, it can mean only one
thing. The new particle has been produced 'on the
flight', i.e. somewhere 'before' the 'end vertex' of
the mother. This can be the case, for instace, for
delta electrons, bremsstrahlung gammas, etc. In such a
situation, we 'split' the mother particle in two
particles and create a new vertex from which the
secondary will be going out. The complication, however,
arises when we have more than one generated 'on the
flight' particle attached to the same mother. In such a
case, for each secondary we need to locate the right
'segment' of the mother particle (i.e. we need to find
between which two vertices we need to add a new
one). To keep track of those segmentations we introduce
a map where each particle ID we map into the number of
existing segments (in the normal case one). Each new
'segment' gets barcode equal to the barcode of the
original particle + N*10000000, where N is the segment
number. In such a way, one can easily follow the
'segmentation' (if any) of each particle. We return
from the method.
This concludes the description of MCTruthManager. The MCTruthConfig
class is a collection of criteria (minimal energy, PDG, creator
process, etc) that we want to apply when deciding whether to store or
not given particle. These values are used by the
'MCTruthTrackingAction' which we describe below. This class can
certainly be extended with other members.
The actual Geant4-dependent part of the MCTruth handling machinery
consists of a few 'G4 user actions' as well as an implementation of
G4VUserTrackInformation. The later one is, for the moment, used only
to store one boolean flag indicating whether the direct mother of the
given track has been stored or not.
The first user action is MCTruthEventAction which is only reponsible
for calling MCTruthManager::GetInstance()->NewEvent() at the beginning
of each event. It can also be used for printing out events for the
purpose of debugging.
The actual 'decision making' concerning which particle to store is
done in MCTruthTrackingAction. At the end of each track the method
trackToBeStored(track) is called to check for various characteristics
of the particle. These, for instance can be energy, particle ID,
creator process, etc.
If the particle satisfies the conditions the
MCTruthManager::GetInstance()->AddParticle is called and all the
procedure described above is performed. The important element here is
that the Geant4 TrackID is used as the unique particle ID in
MCTruthManager and eventually as the barcode of the
HepMC::GenParticle.
If the particle does not qualify to be stored, there are two actions
performed. First the 'ParentID' of the _daughters_ is set to the
'ParentID' of the currenly processed particle. In other words, the
'ParentID' of the daughters is set to the ID of the last stored
particle. Second, the 'directParent' flag from MCTruthTrackInformation
of the __daughters__ is set to FALSE. In such a way, one is still able
to navigate up in the event (to get the ancestors of the particle),
but in the same time, the particle is flagged as 'not having direct
parent'.
@@ -1,8 +1,4 @@
///\file "eventgenerator/HepMC/MCTruth/.README.txt"
///\brief Example MCTruth README page
/*! \page ExampleMCTruth Example MCTruth
\page ExampleMCTruth Example MCTruth
MCTRUTH using HepMC
@@ -15,7 +11,7 @@ used to test whether given particle is to be stored or not. The
decision criteria for storing particle are configurable via the
MCTruthConfig class.
\section ExampleMCTruth_s1 HOW TO BUILD THE EXAMPLE ?
## HOW TO BUILD THE EXAMPLE ?
- if you do not have it yet, install HepMC event record (tested with version 2.06.08)
@@ -25,11 +21,11 @@ MCTruthConfig class.
- run the CMake configuration and build mctruthex target in your build directory
- execute the application:
\verbatim
% your_binary_directory/mctruthex
\endverbatim
```
% ./mctruthex
```
\section ExampleMCTruth_s2 DESCRIPTION OF THE MCTRUTH HANDLING MECHANISM
## DESCRIPTION OF THE MCTRUTH HANDLING MECHANISM
The main element of the MC truth handling machinery is the
MCTruthManager class. This class is responsible for all the
@@ -164,5 +160,3 @@ of the __daughters__ is set to FALSE. In such a way, one is still able
to navigate up in the event (to get the ancestors of the particle),
but in the same time, the particle is flagged as 'not having direct
parent'.
*/
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/DetectorConstruction.hh
/// \file DetectorConstruction.hh
/// \brief Definition of the DetectorConstruction class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - DetectorConstruction class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/MCTruthConfig.hh
/// \file MCTruthConfig.hh
/// \brief Definition of the MCTruthConfig class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - MCTruthConfig class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/MCTruthEventAction.hh
/// \file MCTruthEventAction.hh
/// \brief Definition of the MCTruthEventAction class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - MCTruthEventAction class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/MCTruthManager.hh
/// \file MCTruthManager.hh
/// \brief Definition of the MCTruthManager class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - MCTruthManager class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/MCTruthTrackInformation.hh
/// \file MCTruthTrackInformation.hh
/// \brief Definition of the MCTruthTrackInformation class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - MCTruthTrackInformation class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/MCTruthTrackingAction.hh
/// \file MCTruthTrackingAction.hh
/// \brief Definition of the MCTruthTrackingAction class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - MCTruthTrackingAction class
// --------------------------------------------------------------
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/include/PrimaryGeneratorAction.hh
/// \file PrimaryGeneratorAction.hh
/// \brief Definition of the PrimaryGeneratorAction class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - PrimaryGeneratorAction class
// --------------------------------------------------------------
@@ -23,10 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/mctruthex.cc
/// \brief Main program of the eventgenerator/HepMC/MCTruth example
//
//
/// \file mctruthex.cc
/// \brief Main program of the HepMC/MCTruth example
#include "DetectorConstruction.hh"
#include "FTFP_BERT.hh"
#include "MCTruthEventAction.hh"
@@ -23,12 +23,9 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
/// \file eventgenerator/HepMC/MCTruth/src/DetectorConstruction.cc
/// \file DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
//
//
//
// --------------------------------------------------------------
// GEANT 4 - DetectorConstruction class
// --------------------------------------------------------------

Some files were not shown because too many files have changed in this diff Show More