Import Geant4 11.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2024-12-06 11:11:40 +01:00
parent e58e650b32
commit 32390e802b
1984 changed files with 98713 additions and 83996 deletions
@@ -47,26 +47,26 @@
class G4GFlashSpot
{
public:
G4GFlashSpot(const GFlashEnergySpot* aSpot, const G4FastTrack* aTrack, G4TouchableHandle aH)
: theSpot(aSpot), theTrack(aTrack), theHandle(aH)
{}
G4GFlashSpot(const GFlashEnergySpot * aSpot,
const G4FastTrack * aTrack, G4TouchableHandle aH)
: theSpot(aSpot), theTrack(aTrack), theHandle(aH) {}
~G4GFlashSpot() {}
const GFlashEnergySpot * GetEnergySpot() const {return theSpot;}
const G4FastTrack * GetOriginatorTrack() const {return theTrack;}
G4TouchableHandle GetTouchableHandle() const {return theHandle;}
const GFlashEnergySpot* GetEnergySpot() const { return theSpot; }
const G4FastTrack* GetOriginatorTrack() const { return theTrack; }
G4TouchableHandle GetTouchableHandle() const { return theHandle; }
G4ThreeVector GetPosition() const
{return GetOriginatorTrack()->GetPrimaryTrack()->GetPosition();}
{
return GetOriginatorTrack()->GetPrimaryTrack()->GetPosition();
}
private:
const GFlashEnergySpot * theSpot;
const G4FastTrack * theTrack;
const GFlashEnergySpot* theSpot;
const G4FastTrack* theTrack;
G4TouchableHandle theHandle;
};
@@ -48,81 +48,66 @@
#include "G4GFlashSpot.hh"
#include "G4VSensitiveDetector.hh"
class G4VGFlashSensitiveDetector
class G4VGFlashSensitiveDetector
{
public: // with description
G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector(const G4VGFlashSensitiveDetector&) {}
// Constructors. The user's concrete class must use one of these
// constructors by the constructor initializer of the derived class.
// The name of the sensitive detector must be the same as for the
// corresponding GG4VSensitiveDetector.
public: // with description
public: // without description
virtual ~G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector() {}
G4VGFlashSensitiveDetector(const G4VGFlashSensitiveDetector &) {}
// Constructors. The user's concrete class must use one of these
// constructors by the constructor initializer of the derived class.
// The name of the sensitive detector must be the same as for the
// corresponding GG4VSensitiveDetector.
G4bool operator==(const G4VGFlashSensitiveDetector& right) const { return this == &right; }
G4bool operator!=(const G4VGFlashSensitiveDetector& right) const { return this != &right; }
public: // without description
public: // without description
inline G4bool Hit(G4GFlashSpot* aSpot)
{
// This is the public method invoked by GFlashHitMaker for generating
// hits. The actual user's implementation for generating hits must be
// implemented in GenerateHits() virtual protected method.
virtual ~G4VGFlashSensitiveDetector() {}
G4bool operator==(const G4VGFlashSensitiveDetector &right) const
{return this == &right;}
G4bool operator!=(const G4VGFlashSensitiveDetector &right) const
{return this != &right;}
public: // without description
inline G4bool Hit(G4GFlashSpot * aSpot)
{
// This is the public method invoked by GFlashHitMaker for generating
// hits. The actual user's implementation for generating hits must be
// implemented in GenerateHits() virtual protected method.
G4bool result = true;
G4VSensitiveDetector * This
= dynamic_cast<G4VSensitiveDetector *>(this);
if(!This)
{
G4Exception("G4VGFlashSensitiveDetector::Hit()",
"InvalidSetup", FatalException,
"Needs also to inherit from G4VSensitiveDetector!");
return false;
}
if(This->isActive())
{
G4VReadOutGeometry * ROgeometry = 0;
G4TouchableHistory* ROhis = 0;
if(This) ROgeometry = This->GetROgeometry();
if(ROgeometry)
{
// fake pre-step point for touchable from read-out geometry.
G4Step fakeStep;
G4StepPoint * tmpPoint = fakeStep.GetPreStepPoint();
tmpPoint->SetTouchableHandle(aSpot->GetTouchableHandle());
tmpPoint->SetPosition(aSpot->GetPosition());
tmpPoint->SetMomentumDirection(aSpot->GetOriginatorTrack()
->GetPrimaryTrack()->GetMomentumDirection());
result = ROgeometry->CheckROVolume(&fakeStep, ROhis);
}
if(result) result = ProcessHits(aSpot, ROhis);
}
else
{
result = false;
}
return result;
G4bool result = true;
G4VSensitiveDetector* This = dynamic_cast<G4VSensitiveDetector*>(this);
if (!This) {
G4Exception("G4VGFlashSensitiveDetector::Hit()", "InvalidSetup", FatalException,
"Needs also to inherit from G4VSensitiveDetector!");
return false;
}
if (This->isActive()) {
G4VReadOutGeometry* ROgeometry = 0;
G4TouchableHistory* ROhis = 0;
protected: // with description
if (This) ROgeometry = This->GetROgeometry();
if (ROgeometry) {
// fake pre-step point for touchable from read-out geometry.
G4Step fakeStep;
G4StepPoint* tmpPoint = fakeStep.GetPreStepPoint();
tmpPoint->SetTouchableHandle(aSpot->GetTouchableHandle());
tmpPoint->SetPosition(aSpot->GetPosition());
tmpPoint->SetMomentumDirection(
aSpot->GetOriginatorTrack()->GetPrimaryTrack()->GetMomentumDirection());
result = ROgeometry->CheckROVolume(&fakeStep, ROhis);
}
if (result) result = ProcessHits(aSpot, ROhis);
}
else {
result = false;
}
return result;
}
virtual G4bool ProcessHits(G4GFlashSpot*aSpot,
G4TouchableHistory*ROhist) = 0;
// The user MUST implement this method for generating hit(s) from the
// GFlashSpots. Be aware that this method is a protected method and it
// will be invoked by Hit() method of the Base class once the Readout
// geometry that may be associated to the corresponding
// G4VSensitiveDetector was taken into account.
protected: // with description
virtual G4bool ProcessHits(G4GFlashSpot* aSpot, G4TouchableHistory* ROhist) = 0;
// The user MUST implement this method for generating hit(s) from the
// GFlashSpots. Be aware that this method is a protected method and it
// will be invoked by Hit() method of the Base class once the Readout
// geometry that may be associated to the corresponding
// G4VSensitiveDetector was taken into account.
};
#endif
@@ -46,21 +46,19 @@
class GFlashEnergySpot
{
public:
GFlashEnergySpot();
GFlashEnergySpot(const G4ThreeVector& point, G4double E);
~GFlashEnergySpot();
inline void SetEnergy(const G4double& E) {Energy = E;}
inline G4double GetEnergy() const {return Energy;}
inline void SetPosition(const G4ThreeVector& point) {Point = point;}
inline G4ThreeVector GetPosition() const {return Point;}
private:
G4double Energy; // energy deposition
G4ThreeVector Point; // locus of energy deposition
inline void SetEnergy(const G4double& E) { Energy = E; }
inline G4double GetEnergy() const { return Energy; }
inline void SetPosition(const G4ThreeVector& point) { Point = point; }
inline G4ThreeVector GetPosition() const { return Point; }
private:
G4double Energy; // energy deposition
G4ThreeVector Point; // locus of energy deposition
};
#endif
@@ -52,22 +52,20 @@ class G4Step;
class G4StepPoint;
class G4VProcess;
class GFlashHitMaker
class GFlashHitMaker
{
public:
GFlashHitMaker();
~GFlashHitMaker();
void make(GFlashEnergySpot * aSpot, const G4FastTrack * aT );
inline void SetNameOfWorldWithSD(const G4String& aName) {fWorldWithSdName = aName;};
void make(GFlashEnergySpot* aSpot, const G4FastTrack* aT);
inline void SetNameOfWorldWithSD(const G4String& aName) { fWorldWithSdName = aName; };
inline void SetProcess(G4VProcess* proc) { fpProcess = proc; }
private:
private:
G4TouchableHandle fTouchableHandle;
G4Navigator *fpNavigator;
G4Navigator* fpNavigator;
G4bool fNaviSetup;
/// Name of the world containing the sensitive detector. If empty, default mass world is used.
G4String fWorldWithSdName;
@@ -77,12 +75,7 @@ class GFlashHitMaker
G4VProcess* fpProcess = nullptr;
private:
GFlashHitMaker(const GFlashHitMaker & ) {}
GFlashHitMaker & operator = (const GFlashHitMaker & )
{
return *this;
}
GFlashHitMaker(const GFlashHitMaker&) {}
GFlashHitMaker& operator=(const GFlashHitMaker&) { return *this; }
};
#endif
@@ -49,13 +49,11 @@ class G4Material;
class GFlashHomoShowerParameterisation : public GVFlashShowerParameterisation
{
public: // with description
GFlashHomoShowerParameterisation(G4Material * aMat,
GVFlashHomoShowerTuning * aPar = 0);
GFlashHomoShowerParameterisation(G4Material* aMat, GVFlashHomoShowerTuning* aPar = 0);
~GFlashHomoShowerParameterisation();
void ComputeRadialParameters(G4double y, G4double Tau);
void GenerateLongitudinalProfile(G4double Energy);
void GenerateLongitudinalProfile(G4double Energy);
void ComputeZAX0EFFetc();
G4double IntegrateEneLongitudinal(G4double LongitudinalStep);
@@ -63,71 +61,69 @@ class GFlashHomoShowerParameterisation : public GVFlashShowerParameterisation
G4double ComputeTau(G4double LongitudinalPosition);
G4double GeneratePhi();
G4double GenerateRadius(G4int ispot, G4double Energy,
G4double LongitudinalPosition);
G4double GenerateRadius(G4int ispot, G4double Energy, G4double LongitudinalPosition);
G4double GenerateExponential(G4double Energy);
void SetMaterial(G4Material *mat);
void SetMaterial(G4Material* mat);
inline G4double GetAveR99() {return (3.5 * Rm);}
inline G4double GetAveR90() {return (1.5 * Rm);} //ok
inline G4double GetAveR99() { return (3.5 * Rm); }
inline G4double GetAveR90() { return (1.5 * Rm); } // ok
inline G4double GetAveTmx() {return (X0 * std::exp(AveLogTmaxh));}
inline G4double GetAveT99() {return (X0 * AveLogTmaxh/(AveLogAlphah-1.00));}
inline G4double GetAveT90() {return (2.5* X0*std::exp( AveLogTmaxh) );}
inline G4double GetNspot(){ return NSpot;}
inline G4double GetX0(){return X0;}
inline G4double GetEc(){return Ec;}
inline G4double GetRm(){return Rm;}
inline G4double GetX0() { return X0; }
inline G4double GetEc() { return Ec; }
inline G4double GetRm() { return Rm; }
private:
G4Material* material;
G4Material *material;
//Resolution
G4double ConstantResolution;
G4double NoiseResolution;
// Resolution
G4double ConstantResolution;
G4double NoiseResolution;
G4double SamplingResolution;
// parametrization parameters
GVFlashHomoShowerTuning * thePar;
GVFlashHomoShowerTuning* thePar;
// Cashed parameters:
// Cashed parameters:
// Longitudinal Coefficients for a homogeneous calo
G4double ParAveT1;
G4double ParAveA1,ParAveA2,ParAveA3;
G4double ParSigLogT1,ParSigLogT2;
G4double ParSigLogA1,ParSigLogA2;
G4double ParRho1,ParRho2;
G4double ParAveA1, ParAveA2, ParAveA3;
G4double ParSigLogT1, ParSigLogT2;
G4double ParSigLogA1, ParSigLogA2;
G4double ParRho1, ParRho2;
void ComputeLongitudinalParameters(G4double y);
void GenerateEnergyProfile(G4double y);
void GenerateNSpotProfile(G4double y);
// Radial Coefficients
G4double ParRC1,ParRC2,ParRC3,ParRC4;
G4double ParWC1,ParWC2,ParWC3;
G4double ParWC4,ParWC5,ParWC6;
G4double ParRT1,ParRT2,ParRT3,ParRT4;
G4double ParRT5,ParRT6;
G4double ParRC1, ParRC2, ParRC3, ParRC4;
G4double ParWC1, ParWC2, ParWC3;
G4double ParWC4, ParWC5, ParWC6;
G4double ParRT1, ParRT2, ParRT3, ParRT4;
G4double ParRT5, ParRT6;
// Spot multiplicity Coefficients
G4double ParSpotT1,ParSpotT2,ParSpotA1, ParSpotA2;
G4double ParSpotN1,ParSpotN2;
G4double ParSpotT1, ParSpotT2, ParSpotA1, ParSpotA2;
G4double ParSpotN1, ParSpotN2;
// PARAMETRISATION variables (Energy & position dependent)
// Longitudinal
// Longitudinal
// homogeneous
G4double AveLogAlphah,AveLogTmaxh;
G4double SigmaLogAlphah,SigmaLogTmaxh;
G4double AveLogAlphah, AveLogTmaxh;
G4double SigmaLogAlphah, SigmaLogTmaxh;
G4double Rhoh;
G4double Alphah,Tmaxh,Betah;
G4double Alphah, Tmaxh, Betah;
// Multiplicity
G4double NSpot,AlphaNSpot,TNSpot,BetaNSpot;
G4double NSpot, AlphaNSpot, TNSpot, BetaNSpot;
//Radial
G4double RadiusCore, WeightCore,RadiusTail;
// Radial
G4double RadiusCore, WeightCore, RadiusTail;
};
#endif
@@ -39,36 +39,30 @@
// Author: Joanna Weng - 9.11.04
//---------------------------------------------------------------
#ifndef GFlashParticleBounds_h
#define GFlashParticleBounds_h
#define GFlashParticleBounds_h
#include "G4ParticleDefinition.hh"
#include "G4ParticleDefinition.hh"
class GFlashParticleBounds
class GFlashParticleBounds
{
public: // with description
GFlashParticleBounds();
~GFlashParticleBounds();
// methods to get/set ELE/Gamma max & min energy bounds
G4double GetMinEneToParametrise(G4ParticleDefinition &particleType);
G4double GetMaxEneToParametrise(G4ParticleDefinition &particleType);
G4double GetEneToKill(G4ParticleDefinition &particleType) ;
void SetMinEneToParametrise(G4ParticleDefinition &particleType,
G4double enemin);
void SetMaxEneToParametrise(G4ParticleDefinition &particleType,
G4double enemax);
void SetEneToKill(G4ParticleDefinition &particleType,
G4double enekill);
G4double GetMinEneToParametrise(G4ParticleDefinition& particleType);
G4double GetMaxEneToParametrise(G4ParticleDefinition& particleType);
G4double GetEneToKill(G4ParticleDefinition& particleType);
void SetMinEneToParametrise(G4ParticleDefinition& particleType, G4double enemin);
void SetMaxEneToParametrise(G4ParticleDefinition& particleType, G4double enemax);
void SetEneToKill(G4ParticleDefinition& particleType, G4double enekill);
private:
// electron and positron
G4double EMinEneToParametrise;
G4double EMaxEneToParametrise;
G4double EEneToKill;
};
#endif
@@ -46,130 +46,127 @@
class G4Material;
class GFlashSamplingShowerParameterisation
: public GVFlashShowerParameterisation
class GFlashSamplingShowerParameterisation : public GVFlashShowerParameterisation
{
public:
GFlashSamplingShowerParameterisation(
G4Material* aMat1, G4Material* aMat2, G4double d1, G4double d2,
/// \param aMat1 passive material, \param dd1 - passive layer thickness
/// \param aMat2 active material, \param dd2 - acive layer thickness
GFlashSamplingShowerParameterisation(G4Material* aMat1, G4Material* aMat2,
G4double d1, G4double d2,
/// \param aMat1 passive material, \param dd1 - passive layer thickness
/// \param aMat2 active material, \param dd2 - acive layer thickness
GFlashSamplingShowerTuning * aPar = 0);
GFlashSamplingShowerTuning* aPar = 0);
~GFlashSamplingShowerParameterisation();
void ComputeRadialParameters(G4double y, G4double Tau);
void GenerateLongitudinalProfile(G4double Energy);
void GenerateLongitudinalProfile(G4double Energy);
void ComputeZAX0EFFetc();
G4double IntegrateEneLongitudinal(G4double LongitudinalStep);
G4double IntegrateNspLongitudinal(G4double LongitudinalStep);
G4double ComputeTau(G4double LongitudinalPosition);
void SetMaterial(G4Material *mat1, G4Material *mat2);
void SetMaterial(G4Material* mat1, G4Material* mat2);
G4double GeneratePhi();
G4double GenerateRadius(G4int ispot, G4double Energy,
G4double LongitudinalPosition);
G4double GenerateRadius(G4int ispot, G4double Energy, G4double LongitudinalPosition);
G4double GenerateExponential(G4double Energy);
inline G4double GetAveR99() {return (3.5 * Rmeff);}
inline G4double GetAveR90() {return (1.5 * Rmeff);} //ok
inline G4double GetAveR99() { return (3.5 * Rmeff); }
inline G4double GetAveR90() { return (1.5 * Rmeff); } // ok
//
inline G4double GetAveTmx() {return (X0eff*std::exp(AveLogTmax));}
inline G4double GetAveT99() {return (X0eff*AveLogTmax/(AveLogAlpha-1.00));}
inline G4double GetAveT90() {return (2.5* X0eff* std::exp( AveLogTmax));}
//
inline G4double GetNspot() {return NSpot;}
inline G4double GetX0() {return X0eff;}
inline G4double GetEc() {return Eceff;}
inline G4double GetRm() {return Rmeff;}
inline G4double GetAveTmx() { return (X0eff * std::exp(AveLogTmax)); }
inline G4double GetAveT99() { return (X0eff * AveLogTmax / (AveLogAlpha - 1.00)); }
inline G4double GetAveT90() { return (2.5 * X0eff * std::exp(AveLogTmax)); }
//
inline G4double GetNspot() { return NSpot; }
inline G4double GetX0() { return X0eff; }
inline G4double GetEc() { return Eceff; }
inline G4double GetRm() { return Rmeff; }
inline G4double GetEffDensity() { return Rhoeff; }
G4double ApplySampling(const G4double DEne, const G4double Energy);
private:
// medium related quantities
//
G4Material *material1, *material2 ;
G4double density1, A1, Z1, X01, Ec1, Rm1, d1;
G4double density2, A2, Z2, X02, Ec2, Rm2, d2;
G4double Aeff, Rhoeff, X0eff, Eceff, Rmeff, Fs, ehat, Zeff;
G4Material *material1, *material2;
G4double density1, A1, Z1, X01, Ec1, Rm1, d1;
G4double density2, A2, Z2, X02, Ec2, Rm2, d2;
G4double Aeff, Rhoeff{1.0}, X0eff{1.0}, Eceff{1.0}, Rmeff{1.0}, Fs, ehat, Zeff;
// Resolution
//
G4double ConstantResolution;
G4double NoiseResolution;
G4double ConstantResolution;
G4double NoiseResolution;
G4double SamplingResolution;
// parametrization parameters
//
GFlashSamplingShowerTuning * thePar;
GFlashSamplingShowerTuning* thePar;
// Cashed parameters:
// Cashed parameters:
// Longitudinal Coefficients for a homogenious calo
//
G4double ParAveT1, ParAveT2;
G4double ParAveA1,ParAveA2, ParAveA3;
G4double ParSigLogT1,ParSigLogT2;
G4double ParSigLogA1,ParSigLogA2;
G4double ParRho1,ParRho2;
G4double ParAveA1, ParAveA2, ParAveA3;
G4double ParSigLogT1, ParSigLogT2;
G4double ParSigLogA1, ParSigLogA2;
G4double ParRho1, ParRho2;
//Cashed parameters:
// Longitudinal Coefficients for a sampling calo
// Cashed parameters:
// Longitudinal Coefficients for a sampling calo
//
G4double ParsAveT1, ParsAveT2;
G4double ParsAveA1,ParsAveA2;
G4double ParsSigLogT1,ParsSigLogT2;
G4double ParsSigLogA1,ParsSigLogA2;
G4double ParsRho1,ParsRho2;
G4double ParsAveA1, ParsAveA2;
G4double ParsSigLogT1, ParsSigLogT2;
G4double ParsSigLogA1, ParsSigLogA2;
G4double ParsRho1, ParsRho2;
void ComputeLongitudinalParameters(G4double y);
void GenerateEnergyProfile(G4double y);
void GenerateNSpotProfile(G4double y);
// Radial Coefficients homo
//
G4double ParRC1,ParRC2,ParRC3,ParRC4;
G4double ParWC1,ParWC2,ParWC3;
G4double ParWC4,ParWC5,ParWC6;
G4double ParRT1,ParRT2,ParRT3,ParRT4;
G4double ParRT5,ParRT6;
G4double ParRC1, ParRC2, ParRC3, ParRC4;
G4double ParWC1, ParWC2, ParWC3;
G4double ParWC4, ParWC5, ParWC6;
G4double ParRT1, ParRT2, ParRT3, ParRT4;
G4double ParRT5, ParRT6;
// Radial Coefficients sampling
//
G4double ParsRC1,ParsRC2;
G4double ParsWC1,ParsWC2;
G4double ParsRT1,ParsRT2;
G4double ParsRC1, ParsRC2;
G4double ParsWC1, ParsWC2;
G4double ParsRT1, ParsRT2;
// Spot multiplicity Coefficients
//
G4double ParsSpotT1,ParsSpotT2,ParsSpotA1, ParsSpotA2;
G4double ParsSpotN1,ParsSpotN2;
G4double ParsSpotT1, ParsSpotT2, ParsSpotA1, ParsSpotA2;
G4double ParsSpotN1, ParsSpotN2;
// PARAMETRISATION variables (Energy & position dependent)
// Longitudinal
// Longitudinal
// homogeneous
//
G4double AveLogAlphah,AveLogTmaxh;
G4double SigmaLogAlphah,SigmaLogTmaxh;
G4double AveLogAlphah, AveLogTmaxh;
G4double SigmaLogAlphah, SigmaLogTmaxh;
G4double Rhoh;
G4double Alphah,Tmaxh,Betah;
G4double Alphah, Tmaxh, Betah;
// PARAMETRISATION variables (Energy & position dependent)
// Longitudinal
// Longitudinal
// sampling
//
G4double AveLogAlpha,AveLogTmax;
G4double SigmaLogAlpha,SigmaLogTmax;
G4double AveLogAlpha, AveLogTmax;
G4double SigmaLogAlpha, SigmaLogTmax;
G4double Rho;
G4double Alpha,Tmax,Beta;
G4double Alpha, Tmax, Beta;
// Multiplicity
//
G4double NSpot,AlphaNSpot,TNSpot,BetaNSpot;
G4double NSpot, AlphaNSpot, TNSpot, BetaNSpot;
//Radial
// Radial
//
G4double RadiusCore, WeightCore,RadiusTail;
G4double RadiusCore, WeightCore, RadiusTail;
};
#endif
@@ -60,75 +60,72 @@ class GFlashSamplingShowerTuning : public GVFlashHomoShowerTuning
GFlashSamplingShowerTuning() {}
virtual ~GFlashSamplingShowerTuning() {}
public: // with description
G4double ParsAveT1(){ return -0.55;} // t1
G4double ParsAveT2(){ return -0.69;} // t2
public: // with description
G4double ParsAveT1() { return -0.55; } // t1
G4double ParsAveT2() { return -0.69; } // t2
// T_sam = log(exp( log T_hom) + t1*Fs-1 + t2*(1-ehat))
G4double ParsAveA1(){ return -0.476; } // a1
G4double ParsAveA1() { return -0.476; } // a1
// alpha_sam = log(exp(log alphah_hom) +(a1*Fs-1))
G4double ParsSigLogT1(){ return -2.5;} // t1
G4double ParsSigLogT2(){ return 1.25;} // t2
G4double ParsSigLogT1() { return -2.5; } // t1
G4double ParsSigLogT2() { return 1.25; } // t2
// std::sqrt(var(ln(T_sam))) = 1/(t+t2*ln(y))
G4double ParsSigLogA1(){ return -0.82;} // a1
G4double ParsSigLogA2(){ return 0.79; } // a2
G4double ParsSigLogA1() { return -0.82; } // a1
G4double ParsSigLogA2() { return 0.79; } // a2
// std::sqrt(var(ln(alpha_sam))) = 1/(a1+a2*ln(y))
G4double ParsRho1(){ return 0.784; } // r1
G4double ParsRho2(){ return -0.023;} // r2
G4double ParsRho1() { return 0.784; } // r1
G4double ParsRho2() { return -0.023; } // r2
// Correlation(ln(T),ln(alpha))=r1+r2*ln(y)
// Radial profiles
// f(r) := (1/dE(t))(dE(t,r)/dr)
// Ansatz:
// f(r) = p(2*r*Rc**2)/(r**2+Rc**2)**2+(1-p)*(2*r*Rt**2)/(r**2+Rt**2)**2,
// 0<p<1
// Radial profiles
// f(r) := (1/dE(t))(dE(t,r)/dr)
// Ansatz:
// f(r) = p(2*r*Rc**2)/(r**2+Rc**2)**2+(1-p)*(2*r*Rt**2)/(r**2+Rt**2)**2,
// 0<p<1
G4double ParsRC1(){ return -0.0203; } // c1
G4double ParsRC2(){ return 0.0397; } // c2
G4double ParsRC1() { return -0.0203; } // c1
G4double ParsRC2() { return 0.0397; } // c2
// Rc_sam = Rc_hom + c1 * (1-ehat) + c2 *Fs-1*exp (-tau)
G4double ParsRT1(){ return -0.14; } // t1
G4double ParsRT2(){ return -0.495; } // t2
G4double ParsRT1() { return -0.14; } // t1
G4double ParsRT2() { return -0.495; } // t2
// Rt_sam = Rc_hom + t1 * (1-ehat) + t2 *Fs-1*exp (-tau)
G4double ParsWC1(){ return 0.348; } // c1
G4double ParsWC2(){ return -0.642;} // c2
G4double ParsWC1() { return 0.348; } // c1
G4double ParsWC2() { return -0.642; } // c2
// W_sam = W_hom + (1-ehat)*(c1 + c2 *Fs-1 * exp (- (tau -1 )**2))
// Fluctuations on radial profiles through number of spots
// The total number of spots needed for a shower is
// Fluctuations on radial profiles through number of spots
// The total number of spots needed for a shower is
G4double ParsSpotN1(){ return 10.3; } // n1
G4double ParsSpotN2(){ return 0.959;} // n2
G4double ParsSpotN1() { return 10.3; } // n1
G4double ParsSpotN2() { return 0.959; } // n2
// Ns = n1*ln(Z)(E/GeV)**n2
// The number of spots per longitudinal interval is:
// (1/Ns)(dNs(t)/dt) = f(t)
// = (beta*t)**(alpha-1)*beta*std::exp(-beta*t)/Gamma(alpha)
// <t> = alpha_s/beta_s
// Ts = (alpha_s-1)/beta_s
// and
// Ts = T*(t1+t2*Z)
// alpha_s = alpha*(a1+a2*Z)
// The number of spots per longitudinal interval is:
// (1/Ns)(dNs(t)/dt) = f(t)
// = (beta*t)**(alpha-1)*beta*std::exp(-beta*t)/Gamma(alpha)
// <t> = alpha_s/beta_s
// Ts = (alpha_s-1)/beta_s
// and
// Ts = T*(t1+t2*Z)
// alpha_s = alpha*(a1+a2*Z)
G4double ParsSpotT1(){ return 0.813; } // t1
G4double ParsSpotT2(){ return 0.0019;} // t2
G4double ParsSpotT1() { return 0.813; } // t1
G4double ParsSpotT2() { return 0.0019; } // t2
G4double ParsSpotA1(){ return 0.844; } //a1
G4double ParsSpotA2(){ return 0.0026;} //a2
G4double ParsSpotA1() { return 0.844; } // a1
G4double ParsSpotA2() { return 0.0026; } // a2
// Resolution
G4double ConstantResolution(){ return 0.00; }
G4double NoiseResolution() { return 0.00; } // not used
G4double SamplingResolution(){ return 0.11; } // not used
// Resolution
G4double ConstantResolution() { return 0.00; } // not used
G4double NoiseResolution() { return 0.00; } // not used
G4double SamplingResolution() { return 0.11; }
};
#endif
@@ -59,46 +59,35 @@ class GFlashSamplingShowerParameterisation;
class GFlashShowerModel : public G4VFastSimulationModel
{
public: // with description
GFlashShowerModel(G4String, G4Envelope*);
GFlashShowerModel(G4String);
~GFlashShowerModel();
// Constructors, destructor
GFlashShowerModel (G4String, G4Envelope*);
GFlashShowerModel (G4String);
~GFlashShowerModel ();
// Constructors, destructor
G4bool ModelTrigger(const G4FastTrack &);
G4bool ModelTrigger(const G4FastTrack&);
G4bool IsApplicable(const G4ParticleDefinition&);
void DoIt(const G4FastTrack&, G4FastStep&);
// Checks whether conditions of fast parameterisation are fullfilled
// Checks whether conditions of fast parameterisation are fullfilled
// setting
inline void SetFlagParamType(G4int I)
{ FlagParamType = I; }
inline void SetFlagParticleContainment(G4int I)
{ FlagParticleContainment = I; }
inline void SetStepInX0(G4double Lenght)
{ StepInX0=Lenght; }
inline void SetParameterisation(GVFlashShowerParameterisation &DP)
{ Parameterisation=&DP;}
inline void SetHitMaker(GFlashHitMaker &Maker)
{ HMaker=&Maker; }
inline void SetParticleBounds(GFlashParticleBounds &SpecificBound)
{ PBound =&SpecificBound; }
inline void SetFlagParamType(G4int I) { FlagParamType = I; }
inline void SetFlagParticleContainment(G4int I) { FlagParticleContainment = I; }
inline void SetStepInX0(G4double Lenght) { StepInX0 = Lenght; }
inline void SetParameterisation(GVFlashShowerParameterisation& DP) { Parameterisation = &DP; }
inline void SetHitMaker(GFlashHitMaker& Maker) { HMaker = &Maker; }
inline void SetParticleBounds(GFlashParticleBounds& SpecificBound) { PBound = &SpecificBound; }
// getting
inline G4int GetFlagParamType()
{ return FlagParamType; }
inline G4int GetFlagParticleContainment()
{ return FlagParticleContainment; }
inline G4double GetStepInX0()
{ return StepInX0; }
inline G4int GetFlagParamType() { return FlagParamType; }
inline G4int GetFlagParticleContainment() { return FlagParticleContainment; }
inline G4double GetStepInX0() { return StepInX0; }
public: // without description
// Gets ?
// Gets ?
GFlashParticleBounds *PBound;
GVFlashShowerParameterisation *Parameterisation;
GVFlashShowerParameterisation* Parameterisation;
private:
@@ -107,17 +96,15 @@ class GFlashShowerModel : public G4VFastSimulationModel
// void NeutrinoDoIt(const G4FastTrack&, G4FastStep&);
G4bool CheckParticleDefAndContainment(const G4FastTrack &fastTrack);
G4bool CheckContainment(const G4FastTrack &fastTrack);
private:
GFlashHitMaker *HMaker;
private:
GFlashHitMaker* HMaker;
GFlashShowerModelMessenger* Messenger;
//Control Flags
G4int FlagParamType; ///0=no GFlash 1=only em showers parametrized
G4int FlagParticleContainment; ///0=no check ///1=only fully contained...
G4double StepInX0;
G4double StepInX0;
G4double EnergyStop;
};
#endif
@@ -52,26 +52,24 @@ class G4UIcmdWithAnInteger;
class G4UIcmdWithADoubleAndUnit;
class G4UIcmdWithADouble;
class GFlashShowerModelMessenger: public G4UImessenger
class GFlashShowerModelMessenger : public G4UImessenger
{
public:
GFlashShowerModelMessenger(GFlashShowerModel * myModel);
GFlashShowerModelMessenger(GFlashShowerModel* myModel);
~GFlashShowerModelMessenger();
void SetNewValue(G4UIcommand * command,G4String newValues);
G4String GetCurrentValue(G4UIcommand * command);
private:
void SetNewValue(G4UIcommand* command, G4String newValues);
G4String GetCurrentValue(G4UIcommand* command);
private:
GFlashShowerModel* myModel;
G4UIdirectory* myParaDir;
G4UIcmdWithAnInteger* FlagCmd;
G4UIcmdWithAnInteger* ContCmd; // Containment Check
G4UIcmdWithADouble* StepInX0Cmd;
G4UIcmdWithADoubleAndUnit* EmaxCmd;
G4UIcmdWithADoubleAndUnit* EminCmd;
G4UIcmdWithADoubleAndUnit* EkillCmd;
G4UIdirectory* myParaDir;
G4UIcmdWithAnInteger* FlagCmd;
G4UIcmdWithAnInteger* ContCmd; // Containment Check
G4UIcmdWithADouble* StepInX0Cmd;
G4UIcmdWithADoubleAndUnit* EmaxCmd;
G4UIcmdWithADoubleAndUnit* EminCmd;
G4UIcmdWithADoubleAndUnit* EkillCmd;
};
#endif
@@ -70,22 +70,21 @@ class GVFlashHomoShowerTuning
public:
GVFlashHomoShowerTuning() {}
virtual ~GVFlashHomoShowerTuning() {}
public: // with description
virtual G4double ParAveT1(){ return -0.812; } // t1
virtual G4double ParAveA1(){ return 0.81; } // a1
public: // with description
virtual G4double ParAveT1() { return -0.812; } // t1
virtual G4double ParAveA1() { return 0.81; } // a1
virtual G4double ParAveA2(){ return 0.458; } // a2
virtual G4double ParAveA3(){ return 2.26; } // a3
virtual G4double ParSigLogT1(){ return -1.4; } // t1
virtual G4double ParSigLogT2(){ return 1.26;} // t2
// std::sqrt(var(ln(T))) = 1/(t+t2*ln(y))
virtual G4double ParAveA3() { return 2.26; } // a3
virtual G4double ParSigLogT1() { return -1.4; } // t1
virtual G4double ParSigLogT2() { return 1.26; } // t2
// std::sqrt(var(ln(T))) = 1/(t+t2*ln(y))
virtual G4double ParSigLogA1(){ return -0.58; } // a1
virtual G4double ParSigLogA2(){ return 0.86; } // a2
// std::sqrt(var(ln(alpha))) = 1/(a1+a2*ln(y))
virtual G4double ParRho1(){ return 0.705; } // r1
virtual G4double ParRho2(){ return -0.023; } // r2
// Correlation(ln(T),ln(alpha))=r1+r2*ln(y)
@@ -103,7 +102,7 @@ class GVFlashHomoShowerTuning
// Rc (t/T)= z1 +z2*t/T
// z1 = c1+c2*ln(E/GeV)
// z2 = c3+c4*Z
virtual G4double ParRT1(){ return 0.659; } // t1
virtual G4double ParRT2(){ return -0.00309;} // t2
virtual G4double ParRT3(){ return 0.645; } // k2
@@ -113,7 +112,7 @@ class GVFlashHomoShowerTuning
// Rt (t/T)= k1*(std::exp(k3*(t/T-k2))+std::exp(k4*(t/T-k2)))
// k1 = t1+t2*Z
// k4 = t5+t6*ln(E/GeV)
virtual G4double ParWC1(){ return 2.632; } // c1
virtual G4double ParWC2(){ return -0.00094;} // c2
virtual G4double ParWC3(){ return 0.401; } // c3
@@ -141,11 +140,10 @@ class GVFlashHomoShowerTuning
// alpha_s = alpha*(a1+a2*Z)
virtual G4double ParSpotT1(){ return 0.698; } // t1
virtual G4double ParSpotT2(){ return 0.00212;} // t2
virtual G4double ParSpotA1(){ return 0.639; } //a1
virtual G4double ParSpotA2(){ return 0.00334;} //a2
virtual G4double ParSpotT2() { return 0.00212; } // t2
virtual G4double ParSpotA1() { return 0.639; } // a1
virtual G4double ParSpotA2() { return 0.00334; } // a2
};
#endif
@@ -46,55 +46,51 @@
class MyGamma;
class G4Material;
class GVFlashShowerParameterisation
{
public: // with description
GVFlashShowerParameterisation();
virtual ~GVFlashShowerParameterisation();
virtual void ComputeRadialParameters(G4double y, G4double Tau) = 0;
virtual void GenerateLongitudinalProfile(G4double Energy) = 0;
virtual G4double IntegrateEneLongitudinal(G4double LongitudinalStep) = 0;
virtual G4double IntegrateNspLongitudinal(G4double LongitudinalStep) = 0;
virtual G4double ComputeTau(G4double LongitudinalPosition) = 0;
virtual G4double GenerateRadius(G4int ispot, G4double Energy,
G4double LongitudinalPosition) = 0;
virtual void ComputeLongitudinalParameters(G4double y) = 0;
virtual void GenerateEnergyProfile(G4double y) = 0;
virtual void GenerateNSpotProfile(G4double y) = 0;
virtual G4double GenerateExponential(G4double Energy) = 0;
virtual G4double GetAveR99() = 0;
virtual G4double GetAveR90() = 0;
virtual G4double GetAveTmx() = 0;
virtual G4double GetAveT99() = 0;
virtual G4double GetAveT90() = 0;
virtual G4double GetNspot() = 0;
virtual G4double GetX0() = 0;
virtual G4double GetEc() = 0;
virtual G4double GetRm() = 0;
G4double GeneratePhi();
G4double GetEffZ(const G4Material * material);
G4double GetEffA(const G4Material * material);
G4double gam(G4double x, G4double a) const; // @@@@ gamma function
void PrintMaterial(const G4Material * mat);
protected:
GVFlashHomoShowerTuning * thePar;
// Parameterisation parameters
G4double density, A, Z, X0, Ec, Rm;
// Medium related quantities
G4double NSpot;
private:
MyGamma* fGamma;
public: // with description
GVFlashShowerParameterisation();
virtual ~GVFlashShowerParameterisation();
virtual void ComputeRadialParameters(G4double y, G4double Tau) = 0;
virtual void GenerateLongitudinalProfile(G4double Energy) = 0;
virtual G4double IntegrateEneLongitudinal(G4double LongitudinalStep) = 0;
virtual G4double IntegrateNspLongitudinal(G4double LongitudinalStep) = 0;
virtual G4double ComputeTau(G4double LongitudinalPosition) = 0;
virtual G4double GenerateRadius(G4int ispot, G4double Energy,
G4double LongitudinalPosition) = 0;
virtual void ComputeLongitudinalParameters(G4double y) = 0;
virtual void GenerateEnergyProfile(G4double y) = 0;
virtual void GenerateNSpotProfile(G4double y) = 0;
virtual G4double GenerateExponential(G4double Energy) = 0;
virtual G4double GetAveR99() = 0;
virtual G4double GetAveR90() = 0;
virtual G4double GetAveTmx() = 0;
virtual G4double GetAveT99() = 0;
virtual G4double GetAveT90() = 0;
virtual G4double GetNspot() = 0;
virtual G4double GetX0() = 0;
virtual G4double GetEc() = 0;
virtual G4double GetRm() = 0;
G4double GeneratePhi();
G4double GetEffZ(const G4Material* material);
G4double GetEffA(const G4Material* material);
G4double gam(G4double x, G4double a) const; // @@@@ gamma function
void PrintMaterial(const G4Material* mat);
protected:
GVFlashHomoShowerTuning* thePar;
// Parameterisation parameters
G4double density, A, Z, X0, Ec, Rm;
// Medium related quantities
G4double NSpot;
private:
MyGamma* fGamma;
};
#endif
@@ -45,25 +45,23 @@
class MyGamma
{
public:
MyGamma ();
MyGamma();
~MyGamma();
double Gamma(double z);
double Gamma(double a,double x);
double Gamma(double a, double x);
private:
double GamCf(double a, double x);
double GamSer(double a, double x);
double GamCf(double a,double x);
double GamSer(double a,double x);
// Abs
static short Abs(short d) { return (d > 0) ? d : -d; }
static int Abs(int d) { return (d > 0) ? d : -d; }
static short Abs(short d) { return (d > 0) ? d : -d; }
static int Abs(int d) { return (d > 0) ? d : -d; }
static long Abs(long d) { return (d > 0) ? d : -d; }
static float Abs(float d) { return (d > 0) ? d : -d; }
static double Abs(double d) { return (d > 0) ? d : -d; }
static double LnGamma(double z);
static double LnGamma(double z);
static double Log(double x) { return std::log(x); }
static double Exp(double x) { return std::exp(x); }
};