Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorConstruction.hh,v 1.2 2006/06/29 16:57:29 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: DetectorMessenger.hh,v 1.3 2006/06/29 16:57:31 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: EventAction.hh,v 1.2 2006/06/29 16:57:34 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: EventActionMessenger.hh,v 1.3 2006/06/29 16:57:36 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4LindhardPartition.hh,v 1.1 2008/05/08 11:29:43 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
|
||||
/*
|
||||
* G4LindhardPartition.hh
|
||||
*
|
||||
* Created by Marcus Mendenhall on 1/14/08.
|
||||
* Copyright 2008 Vanderbilt University, Nashville, TN, USA. All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Material;
|
||||
|
||||
class G4VNIELPartition
|
||||
{
|
||||
public:
|
||||
G4VNIELPartition() { }
|
||||
virtual ~G4VNIELPartition() { }
|
||||
|
||||
// return the fraction of the specified energy which will be deposited as NIEL
|
||||
// if an incoming particle with z1, a1 is stopped in the specified material
|
||||
// a1 is in atomic mass units, energy in native G4 energy units.
|
||||
virtual G4double PartitionNIEL(
|
||||
G4int z1, G4double a1, const G4Material *material, G4double energy
|
||||
) const =0;
|
||||
};
|
||||
|
||||
class G4LindhardRobinsonPartition : public G4VNIELPartition
|
||||
{
|
||||
public:
|
||||
G4LindhardRobinsonPartition();
|
||||
virtual ~G4LindhardRobinsonPartition() { }
|
||||
|
||||
virtual G4double PartitionNIEL(
|
||||
G4int z1, G4double a1, const G4Material *material, G4double energy
|
||||
) const ;
|
||||
|
||||
G4double z23[120];
|
||||
size_t max_z;
|
||||
};
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ScreenedNuclearRecoil.hh,v 1.3 2007/12/07 17:51:10 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp
|
||||
// GEANT4 tag
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -44,6 +44,7 @@
|
||||
// with the insides of this code.
|
||||
//
|
||||
// First version, April 2004, Marcus H. Mendenhall, Vanderbilt University
|
||||
// May 1, 2008 -- Added code to allow process to have zero cross section above max energy, to coordinate with G4MSC. -- mhm
|
||||
//
|
||||
// Class Description - End
|
||||
|
||||
@@ -53,30 +54,34 @@
|
||||
|
||||
#include "globals.hh"
|
||||
#include "G4VDiscreteProcess.hh"
|
||||
#include "G4ParticleChange.hh"
|
||||
#include "c2_function.hh"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class G4VParticleChange;
|
||||
class G4VNIELPartition;
|
||||
|
||||
typedef c2_const_ptr<G4double> G4_c2_const_ptr;
|
||||
typedef c2_ptr<G4double> G4_c2_ptr;
|
||||
typedef c2_function<G4double> G4_c2_function;
|
||||
|
||||
typedef struct G4ScreeningTables {
|
||||
G4double z1, z2, m1, m2, au, emin;
|
||||
c2_function<G4double> *EMphiData;
|
||||
G4_c2_const_ptr EMphiData;
|
||||
} G4ScreeningTables;
|
||||
|
||||
// A class for loading ScreenedCoulombCrossSections
|
||||
class G4ScreenedCoulombCrossSectionInfo
|
||||
{
|
||||
public:
|
||||
G4ScreenedCoulombCrossSectionInfo() { }
|
||||
~G4ScreenedCoulombCrossSectionInfo() { }
|
||||
|
||||
const char *CVSHeaderVers() { return
|
||||
"";
|
||||
}
|
||||
|
||||
const char *CVSFileVers() { return ""; }
|
||||
G4ScreenedCoulombCrossSectionInfo() { }
|
||||
~G4ScreenedCoulombCrossSectionInfo() { }
|
||||
|
||||
static const char* CVSHeaderVers() { return
|
||||
"G4ScreenedNuclearRecoil.hh,v 1.24 2008/05/01 19:58:59 marcus Exp GEANT4 tag ";
|
||||
}
|
||||
static const char* CVSFileVers();
|
||||
};
|
||||
|
||||
// A class for loading ScreenedCoulombCrossSections
|
||||
@@ -113,16 +118,16 @@ public:
|
||||
G4double standardmass(G4int z1) { return z1 <= nMassMapElements ? massmap[z1] : 2.5*z1; }
|
||||
|
||||
// get the mean-free-path table for the indexed material
|
||||
c2_function<G4double> * operator [] (G4int materialIndex) {
|
||||
return MFPTables.find(materialIndex)!=MFPTables.end() ? MFPTables[materialIndex] : (c2_function<G4double> *)0;
|
||||
const G4_c2_function * operator [] (G4int materialIndex) {
|
||||
return MFPTables.find(materialIndex)!=MFPTables.end() ? &(MFPTables[materialIndex].get()) : (G4_c2_function *)0;
|
||||
}
|
||||
|
||||
protected:
|
||||
ScreeningMap screeningData; // screening tables for each element
|
||||
ParticleCache targetMap;
|
||||
G4int verbosity;
|
||||
std::map<G4int, c2_function<G4double> *> sigmaMap; // total cross section for each element
|
||||
std::map<G4int, c2_function<G4double> *> MFPTables; // MFP for each material
|
||||
std::map<G4int, G4_c2_const_ptr > sigmaMap; // total cross section for each element
|
||||
std::map<G4int, G4_c2_const_ptr > MFPTables; // MFP for each material
|
||||
|
||||
private:
|
||||
static const G4double massmap[nMassMapElements+1];
|
||||
@@ -133,7 +138,9 @@ typedef struct G4CoulombKinematicsInfo {
|
||||
G4double impactParameter;
|
||||
G4ScreenedCoulombCrossSection *crossSection;
|
||||
G4double a1, a2, sinTheta, cosTheta, sinZeta, cosZeta, eRecoil;
|
||||
G4ParticleDefinition *recoilIon; } G4CoulombKinematicsInfo;
|
||||
G4ParticleDefinition *recoilIon;
|
||||
const G4Material *targetMaterial;
|
||||
} G4CoulombKinematicsInfo;
|
||||
|
||||
class G4ScreenedCollisionStage {
|
||||
public:
|
||||
@@ -145,14 +152,20 @@ public:
|
||||
class G4ScreenedCoulombClassicalKinematics: public G4ScreenedCoulombCrossSectionInfo, public G4ScreenedCollisionStage {
|
||||
|
||||
public:
|
||||
G4ScreenedCoulombClassicalKinematics() { }
|
||||
G4ScreenedCoulombClassicalKinematics();
|
||||
virtual void DoCollisionStep(class G4ScreenedNuclearRecoil *master,
|
||||
const class G4Track& aTrack, const class G4Step& aStep);
|
||||
|
||||
G4bool DoScreeningComputation(class G4ScreenedNuclearRecoil *master,
|
||||
const G4ScreeningTables *screen,
|
||||
G4double eps, G4double beta);
|
||||
virtual ~G4ScreenedCoulombClassicalKinematics() {}
|
||||
virtual ~G4ScreenedCoulombClassicalKinematics() { }
|
||||
protected:
|
||||
// the c2_functions we need to do the work.
|
||||
c2_const_plugin_function_p<G4double> &phifunc;
|
||||
c2_linear_p<G4double> &xovereps;
|
||||
G4_c2_ptr diff;
|
||||
|
||||
};
|
||||
|
||||
class G4SingleScatter: public G4ScreenedCoulombCrossSectionInfo, public G4ScreenedCollisionStage {
|
||||
@@ -164,62 +177,133 @@ public:
|
||||
virtual ~G4SingleScatter() {}
|
||||
};
|
||||
|
||||
/**
|
||||
\brief A process which handles screened Coulomb collisions between nuclei
|
||||
|
||||
*/
|
||||
|
||||
class G4ScreenedNuclearRecoil : public G4ScreenedCoulombCrossSectionInfo, public G4VDiscreteProcess
|
||||
{
|
||||
public:
|
||||
|
||||
friend class G4ScreenedCollisionStage;
|
||||
|
||||
/// \brief Construct the process and set some physics parameters for it.
|
||||
/// \param processName the name to assign the process
|
||||
/// \param ScreeningKey the name of a screening function to use.
|
||||
/// The default functions are "zbl" (recommended for soft scattering),
|
||||
/// "lj" (recommended for backscattering) and "mol" (Moliere potential)
|
||||
/// \param GenerateRecoils if frue, ions struck by primary are converted into new moving particles.
|
||||
/// If false, energy is deposited, but no new moving ions are created.
|
||||
/// \param RecoilCutoff energy below which no new moving particles will be created,
|
||||
/// even if \a GenerateRecoils is true.
|
||||
/// Also, a moving primary particle will be stopped if its energy falls below this limit.
|
||||
/// \param PhysicsCutoff the energy transfer to which screening tables are calucalted.
|
||||
/// There is no really
|
||||
/// compelling reason to change it from the 10.0 eV default. However, see the paper on running this
|
||||
/// in thin targets for further discussion, and its interaction with SetMFPScaling()
|
||||
G4ScreenedNuclearRecoil(const G4String& processName = "ScreenedElastic",
|
||||
const G4String &ScreeningKey="zbl", G4bool GenerateRecoils=1,
|
||||
G4double RecoilCutoff=100.0*eV, G4double PhysicsCutoff=10.0*eV);
|
||||
|
||||
/// \brief destructor
|
||||
virtual ~G4ScreenedNuclearRecoil();
|
||||
|
||||
/// \brief used internally by Geant4 machinery
|
||||
virtual G4double GetMeanFreePath(const G4Track&, G4double, G4ForceCondition* );
|
||||
|
||||
/// \brief used internally by Geant4 machinery
|
||||
virtual G4VParticleChange* PostStepDoIt(const G4Track& aTrack, const G4Step& aStep);
|
||||
|
||||
/// \brief test if a prticle of type \a aParticleType can use this process
|
||||
/// \param aParticleType the particle to test
|
||||
virtual G4bool IsApplicable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
/// \brief Build physics tables in advance. Not Implemented.
|
||||
/// \param aParticleType the type of particle to build tables for
|
||||
virtual void BuildPhysicsTable(const G4ParticleDefinition&) { }
|
||||
|
||||
/// \brief Export physics tables for persistency. Not Implemented.
|
||||
/// \param aParticleType the type of particle to build tables for
|
||||
virtual void DumpPhysicsTable(const G4ParticleDefinition& aParticleType);
|
||||
|
||||
/// \brief deterine if the moving particle is within the strong force range of the selected nucleus
|
||||
/// \param A the nucleon number of the beam
|
||||
/// \param A1 the nucleon number of the target
|
||||
/// \param apsis the distance of closest approach
|
||||
virtual G4bool CheckNuclearCollision(G4double A, G4double A1, G4double apsis); // return true if hard collision
|
||||
|
||||
virtual G4ScreenedCoulombCrossSection *GetNewCrossSectionHandler(void);
|
||||
|
||||
G4double GetNIEL() const { return NIEL; } // Get non-ionizing energy loss for last step
|
||||
/// \brief Get non-ionizing energy loss for last step
|
||||
G4double GetNIEL() const { return NIEL; }
|
||||
|
||||
/// \brief clear precomputed screening tables
|
||||
void ResetTables(); // clear all data tables to allow changing energy cutoff, materials, etc.
|
||||
|
||||
|
||||
/// \brief set the upper energy beyond which this process has no cross section
|
||||
///
|
||||
/// This funciton is used to coordinate this process with G4MSC. Typically, G4MSC should
|
||||
/// not be allowed to operate in a range which overlaps that of this process. The criterion which is most reasonable
|
||||
/// is that the transition should be somewhere in the modestly relativistic regime (500 MeV/u for example).
|
||||
/// \param energy energy per nucleon for the cutoff
|
||||
void SetMaxEnergyForScattering(G4double energy) { processMaxEnergy=energy; }
|
||||
/// \brief find out what screening funciton we are using
|
||||
std::string GetScreeningKey() const { return screeningKey; }
|
||||
/// \brief enable or disable all energy deposition by this process
|
||||
/// \param flag if true, enable deposition of energy (the default). If false, disable deposition.
|
||||
void AllowEnergyDeposition(G4bool flag) { registerDepositedEnergy=flag; }
|
||||
/// \brief get flag indicating whether deposition is enabled
|
||||
G4bool GetAllowEnergyDeposition() const { return registerDepositedEnergy; }
|
||||
/// \brief enable or disable the generation of recoils.
|
||||
/// If recoils are disabled, the energy they would have received is just deposited.
|
||||
/// \param flag if true, create recoil ions in cases in which the energy is above the recoilCutoff.
|
||||
/// If false, just deposit the energy.
|
||||
void EnableRecoils(G4bool flag) { generateRecoils=flag; }
|
||||
/// \brief find out if generation of recoils is enabled.
|
||||
G4bool GetEnableRecoils() const { return generateRecoils; }
|
||||
/// \brief set the mean free path scaling as specified
|
||||
/// \param scale the factor by which the default MFP will be scaled.
|
||||
/// Set to less than 1 for very thin films, typically, to sample multiple scattering,
|
||||
/// or to greater than 1 for quick simulaitons with a very long flight path.
|
||||
void SetMFPScaling(G4double scale) { MFPScale=scale; }
|
||||
/// \brief get the MFPScaling parameter
|
||||
G4double GetMFPScaling() const { return MFPScale; }
|
||||
/// \brief enable or disable whether this process will skip collisions
|
||||
/// which are close enough they need hadronic phsyics. Default is true (skip close collisions).
|
||||
/// Disabling this results in excess nuclear stopping power.
|
||||
/// \param flag true results in hard collisions being skipped. false allows hard collisions.
|
||||
void AvoidNuclearReactions(G4bool flag) { avoidReactions=flag; }
|
||||
/// \brief get the flag indicating whether hadronic collisions are ignored.
|
||||
G4bool GetAvoidNuclearReactions() const { return avoidReactions; }
|
||||
/// \brief set the minimum energy (per nucleon) at which recoils can be generated,
|
||||
/// and the energy (per nucleon) below which all ions are stopped.
|
||||
/// \param energy energy per nucleon
|
||||
void SetRecoilCutoff(G4double energy) { recoilCutoff=energy; }
|
||||
/// \brief get the recoil cutoff
|
||||
G4double GetRecoilCutoff() const { return recoilCutoff; }
|
||||
/// \brief set the energy to which screening tables are computed. Typically, this is 10 eV or so, and not often changed.
|
||||
/// \param energy the cutoff energy
|
||||
void SetPhysicsCutoff(G4double energy) { physicsCutoff=energy; ResetTables(); }
|
||||
/// \brief get the physics cutoff energy.
|
||||
G4double GetPhysicsCutoff() const { return physicsCutoff; }
|
||||
class G4ParticleChange &GetParticleChange() { return aParticleChange; }
|
||||
void AddToNIEL(G4double energy) { NIEL+=energy; }
|
||||
/// \brief set the pointer to a class for paritioning energy into NIEL
|
||||
/// \brief part the pointer to the class.
|
||||
void SetNIELPartitionFunction(const G4VNIELPartition *part);
|
||||
/// \brief set the cross section boost to provide faster computation of backscattering
|
||||
/// \param fraction the fraction of particles to have their cross section boosted.
|
||||
/// \param HardeningFactor the factor by which to boost the scattering cross section.
|
||||
void SetCrossSectionHardening(G4double fraction, G4double HardeningFactor) {
|
||||
hardeningFraction=fraction;
|
||||
hardeningFactor=HardeningFactor;
|
||||
}
|
||||
/// \brief get the fraction of particles which will have boosted scattering
|
||||
G4double GetHardeningFraction() const { return hardeningFraction; }
|
||||
/// \brief get the boost factor in use.
|
||||
G4double GetHardeningFactor() const { return hardeningFactor; }
|
||||
/// \brief the the interaciton length used in the last scattering.
|
||||
G4double GetCurrentInteractionLength() const { return currentInteractionLength; }
|
||||
/// \brief set a function to compute screening tables, if the user needs non-standard behavior.
|
||||
/// \param cs a class which constructs the screening tables.
|
||||
void SetExternalCrossSectionHandler(G4ScreenedCoulombCrossSection *cs) {
|
||||
externalCrossSectionConstructor=cs;
|
||||
}
|
||||
/// \brief get the verbosity.
|
||||
G4int GetVerboseLevel() const { return verboseLevel; }
|
||||
|
||||
std::map<G4int, G4ScreenedCoulombCrossSection*> &GetCrossSectionHandlers()
|
||||
{ return crossSectionHandlers; }
|
||||
void ClearStages(void);
|
||||
@@ -227,14 +311,24 @@ public:
|
||||
G4CoulombKinematicsInfo &GetKinematics() { return kinematics; }
|
||||
void SetValidCollision(G4bool flag) { validCollision=flag; }
|
||||
G4bool GetValidCollision() const { return validCollision; }
|
||||
|
||||
/// \brief get the pointer to our ParticleChange object. for internal use, primarily.
|
||||
class G4ParticleChange &GetParticleChange() { return static_cast<G4ParticleChange &>(*pParticleChange); }
|
||||
/// \brief take the given energy, and use the material information to partition it into NIEL and ionizing energy.
|
||||
void DepositEnergy(G4int z1, G4double a1, const G4Material *material, G4double energy);
|
||||
|
||||
protected:
|
||||
G4double highEnergyLimit, lowEnergyLimit;
|
||||
/// \brief the energy per nucleon above which the MFP is constant
|
||||
G4double highEnergyLimit;
|
||||
/// \brief the energy per nucleon below which the MFP is zero
|
||||
G4double lowEnergyLimit;
|
||||
/// \brief the energy per nucleon beyond which the cross section is zero, to cross over to G4MSC
|
||||
G4double processMaxEnergy;
|
||||
G4String screeningKey;
|
||||
G4bool generateRecoils, avoidReactions;
|
||||
G4double recoilCutoff, physicsCutoff;
|
||||
G4bool registerDepositedEnergy;
|
||||
G4double NIEL;
|
||||
G4double IonizingLoss, NIEL;
|
||||
G4double MFPScale;
|
||||
G4double hardeningFraction, hardeningFactor;
|
||||
|
||||
@@ -242,11 +336,10 @@ protected:
|
||||
std::vector<G4ScreenedCollisionStage *> collisionStages;
|
||||
|
||||
std::map<G4int, G4ScreenedCoulombCrossSection*> crossSectionHandlers;
|
||||
std::map<G4int, c2_function<G4double>*> meanFreePathTables;
|
||||
|
||||
G4bool validCollision;
|
||||
G4CoulombKinematicsInfo kinematics;
|
||||
|
||||
const G4VNIELPartition *NIELPartitionFunction;
|
||||
};
|
||||
|
||||
// A customized G4CrossSectionHandler which gets its data from an external program
|
||||
@@ -267,7 +360,7 @@ public:
|
||||
// get a list of available keys
|
||||
std::vector<G4String> GetScreeningKeys() const;
|
||||
|
||||
typedef c2_function<G4double> &(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au);
|
||||
typedef G4_c2_function &(*ScreeningFunc)(G4int z1, G4int z2, size_t nPoints, G4double rMax, G4double *au);
|
||||
|
||||
void AddScreeningFunction(G4String name, ScreeningFunc fn) {
|
||||
phiMap[name]=fn;
|
||||
@@ -278,6 +371,9 @@ private:
|
||||
std::map<std::string, ScreeningFunc> phiMap;
|
||||
};
|
||||
|
||||
|
||||
G4_c2_function &ZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
|
||||
G4_c2_function &MoliereScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
|
||||
G4_c2_function &LJScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
|
||||
G4_c2_function &LJZBLScreening(G4int z1, G4int z2, size_t npoints, G4double rMax, G4double *auval);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: Histo.hh,v 1.1 2008/08/22 18:30:27 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
|
||||
#ifndef Histo_h
|
||||
#define Histo_h 1
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// ClassName: Histo
|
||||
//
|
||||
// Description: Utility class to hold and manipulate histograms/nTuples
|
||||
//
|
||||
// Author: V.Ivanchenko 30/10/03
|
||||
//
|
||||
//----------------------------------------------------------------------------
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "globals.hh"
|
||||
#include <vector>
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4DataVector.hh"
|
||||
#include "G4Track.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
class HistoMessenger;
|
||||
|
||||
namespace AIDA {
|
||||
class ITree;
|
||||
class ITuple;
|
||||
class IHistogram1D;
|
||||
class IAnalysisFactory;
|
||||
}
|
||||
|
||||
class Histo
|
||||
{
|
||||
|
||||
public:
|
||||
Histo();
|
||||
|
||||
~Histo();
|
||||
|
||||
void book();
|
||||
// Book predefined histogramms
|
||||
|
||||
void save();
|
||||
// Save histogramms to file
|
||||
|
||||
void add1D(const G4String&, const G4String&, G4int nb=100, G4double x1=0.,
|
||||
G4double x2=1., G4double u=1.);
|
||||
// In this method histogramms are predefined
|
||||
|
||||
void setHisto1D(G4int, G4int, G4double, G4double, G4double);
|
||||
// It change bins and boundaries
|
||||
|
||||
void fill(G4int, G4double, G4double);
|
||||
// Histogramms are filled
|
||||
|
||||
void scale(G4int, G4double);
|
||||
|
||||
void addTuple(const G4String&, const G4String&, const G4String&);
|
||||
// In this method nTuple is booked
|
||||
|
||||
void fillTuple(const G4String&, G4double);
|
||||
// Fill nTuple parameter
|
||||
|
||||
void addRow();
|
||||
// Save tuple event
|
||||
|
||||
void setFileName(const G4String&);
|
||||
|
||||
void setFileType(const G4String&);
|
||||
|
||||
private:
|
||||
|
||||
G4String histName;
|
||||
G4String histType;
|
||||
G4String tupleName;
|
||||
G4String tupleId;
|
||||
G4String tupleList;
|
||||
G4int nHisto;
|
||||
G4int verbose;
|
||||
G4int defaultAct;
|
||||
|
||||
std::vector<AIDA::IHistogram1D*> histo;
|
||||
AIDA::IAnalysisFactory* af;
|
||||
AIDA::ITuple* ntup;
|
||||
AIDA::ITree* tree;
|
||||
HistoMessenger* messenger;
|
||||
std::vector<G4int> active;
|
||||
std::vector<G4int> bins;
|
||||
std::vector<G4double> xmin;
|
||||
std::vector<G4double> xmax;
|
||||
std::vector<G4double> unit;
|
||||
std::vector<G4String> ids;
|
||||
std::vector<G4String> titles;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: HistoMessenger.hh,v 1.1 2008/08/22 18:30:27 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef HistoMessenger_h
|
||||
#define HistoMessenger_h 1
|
||||
|
||||
#include "G4UImessenger.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class Histo;
|
||||
class G4UIdirectory;
|
||||
class G4UIcommand;
|
||||
class G4UIcmdWithAString;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class HistoMessenger: public G4UImessenger
|
||||
{
|
||||
public:
|
||||
|
||||
HistoMessenger(Histo* );
|
||||
~HistoMessenger();
|
||||
|
||||
void SetNewValue(G4UIcommand* ,G4String );
|
||||
|
||||
private:
|
||||
|
||||
Histo* histo;
|
||||
|
||||
G4UIdirectory* histoDir;
|
||||
G4UIcmdWithAString* factoryCmd;
|
||||
G4UIcmdWithAString* fileCmd;
|
||||
G4UIcommand* histoCmd;
|
||||
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: PhysListEmLivermore.hh,v 1.1 2006/11/22 18:56:20 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: PhysListEmPenelope.hh,v 1.1 2006/11/22 18:56:21 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: PhysListEmStandard.hh,v 1.3 2006/06/29 16:57:44 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
+7
-7
@@ -23,25 +23,25 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysListEmStandardIG.hh,v 1.1 2007/07/28 16:39:31 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: PhysListEmStandardNR.hh,v 1.1 2008/01/14 12:11:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#ifndef PhysListEmStandardIG_h
|
||||
#define PhysListEmStandardIG_h 1
|
||||
#ifndef PhysListEmStandardNR_h
|
||||
#define PhysListEmStandardNR_h 1
|
||||
|
||||
#include "G4VPhysicsConstructor.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class PhysListEmStandardIG : public G4VPhysicsConstructor
|
||||
class PhysListEmStandardNR : public G4VPhysicsConstructor
|
||||
{
|
||||
public:
|
||||
PhysListEmStandardIG(const G4String& name = "standardIG");
|
||||
virtual ~PhysListEmStandardIG();
|
||||
PhysListEmStandardNR(const G4String& name = "standardNR");
|
||||
virtual ~PhysListEmStandardNR();
|
||||
|
||||
public:
|
||||
// This method is dummy for physics
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysListEmStandardSS.hh,v 1.1 2006/10/24 11:37:56 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: PhysicsList.hh,v 1.6 2006/11/22 18:56:21 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: PhysicsList.hh,v 1.8 2008/11/20 20:34:50 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//
|
||||
@@ -38,6 +38,7 @@
|
||||
#define PhysicsList_h 1
|
||||
|
||||
#include "G4VModularPhysicsList.hh"
|
||||
#include "G4EmConfigurator.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4VPhysicsConstructor;
|
||||
@@ -49,6 +50,7 @@ class PhysicsListMessenger;
|
||||
class PhysicsList: public G4VModularPhysicsList
|
||||
{
|
||||
public:
|
||||
|
||||
PhysicsList();
|
||||
virtual ~PhysicsList();
|
||||
|
||||
@@ -66,6 +68,9 @@ public:
|
||||
StepMax* GetStepMaxProcess() {return stepMaxProcess;};
|
||||
|
||||
private:
|
||||
|
||||
G4EmConfigurator em_config;
|
||||
|
||||
G4double cutForGamma;
|
||||
G4double cutForElectron;
|
||||
G4double cutForPositron;
|
||||
@@ -76,6 +81,7 @@ private:
|
||||
|
||||
G4String emName;
|
||||
G4VPhysicsConstructor* emPhysicsList;
|
||||
G4VPhysicsConstructor* decPhysicsList;
|
||||
std::vector<G4VPhysicsConstructor*> hadronPhys;
|
||||
|
||||
StepMax* stepMaxProcess;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PhysicsListMessenger.hh,v 1.3 2006/06/29 16:57:52 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorAction.hh,v 1.3 2006/06/29 16:57:54 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: PrimaryGeneratorMessenger.hh,v 1.3 2006/06/29 16:57:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: RunAction.hh,v 1.11 2007/06/12 14:01:13 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: RunAction.hh,v 1.14 2008/08/22 18:30:27 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -39,39 +39,35 @@ class DetectorConstruction;
|
||||
class PhysicsList;
|
||||
class PrimaryGeneratorAction;
|
||||
class G4Run;
|
||||
|
||||
namespace AIDA {
|
||||
class IAnalysisFactory;
|
||||
class ITree;
|
||||
class IHistogram1D;
|
||||
}
|
||||
class Histo;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
class RunAction : public G4UserRunAction
|
||||
{
|
||||
public:
|
||||
RunAction(DetectorConstruction*, PhysicsList*,PrimaryGeneratorAction*);
|
||||
RunAction(DetectorConstruction*, PhysicsList*,
|
||||
PrimaryGeneratorAction*);
|
||||
virtual ~RunAction();
|
||||
|
||||
void BeginOfRunAction(const G4Run*);
|
||||
void EndOfRunAction(const G4Run*);
|
||||
|
||||
void FillTallyEdep(G4int n, G4double e) {tallyEdep[n] += e;};
|
||||
void FillTallyEdep(G4int n, G4double e) {tallyEdep[n] += e;};
|
||||
void FillEdep(G4double de, G4double eni) {edeptot += de; eniel += eni;};
|
||||
|
||||
G4double GetBinLength() {return binLength;};
|
||||
G4double GetLength() {return length;};
|
||||
G4double GetOffsetX() {return offsetX;}
|
||||
void FillHisto(G4int id, G4double x, G4double weight = 1.0);
|
||||
G4double GetOffsetX() {return offsetX;}
|
||||
|
||||
void FillHisto(G4int id, G4double x, G4double weight = 1.0);
|
||||
|
||||
void AddProjRange (G4double x) {projRange += x; projRange2 += x*x;};
|
||||
void AddProjRange (G4double x)
|
||||
{projRange += x; projRange2 += x*x; nRange++;};
|
||||
void AddPrimaryStep() {nPrimarySteps++;};
|
||||
|
||||
private:
|
||||
void bookHisto();
|
||||
void cleanHisto();
|
||||
|
||||
private:
|
||||
DetectorConstruction* detector;
|
||||
PhysicsList* physics;
|
||||
PrimaryGeneratorAction* kinematic;
|
||||
@@ -80,11 +76,11 @@ private:
|
||||
G4double offsetX;
|
||||
G4double length;
|
||||
G4double projRange, projRange2;
|
||||
G4double edeptot, eniel;
|
||||
G4int nPrimarySteps;
|
||||
|
||||
AIDA::IAnalysisFactory* af;
|
||||
AIDA::ITree* tree;
|
||||
AIDA::IHistogram1D* histo[1];
|
||||
G4int nRange;
|
||||
|
||||
Histo* histo;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMax.hh,v 1.3 2006/06/29 16:58:01 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: StepMaxMessenger.hh,v 1.2 2006/06/29 16:58:03 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: SteppingAction.hh,v 1.2 2006/06/29 16:58:05 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: SteppingVerbose.hh,v 1.2 2006/06/29 16:58:07 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: TrackingAction.hh,v 1.2 2006/06/29 16:58:09 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,174 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
/**
|
||||
* \file
|
||||
* \brief Provides a factory class to avoid an infinite number of template declarations.
|
||||
*
|
||||
* \author Created by R. A. Weller and Marcus H. Mendenhall on 7/9/05.
|
||||
* \author Copyright 2005 __Vanderbilt University__. All rights reserved.
|
||||
*
|
||||
* \version c2_factory.hh,v 1.13 2008/05/22 12:45:19 marcus Exp
|
||||
*/
|
||||
|
||||
#ifndef __has_c2_factory_hh
|
||||
#define __has_c2_factory_hh 1
|
||||
|
||||
#include "c2_function.hh"
|
||||
|
||||
/// \brief a factory of pre-templated c2_function generators
|
||||
///
|
||||
/// do \code
|
||||
/// typedef c2_ptr<double> c2_p;
|
||||
/// static c2_factory<double> c2;
|
||||
/// c2_p f=c2.sin();
|
||||
/// \endcode
|
||||
/// \note The factory class doesn't contain any data. It can be statically instantiated at the
|
||||
/// top of a file, and used everywhere inside, or even instantiated in your project's top-level include
|
||||
/// file.
|
||||
/// \see c2_math_factory
|
||||
/// \ingroup factories
|
||||
template <typename float_type> class c2_factory {
|
||||
public:
|
||||
|
||||
/// make a *new object
|
||||
static c2_classic_function_p<float_type> &classic_function(const float_type (*c_func)(float_type))
|
||||
{ return *new c2_classic_function_p<float_type>(c_func); }
|
||||
/// make a *new object
|
||||
static c2_plugin_function_p<float_type> &plugin_function()
|
||||
{ return *new c2_plugin_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_plugin_function_p<float_type> &plugin_function(c2_function<float_type> &f)
|
||||
{ return *new c2_plugin_function_p<float_type>(f); }
|
||||
/// make a *new object
|
||||
static c2_const_plugin_function_p<float_type> &const_plugin_function()
|
||||
{ return *new c2_const_plugin_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_const_plugin_function_p<float_type> &const_plugin_function(const c2_function<float_type> &f)
|
||||
{ return *new c2_const_plugin_function_p<float_type>(f); }
|
||||
/// make a *new object
|
||||
static c2_scaled_function_p<float_type> &scaled_function(const c2_function<float_type> &outer, float_type scale)
|
||||
{ return *new c2_scaled_function_p<float_type>(outer, scale); }
|
||||
/// make a *new object
|
||||
static c2_cached_function_p<float_type> &cached_function(const c2_function<float_type> &func)
|
||||
{ return *new c2_cached_function_p<float_type>(func); }
|
||||
/// make a *new object
|
||||
static c2_constant_p<float_type> &constant(float_type x) { return *new c2_constant_p<float_type>(x); }
|
||||
/// make a *new object
|
||||
static interpolating_function_p<float_type> &
|
||||
interpolating_function()
|
||||
{ return *new interpolating_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static lin_log_interpolating_function_p<float_type> &
|
||||
lin_log_interpolating_function()
|
||||
{ return *new lin_log_interpolating_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static log_lin_interpolating_function_p<float_type> &
|
||||
log_lin_interpolating_function()
|
||||
{ return *new log_lin_interpolating_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static log_log_interpolating_function_p<float_type> &
|
||||
log_log_interpolating_function()
|
||||
{ return *new log_log_interpolating_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static arrhenius_interpolating_function_p<float_type> &
|
||||
arrhenius_interpolating_function()
|
||||
{ return *new arrhenius_interpolating_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_connector_function_p<float_type> &connector_function(
|
||||
float_type x0, const c2_function<float_type> &f0, float_type x2, const c2_function<float_type> &f2,
|
||||
bool auto_center, float_type y1)
|
||||
{ return *new c2_connector_function_p<float_type>(x0, f0, x2, f2, auto_center, y1); }
|
||||
/// make a *new object
|
||||
static c2_connector_function_p<float_type> &connector_function(
|
||||
const c2_fblock<float_type> &fb0, const c2_fblock<float_type> &fb2,
|
||||
bool auto_center, float_type y1)
|
||||
{ return *new c2_connector_function_p<float_type>(fb0, fb2, auto_center, y1); }
|
||||
/// make a *new object
|
||||
static c2_connector_function_p<float_type> &connector_function(
|
||||
float_type x0, float_type y0, float_type yp0, float_type ypp0,
|
||||
float_type x2, float_type y2, float_type yp2, float_type ypp2,
|
||||
bool auto_center, float_type y1)
|
||||
{ return *new c2_connector_function_p<float_type>(
|
||||
x0, y0, yp0, ypp0, x2, y2, yp2, ypp2, auto_center, y1); }
|
||||
/// make a *new object
|
||||
static c2_piecewise_function_p<float_type> &piecewise_function()
|
||||
{ return *new c2_piecewise_function_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_sin_p<float_type> &sin() { return *new c2_sin_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_cos_p<float_type> &cos() { return *new c2_cos_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_tan_p<float_type> &tan() { return *new c2_tan_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_log_p<float_type> &log() { return *new c2_log_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_exp_p<float_type> &exp() { return *new c2_exp_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_sqrt_p<float_type> &sqrt() { return *new c2_sqrt_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_recip_p<float_type> &recip(float_type scale=1)
|
||||
{ return *new c2_recip_p<float_type>(scale); }
|
||||
/// make a *new object
|
||||
static c2_identity_p<float_type> &identity() { return *new c2_identity_p<float_type>(); }
|
||||
/// make a *new object
|
||||
static c2_linear_p<float_type> &linear(float_type x0, float_type y0, float_type slope)
|
||||
{ return *new c2_linear_p<float_type>(x0, y0, slope); }
|
||||
/// make a *new object
|
||||
static c2_quadratic_p<float_type> &quadratic(
|
||||
float_type x0, float_type y0, float_type xcoef, float_type x2coef)
|
||||
{ return *new c2_quadratic_p<float_type>(x0, y0, xcoef, x2coef); }
|
||||
/// make a *new object
|
||||
static c2_power_law_p<float_type> &power_law(float_type scale, float_type power)
|
||||
{ return *new c2_power_law_p<float_type>(scale, power); }
|
||||
/// make a *new object
|
||||
static c2_inverse_function_p<float_type> &inverse_function(const c2_function<float_type> &source)
|
||||
{ return *new c2_inverse_function_p<float_type>(source); }
|
||||
|
||||
#if 0
|
||||
/// \brief handle template for inverse_integrated_density_bins<float_type, Final<float_type> >(bincenters, binheights)
|
||||
template <template <typename f_t> class Final >
|
||||
static interpolating_function_p<float_type> & inverse_integrated_density_bins(
|
||||
const std::vector<float_type> &bincenters, const std::vector<float_type> &binheights)
|
||||
throw(c2_exception)
|
||||
{
|
||||
return ::inverse_integrated_density_bins<float_type, Final<float_type> >
|
||||
(bincenters, binheights);
|
||||
}
|
||||
/// \brief handle template for inverse_integrated_density_function<float_type, Final<float_type> >(bincenters, binheights)
|
||||
template <template <typename f_t> class Final >
|
||||
static interpolating_function_p<float_type> & inverse_integrated_density_function(
|
||||
const std::vector<float_type> &bincenters, const c2_function<float_type> &binheights)
|
||||
throw(c2_exception)
|
||||
{
|
||||
return ::inverse_integrated_density_function<float_type, Final<float_type> >
|
||||
(bincenters, binheights);
|
||||
}
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user