remage
Simulation framework for HPGe-based experiments
Toggle main menu visibility
Loading...
Searching...
No Matches
RMGVVertexGenerator.hh
1
// Copyright (C) 2022 Luigi Pertoldi <https://orcid.org/0000-0002-0467-2571>
2
//
3
// This program is free software: you can redistribute it and/or modify it under
4
// the terms of the GNU Lesser General Public License as published by the Free
5
// Software Foundation, either version 3 of the License, or (at your option) any
6
// later version.
7
//
8
// This program is distributed in the hope that it will be useful, but WITHOUT
9
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11
// details.
12
//
13
// You should have received a copy of the GNU Lesser General Public License
14
// along with this program. If not, see <https://www.gnu.org/licenses/>.
15
16
#ifndef _RMG_V_VERTEX_GENERARTOR_HH_
17
#define _RMG_V_VERTEX_GENERARTOR_HH_
18
19
#include "RMGConfig.hh"
20
#if RMG_HAS_BXDECAY0
21
#include "bxdecay0_g4/vertex_generator_interface.hh"
22
#endif
23
24
#include <memory>
25
26
#include "G4ThreeVector.hh"
27
#include "G4UImessenger.hh"
28
29
class
G4Run
;
37
#if RMG_HAS_BXDECAY0
38
class
RMGVVertexGenerator
:
public
bxdecay0_g4::VertexGeneratorInterface {
39
#else
40
class
RMGVVertexGenerator {
41
#endif
42
43
public
:
44
45
RMGVVertexGenerator(std::string name) : fGeneratorName(name) {}
46
47
virtual
~RMGVVertexGenerator() =
default
;
48
49
RMGVVertexGenerator(RMGVVertexGenerator
const
&) =
delete
;
50
RMGVVertexGenerator& operator=(RMGVVertexGenerator
const
&) =
delete
;
51
RMGVVertexGenerator(RMGVVertexGenerator&&) =
delete
;
52
RMGVVertexGenerator& operator=(RMGVVertexGenerator&&) =
delete
;
53
54
virtual
void
BeginOfRunAction(
const
G4Run
*) {};
55
virtual
void
EndOfRunAction(
const
G4Run
*) {};
56
67
virtual
bool
GenerateVertex
(G4ThreeVector& v) {
68
v = kDummyPrimaryPosition;
69
return
false
;
70
}
71
78
void
SetMaxAttempts
(
int
val) { fMaxAttempts = val; }
84
[[nodiscard]]
int
GetMaxAttempts
()
const
{
return
fMaxAttempts; }
85
86
#if RMG_HAS_BXDECAY0
87
void
ShootVertex(G4ThreeVector& v)
override
{
GenerateVertex
(v); }
88
#endif
89
90
protected
:
91
92
std::string fGeneratorName;
93
int
fMaxAttempts = 100;
94
const
G4ThreeVector kDummyPrimaryPosition = G4ThreeVector(0, 0, 0);
95
96
std::unique_ptr<G4UImessenger> fMessenger;
97
};
98
99
#endif
100
101
// vim: tabstop=2 shiftwidth=2 expandtab
G4Run
RMGVVertexGenerator
Abstract base class for vertex generators.
Definition
RMGVVertexGenerator.hh:40
RMGVVertexGenerator::GetMaxAttempts
int GetMaxAttempts() const
Get the maximum number of attempts for vertex generation.
Definition
RMGVVertexGenerator.hh:84
RMGVVertexGenerator::GenerateVertex
virtual bool GenerateVertex(G4ThreeVector &v)
Generate a primary vertex position.
Definition
RMGVVertexGenerator.hh:67
RMGVVertexGenerator::SetMaxAttempts
void SetMaxAttempts(int val)
Set the maximum number of attempts for vertex generation.
Definition
RMGVVertexGenerator.hh:78
include
RMGVVertexGenerator.hh
Generated by
1.17.0