Commit 5e368f3c authored by Valentina Fioretti's avatar Valentina Fioretti
Browse files

SPL v10 added

parent 9c514c33
Loading
Loading
Loading
Loading
+334 −0
Changes for phys/G4EmStandardPhysics_SpacePhysics_v10.cc: 334 added lines, 0 removed lines.
Original line number Diff line number Diff line
//
// ********************************************************************
// * 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.          *
// ********************************************************************
//
// ClassName: G4EmStandardPhysics_SpacePhysics_v10
//
// Authors: P.Dondero (paolo.dondero@cern.ch), modified by V. Fioretti (INAF OAS Bologna)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......


#if defined(GEANT4_11_1)

#include "G4EmStandardPhysics_SpacePhysics_v10.hh"

#include "G4SystemOfUnits.hh"
#include "G4ParticleDefinition.hh"
#include "G4LossTableManager.hh"
#include "G4EmParameters.hh"
#include "G4EmBuilder.hh"

#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4RayleighScattering.hh"
#include "G4PEEffectFluoModel.hh"
#include "G4KleinNishinaModel.hh"
#include "G4BetheHeitler5DModel.hh"
#include "G4LivermorePhotoElectricModel.hh"
#include "G4LivermorePolarizedRayleighModel.hh"
#include "G4PhotoElectricAngularGeneratorPolarized.hh"
#include "G4LowEPComptonModel.hh"
#include "G4LowEPPolarizedComptonModel.hh"

#include "G4eMultipleScattering.hh"
#include "G4hMultipleScattering.hh"
#include "G4MscStepLimitType.hh"
#include "G4UrbanMscModel.hh"
#include "G4GoudsmitSaundersonMscModel.hh"
#include "G4DummyModel.hh"
#include "G4WentzelVIModel.hh"
#include "G4CoulombScattering.hh"
#include "G4eCoulombScatteringModel.hh"

#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4Generator2BS.hh"
#include "G4Generator2BN.hh"
#include "G4SeltzerBergerModel.hh"
#include "G4ePairProduction.hh"
#include "G4LivermoreIonisationModel.hh"
#include "G4PenelopeIonisationModel.hh"
#include "G4UniversalFluctuation.hh"
#include "G4UrbanFluctuation.hh"

#include "G4eplusAnnihilation.hh"
#include "G4hIonisation.hh"
#include "G4ionIonisation.hh"
#include "G4IonParametrisedLossModel.hh"
#include "G4NuclearStopping.hh"
#include "G4Gamma.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4GenericIon.hh"
#include "G4PhysicsListHelper.hh"
#include "G4BuilderType.hh"
#include "G4EmModelActivator.hh"
#include "G4GammaGeneralProcess.hh"

// factory
#include "G4PhysicsConstructorFactory.hh"


//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......



G4EmStandardPhysics_SpacePhysics_v10::G4EmStandardPhysics_SpacePhysics_v10(G4int ver,
                                                                   const G4String&)
