herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
Node.h
1 // -*- C++ -*-
2#ifndef Herwig_Node_H
3#define Herwig_Node_H
4 //
5 // This is the declaration of the Node class.
6 //
7#include "Node.fh"
8#include "MergingFactory.fh"
9#include "Merger.h"
10
11
12
14#include "ThePEG/Config/std.h"
15#include "ThePEG/Interface/Interfaced.h"
16#include "Herwig/MatrixElement/Matchbox/Base/MatchboxMEBase.fh"
17#include "Herwig/MatrixElement/Matchbox/Dipoles/SubtractionDipole.fh"
18#include "Herwig/Shower/Dipole/Base/DipoleEventRecord.h"
19#include "ThePEG/MatrixElement/MEBase.h"
20
21#include <vector>
22
23
24
25namespace Herwig {
26
27
28 using namespace ThePEG;
29
45 class Node : public Interfaced {
46 public:
47
50
51 Node (){};
52
53 // constructor for first nodes
54 Node(MatchboxMEBasePtr nodeME , int cutstage , MergerPtr mh );
55 // another constructor for underlying nodes
56 Node(NodePtr deephead,
57 NodePtr head,
58 SubtractionDipolePtr dipol,
59 MatchboxMEBasePtr nodeME,
60 int cutstage);
62
63 public:
64 // get children from vector<MatchboxMEBasePtr>
65 void birth(const vector<MatchboxMEBasePtr> & vec);
68 void setXComb(tStdXCombPtr xc);
70 pair<CrossSection, CrossSection> calcDipandPS(Energy scale)const;
72 CrossSection calcPs(Energy scale)const;
74 CrossSection calcDip(Energy scale)const;
82 bool generateKinematics(const double *r, bool directCut);
84 bool firstgenerateKinematics(const double *r, bool directCut);
85 //return the ME
86 const MatchboxMEBasePtr nodeME() const;
87 //return the node ME
88 MatchboxMEBasePtr nodeME();
89 //return the parent Node
90 NodePtr parent() const {return theparent;}
92 vector< NodePtr > children() const {return thechildren;}
93 //pick a random child (flat)
94 NodePtr randomChild();
96 bool allAbove(Energy pt);
98 Energy maxChildPt();
100 bool isInHistoryOf(NodePtr other);
102 int legsize() const;
104 void deepHead(NodePtr deephead) {theDeepHead = deephead;}
106 NodePtr deepHead() const {return theDeepHead;}
108 SubtractionDipolePtr dipole() const;
110 StdXCombPtr xcomb() const;
112 StdXCombPtr xcomb() ;
114 Energy runningPt() const { return theRunningPt; }
116 void runningPt(Energy x) { theRunningPt=x; }
118 int cutStage() const { return theCutStage; }
120 vector<NodePtr> getNextOrderedNodes(bool normal=true, double hardscalefactor=1.) const;
121 //true if the node is in shower history for a given pt
122 bool inShowerPS(Energy hardpt)const;
123 //get the history
124 NodePtr getHistory(bool normal=true, double hardscalefactor=1.);
125 //true if node correspond to a subtracted real.
126 bool subtractedReal() const {return theSubtractedReal;}
129 //true if node correspond to a virtual contribution.
130 bool virtualContribution() const { return theVirtualContribution ;}
133 //pointer to the merging helper
134 MergerPtr MH()const{return theMergingHelper;}
136 void MH(MergerPtr a){theMergingHelper=a;}
138 Energy pT()const{return dipole()->lastPt();}
140 pair<PVector , PVector> getInOut();
141
142 private:
144 MatchboxMEBasePtr thenodeMEPtr;
147 SubtractionDipolePtr thedipol;
149 NodePtr theparent;
151 NodePtr theDeepHead;
165 //the xcomb of the node
166 StdXCombPtr thexcomb;
168 vector< NodePtr > thechildren;
174 bool didflush=false;
175
176 public:
184
190 void persistentInput(PersistentIStream & is, int version);
192
199 static void Init();
200
201
202 protected:
209 virtual IBPtr clone() const;
210
215 virtual IBPtr fullclone() const;
217
218
219 // If needed, insert declarations of virtual function defined in the
220 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
221
222
223
224 private:
229 Node & operator=(const Node &) = delete;
230
231 };
232
233}
234
235#endif /* Herwig_Node_H */
236
237
238
239
240
The Node class represents a part of the shower history in the merging procedure.
Definition: Node.h:45
void runningPt(Energy x)
set the current running pt
Definition: Node.h:116
virtual IBPtr clone() const
Make a simple clone of this object.
static void Init()
The standard Init function used to initialize the interfaces.
NodePtr theparent
the parent node
Definition: Node.h:149
int legsize() const
legsize of the node ME
bool isInHistoryOf(NodePtr other)
true if the node is in the history of other.
MergerPtr theMergingHelper
the merging helper (should be static)
Definition: Node.h:164
CrossSection calcDip(Energy scale) const
calculate the dipole
SubtractionDipolePtr dipole() const
returns the dipol of the node.
CrossSection calcPs(Energy scale) const
calculate the ps approximation
bool firstgenerateKinematics(const double *r, bool directCut)
generate the kinamatics of the first node
void MH(MergerPtr a)
set the merging helper
Definition: Node.h:136
vector< NodePtr > children() const
vector of children nodes created in birth
Definition: Node.h:92
NodePtr theProjector
The nodes of the projection stage.
Definition: Node.h:172
Energy maxChildPt()
return maximum of all child pts.
int theCutStage
The CutStage is number of clusterings which are possible without introducing a merging scale to cut a...
Definition: Node.h:158
SubtractionDipolePtr thedipol
the dipol used to substract and generate kinematics using tilde kinematics
Definition: Node.h:147
vector< NodePtr > getNextOrderedNodes(bool normal=true, double hardscalefactor=1.) const
get a vector of the next nodes, ordered in pt (and in parton shower phace space)
bool allAbove(Energy pt)
true if all children show scales above pt
NodePtr theDeepHead
The godfather node of whole tree.(Firstnode)
Definition: Node.h:151
bool theVirtualContribution
flag to tell if node is virtual contribution
Definition: Node.h:162
bool didflush
flag not to enter infinite loop. (There should be a better solution...)
Definition: Node.h:174
void clearKinematics()
recursive clearKinematics
MatchboxMEBasePtr thenodeMEPtr
the Matrixelement representing this node.
Definition: Node.h:144
pair< PVector, PVector > getInOut()
get incoming and outgoing particles (TODO: expensive)
NodePtr deepHead() const
return the first node
Definition: Node.h:106
Energy runningPt() const
return the current running pt
Definition: Node.h:114
pair< CrossSection, CrossSection > calcDipandPS(Energy scale) const
calculate the dipole and ps approximation
Node & operator=(const Node &)=delete
The assignment operator is private and must never be called.
int cutStage() const
return the cut stage to cut on merging pt in generate kinematics
Definition: Node.h:118
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void subtractedReal(bool x)
set if node correspont to a subtracted real.
Definition: Node.h:128
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
void setKinematics()
recursive setKinematics
void virtualContribution(bool x)
set if node correspont to a virtual contribution.
Definition: Node.h:132
void flushCaches()
recursive flush caches and clean up XCombs.
StdXCombPtr xcomb()
return the xcomb (if not created, create one from head)
void deepHead(NodePtr deephead)
set the first node (first men). only use in factory
Definition: Node.h:104
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
void setXComb(tStdXCombPtr xc)
recursive setXComb.
StdXCombPtr xcomb() const
return the xcomb
bool theSubtractedReal
flag to tell if node is subtracted real
Definition: Node.h:160
vector< NodePtr > thechildren
vector of the children node
Definition: Node.h:168
Energy theRunningPt
the current running pt
Definition: Node.h:170
bool generateKinematics(const double *r, bool directCut)
recursive generateKinematics using tilde kinematics of the dipoles
Energy pT() const
pT of the dipole
Definition: Node.h:138
-*- C++ -*-
ThePEG::Ptr< InterfacedBase >::pointer IBPtr