cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
EventModifier.cpp
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2019-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/ParametersList.h
"
20
#include "
CepGen/EventFilter/EventModifier.h
"
21
#include "
CepGen/Utils/Message.h
"
22
23
namespace
cepgen
{
24
EventModifier::EventModifier
(
const
ParametersList
& params)
25
:
EventHandler
(params), seed_(steerAs<int, long long>(
"seed"
)), max_trials_(steer<int>(
"maxTrials"
)) {
26
CG_DEBUG
(
"EventModifier:init"
) <<
"\""
<<
name_
<<
"\"-type event modifier built with:\n\t"
27
<<
"* seed = "
<<
seed_
<<
"\n\t"
28
<<
"* maximum trials: "
<<
max_trials_
;
29
}
30
31
void
EventModifier::readStrings
(
const
std::vector<std::string>& params) {
32
if
(params.empty())
33
return
;
34
std::ostringstream os;
35
for
(
const
auto
& p : params) {
36
readString
(p);
37
os <<
"\n\t '"
<< p <<
"'"
;
38
}
39
CG_DEBUG
(
"EventModifier:configure"
) <<
"Feeding \""
<<
name_
<<
"\" event modifier algorithm with:"
<< os.str();
40
}
41
42
ParametersDescription
EventModifier::description
() {
43
auto
desc =
EventHandler::description
();
44
desc.add<
int
>(
"seed"
, -1).setDescription(
"Random number generator seed"
);
45
desc.add<
int
>(
"maxTrials"
, 1)
46
.setDescription(
47
"Maximum number of attempts to modify the event"
48
" before giving up and returning a zero-weight"
);
49
return
desc;
50
}
51
}
// namespace cepgen
EventModifier.h
Message.h
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
ParametersList.h
cepgen::EventHandler
Class template for modules interacting with events.
Definition
EventHandler.h:30
cepgen::EventHandler::description
static ParametersDescription description()
Definition
EventHandler.cpp:30
cepgen::EventModifier::readStrings
virtual void readStrings(const std::vector< std::string > &)
Parse a list of configuration strings.
Definition
EventModifier.cpp:31
cepgen::EventModifier::readString
virtual void readString(const std::string &)
Parse a configuration string.
Definition
EventModifier.h:39
cepgen::EventModifier::EventModifier
EventModifier(const ParametersList &)
Default constructor for an undefined modifier.
Definition
EventModifier.cpp:24
cepgen::EventModifier::max_trials_
unsigned short max_trials_
Maximal number of trials for the algorithm.
Definition
EventModifier.h:52
cepgen::EventModifier::description
static ParametersDescription description()
Definition
EventModifier.cpp:42
cepgen::EventModifier::seed_
long long seed_
Random numbers generator seed fed to the algorithm.
Definition
EventModifier.h:51
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
Common namespace for this Monte Carlo generator.
Definition
CommandLineHandler.cpp:36
CepGen
EventFilter
EventModifier.cpp
Generated on Mon Jul 29 2024 for CepGen by
1.9.7