Geant4  10.01.p01
G4ExitonConfiguration.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4ExitonConfiguration.hh 71942 2013-06-28 19:08:11Z mkelsey $
27 //
28 // 20100909 Add function to reset values to zero
29 // 20100924 Migrate to integer A and Z
30 // 20110225 M. Kelsey -- Add equality operator (NOT sorting!)
31 // 20110922 M. Kelsey -- Replace print() with stream operator<<(), put
32 // implementation into new .cc file.
33 // 20121009 M. Kelsey -- Add empty() test for no excitons, fix constness
34 // 20130622 M. Kelsey -- Add interface to copy data from G4Fragment
35 
36 #ifndef G4EXITON_CONFIGURATION_HH
37 #define G4EXITON_CONFIGURATION_HH
38 
39 #include "globals.hh"
40 #include <iosfwd>
41 
42 class G4Fragment;
43 
45 public:
48  protonHoles(0), neutronHoles(0) {}
49 
52  protonHoles(qph), neutronHoles(qnh) {}
53 
54  explicit G4ExitonConfiguration(const G4Fragment& frag)
56  protonHoles(0), neutronHoles(0) { fill(frag); }
57 
58 
59  void clear() {
62  }
63 
64  bool empty() const {
66  protonHoles==0 && neutronHoles==0);
67  }
68 
69  void fill(const G4Fragment& frag); // Initialize from G4Fragment data
70 
71  bool operator==(const G4ExitonConfiguration& right) const {
72  return ( (&right == this) ||
75  protonHoles == right.protonHoles &&
76  neutronHoles == right.neutronHoles) );
77  }
78 
79  bool operator!=(const G4ExitonConfiguration& right) const {
80  return !operator==(right);
81  }
82 
83 
84  // Modify configuration
85 
86  void incrementQP(G4int ip) {
87  if (ip == 1) protonQuasiParticles++;
88  else if (ip == 2) neutronQuasiParticles++;
89  }
90 
91  void incrementHoles(G4int ip) {
92  if (ip == 1) protonHoles++;
93  else if (ip == 2) neutronHoles++;
94  }
95 
100 };
101 
102 // Dump information to output
103 
104 std::ostream& operator<<(std::ostream& os, const G4ExitonConfiguration& ex);
105 
106 #endif // G4EXITON_CONFIGURATION_HH
bool operator==(const G4ExitonConfiguration &right) const
void fill(const G4Fragment &frag)
int G4int
Definition: G4Types.hh:78
std::ostream & operator<<(std::ostream &os, const G4ExitonConfiguration &ex)
G4ExitonConfiguration(G4int qpp, G4int qnp, G4int qph, G4int qnh)
bool operator!=(const G4ExitonConfiguration &right) const
G4ExitonConfiguration(const G4Fragment &frag)