Import Geant4 10.6.1 source tree
This commit is contained in:
@@ -16,12 +16,16 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
13 January 20: V.Ivanchenko (emmuons-V10-05-02)
|
||||
- G4MuPairProductionModel - added Store/Retrieve data methods
|
||||
by request of CMS
|
||||
|
||||
14 August 19: V.Ivanchenko (emmuons-V10-05-01)
|
||||
- G4TablesForExtrapolator - created G4LossTableBuilder and
|
||||
destruct end of run
|
||||
|
||||
07 February 19: V.Ivanchenko (emmuons-V10-05-00)
|
||||
- G4MuMultipleSacttering - reduced length of printout (fix problem #2105)
|
||||
- G4MuMultipleScattering - reduced length of printout (fix problem #2105)
|
||||
|
||||
17 September 18: D.Sawkey (emmuons-V10-04-05)
|
||||
- G4MuMultipleScattering, G4MuPairProduction, G4eePairProduction,
|
||||
|
||||
@@ -110,6 +110,11 @@ public:
|
||||
|
||||
inline void SetParticle(const G4ParticleDefinition*);
|
||||
|
||||
// hide assignment operator and copy constructor
|
||||
G4MuPairProductionModel & operator=
|
||||
(const G4MuPairProductionModel &right) = delete;
|
||||
G4MuPairProductionModel(const G4MuPairProductionModel&) = delete;
|
||||
|
||||
protected:
|
||||
|
||||
G4double ComputMuPairLoss(G4double Z, G4double tkin, G4double cut,
|
||||
@@ -130,15 +135,15 @@ private:
|
||||
|
||||
void MakeSamplingTables();
|
||||
|
||||
void DataCorrupted(G4int Z, G4double logTkin);
|
||||
void StoreTables() const;
|
||||
|
||||
G4bool RetrieveTables();
|
||||
|
||||
void DataCorrupted(G4int Z, G4double logTkin) const;
|
||||
|
||||
inline G4double FindScaledEnergy(G4int Z, G4double rand, G4double logTkin,
|
||||
G4double yymin, G4double yymax);
|
||||
|
||||
// hide assignment operator
|
||||
G4MuPairProductionModel & operator=(const G4MuPairProductionModel &right) = delete;
|
||||
G4MuPairProductionModel(const G4MuPairProductionModel&) = delete;
|
||||
|
||||
protected:
|
||||
|
||||
const G4ParticleDefinition* particle;
|
||||
@@ -171,6 +176,8 @@ protected:
|
||||
G4double dy;
|
||||
G4double emin;
|
||||
G4double emax;
|
||||
|
||||
G4bool fTableToFile;
|
||||
};
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -71,6 +71,7 @@
|
||||
#include "G4MuPairProductionModel.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4EmParameters.hh"
|
||||
#include "G4Electron.hh"
|
||||
#include "G4Positron.hh"
|
||||
#include "G4MuonMinus.hh"
|
||||
@@ -84,6 +85,8 @@
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
#include "G4Log.hh"
|
||||
#include "G4Exp.hh"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -118,7 +121,8 @@ G4MuPairProductionModel::G4MuPairProductionModel(const G4ParticleDefinition* p,
|
||||
nbiny(1000),
|
||||
nbine(0),
|
||||
ymin(-5.),
|
||||
dy(0.005)
|
||||
dy(0.005),
|
||||
fTableToFile(false)
|
||||
{
|
||||
nist = G4NistManager::Instance();
|
||||
|
||||
@@ -173,10 +177,12 @@ void G4MuPairProductionModel::Initialise(const G4ParticleDefinition* p,
|
||||
}
|
||||
|
||||
if(IsMaster() && p == particle) {
|
||||
|
||||
if(!fElementData) {
|
||||
fElementData = new G4ElementData();
|
||||
MakeSamplingTables();
|
||||
G4bool dataFile = G4EmParameters::Instance()->RetrieveMuDataFromFile();
|
||||
if(dataFile) { dataFile = RetrieveTables(); }
|
||||
if(!dataFile) { MakeSamplingTables(); }
|
||||
if(fTableToFile) { StoreTables(); }
|
||||
}
|
||||
InitialiseElementSelectors(p, cuts);
|
||||
}
|
||||
@@ -244,10 +250,8 @@ G4double G4MuPairProductionModel::ComputMuPairLoss(G4double Z,
|
||||
G4double hhh = (bbb-aaa)/(G4double)kkk;
|
||||
G4double x = aaa;
|
||||
|
||||
for (G4int l=0 ; l<kkk; l++)
|
||||
{
|
||||
|
||||
for (G4int ll=0; ll<8; ll++)
|
||||
for (G4int l=0 ; l<kkk; ++l) {
|
||||
for (G4int ll=0; ll<8; ++ll)
|
||||
{
|
||||
G4double ep = G4Exp(x+xgi[ll]*hhh);
|
||||
loss += wgi[ll]*ep*ep*ComputeDMicroscopicCrossSection(tkin, Z, ep);
|
||||
@@ -645,7 +649,7 @@ void G4MuPairProductionModel::SampleSecondaries(
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuPairProductionModel::DataCorrupted(G4int Z, G4double logTkin)
|
||||
void G4MuPairProductionModel::DataCorrupted(G4int Z, G4double logTkin) const
|
||||
{
|
||||
G4ExceptionDescription ed;
|
||||
ed << "G4ElementData is not properly initialized Z= " << Z
|
||||
@@ -658,4 +662,49 @@ void G4MuPairProductionModel::DataCorrupted(G4int Z, G4double logTkin)
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void G4MuPairProductionModel::StoreTables() const
|
||||
{
|
||||
for (G4int iz=0; iz<nzdat; ++iz) {
|
||||
G4int Z = zdat[iz];
|
||||
G4Physics2DVector* pv = fElementData->GetElement2DData(Z);
|
||||
if(!pv) { DataCorrupted(Z, 1.0); }
|
||||
std::ostringstream ss;
|
||||
ss << "mupair/" << particle->GetParticleName() << Z << ".dat";
|
||||
std::ofstream outfile(ss.str());
|
||||
pv->Store(outfile);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4bool G4MuPairProductionModel::RetrieveTables()
|
||||
{
|
||||
char* path = std::getenv("G4LEDATA");
|
||||
G4String dir("");
|
||||
if (path) {
|
||||
std::ostringstream ost;
|
||||
ost << path << "/mupair/";
|
||||
dir = ost.str();
|
||||
} else {
|
||||
dir = "./mupair/";
|
||||
}
|
||||
|
||||
for (G4int iz=0; iz<nzdat; ++iz) {
|
||||
G4double Z = zdat[iz];
|
||||
G4Physics2DVector* pv = new G4Physics2DVector(nbiny+1,nbine+1);
|
||||
if(!pv) {
|
||||
DataCorrupted(Z, 2.0);
|
||||
return false;
|
||||
}
|
||||
std::ostringstream ss;
|
||||
ss << dir << particle->GetParticleName() << Z << ".dat";
|
||||
std::ifstream infile(ss.str(), std::ios::in);
|
||||
if(!pv->Retrieve(infile)) { return false; }
|
||||
fElementData->InitialiseForElement(Z, pv);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,10 @@ committal in the CVS repository !
|
||||
|
||||
----------------------------------------------------------
|
||||
|
||||
07 December 19: V.Ivanchenko (emstand-V10-05-27)
|
||||
- G4BetheHeitler5DModel - added protection against negative
|
||||
argument of sqrt() due to precision lost
|
||||
|
||||
06 November 19: V.Ivanchenko (emstand-V10-05-26)
|
||||
- G4ESTARStopping, G4GSMottCorrection, G4GSPWACorrections,
|
||||
G4GoudsmitSaundersonTable, G4SBBremTable, G4SeltzerBergerModel
|
||||
|
||||
@@ -481,12 +481,12 @@ G4BetheHeitler5DModel::SampleSecondaries(std::vector<G4DynamicParticle*>* fvect,
|
||||
const G4double LeptonEnergy2 = PairInvMass*0.5;
|
||||
|
||||
// New way of calucaltion thePRecoil to avoid underflow
|
||||
const G4double ap1 = 2.0*GammaEnergy*RecoilMass -
|
||||
PairInvMass*PairInvMass + 2.0*PairInvMass*RecoilMass;
|
||||
const G4double bp1 = 2.0*GammaEnergy*RecoilMass -
|
||||
PairInvMass*PairInvMass - 2.0*PairInvMass*RecoilMass;
|
||||
G4double abp = std::max((2.0*GammaEnergy*RecoilMass -
|
||||
PairInvMass*PairInvMass + 2.0*PairInvMass*RecoilMass)*
|
||||
(2.0*GammaEnergy*RecoilMass -
|
||||
PairInvMass*PairInvMass - 2.0*PairInvMass*RecoilMass),0.0);
|
||||
|
||||
const G4double thePRecoil = std::sqrt(ap1 * bp1) * isqrts2;
|
||||
G4double thePRecoil = std::sqrt(abp) * isqrts2;
|
||||
|
||||
// back to the center-of-mass frame
|
||||
Recoil.set( thePRecoil*sinTheta*cosPhi,
|
||||
|
||||
@@ -16,12 +16,16 @@ committal in the CVS repository !
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
|
||||
13 January 19: V.Ivanchenko (emutils-V10-05-23)
|
||||
- G4EmParameters, G4EmParametersMessenger - added new parameter
|
||||
to enable read of e+e- production table from file (CMS request)
|
||||
|
||||
16 October 19: D.Sawkey (emutils-V10-05-22)
|
||||
- G4EmBiasingManager - delete non-tracked particles
|
||||
|
||||
11 October 19: W.G.Shin, S.Incerti (emutils-V10-05-21)
|
||||
- G4DNAModelSubType.hh : added Kreipl and Meesungnoen amorphous
|
||||
ice models
|
||||
- G4DNAModelSubType.hh : added Kreipl and Meesungnoen amorphous
|
||||
ice models
|
||||
- G4EmLowEParametersMessenger.* : added corresponding commands
|
||||
|
||||
10 October 19: V.Ivanchenko (emutils-V10-05-20)
|
||||
|
||||
@@ -168,12 +168,15 @@ public:
|
||||
void SetEnablePolarisation(G4bool val);
|
||||
G4bool EnablePolarisation() const;
|
||||
|
||||
G4bool GetDirectionalSplitting();
|
||||
G4bool GetDirectionalSplitting() const;
|
||||
void SetDirectionalSplitting(G4bool v);
|
||||
|
||||
G4bool QuantumEntanglement();
|
||||
G4bool QuantumEntanglement() const;
|
||||
void SetQuantumEntanglement(G4bool v);
|
||||
|
||||
G4bool RetrieveMuDataFromFile() const;
|
||||
void SetRetrieveMuDataFromFile(G4bool v);
|
||||
|
||||
// 5d
|
||||
void SetOnIsolated(G4bool val);
|
||||
G4bool OnIsolated() const;
|
||||
@@ -378,6 +381,7 @@ private:
|
||||
G4bool gener;
|
||||
G4bool fSamplingTable;
|
||||
G4bool fPolarisation;
|
||||
G4bool fMuDataFromFile;
|
||||
G4bool onIsolated; // 5d model conversion on free ions
|
||||
G4bool fDNA;
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ private:
|
||||
G4UIcmdWithABool* onIsolatedCmd;
|
||||
G4UIcmdWithABool* sampleTCmd;
|
||||
G4UIcmdWithABool* icru90Cmd;
|
||||
G4UIcmdWithABool* mudatCmd;
|
||||
|
||||
G4UIcmdWithADouble* minSubSecCmd;
|
||||
G4UIcmdWithADoubleAndUnit* minEnCmd;
|
||||
|
||||
@@ -136,6 +136,7 @@ void G4EmParameters::Initialise()
|
||||
onIsolated = false;
|
||||
fSamplingTable = false;
|
||||
fPolarisation = false;
|
||||
fMuDataFromFile = false;
|
||||
fDNA = false;
|
||||
|
||||
minSubRange = 1.0;
|
||||
@@ -414,6 +415,7 @@ G4bool G4EmParameters::BirksActive() const
|
||||
|
||||
void G4EmParameters::SetUseICRU90Data(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
fICRU90 = val;
|
||||
}
|
||||
|
||||
@@ -481,6 +483,16 @@ void G4EmParameters::SetEmSaturation(G4EmSaturation* ptr)
|
||||
}
|
||||
}
|
||||
|
||||
G4bool G4EmParameters::RetrieveMuDataFromFile() const
|
||||
{
|
||||
return fMuDataFromFile;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetRetrieveMuDataFromFile(G4bool v)
|
||||
{
|
||||
fMuDataFromFile = v;
|
||||
}
|
||||
|
||||
void G4EmParameters::SetOnIsolated(G4bool val)
|
||||
{
|
||||
if(IsLocked()) { return; }
|
||||
@@ -1156,7 +1168,7 @@ void G4EmParameters::DefineRegParamForEM(G4VEmProcess* ptr) const
|
||||
fBParameters->DefineRegParamForEM(ptr);
|
||||
}
|
||||
|
||||
G4bool G4EmParameters::QuantumEntanglement()
|
||||
G4bool G4EmParameters::QuantumEntanglement() const
|
||||
{
|
||||
return fBParameters->QuantumEntanglement();
|
||||
}
|
||||
@@ -1167,7 +1179,7 @@ void G4EmParameters::SetQuantumEntanglement(G4bool v)
|
||||
fBParameters->SetQuantumEntanglement(v);
|
||||
}
|
||||
|
||||
G4bool G4EmParameters::GetDirectionalSplitting() {
|
||||
G4bool G4EmParameters::GetDirectionalSplitting() const {
|
||||
return fBParameters->GetDirectionalSplitting();
|
||||
}
|
||||
|
||||
@@ -1266,7 +1278,8 @@ void G4EmParameters::StreamInfo(std::ostream& os) const
|
||||
<<G4BestUnit(maxKinEnergyCSDA,"Energy") << "\n";
|
||||
os << "Max kinetic energy for NIEL computation "
|
||||
<<G4BestUnit(maxNIELEnergy,"Energy") << "\n";
|
||||
os << "Linear loss limit " <<linLossLimit << "\n";
|
||||
os << "Linear loss limit " <<linLossLimit << "\n";
|
||||
os << "Read data from file for e+e- pair production by mu " <<fMuDataFromFile << "\n";
|
||||
|
||||
os << "=======================================================================" << "\n";
|
||||
os << "====== Multiple Scattering Parameters ========" << "\n";
|
||||
|
||||
@@ -174,6 +174,12 @@ G4EmParametersMessenger::G4EmParametersMessenger(G4EmParameters* ptr)
|
||||
icru90Cmd->SetDefaultValue(false);
|
||||
icru90Cmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
mudatCmd = new G4UIcmdWithABool("/process/em/MuDataFromFile",this);
|
||||
mudatCmd->SetGuidance("Enable usage of muon data from file");
|
||||
mudatCmd->SetParameterName("mudat",true);
|
||||
mudatCmd->SetDefaultValue(false);
|
||||
mudatCmd->AvailableForStates(G4State_PreInit);
|
||||
|
||||
minSubSecCmd = new G4UIcmdWithADouble("/process/eLoss/minsubsec",this);
|
||||
minSubSecCmd->SetGuidance("Set the ratio subcut/cut ");
|
||||
minSubSecCmd->SetParameterName("rcmin",true);
|
||||
@@ -408,6 +414,7 @@ G4EmParametersMessenger::~G4EmParametersMessenger()
|
||||
delete onIsolatedCmd;
|
||||
delete sampleTCmd;
|
||||
delete icru90Cmd;
|
||||
delete mudatCmd;
|
||||
|
||||
delete minSubSecCmd;
|
||||
delete minEnCmd;
|
||||
@@ -496,6 +503,8 @@ void G4EmParametersMessenger::SetNewValue(G4UIcommand* command,
|
||||
theParameters->SetGeneralProcessActive(sharkCmd->GetNewBoolValue(newValue));
|
||||
} else if (command == sampleTCmd) {
|
||||
theParameters->SetEnableSamplingTable(sampleTCmd->GetNewBoolValue(newValue));
|
||||
} else if (command == mudatCmd) {
|
||||
theParameters->SetRetrieveMuDataFromFile(mudatCmd->GetNewBoolValue(newValue));
|
||||
|
||||
} else if (command == minSubSecCmd) {
|
||||
theParameters->SetMinSubRange(minSubSecCmd->GetNewDoubleValue(newValue));
|
||||
|
||||
Reference in New Issue
Block a user