cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EventHandler.cpp
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
22
23namespace cepgen {
25
27 CG_DEBUG("EventHandler") << "Destructor called for '" << name_ << "' event handler.";
28 }
29
31 auto desc = ParametersDescription();
32 desc.setDescription("Unnamed event handler");
33 return desc;
34 }
35
37 if (initialised_)
38 CG_WARNING("EventHandler:initialise") << "Event handler '" << name_ << "' was already initialised.";
39 run_params_ = &params;
40 initialise();
41 initialised_ = true;
42 }
43
45 if (!run_params_)
46 throw CG_FATAL("EventHandler:runParameters") << "Run parameters not yet initialised.";
47 return *run_params_;
48 }
49
51 throw CG_FATAL("EventHandler:enginePtr")
52 << "No engine object declared for event handler with name '" << name_ << "'.";
53 }
54} // namespace cepgen
#define CG_FATAL(mod)
Definition Exception.h:61
#define CG_WARNING(mod)
Definition Message.h:228
#define CG_DEBUG(mod)
Definition Message.h:220
EventHandler(const ParametersList &)
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
const std::string name_
Module unique indexing name.
Definition NamedModule.h:45
A description object for parameters collection.
List of parameters used to start and run the simulation job.
Common namespace for this Monte Carlo generator.