Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:24:17

0001 // -*- C++ -*-
0002 //
0003 // TwoBodyDecay.h is a part of Herwig - A multi-purpose Monte Carlo event generator
0004 // Copyright (C) 2002-2019 The Herwig Collaboration
0005 //
0006 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
0007 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
0008 //
0009 #ifndef HERWIG_TwoBodyDecay_H
0010 #define HERWIG_TwoBodyDecay_H
0011 //
0012 // This is the declaration of the TwoBodyDecay struct.
0013 //
0014 
0015 namespace Herwig {
0016 using namespace ThePEG;
0017 using Helicity::tVertexBasePtr;
0018 
0019 /**
0020  * Struct for the prototype of a two-body decay mode
0021  */
0022 struct TwoBodyDecay {
0023   
0024 public:
0025   
0026   /**
0027    *  Constructor
0028    * @param pa Decaying particle
0029    * @param pb First  decay product
0030    * @param pc Second decay product
0031    */    
0032   TwoBodyDecay(tPDPtr pa, tPDPtr pb, tPDPtr pc,
0033            tVertexBasePtr vertex) : parent_(pa), vertex_(vertex) {
0034     ParticleOrdering order;
0035     if( order(pb, pc) ) {
0036       children_.first = pb;
0037       children_.second = pc;
0038     }
0039     else {
0040       children_.first = pc;
0041       children_.second = pb;
0042     }
0043   }
0044   
0045   /**
0046    *  The parent
0047    */    
0048   tPDPtr parent_;
0049   
0050   /**
0051    *  The children
0052    */
0053   tPDPair children_;
0054   
0055   /**
0056    *  Vertex
0057    */
0058   tVertexBasePtr vertex_;
0059   
0060 private:
0061   
0062   TwoBodyDecay();
0063 };
0064 
0065 /**
0066  * Test whether one TwoBodyDecay is less than another
0067  */
0068 inline bool operator<(const TwoBodyDecay & x, const TwoBodyDecay & y) {
0069   if(x.parent_->id()!=y.parent_->id())
0070     return x.parent_->id()<y.parent_->id();
0071   if(x.children_.first->id()!=y.children_.first->id())
0072     return x.children_.first->id() < y.children_.first->id();
0073   if(x.children_.second->id()!=y.children_.second->id())
0074     return x.children_.second->id() < y.children_.second->id();
0075   return false;
0076 }
0077 inline bool operator==(const TwoBodyDecay & x, const TwoBodyDecay & y) {
0078   if(x.parent_->id()!=y.parent_->id())
0079     return false;
0080   if(x.children_.first->id()!=y.children_.first->id())
0081     return false;
0082   if(x.children_.second->id()!=y.children_.second->id())
0083     return false;
0084   return true;
0085 }
0086 
0087 }
0088 #endif /* HERWIG_TwoBodyDecay_H */
0089