Import Geant4 11.3.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2024-06-28 13:08:51 +02:00
parent f7b23877ed
commit e58e650b32
5232 changed files with 239416 additions and 244360 deletions
@@ -69,99 +69,96 @@ class G4FastSimHitMaker;
class Par03EMShowerModel : public G4VFastSimulationModel
{
public:
Par03EMShowerModel(G4String, G4Region*);
Par03EMShowerModel(G4String);
~Par03EMShowerModel();
public:
Par03EMShowerModel(G4String, G4Region*);
Par03EMShowerModel(G4String);
~Par03EMShowerModel();
/// There are no kinematics constraints. True is returned.
virtual G4bool ModelTrigger(const G4FastTrack&) final;
/// Model is applicable to electrons, positrons, and photons.
virtual G4bool IsApplicable(const G4ParticleDefinition&) final;
/// Take particle out of the full simulation (kill it at the entrance
/// depositing all the energy). Calculate energy deposited in the detector
/// according to Gamma distribution (along the particle direction) and
/// Gaussian distribution in the transverse direction. Mean of the Gaussian is
/// centred on the shower axis. Create energy deposits on a cylindrical mesh.
/// Parameters of the mesh (size, number of cells) and of the distributions
/// (alpha, beta for Gamma, sigma for Gaussian) can be set with UI commands.
virtual void DoIt(const G4FastTrack&, G4FastStep&) final;
/// There are no kinematics constraints. True is returned.
virtual G4bool ModelTrigger(const G4FastTrack&) final;
/// Model is applicable to electrons, positrons, and photons.
virtual G4bool IsApplicable(const G4ParticleDefinition&) final;
/// Take particle out of the full simulation (kill it at the entrance
/// depositing all the energy). Calculate energy deposited in the detector
/// according to Gamma distribution (along the particle direction) and
/// Gaussian distribution in the transverse direction. Mean of the Gaussian is
/// centred on the shower axis. Create energy deposits on a cylindrical mesh.
/// Parameters of the mesh (size, number of cells) and of the distributions
/// (alpha, beta for Gamma, sigma for Gaussian) can be set with UI commands.
virtual void DoIt(const G4FastTrack&, G4FastStep&) final;
/// Print current settings.
void Print() const;
/// Set standard deviation of a Gaussian distribution that describes the
/// transverse shower profile.
inline void SetSigma(const G4double aSigma) { fSigma = aSigma; };
/// Get standard deviation of a Gaussian distribution that describes the
/// transverse shower profile.
inline G4double GetSigma() const { return fSigma; };
/// Set alpha parameter of a Gamma distribution that describes the
/// longitudinal shower profile.
inline void SetAlpha(const G4double aAlpha) { fAlpha = aAlpha; };
/// Get alpha parameter of a Gamma distribution that describes the
/// longitudinal shower profile.
inline G4double GetAlpha() const { return fAlpha; };
/// Set beta parameter of a Gamma distribution that describes the longitudinal
/// shower profile.
inline void SetBeta(const G4double aBeta) { fBeta = aBeta; };
/// Get beta parameter of a Gamma distribution that describes the longitudinal
/// shower profile.
inline G4double GetBeta() const { return fBeta; };
/// Set number of (same energy) hits created in the parametrisation.
inline void SetNbOfHits(const G4int aNumber) { fNbOfHits = aNumber; };
/// Get number of (same energy) hits created in the parametrisation.s
inline G4int GetNbOfHits() const { return fNbOfHits; };
/// Set maximum depth of shower created in fast simulation. It is expressed in
/// units of radiaton length.
inline void SetLongMaxDepth(const G4double aDepth)
{
fLongMaxDepth = aDepth;
};
/// Get maximum depth of shower created in fast simulation. It is expressed in
/// units of radiaton length.
inline G4double GetLongMaxDepth() const { return fLongMaxDepth; };
/// Print current settings.
void Print() const;
/// Set standard deviation of a Gaussian distribution that describes the
/// transverse shower profile.
inline void SetSigma(const G4double aSigma) { fSigma = aSigma; };
/// Get standard deviation of a Gaussian distribution that describes the
/// transverse shower profile.
inline G4double GetSigma() const { return fSigma; };
/// Set alpha parameter of a Gamma distribution that describes the
/// longitudinal shower profile.
inline void SetAlpha(const G4double aAlpha) { fAlpha = aAlpha; };
/// Get alpha parameter of a Gamma distribution that describes the
/// longitudinal shower profile.
inline G4double GetAlpha() const { return fAlpha; };
/// Set beta parameter of a Gamma distribution that describes the longitudinal
/// shower profile.
inline void SetBeta(const G4double aBeta) { fBeta = aBeta; };
/// Get beta parameter of a Gamma distribution that describes the longitudinal
/// shower profile.
inline G4double GetBeta() const { return fBeta; };
/// Set number of (same energy) hits created in the parametrisation.
inline void SetNbOfHits(const G4int aNumber) { fNbOfHits = aNumber; };
/// Get number of (same energy) hits created in the parametrisation.s
inline G4int GetNbOfHits() const { return fNbOfHits; };
/// Set maximum depth of shower created in fast simulation. It is expressed in
/// units of radiaton length.
inline void SetLongMaxDepth(const G4double aDepth) { fLongMaxDepth = aDepth; };
/// Get maximum depth of shower created in fast simulation. It is expressed in
/// units of radiaton length.
inline G4double GetLongMaxDepth() const { return fLongMaxDepth; };
private:
/// Gamma distribution
inline G4double Gamma(G4double x, G4double alpha, G4double beta)
{
return (std::pow(beta, alpha) / std::tgamma(alpha) * std::pow(x, alpha - 1) *
std::exp(-beta * x));
}
/// Gaussian distribution
inline G4double Gaussian(G4double x, G4double sigma = 1, G4double x0 = 0)
{
G4double tmp = (x - x0) / sigma;
return (1.0 / (std::sqrt(2 * CLHEP::pi) * sigma)) * std::exp(-tmp * tmp / 2);
}
private:
/// Gamma distribution
inline G4double Gamma(G4double x, G4double alpha, G4double beta)
{
return (std::pow(beta, alpha) / std::tgamma(alpha) * std::pow(x, alpha - 1)
* std::exp(-beta * x));
}
/// Gaussian distribution
inline G4double Gaussian(G4double x, G4double sigma = 1, G4double x0 = 0)
{
G4double tmp = (x - x0) / sigma;
return (1.0 / (std::sqrt(2 * CLHEP::pi) * sigma)) * std::exp(-tmp * tmp / 2);
}
private:
/// Messenger for configuration
Par03EMShowerMessenger* fMessenger;
/// Helper class for creation of hits within the sensitive detector
std::unique_ptr<G4FastSimHitMaker> fHitMaker;
/// Standard deviation of the Gaussian distribution
/// Can be changed with UI command `/Par03/fastSim/transverseProfile/sigma
/// <sigma>`
/// If sigma is smaller than 0, it will be estimated from the detector
/// material (Moliere radius).
G4double fSigma = -1;
/// Alpha parameter of the Gamma distribution
/// Can be changed with UI command `/Par03/fastSim/longitudunalProfile/alpha
/// <alpha>`
/// If alpha is smaller than 0, it will be estimated from particle energy and
/// the detector material.
G4double fAlpha = -1;
/// Beta parameter of the Gamma distribution
/// Can be changed with UI command `/Par03/fastSim/longitudinalProfile/beta
/// <beta>`
G4double fBeta = 0.5;
/// Number of (same energy) hits created by the parametrisation. Can be
/// changed with UI command `/Par03/fastSim/numberOfHits <number>`
G4int fNbOfHits = 100;
/// Maximum depth of a shower created in fast simulation.
/// It is expressed in units of radiation length. Can be changed with UI
/// command `/Par03/fastSim/longitudinalProfile/maxDepth <depth>`
G4double fLongMaxDepth = 30;
private:
/// Messenger for configuration
Par03EMShowerMessenger* fMessenger;
/// Helper class for creation of hits within the sensitive detector
std::unique_ptr<G4FastSimHitMaker> fHitMaker;
/// Standard deviation of the Gaussian distribution
/// Can be changed with UI command `/Par03/fastSim/transverseProfile/sigma
/// <sigma>`
/// If sigma is smaller than 0, it will be estimated from the detector
/// material (Moliere radius).
G4double fSigma = -1;
/// Alpha parameter of the Gamma distribution
/// Can be changed with UI command `/Par03/fastSim/longitudunalProfile/alpha
/// <alpha>`
/// If alpha is smaller than 0, it will be estimated from particle energy and
/// the detector material.
G4double fAlpha = -1;
/// Beta parameter of the Gamma distribution
/// Can be changed with UI command `/Par03/fastSim/longitudinalProfile/beta
/// <beta>`
G4double fBeta = 0.5;
/// Number of (same energy) hits created by the parametrisation. Can be
/// changed with UI command `/Par03/fastSim/numberOfHits <number>`
G4int fNbOfHits = 100;
/// Maximum depth of a shower created in fast simulation.
/// It is expressed in units of radiation length. Can be changed with UI
/// command `/Par03/fastSim/longitudinalProfile/maxDepth <depth>`
G4double fLongMaxDepth = 30;
};
#endif /* PAR03EMSHOWERMODEL_HH */