File indexing completed on 2025-01-18 09:58:15
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035 #ifndef G4EXITON_CONFIGURATION_HH
0036 #define G4EXITON_CONFIGURATION_HH
0037
0038 #include "globals.hh"
0039 #include <iosfwd>
0040
0041 class G4Fragment;
0042
0043 class G4ExitonConfiguration {
0044 public:
0045 G4ExitonConfiguration()
0046 : protonQuasiParticles(0), neutronQuasiParticles(0),
0047 protonHoles(0), neutronHoles(0) {}
0048
0049 G4ExitonConfiguration(G4int qpp, G4int qnp, G4int qph, G4int qnh)
0050 : protonQuasiParticles(qpp), neutronQuasiParticles(qnp),
0051 protonHoles(qph), neutronHoles(qnh) {}
0052
0053 explicit G4ExitonConfiguration(const G4Fragment& frag)
0054 : protonQuasiParticles(0), neutronQuasiParticles(0),
0055 protonHoles(0), neutronHoles(0) { fill(frag); }
0056
0057
0058 void clear() {
0059 protonQuasiParticles = neutronQuasiParticles = 0;
0060 protonHoles = neutronHoles = 0;
0061 }
0062
0063 bool empty() const {
0064 return (protonQuasiParticles==0 && neutronQuasiParticles==0 &&
0065 protonHoles==0 && neutronHoles==0);
0066 }
0067
0068 void fill(const G4Fragment& frag);
0069
0070 G4bool operator==(const G4ExitonConfiguration& right) const {
0071 return ( (&right == this) ||
0072 (protonQuasiParticles == right.protonQuasiParticles &&
0073 neutronQuasiParticles == right.neutronQuasiParticles &&
0074 protonHoles == right.protonHoles &&
0075 neutronHoles == right.neutronHoles) );
0076 }
0077
0078 G4bool operator!=(const G4ExitonConfiguration& right) const {
0079 return !operator==(right);
0080 }
0081
0082
0083
0084
0085 void incrementQP(G4int ip) {
0086 if (ip == 1) protonQuasiParticles++;
0087 else if (ip == 2) neutronQuasiParticles++;
0088 }
0089
0090 void incrementHoles(G4int ip) {
0091 if (ip == 1) protonHoles++;
0092 else if (ip == 2) neutronHoles++;
0093 }
0094
0095 G4int protonQuasiParticles;
0096 G4int neutronQuasiParticles;
0097 G4int protonHoles;
0098 G4int neutronHoles;
0099 };
0100
0101
0102
0103 std::ostream& operator<<(std::ostream& os, const G4ExitonConfiguration& ex);
0104
0105 #endif