herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
TwoBodyDecay.h
1 // -*- C++ -*-
2 //
3 // TwoBodyDecay.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_TwoBodyDecay_H
10 #define HERWIG_TwoBodyDecay_H
11 //
12 // This is the declaration of the TwoBodyDecay struct.
13 //
14 
15 namespace Herwig {
16 using namespace ThePEG;
17 using Helicity::tVertexBasePtr;
18 
22 struct TwoBodyDecay {
23 
24 public:
25 
33  tVertexBasePtr vertex) : parent_(pa), vertex_(vertex) {
34  ParticleOrdering order;
35  if( order(pb, pc) ) {
36  children_.first = pb;
37  children_.second = pc;
38  }
39  else {
40  children_.first = pc;
41  children_.second = pb;
42  }
43  }
44 
49 
54 
58  tVertexBasePtr vertex_;
59 
60 private:
61 
62  TwoBodyDecay();
63 };
64 
68 inline bool operator<(const TwoBodyDecay & x, const TwoBodyDecay & y) {
69  if(x.parent_->id()!=y.parent_->id())
70  return x.parent_->id()<y.parent_->id();
71  if(x.children_.first->id()!=y.children_.first->id())
72  return x.children_.first->id() < y.children_.first->id();
73  if(x.children_.second->id()!=y.children_.second->id())
74  return x.children_.second->id() < y.children_.second->id();
75  return false;
76 }
77 inline bool operator==(const TwoBodyDecay & x, const TwoBodyDecay & y) {
78  if(x.parent_->id()!=y.parent_->id())
79  return false;
80  if(x.children_.first->id()!=y.children_.first->id())
81  return false;
82  if(x.children_.second->id()!=y.children_.second->id())
83  return false;
84  return true;
85 }
86 
87 }
88 #endif /* HERWIG_TwoBodyDecay_H */
89 
ThePEG::Ptr< ParticleData >::transient_pointer tPDPtr
A struct to order the particles in the same way as in the DecayModes.
bool operator==(const HPDiagram &x, const HPDiagram &y)
Test whether two diagrams are identical.
Definition: HPDiagram.h:98
bool operator<(const HPDiagram &x, const HPDiagram &y)
Test whether one diagram is &#39;less&#39; than another.
Definition: HPDiagram.h:163
TwoBodyDecay(tPDPtr pa, tPDPtr pb, tPDPtr pc, tVertexBasePtr vertex)
Constructor.
Definition: TwoBodyDecay.h:32
Struct for the prototype of a two-body decay mode.
Definition: TwoBodyDecay.h:22
tPDPair children_
The children.
Definition: TwoBodyDecay.h:53
pair< tPDPtr, tPDPtr > tPDPair
tVertexBasePtr vertex_
Vertex.
Definition: TwoBodyDecay.h:58
-*- C++ -*-
tPDPtr parent_
The parent.
Definition: TwoBodyDecay.h:48