herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.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-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_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#include "Herwig/MatrixElement/Matchbox/Utility/DensityOperator.h"
21
22#include <tuple>
23
24namespace Herwig {
25
26using namespace ThePEG;
27
36 : public DipoleSplittingInfo {
37
38public:
39
45
49 list<DipoleChain>::iterator emitterChain() const { return theEmitterChain; }
50
54 list<Dipole>::iterator emitterDipole() const { return theEmitterDipole; }
55
59 list<DipoleChain>::iterator spectatorChain() const { return theSpectatorChain; }
60
64 list<Dipole>::iterator spectatorDipole() const { return theSpectatorDipole; }
65
69 Energy startScale() const { return theStartScale; }
70
74 void emitterChain(list<DipoleChain>::iterator it) { theEmitterChain = it; }
75
79 void emitterDipole(list<Dipole>::iterator it) { theEmitterDipole = it; }
80
84 void spectatorChain(list<DipoleChain>::iterator it) { theSpectatorChain = it; }
85
89 void spectatorDipole(list<Dipole>::iterator it) { theSpectatorDipole = it; }
90
94 void startScale(Energy s) { theStartScale = s; }
95
96private:
97
101 list<DipoleChain>::iterator theEmitterChain;
102
106 list<Dipole>::iterator theEmitterDipole;
107
111 list<DipoleChain>::iterator theSpectatorChain;
112
116 list<Dipole>::iterator theSpectatorDipole;
117
122
123};
124
133
134public:
135
140
145
146public:
147
152 PList& hard() { return theHard; }
153
158 const PList& hard() const { return theHard; }
159
163 const Lorentz5Momentum& pX() const { return thePX; }
164
169
173 const cPDVector& particlesAfter() const { return theParticlesAfter; }
174
179
184
188 vector<Lorentz5Momentum>& momentaAfter() { return theMomentaAfter; }
189
193 const vector<Lorentz5Momentum>& momentaAfter() const { return theMomentaAfter; }
194
198 map<PPtr,size_t>& particleIndices() { return theParticleIndices; }
199
203 const map<PPtr,size_t>& particleIndices() const { return theParticleIndices; }
204
209
214
219 void setSubleadingNc( bool doSub, size_t emissionsLimit ) {
220 doSubleadingNc = doSub;
221 continueSubleadingNc = doSub;
222 subleadingNcEmissionsLimit = emissionsLimit;
223 }
224
229
233 void setDensityOperatorEvolution( int scheme, Energy2 cutoff ) {
235 densityOperatorCutoff = cutoff;
236 }
237
242 double dipoleKernelForEvolution(size_t em, size_t spec,
243 Energy2 pEmitpSpec, Energy2 pEmitpEmis,
244 Energy2 pEmispSpec);
245
251 void transform(const LorentzRotation& rot);
252
253public:
254
258 const list<DipoleChain>& chains() const { return theChains; }
259
263 list<DipoleChain>& chains() { return theChains; }
264
268 const list<DipoleChain>& doneChains() const { return theDoneChains; }
269
273 list<DipoleChain>& doneChains() { return theDoneChains; }
274
279 bool haveChain() const { return !theChains.empty(); }
280
284 DipoleChain& currentChain() { assert(haveChain()); return theChains.front(); }
285
289 void popChain();
290
294 void popChain(list<DipoleChain>::iterator);
295
299 void popChains(const list<list<DipoleChain>::iterator>&);
300
306 mergeIndex(list<Dipole>::iterator firstDipole, const pair<bool,bool>& whichFirst,
307 list<Dipole>::iterator secondDipole, const pair<bool,bool>& whichSecond) const;
308
314 mergeSplittingInfo(list<DipoleChain>::iterator firstChain, list<Dipole>::iterator firstDipole,
315 const pair<bool,bool>& whichFirst,
316 list<DipoleChain>::iterator secondChain, list<Dipole>::iterator secondDipole,
317 const pair<bool,bool>& whichSecond) const;
318
322 void getSubleadingSplittings(list<SubleadingSplittingInfo>&);
323
324public:
325
333 void split(list<Dipole>::iterator dip,
334 DipoleSplittingInfo& dsplit,
335 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
336 DipoleChain*& firstChain, DipoleChain*& secondChain) {
337 split(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
338 }
339
348 void split(list<Dipole>::iterator dip,
349 list<DipoleChain>::iterator ch,
350 DipoleSplittingInfo& dsplit,
351 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
352 DipoleChain*& firstChain, DipoleChain*& secondChain,
353 bool colourSpectator = true);
354
359 pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
360 DipoleSplittingInfo& dsplit,
361 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
362 DipoleChain*& firstChain, DipoleChain*& secondChain) {
363 return tmpsplit(dip,theChains.begin(),dsplit,childIterators,firstChain,secondChain,false);
364 }
365
369 pair<PVector,PVector> tmpsplit(list<Dipole>::iterator dip,
370 list<DipoleChain>::iterator ch,
371 DipoleSplittingInfo& dsplit,
372 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
373 DipoleChain*& firstChain, DipoleChain*& secondChain,
374 bool colourSpectator = true);
375
376
381 void recoil(list<Dipole>::iterator dip,
382 list<DipoleChain>::iterator ch,
383 DipoleSplittingInfo& dsplit);
384
389 pair<list<Dipole>::iterator,list<Dipole>::iterator>& childIterators,
390 DipoleChain*& firstChain, DipoleChain*& secondChain);
391
397
401 pair<PVector,PVector> tmpupdate(DipoleSplittingInfo& dsplit);
402
408
415 list<pair<list<Dipole>::iterator,list<DipoleChain>::iterator> >
417
421 tPPair fillEventRecord(StepPtr step, bool firstInteraction, bool realigned);
422
423public:
424
429 const map<PPtr,PPtr>& prepare(tSubProPtr subpro,
430 tStdXCombPtr xc,
431 StepPtr step,
432 const pair<PDF,PDF>& pdf,
433 tPPair beam,
434 bool firstInteraction,
435 const set<long>& offShellPartons,
436 bool dipoles = true);
442 tStdXCombPtr xc,
443 const pair<PDF,PDF>& pdf,tPPair beam,
444 const set<long>& offShellPartons,
445 bool dipoles = true);
446
451 virtual void clear();
452
458 static set<long> empty;
459 continueSubleadingNc = false;
460 PList cordered = colourOrdered(incoming(),outgoing());
461 findChains(cordered,empty,decay);
462 }
463
464public:
465
469 void debugLastEvent(ostream&) const;
470
471public:
472
476 map<PPtr,PerturbativeProcessPtr> & decays() {return theDecays;}
477
484 void fillFromDecays(PerturbativeProcessPtr decayProc, vector<PPtr>& original);
485
493 void separateDecay(PerturbativeProcessPtr decayProc);
494
498 Energy decay(PPtr incoming, bool& powhegEmission);
499
504 bool prepareDecay(PerturbativeProcessPtr decayProc,
505 const set<long>& offShellPartons);
506
511 void updateDecayMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
512
518 void updateDecayChainMom(PPtr decayParent, PerturbativeProcessPtr decayProc);
519
526 void updateDecays(PerturbativeProcessPtr decayProc, bool iterate = true);
527
531 PerturbativeProcessPtr currentDecay() {return theCurrentDecay;}
532
536 void currentDecay(PerturbativeProcessPtr in) {theCurrentDecay=in;}
537
542 if ( !theNextDecays.empty() )
543 return theNextDecays.back();
544 else
545 return PPtr();
546 }
547
548
549 // SW - Changed from protected to public so that functions can be used in DipoleShowerHandler
550public:
551
556 void findChains(const PList& ordered,
557 const set<long>& offShellpartons,
558 const bool decay = false);
559
564
565
566private:
567
568 struct getMomentum {
569 const Lorentz5Momentum& operator() (PPtr particle) const {
570 return particle->momentum();
571 }
572 };
573
577 Lorentz5Momentum thePX;
578
584
588 map<PPtr,PPtr> theOriginals;
589
593 list<DipoleChain> theChains;
594
598 list<DipoleChain> theDoneChains;
599
604
609
613 vector<Lorentz5Momentum> theMomentaAfter;
614
620 pair<size_t,pair<size_t,size_t> > theEmitterEmissionIndices;
621
625 pair<size_t,size_t> theSpectatorIndices;
626
631
636
642
647
651 size_t subEmDone;
652
653
657 map<PPtr,size_t> theParticleIndices;
658
668
674
683 map<std::tuple<size_t,size_t,size_t>,map<size_t,size_t> > theEmissionsMap;
684
692private:
693
697 map<PPtr,PerturbativeProcessPtr> theDecays;
698
702 PerturbativeProcessPtr theCurrentDecay;
703
713
714};
715
716
717}
718
719#endif /* HERWIG_DipoleEventRecord_H */
Here is the documentation of the DensityOperator class.
The DipoleChain class is used by the dipole shower to represent a chain of dipoles.
Definition: DipoleChain.h:29
The DipoleEventRecord class is used internally by the dipole shower.
void setDensityOperatorEvolution(int scheme, Energy2 cutoff)
Set the scheme and cutoff for the density operator evolution.
void setSubleadingNc(bool doSub, size_t emissionsLimit)
Set the subleading Nc flag and the number of emissions to calculate subleading Nc corrections for.
const Lorentz5Momentum & pX() const
Return the momentum of the hard system.
PList & hard()
Return any non-coloured outgoing particles in the current subprocess.
list< DipoleChain > theDoneChains
The dipole chains which ceased evolving.
cPDVector & particlesAfter()
Return the particles after emission.
vector< Lorentz5Momentum > & momentaAfter()
Return the momenta after emission.
vector< Lorentz5Momentum > theMomentaAfter
Momenta of the particles after emission.
const list< DipoleChain > & doneChains() const
Return the dipole chains which ceased evolving.
pair< size_t, size_t > theSpectatorIndices
Pair of the spectators index before and after emission.
list< pair< list< Dipole >::iterator, list< DipoleChain >::iterator > > inDipoles()
Return the dipole(s) containing the incoming partons after the evolution has ended.
~DipoleEventRecord()
The default destructor just cleans up.
void fillFromDecays(PerturbativeProcessPtr decayProc, vector< PPtr > &original)
Used in DipoleEventRecord::prepare.
const vector< Lorentz5Momentum > & momentaAfter() const
Return the momenta after emission.
PList colourOrdered(PPair &in, PList &out)
Sort the coloured partons into a colour ordered ensemble.
tPPair fillEventRecord(StepPtr step, bool firstInteraction, bool realigned)
Fill the given step and return incoming partons.
void popChains(const list< list< DipoleChain >::iterator > &)
Remove the given chains.
void split(list< Dipole >::iterator dip, list< DipoleChain >::iterator ch, DipoleSplittingInfo &dsplit, pair< list< Dipole >::iterator, list< Dipole >::iterator > &childIterators, DipoleChain *&firstChain, DipoleChain *&secondChain, bool colourSpectator=true)
Split the dipole pointed to by the given iterator in the indicated chain, indicating a splitting with...
const list< DipoleChain > & chains() const
Return the dipole chains to be showered.
void splitSubleading(SubleadingSplittingInfo &dsplit, pair< list< Dipole >::iterator, list< Dipole >::iterator > &childIterators, DipoleChain *&firstChain, DipoleChain *&secondChain)
Peform a subleading-N splitting.
void currentDecay(PerturbativeProcessPtr in)
Set current decay process.
PerturbativeProcessPtr currentDecay()
Access current decay process.
const DensityOperator & densityOperator() const
Return the density operator.
pair< size_t, pair< size_t, size_t > > theEmitterEmissionIndices
Pair of the emitters index before emission and both the emitters and the emissions indices after emis...
bool continueSubleadingNc
Flag to keep track of when to stop calculating colour matrix element corrections.
const map< PPtr, PPtr > & prepare(tSubProPtr subpro, tStdXCombPtr xc, StepPtr step, const pair< PDF, PDF > &pdf, tPPair beam, bool firstInteraction, const set< long > &offShellPartons, bool dipoles=true)
Prepare the event record for the given subprocess.
map< PPtr, size_t > & particleIndices()
Return the dictionary for the particles.
size_t subEmDone
Current number of subleading emissions.
list< DipoleChain > theChains
The dipole chains currently showered.
PPtr nextDecay()
Return the next particle to be decayed.
bool getContinueSubleadingNc() const
Get the continue subleading Nc flag.
void transform(const LorentzRotation &rot)
Transform all intermediate, hard and outgoing particles using the given transformation.
void prepareChainsSubleading(const bool decay)
Prepare the dipole chains for the eventRecord after the subleading shower.
map< PPtr, PerturbativeProcessPtr > theDecays
The coloured partons that can be off-shell To only be filled by DipoleShowerHandler.
void recoil(list< Dipole >::iterator dip, list< DipoleChain >::iterator ch, DipoleSplittingInfo &dsplit)
Let the given dipole take the recoil of the indicated splitting.
void getSubleadingSplittings(list< SubleadingSplittingInfo > &)
Return a list of all possible subleading-N emitting pairs.
map< PPtr, PPtr > theOriginals
Map originals to copies.
void updateDecayMom(PPtr decayParent, PerturbativeProcessPtr decayProc)
Boost the momentum of the outgoing of the given perturbative process to the momentum of given particl...
pair< PVector, PVector > tmpupdate(DipoleSplittingInfo &dsplit)
As update, but not touching the acctual event record.
map< PPtr, size_t > theParticleIndices
Dictionary for particles before emission.
Lorentz5Momentum thePX
The momentum of the hard system.
double dipoleKernelForEvolution(size_t em, size_t spec, Energy2 pEmitpSpec, Energy2 pEmitpEmis, Energy2 pEmispSpec)
Calculates the dipole kernel to use for the density operator evolution.
SubleadingSplittingInfo mergeSplittingInfo(list< DipoleChain >::iterator firstChain, list< Dipole >::iterator firstDipole, const pair< bool, bool > &whichFirst, list< DipoleChain >::iterator secondChain, list< Dipole >::iterator secondDipole, const pair< bool, bool > &whichSecond) const
Create a SubleadingSplitingInfo given two independent dipoles; the first dipole is to provide the emi...
const cPDVector & particlesAfter() const
Return the particles after emission.
DipoleEventRecord()
The default constructor.
bool prepareDecay(PerturbativeProcessPtr decayProc, const set< long > &offShellPartons)
Prepare the event record for the showering of a decay.
void debugLastEvent(ostream &) const
Print event record at current state.
Energy decay(PPtr incoming, bool &powhegEmission)
Decay the particle.
void update(DipoleSplittingInfo &dsplit)
Update the particles upon insertion of the given splitting.
map< PPtr, PerturbativeProcessPtr > & decays()
Get the decays.
PList theNextDecays
List of unstable particles, the decay to be performed and/or showered next is always at the back.
void updateDecayChainMom(PPtr decayParent, PerturbativeProcessPtr decayProc)
Iteratively update the momenta of all particles in a decay chain, starting with the outgoing from the...
Energy2 densityOperatorCutoff
Cutoff scale for the invariants (e.g.
void popChain(list< DipoleChain >::iterator)
Remove the given chain.
void popChain()
Pop the current dipole chain.
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.
void updateInverse(DipoleSplittingInfo &dsplit)
Inverse of update, updateInverse(update(dsplit)) would return the event record to the state if update...
DipoleIndex mergeIndex(list< Dipole >::iterator firstDipole, const pair< bool, bool > &whichFirst, list< Dipole >::iterator secondDipole, const pair< bool, bool > &whichSecond) const
Create a merged dipole index given two independent dipoles; the first dipole is to provide the emitte...
void updateDecays(PerturbativeProcessPtr decayProc, bool iterate=true)
Update theDecays following the decay and/or showering of a decay particle.
map< std::tuple< size_t, size_t, size_t >, map< size_t, size_t > > theEmissionsMap
Dictionary for emissions, maps the three indices.
list< DipoleChain > & doneChains()
Access the dipole chains which ceased evolving.
void findChains(const PList &ordered, const set< long > &offShellpartons, const bool decay=false)
Find the chains to be showered.
cPDVector theParticlesAfter
Particles after the emission.
DensityOperator & densityOperator()
Return the density operator.
void separateDecay(PerturbativeProcessPtr decayProc)
Used in DipoleEventRecord::prepare.
cPDVector theParticlesBefore
Particles before the emission.
int densityOperatorEvolution
Integer used to set which method of evolving the density operator to use: 0 - Vijk is Eikonal but the...
pair< PVector, PVector > tmpsplit(list< Dipole >::iterator dip, list< DipoleChain >::iterator ch, DipoleSplittingInfo &dsplit, pair< list< Dipole >::iterator, list< Dipole >::iterator > &childIterators, DipoleChain *&firstChain, DipoleChain *&secondChain, bool colourSpectator=true)
As split, but not touching the acctual event record.
DensityOperator theDensityOperator
The density operator.
const map< PPtr, size_t > & particleIndices() const
Return the dictionary for the particles.
DipoleChain & currentChain()
Return the current dipole chain.
bool doSubleadingNc
Switch on or off for subleading Nc corrections.
PList theHard
Any non-coloured outgoing particles in the current subprocess.
virtual void clear()
Clear the event record: Give up ownership on any object involved in the evolution.
cPDVector & particlesBefore()
Return the particles before emission.
bool haveChain() const
Return true, if there are chains to be showered.
const PList & hard() const
Return any non-coloured outgoing particles in the current subprocess.
size_t subleadingNcEmissionsLimit
Number of emissions to calculate subleading Nc corrections for.
const cPDVector & particlesBefore() const
Return the particles before emission.
void slimprepare(tSubProPtr subpro, tStdXCombPtr xc, const pair< PDF, PDF > &pdf, tPPair beam, const set< long > &offShellPartons, bool dipoles=true)
Prepare the event record for the given subprocess.
list< DipoleChain > & chains()
Access the dipole chains to be showered.
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.
DipoleIndex is used to index splitting generators for a particular dipole.
DipoleSplittingInfo contains all parameters to generate a full dipole splitting.
Here is the documentation of the ShowerEventRecord class.
PPair & incoming()
Return the incoming partons at the current stage of the evolution.
PList & outgoing()
Return the outgoing partons at the current stage of the evolution.
Generalized dipole splitting info to deal with subleading-N splittings.
list< Dipole >::iterator emitterDipole() const
Get the iterator of the emitter dipole.
SubleadingSplittingInfo()
Default constructor.
void emitterChain(list< DipoleChain >::iterator it)
Set the iterator of the emitter dipole chain.
void spectatorChain(list< DipoleChain >::iterator it)
Set the iterator of the spectator dipole chain.
list< DipoleChain >::iterator theEmitterChain
Iterator of the emitter dipole chain.
list< Dipole >::iterator theSpectatorDipole
Iterator of the spectator dipole.
void emitterDipole(list< Dipole >::iterator it)
Set the iterator of the emitter dipole.
list< DipoleChain >::iterator spectatorChain() const
Get the iterator of the spectator dipole chain.
void startScale(Energy s)
Set the starting scale.
list< DipoleChain >::iterator emitterChain() const
Get the iterator of the emitter dipole chain.
void spectatorDipole(list< Dipole >::iterator it)
Set the iterator of the spectator dipole.
list< Dipole >::iterator theEmitterDipole
Iterator of the emitter dipole.
Energy startScale() const
Get the starting scale.
list< DipoleChain >::iterator theSpectatorChain
Iterator of the spectator dipole chain.
Energy theStartScale
The starting scale.
list< Dipole >::iterator spectatorDipole() const
Get the iterator of the spectator dipole.
-*- C++ -*-
pair< PPtr, PPtr > PPair
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
ThePEG::Ptr< Step >::pointer StepPtr
pair< tPPtr, tPPtr > tPPair
ThePEG::Ptr< Particle >::pointer PPtr
list< PPtr > PList
vector< cPDPtr > cPDVector