DD4hep
1.35.0
Detector Description Toolkit for High Energy Physics
DDG4
include
DDG4
Geant4PrimaryHandler.h
Go to the documentation of this file.
1
//==========================================================================
2
// AIDA Detector description implementation
3
//--------------------------------------------------------------------------
4
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5
// All rights reserved.
6
//
7
// For the licensing terms see $DD4hepINSTALL/LICENSE.
8
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9
//
10
// Author : M.Frank
11
//
12
//==========================================================================
13
24
#ifndef DDG4_GEANT4PRIMARYHANDLER_H
25
#define DDG4_GEANT4PRIMARYHANDLER_H
26
27
// Framework include files
28
#include <
DDG4/Geant4GeneratorAction.h
>
29
30
// C/C++ include files
31
#include <set>
32
34
namespace
dd4hep
{
35
37
namespace
sim {
39
class
Geant4PrimaryConfig
{
40
public
:
42
std::set<int>
m_rejectPDGs
= {1, 2, 3, 4, 5, 6, 21, 23, 24, 25};
44
std::set<int>
m_zeroTimePDGs
= {11, 13, 15, 17};
47
std::set<int>
m_decayByGeant
= {};
48
49
std::string
toString
()
const
{
50
std::stringstream str;
51
str <<
"\nRejectPDGs: "
;
52
for
(
int
i:
m_rejectPDGs
) { str << i <<
", "
; }
53
str <<
"\nzeroTimePDGs: "
;
54
for
(
int
i:
m_zeroTimePDGs
) { str << i <<
", "
; }
55
str <<
"\nDecayByGeant: "
;
56
for
(
int
i:
m_decayByGeant
) { str << i <<
", "
; }
57
return
str.str();
58
}
59
};
60
62
70
class
Geant4PrimaryHandler
:
public
Geant4GeneratorAction
{
71
public
:
73
Geant4PrimaryHandler
(
Geant4Context
*
context
,
const
std::string& nam);
75
virtual
~Geant4PrimaryHandler
();
77
virtual
void
operator()
(G4Event* event)
override
;
78
79
public
:
80
Geant4PrimaryConfig
m_primaryConfig
{};
81
82
};
83
}
// End namespace sim
84
}
// End namespace dd4hep
85
86
#endif // DDG4_GEANT4PRIMARYHANDLER_H
dd4hep::sim::Geant4PrimaryHandler::operator()
virtual void operator()(G4Event *event) override
Event generation action callback.
dd4hep::sim::Geant4PrimaryHandler::Geant4PrimaryHandler
Geant4PrimaryHandler(Geant4Context *context, const std::string &nam)
Standard constructor.
dd4hep::sim::Geant4PrimaryConfig::m_zeroTimePDGs
std::set< int > m_zeroTimePDGs
particles with these PDG IDs are not passed to geant for simulation if their properTime is zero
Definition:
Geant4PrimaryHandler.h:44
dd4hep::sim::Geant4PrimaryConfig::m_rejectPDGs
std::set< int > m_rejectPDGs
particles with these PDG IDs are not passed to geant for simulation
Definition:
Geant4PrimaryHandler.h:42
dd4hep::sim::Geant4PrimaryHandler::m_primaryConfig
Geant4PrimaryConfig m_primaryConfig
Definition:
Geant4PrimaryHandler.h:80
dd4hep::sim::Geant4PrimaryHandler::~Geant4PrimaryHandler
virtual ~Geant4PrimaryHandler()
Default destructor.
dd4hep::sim::Geant4PrimaryConfig
Geant4PrimaryConfig to hold configuration for PrimaryHandlers.
Definition:
Geant4PrimaryHandler.h:39
dd4hep::sim::Geant4PrimaryConfig::m_decayByGeant
std::set< int > m_decayByGeant
Definition:
Geant4PrimaryHandler.h:47
Geant4PrimaryHandler
Geant4Action to convert the particle information to Geant4.
Geant4GeneratorAction.h
dd4hep::sim::Geant4GeneratorAction
Concrete implementation of the Geant4 generator action base class.
Definition:
Geant4GeneratorAction.h:47
dd4hep::sim::Geant4PrimaryConfig::toString
std::string toString() const
Definition:
Geant4PrimaryHandler.h:49
dd4hep
Namespace for the AIDA detector description toolkit.
Definition:
AlignmentsCalib.h:28
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition:
Geant4Context.h:201
dd4hep::sim::Geant4Action::context
Geant4Context * context() const
Access the context.
Definition:
Geant4Action.h:270
Generated on Tue Feb 10 2026 19:22:39 for DD4hep by
1.8.18