G4QContent.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$
00028 //
00029 //      ---------------- G4QContent ----------------
00030 //             by Mikhail Kossov, Sept 1999.
00031 //  class header for Quasmon initiated Contents used by the CHIPS Model
00032 // ----------------------------------------------------------------------
00033 // Short description: This is the basic class of the CHIPS model. It
00034 // describes the quark content of the Quasmon, which is a generalized
00035 // hadronic state. All Quasmons are bags, characterized by the quark
00036 // Content (QContent), but the spin is not fixed and only light (u,d,s)
00037 // quarks are considered (SU(3)). The hadrons are the ground states for
00038 // the corresponding quasmons. The Chipolino (G4QChipolino) or nuclear
00039 // cluster are examples for another Quark Content.
00040 // --------------------------------------------------------------------
00041 // @@ In future total spin & c,b,t of the Hadron can be added @@ M.K.@@
00042 // --------------------------------------------------------------------
00043 
00044 #ifndef G4QContent_h
00045 #define G4QContent_h 1
00046 
00047 #include <iostream>
00048 #include "globals.hh"
00049 #include "Randomize.hh"
00050 #include "G4QException.hh"
00051 
00052 class G4QContent
00053 {
00054 public:
00055   G4QContent(G4int d=0, G4int u=0, G4int s=0, G4int ad=0, G4int au=0, G4int as=0);
00056   G4QContent(std::pair<G4int,G4int> PP); // Create HadronQC from two partons
00057   G4QContent(const G4QContent& rhs);     // Copy constructor by value
00058   G4QContent(G4QContent* rhs);           // Copy constructor by pointer
00059 
00060   ~G4QContent();                         // Public Destructor
00061 
00062   // Overloaded operators
00063   const G4QContent& operator=(const G4QContent& rhs);
00064   G4bool            operator==(const G4QContent& rhs) const;
00065   G4bool            operator!=(const G4QContent& rhs) const;
00066   G4QContent        operator+=(G4QContent& rhs);
00067   G4QContent        operator-=(G4QContent& rhs);
00068   G4QContent        operator*=(G4int& rhs);
00069   G4QContent        operator+=(const G4QContent& rhs);
00070   G4QContent        operator-=(const G4QContent& rhs);
00071   G4QContent        operator*=(const G4int& rhs);
00072 
00073   // Selectors  
00074   G4int             GetCharge() const;
00075   G4int             GetBaryonNumber() const;
00076   G4int             GetStrangeness() const;
00077   G4int             GetSPDGCode() const;
00078   G4int             GetZNSPDGCode() const;
00079   G4int             NOfCombinations(const G4QContent& rhs) const;//@@ can be an "operator/"
00080   G4int             GetQ() const;
00081   G4int             GetAQ() const;
00082   G4int             GetTot() const; 
00083   G4bool            CheckNegative() const;
00084 
00085   G4int GetP() const;       // A#of protons
00086   G4int GetN() const;       // A#of neutrons
00087   G4int GetL() const;       // A#of lambdas
00088   G4int GetAP() const;      // A#of anti-protons
00089   G4int GetAN() const;      // A#of anti-neutrons
00090   G4int GetAL() const;      // A#of anti-lambdas
00091 
00092   G4int GetD() const;       // A#of d-quarks
00093   G4int GetU() const;       // A#of u-quarks
00094   G4int GetS() const;       // A#of s-quarks
00095   G4int GetAD() const;      // A#of anti-d-quarks
00096   G4int GetAU() const;      // A#of anti-u-quarks
00097   G4int GetAS() const;      // A#of anti-s-quarks
00098 
00099   G4int GetNetD() const;    // A net#of d-quarks
00100   G4int GetNetU() const;    // A net#of u-quarks
00101   G4int GetNetS() const;    // A net#of s-quarks
00102   G4int GetNetAD() const;   // A net#of anti-d-quarks
00103   G4int GetNetAU() const;   // A net#of anti-u-quarks
00104   G4int GetNetAS() const;   // A net#of anti-s-quarks
00105 
00106   G4int GetDD() const;      // A#of dd-di-quarks
00107   G4int GetUU() const;      // A#of uu-di-quarks
00108   G4int GetSS() const;      // A#of ss-di-quarks
00109   G4int GetUD() const;      // A#of ud-di-quarks
00110   G4int GetDS() const;      // A#of ds-di-quarks
00111   G4int GetUS() const;      // A#of us-di-quarks
00112   G4int GetADAD() const;    // A#of anti-dd-di-quarks
00113   G4int GetAUAU() const;    // A#of anti-uu-di-quarks
00114   G4int GetASAS() const;    // A#of anti-ss-di-quarks
00115   G4int GetAUAD() const;    // A#of anti-ud-di-quarks
00116   G4int GetADAS() const;    // A#of anti-ds-di-quarks
00117   G4int GetAUAS() const;    // A#of anti-us-di-quarks
00118 
00119   std::pair<G4int,G4int> MakePartonPair() const;// Make PDG's of PartonPairs for Mes&Baryon
00120   G4int AddParton(G4int pPDG) const; // Add parton with pPDG to the hadron with this QC
00121 
00122   // Modifiers
00123   void              Anti();
00124   G4QContent        IndQ (G4int ind=0);
00125   G4QContent        IndAQ(G4int ind=0);
00126   G4QContent        SplitChipo(G4double mQ);
00127   G4bool            SubtractHadron(G4QContent h);
00128   G4bool            SubtractPi0();
00129   G4bool            SubtractPion();
00130   G4bool            SubtractKaon(G4double mQ);
00131 
00132   void SetD (G4int n=0);
00133   void SetU (G4int n=0);
00134   void SetS (G4int n=0);
00135   void SetAD(G4int n=0);
00136   void SetAU(G4int n=0);
00137   void SetAS(G4int n=0);
00138 
00139   void IncD (G4int n=1);
00140   void IncU (G4int n=1);
00141   void IncS (G4int n=1);
00142   void IncAD(G4int n=1);
00143   void IncAU(G4int n=1);
00144   void IncAS(G4int n=1);
00145   void IncQAQ(const G4int& nQAQ=1, const G4double& sProb = 1.);
00146 
00147   void DecD (G4int n=1);
00148   void DecU (G4int n=1);
00149   void DecS (G4int n=1);
00150   void DecAD(G4int n=1);
00151   void DecAU(G4int n=1);
00152   void DecAS(G4int n=1);
00153   G4int DecQAQ(const G4int& nQAQ=1);
00154 
00155 private:
00156   G4QContent        GetThis() const;
00157 
00158   // Body
00159 private:            //                       C    S
00160   G4int nD;         // a#of      d-quarks (-1/3)( 0)
00161   G4int nU;         // a#of      u-quarks (+2/3)( 0)
00162   G4int nS;         // a#of      s-quarks (-1/3)(+1)
00163   G4int nAD;        // a#of anti-d-quarks (+1/3)( 0)
00164   G4int nAU;        // a#of anti-u-quarks (-2/3)( 0)
00165   G4int nAS;        // a#of anti-s-quarks (+1/3)(-1)
00166 };
00167 
00168 // Not member operators
00169 std::ostream&   operator<<(std::ostream& lhs, G4QContent& rhs);
00170 std::ostream&   operator<<(std::ostream& lhs, const G4QContent& rhs);
00171 G4QContent operator+(const G4QContent& lhs, const G4QContent& rhs);
00172 G4QContent operator-(const G4QContent& lhs, const G4QContent& rhs);
00173 G4QContent operator*(const G4QContent& lhs, const G4int&      rhs);
00174 G4QContent operator*(const G4int&      lhs, const G4QContent& rhs);
00175 //G4int      operator/(const G4QContent& lhs, const G4QContent& rhs); // Combinations
00176 // Not member functions
00177 //----------------------------------------------------------------------------------------
00178 
00179 inline G4bool     G4QContent::operator==(const G4QContent& rhs) const {return this==&rhs;}
00180 inline G4bool     G4QContent::operator!=(const G4QContent& rhs) const {return this!=&rhs;}
00181 inline G4int      G4QContent::GetQ() const {return nU+nD+nS;}
00182 inline G4int      G4QContent::GetAQ() const {return nAU+nAD+nAS;}
00183 inline G4int      G4QContent::GetTot() const {return nU+nD+nS+nAU+nAD+nAS;}
00184 inline G4int      G4QContent::GetStrangeness() const {return nS-nAS;}
00185 // @@ Temporary for tests
00186 inline G4bool G4QContent::CheckNegative() const
00187                                             {return nU<0||nD<0||nS<0||nAU<0||nAD<0||nAS<0;}
00188 
00189 inline G4int G4QContent::GetU() const{return nU;}
00190 inline G4int G4QContent::GetD() const{return nD;}
00191 inline G4int G4QContent::GetS() const{return nS;}
00192 inline G4int G4QContent::GetAU() const{return nAU;}
00193 inline G4int G4QContent::GetAD() const{return nAD;}
00194 inline G4int G4QContent::GetAS() const{return nAS;}
00195 
00196 inline G4int G4QContent::GetNetU() const{return nU-nAU;}
00197 inline G4int G4QContent::GetNetD() const{return nD-nAD;}
00198 inline G4int G4QContent::GetNetS() const{return nS-nAS;}
00199 inline G4int G4QContent::GetNetAU() const{return nAU-nU;}
00200 inline G4int G4QContent::GetNetAD() const{return nAD-nD;}
00201 inline G4int G4QContent::GetNetAS() const{return nAS-nS;}
00202 
00203 inline G4int G4QContent::GetUU() const{return nU*(nU-1)/2;}
00204 inline G4int G4QContent::GetDD() const{return nD*(nD-1)/2;}
00205 inline G4int G4QContent::GetSS() const{return nS*(nS-1)/2;}
00206 inline G4int G4QContent::GetUD() const{return nU*nD;}
00207 inline G4int G4QContent::GetUS() const{return nU*nS;}
00208 inline G4int G4QContent::GetDS() const{return nD*nS;}
00209 inline G4int G4QContent::GetAUAU() const{return nAU*(nAU-1)/2;}
00210 inline G4int G4QContent::GetADAD() const{return nAD*(nAD-1)/2;}
00211 inline G4int G4QContent::GetASAS() const{return nAS*(nAS-1)/2;}
00212 inline G4int G4QContent::GetAUAD() const{return nAU*nAD;}
00213 inline G4int G4QContent::GetAUAS() const{return nAU*nAS;}
00214 inline G4int G4QContent::GetADAS() const{return nAD*nAS;}
00215 
00216 // Convert particle to anti-particle
00217 inline G4int G4QContent::GetZNSPDGCode() const
00218 {
00219   G4int kD=nD-nAD;                           // A net # of d quarks
00220   G4int kU=nU-nAU;                           // A net # of u quarks
00221   G4int kS=nS-nAS;                           // A net # of s quarks
00222   // if(kD>=0&&kU>=0&&kS>=0&&kD+kU+kS>0)        // => "Normal nucleus" case
00223   //{
00224   //  G4int b=(kU+kD-kS-kS)/3;
00225   //  G4int d=kU-kD;
00226   //  G4int n=(b-d)/2;
00227   //  return 90000000+1000*(1000*kS+n+d)+n;
00228   //}
00229   //else if(kD<=0&&kU<=0&&kS<=0&&kD+kU+kS<0)   // => "Normal anti-nucleus" case
00230   //{
00231   //  G4int b=(kS+kS-kD-kU)/3;
00232   //  G4int d=kD-kU;
00233   //  G4int n=(b-d)/2;
00234   //  return -90000000-1000*(1000*kS+n+d)-n;   // @@ double notation for anti-nuclei
00235   //}
00236   //else
00237   //{
00238     G4int b=(kU+kD-kS-kS)/3;                 // Baryon number-n*{LAMBDA=kS)
00239     if(!b && !kS) return GetSPDGCode();      // Not a nucleus
00240     G4int d=kU-kD;                           // Isotopic shift
00241     G4int n=(b-d)/2;                         // A#of neutrons
00242     return 90000000+1000*(1000*kS+n+d)+n;
00243   //}
00244   //return 0;
00245 }
00246 
00247 // Convert particle to anti-particle
00248 inline void G4QContent::Anti()
00249 {
00250   G4int r=nD;
00251   nD = nAD;
00252   nAD= r;
00253   r  = nU;
00254   nU = nAU;
00255   nAU= r;
00256   r  = nS;
00257   nS = nAS;
00258   nAS= r;
00259 }
00260 
00261 // Add Quark Content
00262 inline G4QContent G4QContent::operator+=(const G4QContent& rhs)
00263 {
00264   nD += rhs.nD;
00265   nU += rhs.nU;
00266   nS += rhs.nS;
00267   nAD+= rhs.nAD;
00268   nAU+= rhs.nAU;
00269   nAS+= rhs.nAS;
00270   return *this;
00271 } 
00272 
00273 // Add Quark Content
00274 inline G4QContent G4QContent::operator+=(G4QContent& rhs)
00275 {
00276   nD += rhs.nD;
00277   nU += rhs.nU;
00278   nS += rhs.nS;
00279   nAD+= rhs.nAD;
00280   nAU+= rhs.nAU;
00281   nAS+= rhs.nAS;
00282   return *this;
00283 } 
00284 
00285 // Multiply Quark Content by integer number
00286 inline G4QContent G4QContent::operator*=(const G4int& rhs)
00287 {
00288   nU *= rhs;
00289   nD *= rhs;
00290   nS *= rhs;
00291   nAU*= rhs;
00292   nAD*= rhs;
00293   nAS*= rhs;
00294   return *this;
00295 } 
00296 
00297 // Multiply Quark Content by integer number
00298 inline G4QContent G4QContent::operator*=(G4int& rhs)
00299 {
00300   nU *= rhs;
00301   nD *= rhs;
00302   nS *= rhs;
00303   nAU*= rhs;
00304   nAD*= rhs;
00305   nAS*= rhs;
00306   return *this;
00307 } 
00308 
00309 inline void  G4QContent::SetU(G4int n) {nU=n;}
00310 inline void  G4QContent::SetD(G4int n) {nD=n;}
00311 inline void  G4QContent::SetS(G4int n) {nS=n;}
00312 inline void  G4QContent::SetAU(G4int n){nAU=n;}
00313 inline void  G4QContent::SetAD(G4int n){nAD=n;}
00314 inline void  G4QContent::SetAS(G4int n){nAS=n;}
00315 
00316 inline void  G4QContent::IncU(G4int n) {nU+=n;}
00317 inline void  G4QContent::IncD(G4int n) {nD+=n;}
00318 inline void  G4QContent::IncS(G4int n) {nS+=n;}
00319 inline void  G4QContent::IncAU(G4int n){nAU+=n;}
00320 inline void  G4QContent::IncAD(G4int n){nAD+=n;}
00321 inline void  G4QContent::IncAS(G4int n){nAS+=n;}
00322 
00323 inline void  G4QContent::DecU(G4int n) {nU-=n;}
00324 inline void  G4QContent::DecD(G4int n) {nD-=n;}
00325 inline void  G4QContent::DecS(G4int n) {nS-=n;}
00326 inline void  G4QContent::DecAU(G4int n){nAU-=n;}
00327 inline void  G4QContent::DecAD(G4int n){nAD-=n;}
00328 inline void  G4QContent::DecAS(G4int n){nAS-=n;}
00329 
00330 // Private member functions
00331 inline G4QContent G4QContent::GetThis()const{return G4QContent(nD,nU,nS,nAD,nAU,nAS);}
00332 #endif

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