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......
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user