Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // CheckId.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 //
0010 #ifndef HERWIG_CheckId_H
0011 #define HERWIG_CheckId_H
0012 //
0013 // This is the declaration of the CheckId class.
0014 
0015 #include "ThePEG/PDT/StandardMatchers.h"
0016 #include "ThePEG/PDT/ParticleData.h"
0017 #include <ThePEG/PDT/EnumParticles.h>
0018 #include "ThePEG/Repository/CurrentGenerator.h"
0019 
0020 namespace Herwig {
0021 
0022 using namespace ThePEG;
0023 
0024 /** \ingroup Hadronization
0025  *
0026  *  This is a namespace which provides some useful methods
0027  *  for checking the PDG id of particles.
0028  *  Notice that the name "quark" in the methods below means any of
0029  *  the following:
0030  *  d , u , s , c , b   anti-d , anti-u , anti-s , anti-c , anti-b
0031  *  that is we do not distinguish between particle or antiparticle
0032  *  ( because can be done directly by the user:
0033  *        id > 0  for  particles ;  id < 0  for  anti-particles )
0034  *  and we do not include  t  (and  anti-t ) because we are interested
0035  *  in components of mesons and baryons.
0036  *  Similarly for the name  "diquark"  which include all  diquarks (id > 0)
0037  *  and  anti-diquarks  (id < 0)  not made with  t  ( anti-t ) component.
0038  *
0039  *  NB) For Other useful methods (even some implemented in CheckId)
0040  *      @see StandardMatchers
0041  */
0042 namespace CheckId {
0043 
0044   /**
0045    * Return the id of the diquark (anti-diquark) made by the two
0046    * quarks (antiquarks) of id specified in input (id1, id2).
0047    * Caller must ensure that id1 and id2 are quarks.
0048    */
0049   long makeDiquarkID(long id1, long id2, long pspin);
0050 
0051   /**
0052    * Return true if the two particles in input can be the components of a meson;
0053    *false otherwise.
0054    */
0055   bool canBeMeson(tcPDPtr par1,tcPDPtr par2);
0056 
0057   /**
0058    * Return true if the two or three particles in input can be the components
0059    * of a baryon; false otherwise.
0060    */
0061   bool canBeBaryon(tcPDPtr par1, tcPDPtr par2 , tcPDPtr par3 = PDPtr());
0062 
0063    /**
0064    * Return true if the two or three particles in input can be the components
0065    * of a hadron; false otherwise.
0066    */
0067   inline bool canBeHadron(tcPDPtr par1, tcPDPtr par2 , tcPDPtr par3 = PDPtr())  {
0068     return (!par3 && canBeMeson(par1,par2)) || canBeBaryon(par1,par2,par3);
0069   }
0070 
0071 
0072   /**
0073    * Return true if any of the possible three input particles has
0074    * b-flavour;
0075    * false otherwise. In the case that only the first particle is specified,
0076    * it can be: an (anti-)quark, an (anti-)diquark
0077    * an (anti-)meson, an (anti-)baryon; in the other cases, each pointer
0078    * is assumed to be either (anti-)quark or (anti-)diquark.
0079    */
0080   bool hasBottom(tcPDPtr par1, tcPDPtr par2 = PDPtr(), tcPDPtr par3 = PDPtr());
0081   /**
0082    * Return true if any of the possible three input particles has
0083    * c-flavour;
0084    * false otherwise.In the case that only the first pointer is specified,
0085    * it can be: a (anti-)quark, a (anti-)diquark
0086    * a (anti-)meson, a (anti-)baryon; in the other cases, each pointer
0087    * is assumed to be either (anti-)quark or (anti-)diquark.
0088    */
0089   bool hasCharm(tcPDPtr par1, tcPDPtr par2 = PDPtr(), tcPDPtr par3 = PDPtr());
0090   /**
0091    * Return true, if any of the possible input particle pointer is an exotic quark, e.g. Susy quark;
0092    * false otherwise.
0093    */
0094   bool isExotic(tcPDPtr par1, tcPDPtr par2 = PDPtr(), tcPDPtr par3 = PDPtr());
0095 
0096 }
0097 
0098 }
0099 
0100 #endif /* HERWIG_CheckId_H */