G4PDGCodeChecker.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id: G4PDGCodeChecker.hh 69798 2013-05-15 13:36:02Z gcosmo $
00028 //
00029 // 
00030 // ------------------------------------------------------------
00031 //      GEANT 4 class header file
00032 //
00033 //      History: first implementation, based on object model of
00034 //      Hisaya Kurashige,  17 Aug. 1999
00035 //
00036 
00037 
00038 #ifndef G4PDGCodeChecker_h
00039 #define G4PDGCodeChecker_h 1
00040 
00041 #include "globals.hh"
00042 #include "G4ios.hh"
00043 
00044 class G4PDGCodeChecker 
00045 {
00046 
00047  public:
00048   G4PDGCodeChecker();
00049   ~G4PDGCodeChecker(){};
00050 
00051  public: // With Description
00052   G4int  CheckPDGCode(G4int code, G4String type);
00053 
00054   G4int  GetQuarkContent(G4int flavor) const ;
00055   G4int  GetAntiQuarkContent(G4int flavor) const;
00056   
00057   G4bool IsAntiParticle() const;
00058 
00059   G4int  GetQuarkFlavor(G4int idx) const;
00060 
00061  public:
00062   G4int  GetSpin() const;
00063   G4int  GetExotic() const;
00064   G4int  GetRadial() const;
00065   G4int  GetMultiplet() const;
00066 
00067   G4bool CheckCharge(G4double charge) const;
00068 
00069   G4int GetVerboseLevel() const;
00070   void  SetVerboseLevel(G4int verbose);
00071 
00072  protected:
00073   enum {NumberOfQuarkFlavor = 8};
00074 
00075  private: 
00076   void   GetDigits(G4int code);
00077   G4int  CheckForQuarks();
00078   G4int  CheckForDiQuarks();
00079   G4int  CheckForMesons();
00080   G4int  CheckForBaryons();
00081   G4int  CheckForNuclei();
00082   
00083 
00084  private:
00085   G4int verboseLevel;
00086 
00087   G4int code;
00088   G4String theParticleType;
00089 
00090   G4int higherSpin;
00091   G4int exotic;
00092   G4int radial;
00093   G4int multiplet;
00094   G4int quark1;
00095   G4int quark2;
00096   G4int quark3;
00097   G4int spin;
00098 
00099   G4int  theQuarkContent[NumberOfQuarkFlavor];
00100   G4int  theAntiQuarkContent[NumberOfQuarkFlavor];
00101   //  the number of quark (minus Sign means anti-quark) contents
00102   //  The value of flavor is assigned as follows 
00103   //    0:d, 1:u, 2:s, 3:c, 
00104   //    4:b, 5:t, 6:l(down type quark) 7:h(up type quark) 
00105 
00106 };
00107 
00108 inline
00109   G4int  G4PDGCodeChecker::GetQuarkContent(G4int flavor) const
00110 {
00111   G4int value = 0;
00112   if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
00113     value = theQuarkContent[flavor];
00114   }
00115   return value;
00116 }
00117 
00118 inline
00119   G4int  G4PDGCodeChecker::GetAntiQuarkContent(G4int flavor) const
00120 {
00121   G4int value = 0;
00122   if ((flavor>=0)&&(flavor<NumberOfQuarkFlavor)) {
00123     value = theAntiQuarkContent[flavor];
00124   }
00125   return value;
00126 }
00127 
00128 
00129 inline
00130   G4int G4PDGCodeChecker::GetQuarkFlavor(G4int idx) const
00131 {
00132   G4int value;
00133   if (idx ==0) value = quark1;
00134   else if (idx ==1) value = quark2;
00135   else if (idx ==2) value = quark3;
00136   else value = -1;
00137   return value;
00138 }
00139 
00140 inline
00141   G4int G4PDGCodeChecker::GetExotic() const
00142 {
00143   return exotic;
00144 }
00145 
00146 inline
00147   G4int G4PDGCodeChecker::GetRadial() const
00148 {
00149   return radial;
00150 }
00151 
00152 inline
00153   G4int G4PDGCodeChecker::GetMultiplet() const
00154 {
00155   return multiplet;
00156 }
00157 
00158 inline
00159   G4int G4PDGCodeChecker::GetSpin() const
00160 {
00161   return spin;
00162 }
00163 
00164 inline
00165   G4bool G4PDGCodeChecker::IsAntiParticle() const
00166 {
00167   return (code <0);
00168 }
00169 
00170 inline 
00171   void G4PDGCodeChecker::SetVerboseLevel(G4int value)
00172 {
00173    verboseLevel = value;
00174 }
00175 
00176 inline 
00177   G4int G4PDGCodeChecker::GetVerboseLevel() const
00178 {
00179    return verboseLevel;
00180 }
00181 
00182 
00183 #endif
00184 
00185 
00186 
00187 
00188 
00189 

Generated on Mon May 27 17:49:17 2013 for Geant4 by  doxygen 1.4.7