herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Reshuffler.h
1// -*- C++ -*-
2//
3// Reshuffler.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4// Copyright (C) 2002-2019 The Herwig Collaboration
5//
6// Herwig is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef HERWIG_Reshuffler_H
10#define HERWIG_Reshuffler_H
11//
12// This is the declaration of the Reshuffler class.
13//
14
16
17namespace Herwig {
18
19using namespace ThePEG;
20
30
31protected:
32
37 template<class PIterator, class MIterator>
39
40 ReshuffleEquation (Energy q,
41 PIterator pp_begin,
42 PIterator pp_end,
43 MIterator mm_begin,
44 MIterator mm_end)
45 : w(q), p_begin(pp_begin), p_end(pp_end),
46 m_begin(mm_begin), m_end(mm_end) {}
47
48 typedef double ArgType;
49 typedef double ValType;
50
51 static double aUnit() { return 1.; }
52 static double vUnit() { return 1.; }
53
54 double operator() (double xi) const {
55 double r = - w/GeV;
56 PIterator p = p_begin;
57 MIterator m = m_begin;
58 for (; p != p_end; ++p, ++m) {
59 r += sqrt(sqr(*m) +
60 xi*xi*(sqr((**p).momentum().t())-sqr((**p).dataPtr()->mass()))) / GeV;
61 }
62 return r;
63 }
64
65 Energy w;
66
67 PIterator p_begin;
68 PIterator p_end;
69
70 MIterator m_begin;
71 MIterator m_end;
72
73 };
74
78 void reshuffle(const PVector& particles,
79 const vector<Energy>& masses) const;
80
81};
82
83}
84
85#endif /* HERWIG_Reshuffler_H */
86
The Reshuffler class implements reshuffling of partons on their nominal mass shell to their constitue...
Definition: Reshuffler.h:29
void reshuffle(const PVector &particles, const vector< Energy > &masses) const
Reshuffle to consitutent masses.
-*- C++ -*-
double sqrt(int x)
vector< PPtr > PVector
constexpr auto sqr(const T &x) -> decltype(x *x)
The function object defining the equation to be solved.
Definition: Reshuffler.h:38