cepgen
is hosted by
Hepforge
,
IPPP Durham
CepGen
1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
cepgenProbeOnePoint.cc
Go to the documentation of this file.
1
/*
2
* CepGen: a central exclusive processes event generator
3
* Copyright (C) 2013-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/RunParameters.h
"
20
#include "
CepGen/Generator.h
"
21
#include "
CepGen/Process/Process.h
"
22
#include "
CepGen/Utils/ArgumentsParser.h
"
23
#include "
CepGen/Utils/Message.h
"
24
25
using namespace
std;
26
27
int
main
(
int
argc,
char
* argv[]) {
28
string
input_card;
29
int
num_scans;
30
using
point_t = vector<double>;
31
point_t user_point;
32
33
const
auto
args =
cepgen::ArgumentsParser
(argc, argv)
34
.
addArgument
(
"input,i"
,
"input card"
, &input_card)
35
.
addOptionalArgument
(
"point,p"
,
"point to test"
, &user_point, point_t(12, 0.3))
36
.
addOptionalArgument
(
"scan,s"
,
"number of values to scan for a non-zero ME"
, &num_scans, 0)
37
.
parse
();
38
39
if
(args.debugging())
40
CG_LOG_LEVEL
(debugInsideLoop);
41
42
cepgen::Generator
gen;
43
gen.
parseRunParameters
(input_card);
44
gen.
runParameters
().
process
().
initialise
();
45
CG_DEBUG
(
"main"
) << gen.
runParameters
();
46
47
const
auto
ndim = gen.
runParameters
().
process
().
ndim
();
48
vector<point_t> points;
49
if
(num_scans > 0) {
50
for
(
const
auto
& range :
cepgen::Limits
{0., 1.}.
generate
(num_scans))
51
points.emplace_back(ndim, range);
52
}
else
53
points = vector<point_t>{user_point};
54
CG_DEBUG
(
"main"
) << points;
55
56
vector<pair<point_t, double> > values;
57
for
(
auto
& point : points) {
58
if
(point.size() < 2)
59
point = point_t(ndim, point[0]);
60
else
if
(point.size() != ndim)
61
point.resize(ndim);
62
const
double
weight = gen.
computePoint
(point);
63
CG_DEBUG
(
"main"
) <<
"point "
<< point <<
": weight="
<< weight;
64
if
(weight > 0.)
65
values.emplace_back(make_pair(point, weight));
66
}
67
CG_LOG
<<
"Points with non-zero values: "
<< values;
68
69
return
0;
70
}
ArgumentsParser.h
Generator.h
CG_LOG_LEVEL
#define CG_LOG_LEVEL(type)
Definition
Logger.h:83
Message.h
CG_LOG
#define CG_LOG
Definition
Message.h:212
CG_DEBUG
#define CG_DEBUG(mod)
Definition
Message.h:220
Process.h
RunParameters.h
cepgen::ArgumentsParser
A generic command line arguments parser.
Definition
ArgumentsParser.h:31
cepgen::ArgumentsParser::addArgument
ArgumentsParser & addArgument(Args &&... args)
Add a parameter required for the parser.
Definition
ArgumentsParser.h:39
cepgen::ArgumentsParser::parse
ArgumentsParser & parse()
Associate command-line arguments to parameters.
Definition
ArgumentsParser.cpp:106
cepgen::ArgumentsParser::addOptionalArgument
ArgumentsParser & addOptionalArgument(Args &&... args)
Add a non-mandatory parameters that can be parsed.
Definition
ArgumentsParser.h:46
cepgen::Generator
Core generator object allowing for process definition, cross section computation, and event generatio...
Definition
Generator.h:48
cepgen::Generator::computePoint
double computePoint(const std::vector< double > &x)
Compute one single point from the total phase space.
Definition
Generator.cpp:90
cepgen::Generator::parseRunParameters
void parseRunParameters(const std::string &)
Read a steering card to populate the run parameters block.
Definition
Generator.cpp:72
cepgen::Generator::runParameters
const RunParameters & runParameters() const
Pointer to the parameters block.
Definition
Generator.cpp:76
cepgen::Limits
Validity interval for a variable.
Definition
Limits.h:28
cepgen::Limits::generate
std::vector< double > generate(size_t num_bins, bool log_scale=false) const
Generate a collection of values from a number of bins.
Definition
Limits.cpp:113
cepgen::RunParameters::process
proc::Process & process()
Process object for cross-section computation/events generation.
Definition
RunParameters.cpp:105
cepgen::proc::Process::initialise
void initialise()
Initialise the process once the kinematics has been set.
Definition
Process.cpp:285
cepgen::proc::Process::ndim
size_t ndim() const
Number of dimensions on which the integration is performed.
Definition
Process.h:60
main
int main()
Definition
pythia6_decay.cc:9
src
utils
cepgenProbeOnePoint.cc
Generated on Mon Jul 29 2024 for CepGen by
1.9.7