herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ShowerTree.h
1// -*- C++ -*-
2//
3// ShowerTree.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_ShowerTree_H
10#define HERWIG_ShowerTree_H
11
13#include "Herwig/Shower/ShowerHandler.fh"
14#include "Herwig/Shower/PerturbativeProcess.h"
15#include "Herwig/Shower/RealEmissionProcess.h"
16#include "Herwig/Shower/ShowerEventRecord.h"
17#include "Herwig/Shower/QTilde/ShowerConfig.h"
18#include "Herwig/Shower/QTilde/Base/ShowerParticle.h"
19#include "Herwig/Shower/QTilde/Base/ShowerProgenitor.h"
20#include "ThePEG/EventRecord/Step.h"
21#include <cassert>
22#include "ShowerTree.fh"
23
24namespace Herwig {
25
29typedef multimap<Energy,ShowerTreePtr,std::greater<Energy> > ShowerDecayMap;
30
31using namespace ThePEG;
32
41
42 friend class QTildeShowerHandler;
43
44public:
45
50 ShowerTree(PerturbativeProcessPtr process);
51
56 static Lorentz5Distance spaceTimeDistance(tPPtr particle);
57
65 static void constructTrees(ShowerTreePtr & hardTree,
66 ShowerDecayMap & decayTrees,
67 PerturbativeProcessPtr hard,
68 DecayProcessMap decay);
69
70public:
71
78 void fillEventRecord(StepPtr pstep,bool ISR,bool FSR) {
79 if(_wasHard)
80 insertHard (pstep,ISR,FSR);
81 else
82 insertDecay(pstep,ISR,FSR);
83 }
84
85
90 void setParents();
91
99 bool isHard() const { return _wasHard; }
100
101
105 bool isDecay() const { return !_wasHard; }
107
111 map<ShowerProgenitorPtr,ShowerParticlePtr> & incomingLines() {
112 return _incomingLines;
113 }
114
118 map<ShowerProgenitorPtr,tShowerParticlePtr> & outgoingLines() {
119 return _outgoingLines;
120 }
121
125 void updateFinalStateShowerProduct(ShowerProgenitorPtr progenitor,
126 ShowerParticlePtr parent,
127 const ShowerParticleVector & children);
128
132 void updateInitialStateShowerProduct(ShowerProgenitorPtr progenitor,
133 ShowerParticlePtr newParent);
134
138 tShowerParticlePtr getFinalStateShowerProduct(ShowerProgenitorPtr progenitor) {
139 return _outgoingLines.find(progenitor)==_outgoingLines.end()
140 ? tShowerParticlePtr() : _outgoingLines[progenitor];
141 }
142
149 void addFinalStateBranching(ShowerParticlePtr parent,
150 const ShowerParticleVector & children);
151
160 void addInitialStateBranching(ShowerParticlePtr oldParent,
161 ShowerParticlePtr newParent,
162 ShowerParticlePtr otherChild);
163
164 // /**
165 // * Member called at the end of the shower of a tree to perform a number of
166 // * updates.
167 // * @param decay The map of widths and ShowerTrees for the decays so that
168 // * any unstable decay products can be added.
169 // */
170 void updateAfterShower(ShowerDecayMap & decay);
171
179 bool hasShowered() const { return _hasShowered; }
180
184 void hasShowered(bool in) { _hasShowered=in; }
186
190 ShowerTreePtr parent() const { return _parent; }
191
196 void clear();
197
203
207 void setVetoes(const map<ShowerInteraction,Energy> & pTs,
208 unsigned int type);
209
213 vector<ShowerProgenitorPtr> extractProgenitors();
214
218 const set<tShowerParticlePtr> & forwardParticles() const { return _forward; }
219
224 const map<tShowerTreePtr,pair<tShowerProgenitorPtr,tShowerParticlePtr> > &
225 treelinks() const {return _treelinks;}
226
230 void updateLink(tShowerTreePtr tree,
231 pair<tShowerProgenitorPtr,tShowerParticlePtr> in) {
232 _treelinks[tree] = in;
233 }
234
238 void transform(const LorentzRotation & rot, bool applyNow);
239
244
249
254
258 vector<ShowerParticlePtr> extractProgenitorParticles();
259
264
268 void update(PerturbativeProcessPtr newProcess);
269
273 RealEmissionProcessPtr perturbativeProcess();
274
275protected:
276
287 void insertHard(StepPtr pstep,bool ISR,bool FSR);
288
295 void insertDecay(StepPtr pstep,bool ISR,bool FSR);
296
302 void addFinalStateShower(PPtr particle, StepPtr step);
303
311 void addInitialStateShower(PPtr particle, PPtr hadron,
312 StepPtr step, bool addchildren=true);
314
320 void fixColour(tShowerParticlePtr part);
321
322private:
327
333 map<ShowerProgenitorPtr,ShowerParticlePtr> _incomingLines;
334
340 map<ShowerProgenitorPtr,tShowerParticlePtr> _outgoingLines;
341
345 set<tShowerParticlePtr> _forward;
346
351
356 map<tShowerTreePtr,pair<tShowerProgenitorPtr,tShowerParticlePtr> > _treelinks;
357
361 tShowerTreePtr _parent;
362
367
372
373private:
374
378 static bool _spaceTime;
379
383 static Energy2 _vmin2;
384
385};
386}
387
388#endif
The QTildeShowerHandler class.
Here is the documentation of the ShowerEventRecord class.
The ShowerTree class stores the basic information needed for each hard interaction,...
Definition: ShowerTree.h:40
void updateLink(tShowerTreePtr tree, pair< tShowerProgenitorPtr, tShowerParticlePtr > in)
Update the link between shower particle and tree.
Definition: ShowerTree.h:230
static bool _spaceTime
Whether or not to include space-time distances.
Definition: ShowerTree.h:378
static void constructTrees(ShowerTreePtr &hardTree, ShowerDecayMap &decayTrees, PerturbativeProcessPtr hard, DecayProcessMap decay)
Construct the trees from the hard process.
tShowerTreePtr _parent
The parent tree.
Definition: ShowerTree.h:361
void hasShowered(bool in)
Set the flag.
Definition: ShowerTree.h:184
void fixColour(tShowerParticlePtr part)
After the creatation of a ShowerParticle make sure it is properly attached to its ColourLine.
PPair _incoming
Incoming partons for the hard process.
Definition: ShowerTree.h:326
bool hasShowered() const
Access and set the flag for whether this tree has been showered.
Definition: ShowerTree.h:179
void clearTransforms()
Clear any postphoned transformations.
vector< ShowerParticlePtr > extractProgenitorParticles()
Get all the progenitors.
bool isHard() const
Access methods for the type of interaction.
Definition: ShowerTree.h:99
map< ShowerProgenitorPtr, tShowerParticlePtr > & outgoingLines()
Get the outgoing shower particles.
Definition: ShowerTree.h:118
bool _wasHard
Was this a scattering process or a decay.
Definition: ShowerTree.h:350
map< tShowerTreePtr, pair< tShowerProgenitorPtr, tShowerParticlePtr > > _treelinks
Map of particles in this Tree which are the initial particles in other trees.
Definition: ShowerTree.h:356
void update(PerturbativeProcessPtr newProcess)
Update tree after the parent has been decayed.
bool isDecay() const
Whether or not this is a decay.
Definition: ShowerTree.h:105
tShowerParticlePtr getFinalStateShowerProduct(ShowerProgenitorPtr progenitor)
Get the current final shower product for a final-state particle.
Definition: ShowerTree.h:138
void insertHard(StepPtr pstep, bool ISR, bool FSR)
Functions to add the shower to the event record.
static Lorentz5Distance spaceTimeDistance(tPPtr particle)
Calculate the space-time displacement.
const map< tShowerTreePtr, pair< tShowerProgenitorPtr, tShowerParticlePtr > > & treelinks() const
Map of particles in this Tree which are the initial particles in other trees.
Definition: ShowerTree.h:225
ShowerTreePtr parent() const
Access the parent tree.
Definition: ShowerTree.h:190
void checkMomenta()
Check the momentum conservation in the tree.
RealEmissionProcessPtr perturbativeProcess()
The perturbative process.
set< tShowerParticlePtr > _forward
The outgoing ShowerParticles at the end of the final-state shower.
Definition: ShowerTree.h:345
void resetShowerProducts()
Reset the particles resulting from the shower to those which started the shower.
void transform(const LorentzRotation &rot, bool applyNow)
Transform the tree.
void setVetoes(const map< ShowerInteraction, Energy > &pTs, unsigned int type)
Set maximum Emission scales.
map< ShowerProgenitorPtr, ShowerParticlePtr > _incomingLines
The incoming ShowerParticles connected to the interaction as the index of a map with the particle the...
Definition: ShowerTree.h:333
map< ShowerProgenitorPtr, ShowerParticlePtr > & incomingLines()
Get the incoming shower particles.
Definition: ShowerTree.h:111
bool _hasShowered
Has this tree showered.
Definition: ShowerTree.h:366
void addFinalStateShower(PPtr particle, StepPtr step)
Recursively add the final-state shower from the particle to the event record.
vector< ShowerProgenitorPtr > extractProgenitors()
Extract the progenitors for the reconstruction.
void addInitialStateShower(PPtr particle, PPtr hadron, StepPtr step, bool addchildren=true)
Add the initial-state shwoer from the particle to the step.
LorentzRotation _transforms
The transforms which still need to be applied.
Definition: ShowerTree.h:371
const set< tShowerParticlePtr > & forwardParticles() const
Access to the outgoing particles.
Definition: ShowerTree.h:218
void updateFinalStateShowerProduct(ShowerProgenitorPtr progenitor, ShowerParticlePtr parent, const ShowerParticleVector &children)
Update the shower product for a final-state particle.
void addInitialStateBranching(ShowerParticlePtr oldParent, ShowerParticlePtr newParent, ShowerParticlePtr otherChild)
Add an initial-state branching.
void clear()
Clear all the shower products so that the event can be reshowered if the first attempt fail.
void fillEventRecord(StepPtr pstep, bool ISR, bool FSR)
Insert the tree into the event record.
Definition: ShowerTree.h:78
map< ShowerProgenitorPtr, tShowerParticlePtr > _outgoingLines
The outgoing ShowerParticles connected to the interaction as the index of a map with the particle the...
Definition: ShowerTree.h:340
void updateInitialStateShowerProduct(ShowerProgenitorPtr progenitor, ShowerParticlePtr newParent)
Update the shower product for an initial-state particle.
void applyTransforms()
Apply any postphoned transformations.
void addFinalStateBranching(ShowerParticlePtr parent, const ShowerParticleVector &children)
Add a final-state branching.
ShowerTree(PerturbativeProcessPtr process)
Constructor from a perturbative process.
static Energy2 _vmin2
Minimum virtuality for the space-time model.
Definition: ShowerTree.h:383
const LorentzRotation & transform()
Transform which needs to be applied.
Definition: ShowerTree.h:253
void insertDecay(StepPtr pstep, bool ISR, bool FSR)
Insert a decay process.
void setParents()
Set the parent tree to this tree for trees which come from this one.
-*- C++ -*-
vector< ShowerParticlePtr > ShowerParticleVector
A Vector of ShowerParticle pointers.
Definition: ShowerConfig.h:54
multimap< Energy, PerturbativeProcessPtr, std::greater< Energy > > DecayProcessMap
Typedef for map of PerturbativeProcess for decays.
multimap< Energy, ShowerTreePtr, std::greater< Energy > > ShowerDecayMap
Typedef for map of ShowerTrees for decays.
Definition: ShowerTree.h:29
ThePEG::Ptr< Particle >::transient_pointer tPPtr
pair< PPtr, PPtr > PPair
ThePEG::Ptr< Step >::pointer StepPtr
ThePEG::Ptr< Particle >::pointer PPtr