: G4VPhysicsConstructor("G4EmStandard_SpacePhysics"), fVerbose(ver)
{
    G4cout << "---> Using G4EmStandard_SpacePhysics v. 11.03 " << G4endl;
    G4EmParameters* param = G4EmParameters::Instance();
    param->SetDefaults();
    param->SetVerbose(ver);
        
    param->SetMinEnergy(100*CLHEP::eV);
    param->SetLowestElectronEnergy(50*CLHEP::eV);
    param->SetNumberOfBinsPerDecade(20);
    param->ActivateAngularGeneratorForIonisation(true);
    param->SetStepFunction(0.2, 10*CLHEP::um);
    param->SetStepFunctionMuHad(0.05, 0.01*CLHEP::um);
    param->SetStepFunctionLightIons(0.1, 20*CLHEP::um);
    param->SetStepFunctionIons(0.1, 1*CLHEP::um);
    param->SetUseMottCorrection(true); // use Mott-correction for e-/e+ msc gs
    param->SetMscStepLimitType(fUseSafetyPlus); // for e-/e+ msc gs
    param->SetMscSkin(3);              // error-free stepping for e-/e+ msc gs
    param->SetMscRangeFactor(0.08);    // error-free stepping for e-/e+ msc gs
    param->SetMuHadLateralDisplacement(true);
    param->SetFluo(true);
    param->SetUseICRU90Data(true);
    param->SetMaxNIELEnergy(1*CLHEP::MeV);
    SetPhysicsType(bElectromagnetic);            
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4EmStandardPhysics_SpacePhysics_v10::ConstructParticle()
{
      // minimal set of particles for EM physics
      G4EmBuilder::ConstructMinimalEmSet();
}

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

void G4EmStandardPhysics_SpacePhysics_v10::ConstructProcess()
{
    if(fVerbose > 1)
    {
        G4cout << "### " << GetPhysicsName() << " Construct Space Physics Processes " << G4endl;
    }
    G4EmBuilder::PrepareEMPhysics();
    
    auto *ph = G4PhysicsListHelper::GetPhysicsListHelper();
    auto *param = G4EmParameters::Instance();
    
    // processes used by several particles
    auto *hmsc = new G4hMultipleScattering("ionmsc");
    
    // nuclear stopping is enabled if the energy limit above zero
    G4double nielEnergyLimit = param->MaxNIELEnergy();
    G4NuclearStopping* pnuc = nullptr;
    if(nielEnergyLimit > 0.0)
    {
        pnuc = new G4NuclearStopping();
        pnuc->SetMaxKinEnergy(nielEnergyLimit);
    }
    
    // high energy limit for e+- scattering models and bremsstrahlung
    G4double highEnergyLimit = param->MscEnergyLimit();
    
    // Add gamma EM Processes
    G4ParticleDefinition *particle = G4Gamma::Gamma();
    G4bool polar = param->EnablePolarisation();
    
    // Photoelectric
    auto *pe = new G4PhotoElectricEffect();
    auto *peModel = new G4LivermorePhotoElectricModel();
    pe->SetEmModel(peModel);
    if(polar)
    {
        peModel->SetAngularDistribution(new G4PhotoElectricAngularGeneratorPolarized());
    }
    
    // Compton scattering
    auto *cs = new G4ComptonScattering;
    cs->SetEmModel(new G4KleinNishinaModel());
    G4VEmModel* cModel = nullptr;
    if(polar)
    {
        cModel = new G4LowEPPolarizedComptonModel();
    }
    else
    {
        cModel = new G4LowEPComptonModel();
    }
    cModel->SetHighEnergyLimit(20*CLHEP::MeV);
    cs->AddEmModel(0, cModel);
    
    // Gamma conversion
    auto *gc = new G4GammaConversion();
    auto *conv = new G4BetheHeitler5DModel();
    gc->SetEmModel(conv);
    
    // default Rayleigh scattering is Livermore
    G4RayleighScattering* rl = new G4RayleighScattering();
    if(polar)
    {
        rl->SetEmModel(new G4LivermorePolarizedRayleighModel());
    }
    
    if(param->GeneralProcessActive())
    {
        auto *sp = new G4GammaGeneralProcess();
        sp->AddEmProcess(pe);
        sp->AddEmProcess(cs);
        sp->AddEmProcess(gc);
        sp->AddEmProcess(rl);
        G4LossTableManager::Instance()->SetGammaGeneralProcess(sp);
        ph->RegisterProcess(sp, particle);
    }
    else
    {
        ph->RegisterProcess(pe, particle);
        ph->RegisterProcess(cs, particle);
        ph->RegisterProcess(gc, particle);
        ph->RegisterProcess(rl, particle);
    }
    
    // e-
    particle = G4Electron::Electron();
    
    // multiple scattering
    auto *msc = new G4eMultipleScattering();
    // e-/e+ msc gs with Mott-correction
    // (Mott-correction is set through G4EmParameters)
    auto *msc1 = new G4GoudsmitSaundersonMscModel();
    auto *msc2 = new G4WentzelVIModel();
    msc1->SetHighEnergyLimit(highEnergyLimit);
    msc2->SetLowEnergyLimit(highEnergyLimit);
    msc->SetEmModel(msc1);
    msc->SetEmModel(msc2);
    
    auto *ssm = new G4eCoulombScatteringModel();
    G4CoulombScattering* ss = new G4CoulombScattering();
    ss->SetEmModel(ssm);
    ss->SetMinKinEnergy(highEnergyLimit);
    ssm->SetLowEnergyLimit(highEnergyLimit);
    ssm->SetActivationLowEnergyLimit(highEnergyLimit);
    
    // ionisation
    // energy limits for e+- ionisation models
    G4double penEnergyLimit = 1*MeV;
    
    G4eIonisation* eIoni = new G4eIonisation();
    eIoni->SetStepFunction(0.2, 100*um);
    G4PenelopeIonisationModel* pen = new G4PenelopeIonisationModel();
    pen->SetHighEnergyLimit(penEnergyLimit);
    eIoni->AddEmModel(0, pen, new G4UniversalFluctuation());
    
    // bremsstrahlung
    auto *brem = new G4eBremsstrahlung();
    auto *br1 = new G4SeltzerBergerModel();
    auto *br2 = new G4eBremsstrahlungRelModel();
    br1->SetAngularDistribution(new G4Generator2BS());
    br2->SetAngularDistribution(new G4Generator2BS());
    brem->SetEmModel(br1);
    brem->SetEmModel(br2);
    br1->SetHighEnergyLimit(CLHEP::GeV);
    
    auto *ee = new G4ePairProduction();
    
    // register processes
    ph->RegisterProcess(msc, particle);
    ph->RegisterProcess(eIoni, particle);
    ph->RegisterProcess(brem, particle);
    ph->RegisterProcess(ee, particle);
    ph->RegisterProcess(ss, particle);
    
    // e+
    particle = G4Positron::Positron();
    
    // multiple scattering
    msc = new G4eMultipleScattering();
    // e-/e+ msc gs with Mott-correction
    // (Mott-correction is set through G4EmParameters)
    msc1 = new G4GoudsmitSaundersonMscModel();
    msc2 = new G4WentzelVIModel();
    msc1->SetHighEnergyLimit(highEnergyLimit);
    msc2->SetLowEnergyLimit(highEnergyLimit);
    msc->SetEmModel(msc1);
    msc->SetEmModel(msc2);
    
    ssm = new G4eCoulombScatteringModel();
    ss = new G4CoulombScattering();
    ss->SetEmModel(ssm);
    ss->SetMinKinEnergy(highEnergyLimit);
    ssm->SetLowEnergyLimit(highEnergyLimit);
    ssm->SetActivationLowEnergyLimit(highEnergyLimit);
    
    // ionisation
    G4eIonisation* eIoni_pos = new G4eIonisation();
    eIoni_pos->SetStepFunction(0.2, 100*um);
    G4PenelopeIonisationModel* pen_pos = new G4PenelopeIonisationModel();
    pen_pos->SetHighEnergyLimit(penEnergyLimit);
    eIoni_pos->AddEmModel(0, pen_pos, new G4UniversalFluctuation());
    
    // bremsstrahlung
    brem = new G4eBremsstrahlung();
    br1 = new G4SeltzerBergerModel();
    br2 = new G4eBremsstrahlungRelModel();
    br1->SetAngularDistribution(new G4Generator2BS());
    br2->SetAngularDistribution(new G4Generator2BS());
    brem->SetEmModel(br1);
    brem->SetEmModel(br2);
    br1->SetHighEnergyLimit(CLHEP::GeV);
    
    // register processes
    ph->RegisterProcess(msc, particle);
    ph->RegisterProcess(eIoni_pos, particle);
    ph->RegisterProcess(brem, particle);
    ph->RegisterProcess(ee, particle);
    ph->RegisterProcess(new G4eplusAnnihilation(), particle);
    ph->RegisterProcess(ss, particle);
    
    // generic ion
    particle = G4GenericIon::GenericIon();
    auto *ionIoni = new G4ionIonisation();
    ionIoni->SetEmModel(new G4IonParametrisedLossModel());
    ph->RegisterProcess(hmsc, particle);
    ph->RegisterProcess(ionIoni, particle);
    if(nullptr != pnuc) { ph->RegisterProcess(pnuc, particle); }
    
    // muons, hadrons, ions
    G4EmBuilder::ConstructCharged(hmsc, pnuc);
    
    // extra configuration
    G4EmModelActivator mact(GetPhysicsName());
    
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+64 −0
Changes for phys/G4EmStandardPhysics_SpacePhysics_v10.hh: 64 added lines, 0 removed lines.
Original line number Diff line number Diff line
//
// ********************************************************************
// * 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.          *
// ********************************************************************
//
// ClassName: G4EmStandardPhysics_SpacePhysics_v10
//
// Authors: P.Dondero (paolo.dondero@cern.ch), modified by V. Fioretti (INAF OAS Bologna)
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......


#ifndef G4EmStandardPhysics_SpacePhysics_v10_h
#define G4EmStandardPhysics_SpacePhysics_v10_h 1

#include "G4VPhysicsConstructor.hh"
#include "BoGEMMSGlobalMemory.hh"
#include "globals.hh"

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

class G4EmStandardPhysics_SpacePhysics_v10 : public G4VPhysicsConstructor
{
  public:

    G4EmStandardPhysics_SpacePhysics_v10(G4int ver=1, const G4String& name="");
    ~G4EmStandardPhysics_SpacePhysics_v10() override = default;
    void ConstructParticle() override;
    void ConstructProcess() override;

  private:
    G4int  fVerbose;
};

//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......

#endif