herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ProtoTree.h
1// -*- C++ -*-
2#ifndef HERWIG_ProtoTree_H
3#define HERWIG_ProtoTree_H
4//
5// This is the declaration of the ProtoTree class.
6//
7
8#include "ProtoBranching.h"
9#include "CKKWTree.h"
10
11namespace Herwig {
12
13using namespace ThePEG;
14
18class ProtoTree;
19ThePEG_DECLARE_POINTERS(Herwig::ProtoTree,ProtoTreePtr);
20
24class ProtoTree:public Base {
25
26public:
27
32
36 ProtoTree(const set<tProtoBranchingPtr> & newBranchings) :
37 branchings_( newBranchings ) {}
38
42 void addBranching( tProtoBranchingPtr Branching ){
43 branchings_.insert( Branching );
44 }
45
46 const set< tProtoBranchingPtr > & branchings() const {
47 return branchings_;
48 }
49
53 CKKWTreePtr createHardTree() {
54 vector<HardBranchingPtr> branchings,spacelike;
55 map<ColinePtr,ColinePtr> cmap;
56 for(set<tProtoBranchingPtr>::const_iterator it=branchings_.begin();
57 it!=branchings_.end();++it) {
58 if((**it).status()==HardBranching::Outgoing) {
59 branchings.push_back(createTimeLikeBranching(*it,cmap));
60 }
61 else {
62 HardBranchingPtr space;
63 branchings.push_back(createSpaceLikeBranching(*it,space,cmap));
64 spacelike.push_back(space);
65 }
66 }
67 // Create the hard tree
68 return new_ptr(CKKWTree( branchings, spacelike , ShowerInteraction::QCD));
69 }
70
71protected:
72
76 HardBranchingPtr createTimeLikeBranching(tProtoBranchingPtr branch,map<ColinePtr,ColinePtr> & cmap) {
77 ShowerParticlePtr particle = new_ptr( ShowerParticle( branch->particle() , true ) );
78 particle->set5Momentum( branch->momentum() );
79 HardBranchingPtr newBranch = new_ptr( HardBranching( particle, branch->sudakov(),
80 HardBranchingPtr(),
81 HardBranching::Outgoing ) );
82 if(branch->colourLine()) {
83 if(cmap.find((branch->colourLine()))==cmap.end())
84 cmap[branch->colourLine()] = new_ptr(ColourLine());
85 cmap[branch->colourLine()]->addColoured(particle);
86 }
87 if(branch->antiColourLine()) {
88 if(cmap.find((branch->antiColourLine()))==cmap.end())
89 cmap[branch->antiColourLine()] = new_ptr(ColourLine());
90 cmap[branch->antiColourLine()]->addAntiColoured(particle);
91 }
92 Lorentz5Momentum pnew;
93 if(branch->children().empty()) {
94 pnew = branch->momentum();
95 }
96 else {
97 for(unsigned int ix=0;ix<branch->children().size();++ix) {
98 HardBranchingPtr child = createTimeLikeBranching(branch->children()[ix],cmap);
99 newBranch->addChild(child);
100 child->parent(newBranch);
101 pnew += child->branchingParticle()->momentum();
102 pnew.setMass(branch->particle()->mass());
103 }
104 }
105 particle->set5Momentum( pnew );
106 if(branch->type()!=ShowerPartnerType::Undefined)
107 newBranch->type(branch->type());
108 return newBranch;
109 }
110
114 HardBranchingPtr createSpaceLikeBranching(tProtoBranchingPtr branch,
115 HardBranchingPtr & spacelike,
116 map<ColinePtr,ColinePtr> & cmap) {
117 ShowerParticlePtr particle = new_ptr( ShowerParticle( branch->particle() , false ) );
118 particle->set5Momentum( branch->momentum() );
119 if(branch->colourLine()) {
120 if(cmap.find((branch->colourLine()))==cmap.end())
121 cmap[branch->colourLine()] = new_ptr(ColourLine());
122 cmap[branch->colourLine()]->addColoured(particle);
123 }
124 if(branch->antiColourLine()) {
125 if(cmap.find((branch->antiColourLine()))==cmap.end())
126 cmap[branch->antiColourLine()] = new_ptr(ColourLine());
127 cmap[branch->antiColourLine()]->addAntiColoured(particle);
128 }
129 HardBranchingPtr newBranch = new_ptr( HardBranching( particle, SudakovPtr(),
130 HardBranchingPtr(),
131 HardBranching::Incoming ) );
132 if(!branch->backChildren().empty()) {
133 HardBranchingPtr newTimeLike = createTimeLikeBranching(branch->backChildren()[1],cmap);
134 HardBranchingPtr newSpaceLike = createSpaceLikeBranching(branch->backChildren()[0],
135 spacelike,cmap);
136 newBranch ->parent(newSpaceLike);
137 newTimeLike->parent(newSpaceLike);
138 newSpaceLike->addChild(newBranch);
139 newSpaceLike->addChild(newTimeLike);
140 newSpaceLike->sudakov(branch->sudakov());
141 }
142 else {
143 spacelike = newBranch;
144 }
145 if(branch->type()!=ShowerPartnerType::Undefined)
146 newBranch->type(branch->type());
147 return newBranch;
148 }
149
150
151private:
152
156 set< tProtoBranchingPtr > branchings_;
157
158};
159
160}
161
162#endif /* HERWIG_ProtoTree_H */
Here is the documentation of the CKKWTree class.
Definition: CKKWTree.h:18
The HardBranching class is designed to contain the information needed for an individual branching in ...
Definition: HardBranching.h:23
Class for a prototype tree.
Definition: ProtoTree.h:24
set< tProtoBranchingPtr > branchings_
The branchings in the tree.
Definition: ProtoTree.h:156
HardBranchingPtr createSpaceLikeBranching(tProtoBranchingPtr branch, HardBranchingPtr &spacelike, map< ColinePtr, ColinePtr > &cmap)
Create a spacelike branching.
Definition: ProtoTree.h:114
HardBranchingPtr createTimeLikeBranching(tProtoBranchingPtr branch, map< ColinePtr, ColinePtr > &cmap)
Create a timelike branching.
Definition: ProtoTree.h:76
ProtoTree(const set< tProtoBranchingPtr > &newBranchings)
Constructor.
Definition: ProtoTree.h:36
ProtoTree()
Default constructor.
Definition: ProtoTree.h:31
void addBranching(tProtoBranchingPtr Branching)
Add a branching.
Definition: ProtoTree.h:42
CKKWTreePtr createHardTree()
Create the HardTree.
Definition: ProtoTree.h:53
This class represents a particle in the showering process.
-*- C++ -*-
The branching struct is used to store information on the branching.
Definition: Branching.h:20