remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGVGenerator.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_GENERATOR_HH_
17#define _RMG_V_GENERATOR_HH_
18
19#include <memory>
20
21#include "G4ThreeVector.hh"
22#include "G4UImessenger.hh"
23#include "globals.hh"
24
25class G4Event;
26class G4Run;
33class RMGVGenerator {
34
35 public:
36
37 RMGVGenerator() = delete;
38
39 RMGVGenerator(std::string name) : fGeneratorName(name) {};
40
41 virtual ~RMGVGenerator() = default;
42
43 RMGVGenerator(RMGVGenerator const&) = delete;
44 RMGVGenerator& operator=(RMGVGenerator const&) = delete;
45 RMGVGenerator(RMGVGenerator&&) = delete;
46 RMGVGenerator& operator=(RMGVGenerator&&) = delete;
47
53 virtual void BeginOfRunAction(const G4Run*) {};
59 virtual void EndOfRunAction(const G4Run*) {};
60
69 virtual void SetParticlePosition(G4ThreeVector vec) = 0;
78 virtual void GeneratePrimaries(G4Event* event) = 0;
79
80 void SetReportingFrequency(int freq) { fReportingFrequency = freq; }
81 std::string GetGeneratorName() { return fGeneratorName; }
82
83 protected:
84
85 std::string fGeneratorName;
86 std::unique_ptr<G4UImessenger> fMessenger;
87 int fReportingFrequency = 1000;
88};
89
90#endif
91
92// vim: tabstop=2 shiftwidth=2 expandtab
virtual void BeginOfRunAction(const G4Run *)
Called at the beginning of a run.
Definition RMGVGenerator.hh:53
virtual void EndOfRunAction(const G4Run *)
Called at the end of a run.
Definition RMGVGenerator.hh:59
virtual void SetParticlePosition(G4ThreeVector vec)=0
Set the primary vertex position.
virtual void GeneratePrimaries(G4Event *event)=0
Generate primary particles for an event.