Import Geant4 10.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-10 11:51:14 +02:00
parent e2d2f9810a
commit 286caacf06
12421 changed files with 730077 additions and 502383 deletions
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4DecayStrongResonances.hh 67984 2013-03-13 10:44:01Z gcosmo $
//
// -------------------------------------------------------------------
//
@@ -86,6 +86,8 @@ class G4Fancy3DNucleus : public G4V3DNucleus
G4double GetNuclearRadius();
G4double GetNuclearRadius(const G4double maxRelativeDensity);
G4double GetOuterRadius();
G4double AddExcitationEnergy(G4double);
G4double GetExcitationEnergy();
G4double CoulombBarrier();
void DoLorentzBoost(const G4LorentzVector & theBoost);
void DoLorentzBoost(const G4ThreeVector & theBeta);
@@ -107,6 +109,7 @@ class G4Fancy3DNucleus : public G4V3DNucleus
G4VNuclearDensity * theDensity;
G4FermiMomentum theFermi;
const G4double nucleondistance;
G4double excitationEnergy;
std::vector<G4ThreeVector> places; // For selecting locations
std::vector<G4ThreeVector> momentum; // For selecting nucleon motion
@@ -124,5 +127,15 @@ inline G4int G4Fancy3DNucleus::GetMassNumber()
{
return myA;
}
inline G4double G4Fancy3DNucleus::AddExcitationEnergy(G4double anE)
{
excitationEnergy +=anE;
return excitationEnergy;
}
inline G4double G4Fancy3DNucleus::GetExcitationEnergy()
{
return excitationEnergy;
}
#endif
@@ -23,7 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
// $Id: G4Fragment.hh 67984 2013-03-13 10:44:01Z gcosmo $
//
//---------------------------------------------------------------------
//
@@ -166,7 +166,7 @@ private:
// ============= DATA MEMBERS ==================
static G4int errCount;
static G4ThreadLocal G4int errCount;
G4int theA;
@@ -0,0 +1,107 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Multibody "phase space" generator, which provides interface to
// algorithms for sampling. Momentum vectors are generated in the
// center-of-mass frame of the decay, and returned in a user-supplied
// buffer.
//
// Sampling algorithm is specified via constructor argument, either by
// code for centrally supplied algorithms (Kopylov, GENBOD, or NBody),
// or by pointer (which is owned by the generator).
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4HadDecayGenerator_HH
#define G4HadDecayGenerator_HH 1
#include "globals.hh"
#include "G4LorentzVector.hh"
#include <vector>
class G4ParticleDefinition;
class G4VHadDecayAlgorithm;
class G4HadDecayGenerator {
public:
// Flags to select algorithm by code in constructor
enum Algorithm { NONE=0, Kopylov=1, GENBOD=2, NBody=3 };
// Specify "standard" algorithm by code or by object (takes ownership)
G4HadDecayGenerator(Algorithm alg=Kopylov, G4int verbose=0);
G4HadDecayGenerator(G4VHadDecayAlgorithm* alg, G4int verbose=0);
virtual ~G4HadDecayGenerator();
// Enable (or disable if 0) diagnostic messages
void SetVerboseLevel(G4int verbose);
const G4String& GetAlgorithmName() const;
// Initial state (rest mass) and list of final masses
G4bool Generate(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
// Initial state particle and list of final masses
G4bool Generate(const G4ParticleDefinition* initialPD,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
// Initial state (frame) and list of final masses
// Final state particles will be boosted to initial-state frame
G4bool Generate(const G4LorentzVector& initialState,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
protected:
// Special case for one-body final state
G4bool GenerateOneBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState) const;
// Special function used by constructor for unrecognized algorithm code
void ReportInvalidAlgorithm(Algorithm alg) const;
void ReportMissingAlgorithm() const;
protected:
// SPECIAL FUNCTION FOR SUBCLASSES: A subclass may implement a
// collection of algorithms, to be switched on an event-by-event
// basis. This function allows the subclass to switch the "active"
// algorithm before Generate() is called.
//
// If this function is used by the subclass, then the subclass has
// ownership of _all_ instantiated algorithms, and should delete
// them in its own dtor. The subclass dtor must also call
// UseAlgorithm(0) to set the base algorithm to a null pointer, to
// prevent a double-delete error.
void UseAlgorithm(G4VHadDecayAlgorithm* alg) { theAlgorithm = alg; }
G4int verboseLevel;
G4VHadDecayAlgorithm* theAlgorithm;
};
#endif /* G4HadDecayGenerator_HH */
@@ -0,0 +1,83 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Multibody "phase space" generator using GENBOD (CERNLIB W515) method.
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4HadPhaseSpaceGenbod_HH
#define G4HadPhaseSpaceGenbod_HH 1
#include "G4VHadPhaseSpaceAlgorithm.hh"
class G4HadPhaseSpaceGenbod : public G4VHadPhaseSpaceAlgorithm {
public:
G4HadPhaseSpaceGenbod(G4int verbose=0);
virtual ~G4HadPhaseSpaceGenbod() {;}
protected:
virtual void GenerateMultiBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
protected:
void Initialize(G4double initialMass,
const std::vector<G4double>& masses);
void FillRandomBuffer();
void ComputeWeightScale(const std::vector<G4double>& masses);
void FillEnergySteps(G4double initialMass,
const std::vector<G4double>& masses);
void GenerateMomenta(const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
void AccumulateFinalState(size_t i,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
G4bool AcceptEvent() const; // Use accept-reject to generate distribution
G4double ComputeWeight() const;
private:
size_t nFinal; // Number of final state particles
G4double totalMass; // Sum of final state masses
G4double massExcess; // Available kinetic energy
G4double weightMax; // Maximum possible weight
G4int nTrials; // Accept/reject cycles taken
std::vector<G4double> msum; // Cumulative sum of masses
std::vector<G4double> msq; // Final state squared masses
std::vector<G4double> rndm; // Random sequence for effective masses
std::vector<G4double> meff; // Random final-state effective masses
std::vector<G4double> pd; // Random momentum magnitudes
};
#endif /* G4HadPhaseSpaceGenbod_HH */
@@ -0,0 +1,53 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Multibody "phase space" generator using Kopylov's algorithm
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4HadPhaseSpaceKopylov_HH
#define G4HadPhaseSpaceKopylov_HH 1
#include "G4VHadPhaseSpaceAlgorithm.hh"
class G4HadPhaseSpaceKopylov : public G4VHadPhaseSpaceAlgorithm {
public:
G4HadPhaseSpaceKopylov(G4int verbose=0)
: G4VHadPhaseSpaceAlgorithm("G4HadPhaseSpaceKopylov",verbose) {;}
virtual ~G4HadPhaseSpaceKopylov() {;}
protected:
virtual void GenerateMultiBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
protected:
G4double BetaKopylov(G4int K) const;
};
#endif /* G4HadPhaseSpaceKopylov_HH */
@@ -0,0 +1,50 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Multibody "phase space" generator using Makoto Asai's NBody method.
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4HadPhaseSpaceNBodyAsai_HH
#define G4HadPhaseSpaceNBodyAsai_HH 1
#include "G4VHadPhaseSpaceAlgorithm.hh"
class G4HadPhaseSpaceNBodyAsai : public G4VHadPhaseSpaceAlgorithm {
public:
G4HadPhaseSpaceNBodyAsai(G4int verbose=0)
: G4VHadPhaseSpaceAlgorithm("G4HadPhaseSpaceNBodyAsai",verbose) {;}
virtual ~G4HadPhaseSpaceNBodyAsai() {;}
protected:
virtual void GenerateMultiBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
};
#endif /* G4HadPhaseSpaceNBody_HH */
@@ -24,7 +24,7 @@
// ********************************************************************
//
//
//
#ifndef G4NuclearFermiDensity_h
#define G4NuclearFermiDensity_h 1
@@ -37,7 +37,6 @@
class G4NuclearFermiDensity : public G4VNuclearDensity
{
public:
G4NuclearFermiDensity(G4int anA, G4int aZ);
~G4NuclearFermiDensity();
@@ -61,12 +60,9 @@ class G4NuclearFermiDensity : public G4VNuclearDensity
}
private:
G4int theA;
G4int theZ;
G4int theA;
G4double theR; // Nuclear Radius
const G4double a; // Determines the nuclear surface thickness
};
#endif
@@ -48,7 +48,7 @@ class G4NuclearShellModelDensity : public G4VNuclearDensity
private:
G4int theA;
G4int theZ;
//G4int theZ;
G4double theRsquare;
};
@@ -71,7 +71,7 @@ public:
private:
static minMassMapType minMassCache;
static G4ThreadLocal minMassMapType *minMassCache_G4MT_TLS_;
};
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Abstract base class for multibody "phase space" generators. Subclasses
// implement a specific algorithm, such as Kopylov, GENBOD, or Makoto's
// NBody. Subclasses are used by G4HadPhaseSpaceGenerator.
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4VHadDecayAlgorithm_HH
#define G4VHadDecayAlgorithm_HH 1
#include "globals.hh"
#include "G4LorentzVector.hh"
#include "G4ThreeVector.hh"
#include <vector>
#include <iosfwd>
class G4VHadDecayAlgorithm {
public:
G4VHadDecayAlgorithm(const G4String& algName, G4int verbose=0)
: name(algName), verboseLevel(verbose) {;}
virtual ~G4VHadDecayAlgorithm() {;}
// Initial state (rest mass) and list of final masses
void Generate(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
// Enable (or disable if 0) diagnostic messages (subclass may overload)
virtual void SetVerboseLevel(G4int verbose) { verboseLevel = verbose; }
G4int GetVerboseLevel() const { return verboseLevel; }
const G4String& GetName() const { return name; }
protected:
// Subclasses MUST implement these functions
virtual void GenerateTwoBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState) = 0;
virtual void GenerateMultiBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState) = 0;
// Validate kinematics (e.g., limit number of final state particles)
// Subclasses may override or call back to this function
virtual G4bool IsDecayAllowed(G4double initialMass,
const std::vector<G4double>& masses) const;
// Two-body momentum function (c.f. PDK from CERNLIB W505)
G4double TwoBodyMomentum(G4double M0, G4double M1, G4double M2) const;
// Convenience functions for uniform angular distributions
G4double UniformTheta() const;
G4double UniformPhi() const;
// Utility to dump vector contents to line of output
void PrintVector(const std::vector<G4double>& v, const G4String& name,
std::ostream& os) const;
private:
G4String name;
G4int verboseLevel;
};
#endif /* G4VHadDecayAlgorithm_HH */
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id$
//
// Abstract base class for multibody uniform phase space generators.
// Subclasses implement a specific algorithm, such as Kopylov, GENBOD,
// or Makoto's NBody. Subclasses are used by G4HadDecayGenerator.
//
// Author: Michael Kelsey (SLAC) <kelsey@slac.stanford.edu>
#ifndef G4VHadPhaseSpaceAlgorithm_HH
#define G4VHadPhaseSpaceAlgorithm_HH 1
#include "globals.hh"
#include "G4VHadDecayAlgorithm.hh"
#include "G4LorentzVector.hh"
#include "G4ThreeVector.hh"
#include <vector>
#include <iosfwd>
class G4VHadPhaseSpaceAlgorithm : public G4VHadDecayAlgorithm {
public:
G4VHadPhaseSpaceAlgorithm(const G4String& algName, G4int verbose=0)
: G4VHadDecayAlgorithm(algName, verbose) {;}
virtual ~G4VHadPhaseSpaceAlgorithm() {;}
protected:
// Multi-body function remains pure-virtual from base class
// Two-body uniform distribution is common to all algorithms
virtual void GenerateTwoBody(G4double initialMass,
const std::vector<G4double>& masses,
std::vector<G4LorentzVector>& finalState);
// Sample spherical distribution
G4ThreeVector UniformVector(G4double mag=1.) const;
};
#endif /* G4VHadPhaseSpaceAlgorithm_HH */