LDMX Software
Simulator.h
Go to the documentation of this file.
1
8#ifndef _SIMCORE_SIMULATOR_H_
9#define _SIMCORE_SIMULATOR_H_
10
11/*~~~~~~~~~~~~~~~~*/
12/* C++ StdLib */
13/*~~~~~~~~~~~~~~~~*/
14#include <any>
15#include <map>
16#include <memory>
17#include <string>
18
19/*~~~~~~~~~~~~~~~*/
20/* Framework */
21/*~~~~~~~~~~~~~~~*/
22#include "Framework/Configure/Parameters.h"
24#include "SimCore/ConditionsInterface.h"
25#include "SimCore/DetectorConstruction.h"
26#include "SimCore/RunManager.h"
27#include "SimCore/SimulatorBase.h"
28
29class G4UImanager;
30class G4UIsession;
31class G4RunManager;
32class G4GDMLParser;
33class G4GDMLMessenger;
34class G4CascadeParameters;
35
36namespace simcore {
37
46class Simulator : public SimulatorBase {
47 public:
58 Simulator(const std::string& name, framework::Process& process);
59
64 virtual ~Simulator() = default;
65
72 void configure(framework::config::Parameters& parameters) override;
73
81 void beforeNewRun(ldmx::RunHeader& header) override;
82
89 void onNewRun(const ldmx::RunHeader& header) override;
90
96 virtual void produce(framework::Event& event) override;
97
99 void onProcessEnd() override;
100
101 private:
109 void setSeeds(std::vector<int> seeds);
110
111 private:
114
117
119 int run_{-1};
120};
121} // namespace simcore
122
123#endif /* SIMCORE_SIMULATOR_H */
Base classes for all user event processing components to extend.
Class providing a Geant4 run manager implementation.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
Run-specific configuration and data stored in its own output TTree alongside the event TTree in the o...
Definition RunHeader.h:54
Producer that runs Geant4 simulation inside of ldmx-app.
Definition Simulator.h:46
void configure(framework::config::Parameters &parameters) override
Callback for the processor to configure itself from the given set of parameters.
Definition Simulator.cxx:48
void beforeNewRun(ldmx::RunHeader &header) override
Given a non-const reference to the new RunHeader, we can add parameters from the simulation here befo...
Definition Simulator.cxx:52
void setSeeds(std::vector< int > seeds)
Set the seeds to be used by the Geant4 random engine.
void onNewRun(const ldmx::RunHeader &header) override
Before the run starts (but after the conditions are configured) set up the random seeds for this run.
int numEventsBegan_
Number of events started.
Definition Simulator.h:113
virtual void produce(framework::Event &event) override
Run simulation and export results to output event.
int numEventsCompleted_
Number of events completed.
Definition Simulator.h:116
void onProcessEnd() override
Callback called once processing is complete.
virtual ~Simulator()=default
Destructor.
int run_
the run number (for accessing the run header in onFileClose
Definition Simulator.h:119