herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ConstituentReshuffler.h
1// -*- C++ -*-
2//
3// ConstituentReshuffler.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_ConstituentReshuffler_H
10#define HERWIG_ConstituentReshuffler_H
11//
12// This is the declaration of the ConstituentReshuffler class.
13//
14
15#include "ThePEG/Handlers/HandlerBase.h"
16#include "ThePEG/Utilities/Exception.h"
17#include "Herwig/Shower/PerturbativeProcess.h"
18#include "Herwig/Utilities/Reshuffler.h"
19
20namespace Herwig {
21
22using namespace ThePEG;
23
34
35public:
36
45 void reshuffle(PList& out,
46 PPair& in,
47 PList& intermediates,
48 const bool decay,
49 PList& decayPartons,
50 PList& decayRecoilers);
51
60 void reshuffle(PList& out,
61 PPair& in,
62 PList& intermediates,
63 const bool decay=false) {
64
65 PList decayPartons;
66 PList decayRecoilers;
67
68 reshuffle(out,
69 in,
70 intermediates,
71 decay,
72 decayPartons,
73 decayRecoilers);
74 }
75
76
86 PList& eventOutgoing,
87 PList& eventHard,
88 PPair& eventIncoming,
89 PList& eventIntermediates) ;
90
98 void decayReshuffle(PerturbativeProcessPtr& decayProc,
99 PList& eventOutgoing,
100 PList& eventHard,
101 PList& eventIntermediates) ;
102
107 void updateEvent( PList& intermediates,
108 PList& eventIntermediates,
109 PList& out,
110 PList& eventOutgoing,
111 PList& eventHard,
112 PerturbativeProcessPtr decayProc = PerturbativeProcessPtr() ) ;
113
114
120 void updateSpinInfo( PPtr& oldPart,
121 PPtr& newPart ) ;
122
123protected:
124
131
132 DecayReshuffleEquation (Energy q,
133 PList::iterator m_begin,
134 PList::iterator m_end,
135 PList::iterator n_begin,
136 PList::iterator n_end)
137 : w(q), p_begin(m_begin), p_end(m_end), r_begin(n_begin), r_end(n_end) {}
138
139 typedef double ArgType;
140 typedef double ValType;
141
142 static double aUnit() { return 1.; }
143 static double vUnit() { return 1.; }
144
145 Energy w;
146
147 PList::iterator p_begin;
148 PList::iterator p_end;
149
150 PList::iterator r_begin;
151 PList::iterator r_end;
152
153 double operator() (double xi) const {
154
155 double r = - w/GeV;
156
157 for (PList::iterator pIt = p_begin; pIt != p_end; ++pIt) {
158 r += sqrt(sqr((**pIt).dataPtr()->constituentMass()) +
159 xi*xi*(sqr((**pIt).momentum().t())-sqr((**pIt).dataPtr()->mass()))) / GeV;
160 }
161
162 for (PList::iterator rIt = r_begin; rIt != r_end; ++rIt) {
163 r += sqrt(sqr((**rIt).momentum().m()) +
164 xi*xi*(sqr((**rIt).momentum().t())-sqr((**rIt).momentum().m()))) / GeV;
165 }
166
167 return r;
168 }
169
170 };
171
172
173
174public:
175
183
189 void persistentInput(PersistentIStream & is, int version);
191
198 static void Init();
199
200protected:
201
208 virtual IBPtr clone() const;
209
214 virtual IBPtr fullclone() const;
216
217
218// If needed, insert declarations of virtual function defined in the
219// InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
220
221
222private:
223
229
235
236};
237
238}
239
240#include "ThePEG/Utilities/ClassTraits.h"
241
242namespace ThePEG {
243
248template <>
249struct BaseClassTrait<Herwig::ConstituentReshuffler,1> {
251 typedef HandlerBase NthBase;
252};
253
256template <>
257struct ClassTraits<Herwig::ConstituentReshuffler>
258 : public ClassTraitsBase<Herwig::ConstituentReshuffler> {
260 static string className() { return "Herwig::ConstituentReshuffler"; }
268 static string library() { return "HwDipoleShower.so"; }
269};
270
273}
274
275#endif /* HERWIG_ConstituentReshuffler_H */
The ConstituentReshuffler class implements reshuffling of partons on their nominal mass shell to thei...
void reshuffle(PList &out, PPair &in, PList &intermediates, const bool decay=false)
Reshuffle the outgoing partons to constituent masses.
ConstituentReshuffler & operator=(const ConstituentReshuffler &)=delete
The assignment operator is private and must never be called.
static ClassDescription< ConstituentReshuffler > initConstituentReshuffler
The static object used to initialize the description of this class.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
static void Init()
The standard Init function used to initialize the interfaces.
void updateEvent(PList &intermediates, PList &eventIntermediates, PList &out, PList &eventOutgoing, PList &eventHard, PerturbativeProcessPtr decayProc=PerturbativeProcessPtr())
Update the dipole event record and, if appropriate, the relevant decay process.
void reshuffle(PList &out, PPair &in, PList &intermediates, const bool decay, PList &decayPartons, PList &decayRecoilers)
Reshuffle the outgoing partons to constituent masses.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void hardProcDecayReshuffle(PList &decaying, PList &eventOutgoing, PList &eventHard, PPair &eventIncoming, PList &eventIntermediates)
Reshuffle the outgoing partons following the showering of the initial hard interaction to constituent...
virtual IBPtr clone() const
Make a simple clone of this object.
void updateSpinInfo(PPtr &oldPart, PPtr &newPart)
Update the spinInfo of a particle following reshuffling to take account of the change in momentum.
void decayReshuffle(PerturbativeProcessPtr &decayProc, PList &eventOutgoing, PList &eventHard, PList &eventIntermediates)
Reshuffle the outgoing partons following the showering of a particle decay to constituent masses.
The Reshuffler class implements reshuffling of partons on their nominal mass shell to their constitue...
Definition: Reshuffler.h:29
-*- C++ -*-
pair< PPtr, PPtr > PPair
double sqrt(int x)
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
ThePEG::Ptr< Particle >::pointer PPtr
constexpr auto sqr(const T &x) -> decltype(x *x)
list< PPtr > PList
The function object defining the equation to be solved in the case of separate recoilers TODO - refin...
static string className()
static string library()