forked from celeritas-project/celeritas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HepMC3PrimaryGeneratorAction.cc
42 lines (36 loc) · 1.29 KB
/
HepMC3PrimaryGeneratorAction.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//----------------------------------*-C++-*----------------------------------//
// Copyright 2022-2023 UT-Battelle, LLC, and other Celeritas developers.
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//---------------------------------------------------------------------------//
//! \file celer-g4/HepMC3PrimaryGeneratorAction.cc
//---------------------------------------------------------------------------//
#include "HepMC3PrimaryGeneratorAction.hh"
#include <G4Event.hh>
#include "corecel/Macros.hh"
#include "accel/HepMC3PrimaryGenerator.hh"
#include "GlobalSetup.hh"
namespace celeritas
{
namespace app
{
//---------------------------------------------------------------------------//
/*!
* Construct from a shared generator.
*/
HepMC3PrimaryGeneratorAction::HepMC3PrimaryGeneratorAction(SPGenerator gen)
: generator_{std::move(gen)}
{
CELER_EXPECT(generator_);
}
//---------------------------------------------------------------------------//
/*!
* Generate primaries from HepMC3 input file.
*/
void HepMC3PrimaryGeneratorAction::GeneratePrimaries(G4Event* event)
{
generator_->GeneratePrimaryVertex(event);
}
//---------------------------------------------------------------------------//
} // namespace app
} // namespace celeritas