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
19
#include "
CepGen/Core/Exception.h
"
20
#include "
CepGen/Core/RunParameters.h
"
21
#include "
CepGen/EventFilter/EventHandler.h
"
22
23
namespace
cepgen
{
24
EventHandler::EventHandler
(
const
ParametersList
& params) :
NamedModule
(params) {}
25
26
EventHandler::~EventHandler
() {
27
CG_DEBUG
(
"EventHandler"
) <<
"Destructor called for '"
<<
name_
<<
"' event handler."
;
28
}
29
30
ParametersDescription
EventHandler::description
() {
31
auto
desc =
ParametersDescription
();
32
desc.setDescription(
"Unnamed event handler"
);
33
return
desc;
34
}
35
36
void
EventHandler::initialise
(
const
RunParameters
& params) {
37
if
(initialised_)
38
CG_WARNING
(
"EventHandler:initialise"
) <<
"Event handler '"
<<
name_
<<
"' was already initialised."
;
39
run_params_ = ¶ms;
40
initialise
();
41
initialised_ =
true
;
42
}
43
44
const
RunParameters
&
EventHandler::runParameters
()
const
{
45
if
(!run_params_)
46
throw
CG_FATAL
(
"EventHandler:runParameters"
) <<
"Run parameters not yet initialised."
;
47
return
*run_params_;
48
}
49
50
void
*
EventHandler::enginePtr
() {
51
throw
CG_FATAL
(
"EventHandler:enginePtr"
)
52
<<
"No engine object declared for event handler with name '"
<<
name_
<<
"'."
;
53
}
54
}
// namespace cepgen
EventHandler.h
Exception.h
CG_FATAL
#define CG_FATAL(mod)
Definition
Exception.h:61
CG_WARNING
#define CG_WARNING(mod)
Definition
Message.h:228
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
RunParameters.h
cepgen::EventHandler::EventHandler
EventHandler(const ParametersList &)
Definition
EventHandler.cpp:24
cepgen::EventHandler::enginePtr
virtual void * enginePtr()
Engine object.
Definition
EventHandler.cpp:50
cepgen::EventHandler::description
static ParametersDescription description()
Definition
EventHandler.cpp:30
cepgen::EventHandler::~EventHandler
virtual ~EventHandler()
Definition
EventHandler.cpp:26
cepgen::EventHandler::initialise
virtual void initialise()=0
cepgen::EventHandler::runParameters
const RunParameters & runParameters() const
List of run parameters.
Definition
EventHandler.cpp:44
cepgen::NamedModule
Base runtime module object.
Definition
NamedModule.h:28
cepgen::NamedModule< EventHandler >::name_
const std::string name_
Module unique indexing name.
Definition
NamedModule.h:45
cepgen::ParametersDescription
A description object for parameters collection.
Definition
ParametersDescription.h:26
cepgen::ParametersList
Definition
ParametersList.h:52
cepgen::RunParameters
List of parameters used to start and run the simulation job.
Definition
RunParameters.h:41
cepgen
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
EventFilter
EventHandler.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7