hej is hosted by Hepforge, IPPP Durham
HEJ 2.2.2
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
ScaleFunction.hh
Go to the documentation of this file.
1
8#pragma once
9
10#include <functional>
11#include <memory>
12#include <string>
13#include <utility>
14#include <vector>
15
16namespace HEJ {
17 class Event;
18
21 public:
23
27 ScaleFunction(std::string name, std::function<double(Event const &)> fun):
28 name_{std::move(name)},
29 fun_{std::move(fun)}
30 {}
31
33 std::string const & name() const {
34 return name_;
35 }
36
38 double operator()(Event const & ev) const {
39 return fun_(ev);
40 }
41
42 private:
43 friend ScaleFunction operator*(double factor, ScaleFunction base_scale);
44 friend ScaleFunction operator/(ScaleFunction base_scale, double denom);
47
48 std::string name_;
49 std::function<double(Event const &)> fun_;
50 };
51
53
57 ScaleFunction operator*(double factor, ScaleFunction base_scale);
59
65
69 ScaleFunction operator/(ScaleFunction base_scale, double denom);
71
76
78
82 double H_T(Event const & /*ev*/);
84 double max_jet_pt(Event const & /*ev*/);
86 double jet_invariant_mass(Event const & /*ev*/);
88 double m_j1j2(Event const & /*ev*/);
89
91 class FixedScale {
92 public:
93 explicit FixedScale(double mu): mu_{mu} {}
94 double operator()(Event const & /*unused*/) const {
95 return mu_;
96 }
97 private:
98 double mu_;
99 };
100
101 struct ParameterDescription;
102
105 public:
106 ScaleGenerator() = default;
107
116 template<class ScaleFunIterator, class FactorIterator>
118 ScaleFunIterator scale_functions_begin,
119 ScaleFunIterator scale_functions_end,
120 FactorIterator scale_factors_begin,
121 FactorIterator scale_factors_end,
122 double max_scale_ratio
123 ):
124 scales_(scale_functions_begin, scale_functions_end),
125 scale_factors_(scale_factors_begin, scale_factors_end),
126 max_scale_ratio_{max_scale_ratio}
127 {
128 gen_descriptions();
129 }
130
138 std::vector<ScaleFunction> scales,
139 std::vector<double> scale_factors,
140 double max_scale_ratio
141 ):
142 scales_(std::move(scales)),
143 scale_factors_(std::move(scale_factors)),
144 max_scale_ratio_{max_scale_ratio}
145 {
146 gen_descriptions();
147 }
148
163 Event operator()(Event event) const;
164
165 private:
166 void gen_descriptions();
167
168 std::vector<ScaleFunction> scales_;
169 std::vector<double> scale_factors_;
170 std::vector<std::shared_ptr<ParameterDescription>> descriptions_;
171 double max_scale_ratio_{};
172 };
173
174} // namespace HEJ
An event with clustered jets.
Definition: Event.hh:51
Functor that returns a fixed scale regardless of the input event.
Definition: ScaleFunction.hh:91
double operator()(Event const &) const
Definition: ScaleFunction.hh:94
FixedScale(double mu)
Definition: ScaleFunction.hh:93
Class to calculate the scale associated with an event.
Definition: ScaleFunction.hh:20
double operator()(Event const &ev) const
Calculate the scale associated with an event.
Definition: ScaleFunction.hh:38
friend ScaleFunction operator/(ScaleFunction base_scale, ScaleFunction denom)
Divide a scale choice by a second one.
std::string const & name() const
Name of the scale choice.
Definition: ScaleFunction.hh:33
friend ScaleFunction operator*(double factor, ScaleFunction base_scale)
Multiply a scale choice by a constant factor.
friend ScaleFunction operator/(ScaleFunction base_scale, double denom)
Divide a scale choice by a constant factor.
friend ScaleFunction operator*(ScaleFunction factor, ScaleFunction base_scale)
Multiply a scale choice by a second one.
ScaleFunction(std::string name, std::function< double(Event const &)> fun)
Constructor.
Definition: ScaleFunction.hh:27
Generate combinations of renormalisation and factorisation scales.
Definition: ScaleFunction.hh:104
Event operator()(Event event) const
Adjust event parameters, adding scale variation.
ScaleGenerator()=default
ScaleGenerator(std::vector< ScaleFunction > scales, std::vector< double > scale_factors, double max_scale_ratio)
Constructor.
Definition: ScaleFunction.hh:137
ScaleGenerator(ScaleFunIterator scale_functions_begin, ScaleFunIterator scale_functions_end, FactorIterator scale_factors_begin, FactorIterator scale_factors_end, double max_scale_ratio)
Constructor.
Definition: ScaleFunction.hh:117
Main HEJ 2 Namespace.
Definition: mainpage.dox:1
Parameters< T1 > operator*(Parameters< T1 > a, Parameters< T2 > const &b)
Definition: Parameters.hh:43
Parameters< T1 > operator/(Parameters< T1 > a, Parameters< T2 > const &b)
Definition: Parameters.hh:58
double jet_invariant_mass(Event const &)
The invariant mass of the sum of all jet momenta.
double m_j1j2(Event const &)
Invariant mass of the two hardest jets.
double max_jet_pt(Event const &)
The maximum of all (scalar) jet transverse momentum.
double H_T(Event const &)
Calculate for the input event.