Herwig 7 is hosted by Hepforge, IPPP Durham
Herwig  7.1.0
DipoleEventRecord.h
1 // -*- C++ -*-
2 //
3 // DipoleEventRecord.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2017 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_DipoleEventRecord_H
10 #define HERWIG_DipoleEventRecord_H
11 //
12 // This is the declaration of the DipoleEventRecord class.
13 //
14 
15 #include "Herwig/Shower/ShowerEventRecord.h"
16 #include "Herwig/Shower/PerturbativeProcess.h"
17 #include "ThePEG/PDF/PDF.h"
18 #include "Dipole.h"
19 #include "DipoleChain.h"
20 
21 namespace Herwig {
22 
23 using namespace ThePEG;
24 
33  : public DipoleSplittingInfo {
34 
35 public:
36 
41  : DipoleSplittingInfo() {}
42 
46  list<DipoleChain>::iterator emitterChain() const { return theEmitterChain; }
47 
51  list<Dipole>::iterator emitterDipole() const { return theEmitterDipole; }
52 
56  list<DipoleChain>::iterator spectatorChain() const { return theSpectatorChain; }
57 
61  list<Dipole>::iterator spectatorDipole() const { return theSpectatorDipole; }
62 
66  Energy startScale() const { return theStartScale; }
67 
71  void emitterChain(list<DipoleChain>::iterator it) { theEmitterChain = it; }
72 
76  void emitterDipole(list<Dipole>::iterator it) { theEmitterDipole = it; }
77 
81  void spectatorChain(list<DipoleChain>::iterator it) { theSpectatorChain = it; }
82 
86  void spectatorDipole(list<Dipole>::iterator it) { theSpectatorDipole = it; }
87 
91  void startScale(Energy s) { theStartScale = s; }
92 
93 private:
94 
98  list<DipoleChain>::iterator theEmitterChain;
99 
103  list<Dipole>::iterator theEmitterDipole;
104 
108  list<DipoleChain>::iterator theSpectatorChain;
109 
113  list<Dipole>::iterator theSpectatorDipole;
114 
119 
120 };
121 
130 
131 public:
132 
137 
141  ~DipoleEventRecord() { clear(); }
142 
143 public:
144 
149  PList& hard() { return theHard; }
150 
155  const PList& hard() const { return theHard; }
156 
160  const Lorentz5Momentum& pX() const { return thePX; }
161 
166  void transform(const SpinOneLorentzRotation& rot);
167 
168 public:
169 
173  const list<DipoleChain>& chains() const { return theChains; }
174 
178  list<DipoleChain>& chains() { return theChains; }
179 
183  const list<DipoleChain>& doneChains() const { return theDoneChains; }
184 
188  list<DipoleChain>& doneChains() { return theDoneChains; }
189 
194  bool haveChain() const { return !theChains.empty(); }
195 
199  DipoleChain& currentChain() { assert(haveChain()); return theChains.front(); }
200 
204  void popChain();
205 
209  void popChain(list<DipoleChain>::iterator);
210 
214  void popChains(const list<list<DipoleChain>::iterator>&);
215 
220  DipoleIndex
221  mergeIndex(list<Dipole>::iterator firstDipole, const pair<bool,bool>& whichFirst,
222  list<Dipole>::iterator secondDipole, const pair<bool,bool>& whichSecond) const;
223 
229  mergeSplittingInfo(list<DipoleChain>::iterator firstChain, list<Dipole>::iterator firstDipole,
230  const pair<bool,bool>& whichFirst,
231  list<DipoleChain>::iterator secondChain, list<Dipole>::iterator secondDipole,
232  const pair<bool,bool>& whichSecond) const;
233 
237  void getSubleadingSplittings(list<SubleadingSplittingInfo>&);
238 
239 public:
240 
248  void split(list<Dipole>::iterator dip,
249  DipoleSplittingInfo& dsplit,
250  pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
251  DipoleChain*& firstChain, DipoleChain*& secondChain) {
252  split(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
253  }
254 
263  void split(list<Dipole>::iterator dip,
264  list<DipoleChain>::iterator ch,
265  DipoleSplittingInfo& dsplit,
266  pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
267  DipoleChain*& firstChain, DipoleChain*& secondChain,
268  bool colourSpectator = true);
269 
274  pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
275  DipoleSplittingInfo& dsplit,
276  pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
277  DipoleChain*& firstChain, DipoleChain*& secondChain) {
278  return tmpsplit(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
279  }
280 
284  pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
285  list<DipoleChain>::iterator ch,
286  DipoleSplittingInfo& dsplit,
287  pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
288  DipoleChain*& firstChain, DipoleChain*& secondChain,
289  bool colourSpectator = true);
290 
291 
296  void recoil(list<Dipole>::iterator dip,
297  list<DipoleChain>::iterator ch,
298  DipoleSplittingInfo& dsplit);
299 
303  void splitSubleading(SubleadingSplittingInfo& dsplit,
304  pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
305  DipoleChain*& firstChain, DipoleChain*& secondChain);
306 
311  void update(DipoleSplittingInfo& dsplit);
312 
316  pair<PVector,PVector> tmpupdate(DipoleSplittingInfo& dsplit);
317 
324  list<pair<list<Dipole>::iterator,list<DipoleChain>::iterator> >
325  inDipoles();
326 
330  tPPair fillEventRecord(StepPtr step, bool firstInteraction, bool realigned);
331 
332 public:
333 
338  const map<PPtr,PPtr>& prepare(tSubProPtr subpro,
339  tStdXCombPtr xc,
340  StepPtr step,
341  const pair<PDF,PDF>& pdf,
342  tPPair beam,
343  bool firstInteraction,
344  bool dipoles = true);
349  void slimprepare(tSubProPtr subpro,
350  tStdXCombPtr xc,
351  const pair<PDF,PDF>& pdf,tPPair beam,
352  bool dipoles = true);
353 
358  virtual void clear();
359 
360 public:
361 
365  void debugLastEvent(ostream&) const;
366 
367 public:
368 
372  map<PPtr,PerturbativeProcessPtr> & decays() {return theDecays;}
373 
380  void fillFromDecays(PerturbativeProcessPtr decayProc, vector<PPtr>& original);
381 
389  void separateDecay(PerturbativeProcessPtr decayProc);
390 
394  Energy decay(PPtr incoming, bool& powhegEmission);
395 
400  bool prepareDecay(PerturbativeProcessPtr decayProc);
401 
406  void updateDecayMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
407 
413  void updateDecayChainMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
414 
421  void updateDecays(PerturbativeProcessPtr decayProc, bool iterate = true);
422 
426  PerturbativeProcessPtr currentDecay() {return theCurrentDecay;}
427 
431  void currentDecay(PerturbativeProcessPtr in) {theCurrentDecay=in;}
432 
433 
434  // SW - Changed from protected to public so that functions can be used in DipoleShowerHandler
435 public:
436 
441  void findChains(const PList& ordered, const bool decay = false);
442 
446  PList colourOrdered(PPair & in,PList & out);
447 
448 
449 private:
450 
451  struct getMomentum {
452  const Lorentz5Momentum& operator() (PPtr particle) const {
453  return particle->momentum();
454  }
455  };
456 
460  Lorentz5Momentum thePX;
461 
467 
471  map<PPtr,PPtr> theOriginals;
472 
476  list<DipoleChain> theChains;
477 
481  list<DipoleChain> theDoneChains;
482 
483 private:
484 
488  map<PPtr,PerturbativeProcessPtr> theDecays;
489 
493  PerturbativeProcessPtr theCurrentDecay;
494 };
495 
496 
497 }
498 
499 #endif /* HERWIG_DipoleEventRecord_H */
DipoleChain & currentChain()
Return the current dipole chain.
map< PPtr, PPtr > theOriginals
Map originals to copies.
ThePEG::Ptr< Particle >::pointer PPtr
const PList & hard() const
Return any non-coloured outgoing particles in the current subprocess.
Generalized dipole splitting info to deal with subleading-N splittings.
list< DipoleChain >::iterator theEmitterChain
Iterator of the emitter dipole chain.
void currentDecay(PerturbativeProcessPtr in)
Set current decay process.
void spectatorDipole(list< Dipole >::iterator it)
Set the iterator of the spectator dipole.
PerturbativeProcessPtr currentDecay()
Access current decay process.
list< DipoleChain > & chains()
Access the dipole chains to be showered.
list< DipoleChain >::iterator emitterChain() const
Get the iterator of the emitter dipole chain.
list< Dipole >::iterator theEmitterDipole
Iterator of the emitter dipole.
DipoleIndex is used to index splitting generators for a particular dipole.
void startScale(Energy s)
Set the starting scale.
pair< PVector, PVector > tmpsplit(list< Dipole >::iterator dip, DipoleSplittingInfo &dsplit, pair< list< Dipole >::iterator, list< Dipole >::iterator > &childIterators, DipoleChain *&firstChain, DipoleChain *&secondChain)
As split, but not touching the acctual event record.
list< DipoleChain >::iterator spectatorChain() const
Get the iterator of the spectator dipole chain.
list< DipoleChain > theChains
The dipole chains currently showered.
Energy theStartScale
The starting scale.
void emitterDipole(list< Dipole >::iterator it)
Set the iterator of the emitter dipole.
map< PPtr, PerturbativeProcessPtr > & decays()
Get the decays.
PList theHard
Any non-coloured outgoing particles in the current subprocess.
pair< tPPtr, tPPtr > tPPair
bool haveChain() const
Return true, if there are chains to be showered.
void emitterChain(list< DipoleChain >::iterator it)
Set the iterator of the emitter dipole chain.
list< Dipole >::iterator spectatorDipole() const
Get the iterator of the spectator dipole.
DipoleEventRecord()
The default constructor.
Energy startScale() const
Get the starting scale.
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
const Lorentz5Momentum & pX() const
Return the momentum of the hard system.
pair< PPtr, PPtr > PPair
~DipoleEventRecord()
The default destructor just cleans up.
Here is the documentation of the ShowerEventRecord class.
list< Dipole >::iterator theSpectatorDipole
Iterator of the spectator dipole.
list< DipoleChain > & doneChains()
Access the dipole chains which ceased evolving.
SubleadingSplittingInfo()
Default constructor.
-*- C++ -*-
PList & hard()
Return any non-coloured outgoing particles in the current subprocess.
const list< DipoleChain > & doneChains() const
Return the dipole chains which ceased evolving.
void split(list< Dipole >::iterator dip, DipoleSplittingInfo &dsplit, pair< list< Dipole >::iterator, list< Dipole >::iterator > &childIterators, DipoleChain *&firstChain, DipoleChain *&secondChain)
Split the dipole pointed to by the given iterator.
list< DipoleChain > theDoneChains
The dipole chains which ceased evolving.
The DipoleEventRecord class is used internally by the dipole shower.
map< PPtr, PerturbativeProcessPtr > theDecays
Storage of the particles which need to be decayed.
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
Lorentz5Momentum thePX
The momentum of the hard system.
list< DipoleChain >::iterator theSpectatorChain
Iterator of the spectator dipole chain.
const list< DipoleChain > & chains() const
Return the dipole chains to be showered.
The DipoleChain class is used by the dipole shower to represent a chain of dipoles.
Definition: DipoleChain.h:29
list< Dipole >::iterator emitterDipole() const
Get the iterator of the emitter dipole.
ThePEG::Ptr< Step >::pointer StepPtr
void spectatorChain(list< DipoleChain >::iterator it)
Set the iterator of the spectator dipole chain.
list< PPtr > PList