herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
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 
13 #include "ThePEG/Config/ThePEG.h"
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 
25 namespace Herwig {
26 
27 
28  using namespace ThePEG;
29 
38  class Node : public Interfaced {
39  public:
40 
43 
44  Node (){};
45 
46  // constructor for first nodes
47  Node(MatchboxMEBasePtr nodeME , int cutstage , MergerPtr mh );
48  // another constructor for underlying nodes
49  Node(NodePtr deephead,
50  NodePtr head,
51  SubtractionDipolePtr dipol,
52  MatchboxMEBasePtr nodeME,
53  int cutstage);
55  virtual ~Node();
57 
58  public:
59  // get children from vector<MatchboxMEBasePtr>
60  void birth(const vector<MatchboxMEBasePtr> & vec);
63  void setXComb(tStdXCombPtr xc);
65  pair<CrossSection, CrossSection> calcDipandPS(Energy scale)const;
67  CrossSection calcPs(Energy scale)const;
69  CrossSection calcDip(Energy scale)const;
71  void flushCaches();
73  void clearKinematics();
75  void setKinematics();
77  bool generateKinematics(const double *r, bool directCut);
79  bool firstgenerateKinematics(const double *r, bool directCut);
80  //return the ME
81  const MatchboxMEBasePtr nodeME() const;
82  //return the node ME
83  MatchboxMEBasePtr nodeME();
84  //return the parent Node
85  NodePtr parent() const {return theparent;}
87  vector< NodePtr > children() const {return thechildren;}
88  //pick a random child (flat)
89  NodePtr randomChild();
91  bool allAbove(Energy pt);
93  Energy maxChildPt();
95  bool isInHistoryOf(NodePtr other);
97  int legsize() const;
99  void deepHead(NodePtr deephead) {theDeepHead = deephead;}
101  NodePtr deepHead() const {return theDeepHead;}
103  SubtractionDipolePtr dipole() const;
105  StdXCombPtr xcomb() const;
107  StdXCombPtr xcomb() ;
109  Energy runningPt() const { return theRunningPt; }
111  void runningPt(Energy x) { theRunningPt=x; }
113  int cutStage() const { return theCutStage; }
115  vector<NodePtr> getNextOrderedNodes(bool normal=true, double hardscalefactor=1.) const;
116  //true if the node is in shower history for a given pt
117  bool inShowerPS(Energy hardpt)const;
118  //get the history
119  NodePtr getHistory(bool normal=true, double hardscalefactor=1.);
120  //true if node correspond to a subtracted real.
121  bool subtractedReal() const {return theSubtractedReal;}
123  void subtractedReal(bool x) { theSubtractedReal = x;}
124  //true if node correspond to a virtual contribution.
125  bool virtualContribution() const { return theVirtualContribution ;}
127  void virtualContribution(bool x) {theVirtualContribution = x;}
128  //pointer to the merging helper
129  MergerPtr MH()const{return theMergingHelper;}
131  void MH(MergerPtr a){theMergingHelper=a;}
133  Energy pT()const{return dipole()->lastPt();}
135  pair<PVector , PVector> getInOut();
136 
137  private:
139  MatchboxMEBasePtr thenodeMEPtr;
142  SubtractionDipolePtr thedipol;
144  NodePtr theparent;
146  NodePtr theDeepHead;
155  // bool isOrdered;
161  MergerPtr theMergingHelper;
162  //the xcomb of the node
163  StdXCombPtr thexcomb;
165  vector< NodePtr > thechildren;
167  Energy theRunningPt;
169  NodePtr theProjector;
171  bool didflush=false;
172 
173  public:
180  void persistentOutput(PersistentOStream & os) const;
181 
187  void persistentInput(PersistentIStream & is, int version);
189 
196  static void Init();
197 
198 
199  protected:
206  virtual IBPtr clone() const;
207 
212  virtual IBPtr fullclone() const;
214 
215 
216  // If needed, insert declarations of virtual function defined in the
217  // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
218 
219 
220 
221  private:
226  Node & operator=(const Node &) = delete;
227 
228  };
229 
230 }
231 
232 #endif /* Herwig_Node_H */
233 
234 
235 
236 
237 
void runningPt(Energy x)
set the current running pt
Definition: Node.h:111
NodePtr theDeepHead
The godfather node of whole tree.(Firstnode)
Definition: Node.h:146
void virtualContribution(bool x)
set if node correspont to a virtual contribution.
Definition: Node.h:127
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
void subtractedReal(bool x)
set if node correspont to a subtracted real.
Definition: Node.h:123
Energy theRunningPt
the current running pt
Definition: Node.h:167
vector< NodePtr > thechildren
vector of the children node
Definition: Node.h:165
Energy pT() const
pT of the dipole
Definition: Node.h:133
MatchboxMEBasePtr thenodeMEPtr
the Matrixelement representing this node.
Definition: Node.h:139
int theCutStage
The CutStage is number of clusterings which are possible without introducing a merging scale to cut a...
Definition: Node.h:153
NodePtr theparent
the parent node
Definition: Node.h:144
bool theVirtualContribution
flag to tell if node is virtual contribution
Definition: Node.h:159
bool theSubtractedReal
tell if node belongs to an ordered history
Definition: Node.h:157
vector< NodePtr > children() const
vector of children nodes created in birth
Definition: Node.h:87
void deepHead(NodePtr deephead)
set the first node (first men). only use in factory
Definition: Node.h:99
NodePtr deepHead() const
return the first node
Definition: Node.h:101
int cutStage() const
return the cut stage to cut on merging pt in generate kinematics
Definition: Node.h:113
-*- C++ -*-
void MH(MergerPtr a)
set the merging helper
Definition: Node.h:131
SubtractionDipolePtr thedipol
the dipol used to substract and generate kinematics using tilde kinematics
Definition: Node.h:142
NodePtr theProjector
The nodes of the projection stage.
Definition: Node.h:169
MergerPtr theMergingHelper
the merging helper
Definition: Node.h:161
Energy runningPt() const
return the current running pt
Definition: Node.h:109
Here is the documentation of the Node class.
Definition: Node.h:38