DD4hep
1.30.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};
45
46
std::string
toString
()
const
{
47
std::stringstream str;
48
str <<
"\nRejectPDGs: "
;
49
for
(
int
i:
m_rejectPDGs
) { str << i <<
", "
; }
50
str <<
"\nzeroTimePDGs: "
;
51
for
(
int
i:
m_zeroTimePDGs
) { str << i <<
", "
; }
52
return
str.str();
53
}
54
};
55
57
65
class
Geant4PrimaryHandler
:
public
Geant4GeneratorAction
{
66
public
:
68
Geant4PrimaryHandler
(
Geant4Context
*
context
,
const
std::string& nam);
70
virtual
~Geant4PrimaryHandler
();
72
virtual
void
operator()
(G4Event* event)
override
;
73
74
public
:
75
Geant4PrimaryConfig
m_primaryConfig
{};
76
77
};
78
}
// End namespace sim
79
}
// End namespace dd4hep
80
81
#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:75
dd4hep::sim::Geant4PrimaryHandler::~Geant4PrimaryHandler
virtual ~Geant4PrimaryHandler()
Default destructor.
dd4hep::sim::Geant4PrimaryConfig
Geant4PrimaryConfig to hold configuration for PrimaryHandlers.
Definition:
Geant4PrimaryHandler.h:39
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:46
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 Thu Nov 7 2024 13:31:58 for DD4hep by
1.8.18