LDMX Software
PrimaryGenerator.h
Go to the documentation of this file.
1
6#ifndef SIMCORE_PRIMARYGENERATOR_H
7#define SIMCORE_PRIMARYGENERATOR_H
8
9/*~~~~~~~~~~~~~~~~*/
10/* C++ StdLib */
11/*~~~~~~~~~~~~~~~~*/
12#include <string>
13
14/*~~~~~~~~~~~~*/
15/* Geant4 */
16/*~~~~~~~~~~~~*/
17#include "G4VPrimaryGenerator.hh"
18
19/*~~~~~~~~~~~~~~~*/
20/* Framework */
21/*~~~~~~~~~~~~~~~*/
22#include "Framework/Configure/Parameters.h"
23#include "Framework/Factory.h"
24#include "Framework/RunHeader.h"
25
26// Forward Declarations
27class G4Event;
28
29namespace simcore {
30
38class PrimaryGenerator : public G4VPrimaryGenerator {
39 public:
45 PrimaryGenerator(const std::string& name,
46 const framework::config::Parameters& parameters);
47
49 std::shared_ptr<PrimaryGenerator>,
50 const std::string&,
52
54 virtual ~PrimaryGenerator() = default;
55
61 virtual void GeneratePrimaryVertex(G4Event*) = 0;
62
69 virtual void RecordConfig(const std::string& id, ldmx::RunHeader& rh) = 0;
70
71 std::string name() { return name_; }
72
73 protected:
75 std::string name_{""};
76}; // PrimaryGenerator
77
78} // namespace simcore
79
87#define DECLARE_GENERATOR(CLASS) \
88 FACTORY_REGISTRATION(simcore::PrimaryGenerator, CLASS)
89
90#endif // SIMCORE_PRIMARYGENERATOR_H
Header holding Factory class and supporting macros.
#define DECLARE_FACTORY_WITH_WAREHOUSE(...)
This macro is used in the public portion of your prototype class declaration.
Definition Factory.h:395
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:57
Interface that defines a simulation primary generator.
virtual ~PrimaryGenerator()=default
Destructor.
virtual void GeneratePrimaryVertex(G4Event *)=0
Generate a Primary Vertex.
std::string name_
Name of the PrimaryGenerator.
virtual void RecordConfig(const std::string &id, ldmx::RunHeader &rh)=0
Record the configuration of the primary generator into the run header.
PrimaryGenerator(const std::string &name, const framework::config::Parameters &parameters)
Constructor.
Dynamically loadable photonuclear models either from SimCore or external libraries implementing this ...