hej is hosted by Hepforge, IPPP Durham
HEJ 2  2.0
High energy resummation for hadron colliders
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 
16 namespace HEJ{
17  class Event;
18 
20  class ScaleFunction {
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);
45 
46  std::string name_;
47  std::function<double(Event const &)> fun_;
48  };
49 
51 
55  ScaleFunction operator*(double factor, ScaleFunction base_scale);
57 
61  ScaleFunction operator/(ScaleFunction base_scale, double denom);
62 
64 
68  double H_T(Event const &);
70  double max_jet_pt(Event const &);
72  double jet_invariant_mass(Event const &);
74  double m_j1j2(Event const &);
75 
77  class FixedScale {
78  public:
79  explicit FixedScale(double mu): mu_{mu} {}
80  double operator()(Event const &) const {
81  return mu_;
82  }
83  private:
84  double mu_;
85  };
86 
87  class ParameterDescription;
88 
91  public:
92  ScaleGenerator() = default;
93 
102  template<class ScaleFunIterator, class FactorIterator>
104  ScaleFunIterator scale_functions_begin,
105  ScaleFunIterator scale_functions_end,
106  FactorIterator scale_factors_begin,
107  FactorIterator scale_factors_end,
108  double max_scale_ratio
109  ):
110  scales_(scale_functions_begin, scale_functions_end),
111  scale_factors_(scale_factors_begin, scale_factors_end),
112  max_scale_ratio_{max_scale_ratio}
113  {
114  gen_descriptions();
115  }
116 
124  std::vector<ScaleFunction> scales,
125  std::vector<double> scale_factors,
126  double max_scale_ratio
127  ):
128  scales_(std::move(scales)),
129  scale_factors_(std::move(scale_factors)),
130  max_scale_ratio_{max_scale_ratio}
131  {
132  gen_descriptions();
133  }
134 
149  Event operator()(Event event) const;
150 
151  private:
152  void gen_descriptions();
153 
154  std::vector<ScaleFunction> scales_;
155  std::vector<double> scale_factors_;
156  std::vector<std::shared_ptr<ParameterDescription>> descriptions_;
157  double max_scale_ratio_;
158  };
159 
160 }
Definition: Event.hh:84
Functor that returns a fixed scale regardless of the input event.
Definition: ScaleFunction.hh:77
double operator()(Event const &) const
Definition: ScaleFunction.hh:80
FixedScale(double mu)
Definition: ScaleFunction.hh:79
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
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.
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:90
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:123
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:103
@ mu
Definition: PDG_codes.hh:40
Main HEJ 2 Namespace.
Definition: mainpage.dox:1
double jet_invariant_mass(Event const &)
The invariant mass of the sum of all jet momenta.
ScaleFunction operator*(double factor, ScaleFunction base_scale)
Multiply a scale choice by a constant factor.
double m_j1j2(Event const &)
Invariant mass of the two hardest jets.
ScaleFunction operator/(ScaleFunction base_scale, double denom)
Divide a scale choice by a constant factor.
double max_jet_pt(Event const &)
The maximum of all (scalar) jet transverse momentum.
double H_T(Event const &)
Calculate for the input event.