Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4INCLProjectileRemnant.hh
이 파일의 문서화 페이지로 가기
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 // INCL++ intra-nuclear cascade model
27 // Alain Boudard, CEA-Saclay, France
28 // Joseph Cugnon, University of Liege, Belgium
29 // Jean-Christophe David, CEA-Saclay, France
30 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland
31 // Sylvie Leray, CEA-Saclay, France
32 // Davide Mancusi, CEA-Saclay, France
33 //
34 #define INCLXX_IN_GEANT4_MODE 1
35 
36 #include "globals.hh"
37 
45 #ifndef G4INCLPROJECTILEREMNANT_HH_
46 #define G4INCLPROJECTILEREMNANT_HH_
47 
48 #include "G4INCLCluster.hh"
49 #include "G4INCLRandom.hh"
50 #include "G4INCLAllocationPool.hh"
51 #include <vector>
52 #include <map>
53 #include <numeric>
54 #include <functional>
55 
56 namespace G4INCL {
57 
58  class ProjectileRemnant : public Cluster {
59  public:
60 
61  // typedefs for the calculation of the projectile excitation energy
62  typedef std::vector<G4double> EnergyLevels;
63  typedef std::map<long, G4double> EnergyLevelMap;
64 
66  : Cluster(species.theZ, species.theA, species.theS) {
67 
68  // Use the table mass
69  setTableMass();
70 
71  // Set the kinematics
72  const G4double projectileMass = getMass();
73  const G4double energy = kineticEnergy + projectileMass;
74  const G4double momentumZ = std::sqrt(energy*energy - projectileMass*projectileMass);
75 
76  // Initialise the particles
80 
81  // Store the energy levels of the ProjectileRemnant (used to compute its
82  // excitation energy)
84 
85  // Boost the whole thing
86  const ThreeVector aBoostVector = ThreeVector(0.0, 0.0, momentumZ / energy);
87  boost(-aBoostVector);
88 
89  // Freeze the internal motion of the particles
91 
92  // Set as projectile spectator
94  }
95 
98  // The ProjectileRemnant owns its particles
101  }
102 
104  void reset();
105 
111  void removeParticle(Particle * const p, const G4double theProjectileCorrection);
112 
122 
133 
139 
142  for(std::map<long,Particle*>::const_iterator p=storedComponents.begin(), e=storedComponents.end(); p!=e; ++p)
143  delete p->second;
145  }
146 
149  storedComponents.clear();
150  }
151 
154  theInitialEnergyLevels.clear();
155  theGroundStateEnergies.clear();
156  }
157 
167  G4double computeExcitationEnergyExcept(const long exceptID) const;
168 
174 
177  for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
178  // Store the particles (needed for forced CN)
179  storedComponents[(*p)->getID()]=new Particle(**p);
180  }
181  }
182 
185  return storedComponents.size();
186  }
187 
190  EnergyLevels energies;
191 
192  for(ParticleIter p=particles.begin(), e=particles.end(); p!=e; ++p) {
193  const G4double theCMEnergy = (*p)->getEnergy();
194  // Store the CM energy in the EnergyLevels map
195  theInitialEnergyLevels[(*p)->getID()] = theCMEnergy;
196  energies.push_back(theCMEnergy);
197  }
198 
199  std::sort(energies.begin(), energies.end());
200 // assert(energies.size()==(unsigned int)theA);
201  theGroundStateEnergies.resize(energies.size());
202  // Compute the partial sums of the CM energies -- they are our reference
203  // ground-state energies for any number of nucleons
204  std::partial_sum(energies.begin(), energies.end(), theGroundStateEnergies.begin());
205  }
206 
208  return theGroundStateEnergies;
209  }
210 
211  private:
212 
221  G4double computeExcitationEnergy(const EnergyLevels &levels) const;
222 
223  EnergyLevels getPresentEnergyLevelsExcept(const long exceptID) const;
224 
226 
230  std::random_shuffle(pL.begin(), pL.end(), Random::getAdapter());
231  return pL;
232  }
233 
235  ParticleList pL;
236  for(std::map<long,Particle*>::const_iterator p=storedComponents.begin(), e=storedComponents.end(); p!=e; ++p)
237  pL.push_back(p->second);
238  return pL;
239  }
240 
242  ThreeVector const &getStoredMomentum(Particle const * const p) const {
243  std::map<long,Particle*>::const_iterator i = storedComponents.find(p->getID());
244  if(i==storedComponents.end()) {
245  INCL_ERROR("Couldn't find particle " << p->getID() << " in the list of projectile components" << '\n');
246  return p->getMomentum();
247  } else {
248  return i->second->getMomentum();
249  }
250  }
251 
259 
261  /* G4double getStoredEnergy(Particle const * const p) {
262  std::map<long,Particle*>::const_iterator i = initialProjectileComponents.find(p->getID());
263  if(i==initialProjectileComponents.end()) {
264  INCL_ERROR("Couldn't find particle " << p->getID() << " in the list of projectile components" << '\n');
265  return 0.;
266  } else {
267  return i->second->getEnergy();
268  }
269  }*/
270 
275  std::map<long, Particle*> storedComponents;
276 
279 
282 
284  };
285 }
286 
287 #endif // G4INCLPROJECTILEREMNANT_HH_
288 
ParticleList::const_iterator ParticleIter
void boost(const ThreeVector &aBoostVector)
Boost the cluster with the indicated velocity.
void setTableMass()
Set the mass of the Particle to its table mass.
#define INCL_DECLARE_ALLOCATION_POOL(T)
void deleteStoredComponents()
Clear the stored projectile components and delete the particles.
ParticleList addDynamicalSpectators(ParticleList pL)
Add back dynamical spectators to the projectile remnant.
const G4INCL::ThreeVector & getMomentum() const
ParticleList addAllDynamicalSpectators(ParticleList const &pL)
Add back all dynamical spectators to the projectile remnant.
const char * p
Definition: xmltok.h:285
long getID() const
G4bool addDynamicalSpectator(Particle *const p)
Add back a nucleon to the projectile remnant.
G4double computeExcitationEnergyExcept(const long exceptID) const
Compute the excitation energy when a nucleon is removed.
std::map< long, G4double > EnergyLevelMap
G4double getMass() const
Get the cached particle mass.
ParticleList shuffleStoredComponents()
Shuffle the list of stored projectile components.
ParticleList particles
EnergyLevels const & getGroundStateEnergies() const
void clearEnergyLevels()
Clear the stored energy levels.
Adapter const & getAdapter()
void storeEnergyLevels()
Store the energy levels.
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
std::vector< G4double > EnergyLevels
virtual void makeProjectileSpectator()
Make all the components projectile spectators, too.
void storeComponents()
Store the projectile components.
ThreeVector const & getStoredMomentum(Particle const *const p) const
Return the stored momentum of a given projectile component.
void putParticlesOffShell()
Put the cluster components off shell.
#define INCL_ERROR(x)
void clearStoredComponents()
Clear the stored projectile components.
void freezeInternalMotion()
Freeze the internal motion of the particles.
double energy
Definition: plottest35.C:25
G4int getNumberStoredComponents() const
Get the number of the stored components.
Singleton for recycling allocation of instances of a given class.
void reset()
Reset the projectile remnant to the state at the beginning of the cascade.
EnergyLevels theGroundStateEnergies
Ground-state energies for any number of nucleons.
int G4int
Definition: G4Types.hh:78
ProjectileRemnant(ParticleSpecies const &species, const G4double kineticEnergy)
void internalBoostToCM()
Boost to the CM of the component particles.
EnergyLevels getPresentEnergyLevelsWith(const ParticleList &pL) const
virtual void initializeParticles()
Initialise the NuclearDensity pointer and sample the particles.
EnergyLevelMap theInitialEnergyLevels
Initial energy levels of the projectile.
void removeParticle(Particle *const p, const G4double theProjectileCorrection)
Remove a nucleon from the projectile remnant.
ParticleList addMostDynamicalSpectators(ParticleList pL)
Add back dynamical spectators to the projectile remnant.
G4double computeExcitationEnergyWith(const ParticleList &pL) const
Compute the excitation energy if some nucleons are put back.
ParticleList getStoredComponents() const
G4double computeExcitationEnergy(const EnergyLevels &levels) const
Compute the excitation energy for a given configuration.
std::map< long, Particle * > storedComponents
Return the stored energy of a given projectile component.
EnergyLevels getPresentEnergyLevelsExcept(const long exceptID) const