G4ExitonConfiguration.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 // $Id$
00027 //
00028 // 20100909  Add function to reset values to zero
00029 // 20100924  Migrate to integer A and Z
00030 // 20110225  M. Kelsey -- Add equality operator (NOT sorting!)
00031 // 20110922  M. Kelsey -- Replace print() with stream operator<<(), put
00032 //              implementation into new .cc file.
00033 // 20121009  M. Kelsey -- Add empty() test for no excitons, fix constness
00034 
00035 #ifndef G4EXITON_CONFIGURATION_HH
00036 #define G4EXITON_CONFIGURATION_HH
00037 
00038 #include "globals.hh"
00039 #include <iosfwd>
00040 
00041 class G4ExitonConfiguration {
00042 public:
00043   G4ExitonConfiguration() 
00044     : protonQuasiParticles(0), neutronQuasiParticles(0),
00045       protonHoles(0), neutronHoles(0) {}
00046 
00047   G4ExitonConfiguration(G4int qpp, G4int qnp, G4int qph, G4int qnh) 
00048     : protonQuasiParticles(qpp), neutronQuasiParticles(qnp), 
00049       protonHoles(qph), neutronHoles(qnh) {}
00050 
00051   void clear() {
00052     protonQuasiParticles = neutronQuasiParticles = 0;
00053     protonHoles = neutronHoles = 0;
00054   }
00055 
00056   bool empty() const {
00057     return (protonQuasiParticles==0 && neutronQuasiParticles==0 &&
00058             protonHoles==0 && neutronHoles==0);
00059   }
00060 
00061   bool operator==(const G4ExitonConfiguration& right) const {
00062     return ( (&right == this) ||
00063              (protonQuasiParticles == right.protonQuasiParticles &&
00064               neutronQuasiParticles == right.neutronQuasiParticles &&
00065               protonHoles == right.protonHoles &&
00066               neutronHoles == right.neutronHoles) );
00067   }
00068 
00069   bool operator!=(const G4ExitonConfiguration& right) const {
00070     return !operator==(right);
00071   }
00072 
00073 
00074   // Modify configuration
00075 
00076   void incrementQP(G4int ip) {
00077     if (ip == 1) protonQuasiParticles++;
00078     else if (ip == 2) neutronQuasiParticles++;
00079   }
00080 
00081   void incrementHoles(G4int ip) {
00082     if (ip == 1) protonHoles++;
00083     else if (ip == 2) neutronHoles++;
00084   }
00085 
00086   G4int protonQuasiParticles;
00087   G4int neutronQuasiParticles;
00088   G4int protonHoles;
00089   G4int neutronHoles;
00090 };        
00091 
00092 // Dump information to output
00093 
00094 std::ostream& operator<<(std::ostream& os, const G4ExitonConfiguration& ex);
00095 
00096 #endif // G4EXITON_CONFIGURATION_HH 

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