Import Geant4 9.5.0 source tree
This commit is contained in:
@@ -26,49 +26,68 @@
|
||||
#ifndef G4HadFinalState_hh
|
||||
#define G4HadFinalState_hh
|
||||
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
// Modifications:
|
||||
// 20110810 M. Kelsey -- Store secondaries by value, not by pointer.
|
||||
// Improve constness of argument passing. Drop stale flag.
|
||||
// 20110907 M. Kelsey -- Improve constness of functions, discard add pointer,
|
||||
// add function to concatenate vectors
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4HadSecondary.hh"
|
||||
#include "G4LorentzRotation.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include <vector>
|
||||
|
||||
enum G4HadFinalStateStatus{isAlive, stopAndKill, suspend};
|
||||
|
||||
|
||||
class G4HadFinalState
|
||||
{
|
||||
public:
|
||||
G4HadFinalState();
|
||||
G4int GetNumberOfSecondaries();
|
||||
void SetEnergyChange(G4double anEnergy);
|
||||
G4double GetEnergyChange();
|
||||
void SetMomentumChange(G4ThreeVector aV);
|
||||
void SetMomentumChange(G4double x, G4double y, G4double z) ;
|
||||
G4ThreeVector GetMomentumChange();
|
||||
void AddSecondary(G4DynamicParticle * aP);
|
||||
void AddSecondary(G4HadSecondary * aP);
|
||||
void SetStatusChange(G4HadFinalStateStatus aS);
|
||||
G4HadFinalStateStatus GetStatusChange();
|
||||
void Clear();
|
||||
G4LorentzRotation & GetTrafoToLab();
|
||||
void SetTrafoToLab(G4LorentzRotation & aT);
|
||||
void SetWeightChange(G4double aW);
|
||||
G4double GetWeightChange();
|
||||
G4HadSecondary * GetSecondary(size_t i);
|
||||
void SetLocalEnergyDeposit(G4double aE);
|
||||
G4double GetLocalEnergyDeposit();
|
||||
void SecondariesAreStale();
|
||||
void ClearSecondaries();
|
||||
|
||||
private:
|
||||
G4ThreeVector theDirection;
|
||||
G4double theEnergy;
|
||||
std::vector<G4HadSecondary *> theSecs;
|
||||
G4HadFinalStateStatus theStat;
|
||||
G4LorentzRotation theT;
|
||||
G4double theW;
|
||||
G4double theEDep;
|
||||
G4bool hasStaleSecondaries;
|
||||
public:
|
||||
G4HadFinalState();
|
||||
|
||||
G4int GetNumberOfSecondaries() const;
|
||||
void SetEnergyChange(G4double anEnergy);
|
||||
G4double GetEnergyChange() const;
|
||||
void SetMomentumChange(const G4ThreeVector& aV);
|
||||
void SetMomentumChange(G4double x, G4double y, G4double z) ;
|
||||
const G4ThreeVector& GetMomentumChange() const;
|
||||
void AddSecondary(G4DynamicParticle* aP);
|
||||
void AddSecondary(const G4HadSecondary& aHS) { theSecs.push_back(aHS); }
|
||||
void SetStatusChange(G4HadFinalStateStatus aS);
|
||||
G4HadFinalStateStatus GetStatusChange() const;
|
||||
void Clear();
|
||||
const G4LorentzRotation& GetTrafoToLab() const;
|
||||
void SetTrafoToLab(const G4LorentzRotation & aT);
|
||||
void SetWeightChange(G4double aW);
|
||||
G4double GetWeightChange() const;
|
||||
G4HadSecondary* GetSecondary(size_t i);
|
||||
const G4HadSecondary* GetSecondary(size_t i) const;
|
||||
void SetLocalEnergyDeposit(G4double aE);
|
||||
G4double GetLocalEnergyDeposit() const;
|
||||
void SecondariesAreStale(); // Deprecated; not needed for values
|
||||
void ClearSecondaries();
|
||||
|
||||
// Concatenate lists efficiently
|
||||
void AddSecondaries(const std::vector<G4HadSecondary>& addSecs);
|
||||
|
||||
void AddSecondaries(const G4HadFinalState& addHFS) {
|
||||
AddSecondaries(addHFS.theSecs);
|
||||
}
|
||||
|
||||
void AddSecondaries(const G4HadFinalState* addHFS) {
|
||||
if (addHFS) AddSecondaries(addHFS->theSecs);
|
||||
}
|
||||
|
||||
private:
|
||||
G4ThreeVector theDirection;
|
||||
G4double theEnergy;
|
||||
std::vector<G4HadSecondary> theSecs;
|
||||
G4HadFinalStateStatus theStat;
|
||||
G4LorentzRotation theT;
|
||||
G4double theW;
|
||||
G4double theEDep;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -23,20 +23,25 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// 20110907 M. Kelsey -- Fix constness for accessors
|
||||
|
||||
#ifndef G4HadSecondary_hh
|
||||
#define G4HadSecondary_hh
|
||||
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4DynamicParticle;
|
||||
|
||||
class G4HadSecondary
|
||||
{
|
||||
public:
|
||||
G4HadSecondary(G4DynamicParticle * aT, G4double aWeight = 1);
|
||||
G4DynamicParticle * GetParticle() {return theP;}
|
||||
G4double GetWeight() {return theWeight;}
|
||||
const G4DynamicParticle* GetParticle() const {return theP;}
|
||||
G4double GetWeight() const {return theWeight;}
|
||||
void SetWeight(G4double aW){theWeight= aW;}
|
||||
void SetTime(G4double aT) {theTime = aT;}
|
||||
G4double GetTime() {return theTime;}
|
||||
G4double GetTime() const {return theTime;}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -32,9 +32,6 @@
|
||||
// Waiting for permission to use namespaces in geant4.....
|
||||
// namespace G4Had_Tmp_Util
|
||||
// {
|
||||
G4int G4lrint(double ad);
|
||||
G4int G4lint(double ad);
|
||||
G4int G4rint(double ad);
|
||||
G4String G4inttostring(int ai);
|
||||
template <class A> class G4SortHelperPtr
|
||||
{
|
||||
|
||||
@@ -99,13 +99,14 @@
|
||||
void SetParameters( const G4double A, const G4double Z );
|
||||
void SetParameters( const G4int A, const G4int Z );
|
||||
|
||||
#ifndef G4Hadr_Nucleus_IntegerAZ
|
||||
//deprecated Jan 2010, GF
|
||||
inline G4double GetN() const
|
||||
{ return aEff; }
|
||||
|
||||
inline G4double GetZ() const
|
||||
{ return zEff; }
|
||||
|
||||
#endif
|
||||
//to be replaced by new
|
||||
inline G4int GetA_asInt() const
|
||||
{ return theA; }
|
||||
|
||||
@@ -23,25 +23,33 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
//
|
||||
// J.L. Chuma, TRIUMF, 31-Oct-1996
|
||||
// last modified: 19-Dec-1996
|
||||
// modified by J.L.Chuma, 24-Jul-1997 to include total momentum
|
||||
// inluded operator *, and some minor modifications.
|
||||
// modified by H.P.Wellisch to add functionality needed by string models,
|
||||
// cascade and Nucleus. (Mon Mar 16 1998)
|
||||
// J.L. Chuma, TRIUMF, 31-Oct-1996
|
||||
// last modified: 19-Dec-1996
|
||||
// modified by J.L.Chuma, 24-Jul-1997 to include total momentum
|
||||
// inluded operator *, and some minor modifications.
|
||||
// modified by H.P.Wellisch to add functionality needed by string models,
|
||||
// cascade and Nucleus. (Mon Mar 16 1998)
|
||||
// M. Kelsey 29-Aug-2011 -- Use G4Allocator model to avoid memory churn.
|
||||
|
||||
#ifndef G4ReactionProduct_h
|
||||
#define G4ReactionProduct_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4Allocator.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4HadProjectile.hh"
|
||||
#include "G4HadronicException.hh"
|
||||
|
||||
class G4ReactionProduct
|
||||
{
|
||||
|
||||
// To support better memory management and reduced fragmentation
|
||||
class G4ReactionProduct;
|
||||
#if defined G4HADRONIC_ALLOC_EXPORT
|
||||
extern G4DLLEXPORT G4Allocator<G4ReactionProduct> aRPAllocator;
|
||||
#else
|
||||
extern G4DLLIMPORT G4Allocator<G4ReactionProduct> aRPAllocator;
|
||||
#endif
|
||||
|
||||
class G4ReactionProduct
|
||||
{
|
||||
friend G4ReactionProduct operator+(
|
||||
const G4ReactionProduct & p1, const G4ReactionProduct &p2 );
|
||||
|
||||
@@ -63,11 +71,20 @@
|
||||
G4ReactionProduct();
|
||||
|
||||
G4ReactionProduct( G4ParticleDefinition *aParticleDefinition );
|
||||
|
||||
|
||||
~G4ReactionProduct() {}
|
||||
|
||||
G4ReactionProduct( const G4ReactionProduct &right );
|
||||
|
||||
|
||||
// Override new and delete for use with G4Allocator
|
||||
inline void* operator new(size_t) {
|
||||
return (void *)aRPAllocator.MallocSingle();
|
||||
}
|
||||
|
||||
inline void operator delete(void* aReactionProduct) {
|
||||
aRPAllocator.FreeSingle((G4ReactionProduct*)aReactionProduct);
|
||||
}
|
||||
|
||||
G4ReactionProduct &operator= ( const G4ReactionProduct &right );
|
||||
|
||||
G4ReactionProduct &operator= ( const G4DynamicParticle &right );
|
||||
|
||||
Reference in New Issue
Block a user