DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
DDG4
src
Geant4PrimaryHandler.cpp
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
14
// Framework include files
15
#include <
DD4hep/Printout.h
>
16
#include <
DD4hep/InstanceCount.h
>
17
#include <
DDG4/Geant4InputHandling.h
>
18
#include <
DDG4/Geant4PrimaryHandler.h
>
19
20
using namespace
dd4hep::sim
;
21
23
Geant4PrimaryHandler::Geant4PrimaryHandler
(
Geant4Context
* ctxt,
const
std::string& nam)
24
:
Geant4GeneratorAction
(ctxt,nam)
25
{
26
InstanceCount::increment
(
this
);
27
declareProperty(
"RejectPDGs"
, m_primaryConfig.m_rejectPDGs);
28
declareProperty(
"ZeroTimePDGs"
, m_primaryConfig.m_zeroTimePDGs);
29
}
30
32
Geant4PrimaryHandler::~Geant4PrimaryHandler
() {
33
InstanceCount::decrement
(
this
);
34
}
35
37
void
Geant4PrimaryHandler::operator()
(G4Event* event) {
38
generatePrimaries
(
this
,
context
(), event);
39
}
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::Geant4PrimaryHandler::~Geant4PrimaryHandler
virtual ~Geant4PrimaryHandler()
Default destructor.
Geant4PrimaryHandler.h
dd4hep::InstanceCount::increment
static void increment(T *)
Increment count according to type information.
Definition:
InstanceCount.h:98
Geant4InputHandling.h
dd4hep::sim::generatePrimaries
int generatePrimaries(const Geant4Action *caller, const Geant4Context *context, G4Event *event)
Generate all primary vertices corresponding to the merged interaction.
Definition:
Geant4InputHandling.cpp:476
dd4hep::InstanceCount::decrement
static void decrement(T *)
Decrement count according to type information.
Definition:
InstanceCount.h:102
dd4hep::sim::Geant4GeneratorAction
Concrete implementation of the Geant4 generator action base class.
Definition:
Geant4GeneratorAction.h:47
dd4hep::sim
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Definition:
Geant4Output2EDM4hep.cpp:49
InstanceCount.h
Printout.h
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 Jan 9 2025 17:18:09 for DD4hep by
1.8.18