cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.3
A generic central exclusive processes event generator
Loading...
Searching...
No Matches
EventHandler.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2023-2024 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef CepGen_EventFilter_EventHandler_h
20#define CepGen_EventFilter_EventHandler_h
21
23
24namespace cepgen {
25 class Event;
26 class RunParameters;
30 class EventHandler : public NamedModule<EventHandler> {
31 public:
32 explicit EventHandler(const ParametersList&);
33 virtual ~EventHandler();
34
36
37 void initialise(const RunParameters&);
38 const RunParameters& runParameters() const;
39
41 template <typename T>
42 T* engine() {
43 return static_cast<T*>(enginePtr());
44 }
45
46 protected:
47 virtual void initialise() = 0;
48 virtual void* enginePtr();
49
50 private:
51 const RunParameters* run_params_{nullptr}; // NOT owning
52 bool initialised_{false};
53 };
54} // namespace cepgen
55
56#endif
Class template for modules interacting with events.
T * engine()
Retrieve the engine object.
virtual void * enginePtr()
Engine object.
static ParametersDescription description()
virtual void initialise()=0
const RunParameters & runParameters() const
List of run parameters.
Base runtime module object.
Definition NamedModule.h:28
A description object for parameters collection.
List of parameters used to start and run the simulation job.
Common namespace for this Monte Carlo generator.