File indexing completed on 2024-05-10 02:21:27
0001 #include "SimG4Core/PhysicsLists/interface/CMSEmNoDeltaRay.h"
0002 #include "SimG4Core/PhysicsLists/interface/EmParticleList.h"
0003
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005
0006 #include "G4EmParameters.hh"
0007 #include "G4ParticleTable.hh"
0008
0009 #include "G4ParticleDefinition.hh"
0010 #include "G4ProcessManager.hh"
0011 #include "G4LossTableManager.hh"
0012 #include "G4RegionStore.hh"
0013
0014 #include "G4ComptonScattering.hh"
0015 #include "G4GammaConversion.hh"
0016 #include "G4PhotoElectricEffect.hh"
0017 #include "G4UrbanMscModel.hh"
0018
0019 #include "G4hMultipleScattering.hh"
0020 #include "G4eMultipleScattering.hh"
0021 #include "G4MscStepLimitType.hh"
0022
0023 #include "G4hhIonisation.hh"
0024
0025 #include "G4eBremsstrahlung.hh"
0026 #include "G4eplusAnnihilation.hh"
0027
0028 #include "G4MuBremsstrahlung.hh"
0029 #include "G4MuPairProduction.hh"
0030
0031 #include "G4hBremsstrahlung.hh"
0032 #include "G4hPairProduction.hh"
0033
0034 #include "G4Gamma.hh"
0035 #include "G4Electron.hh"
0036 #include "G4Positron.hh"
0037 #include "G4MuonPlus.hh"
0038 #include "G4MuonMinus.hh"
0039 #include "G4PionPlus.hh"
0040 #include "G4PionMinus.hh"
0041 #include "G4KaonPlus.hh"
0042 #include "G4KaonMinus.hh"
0043 #include "G4Proton.hh"
0044 #include "G4AntiProton.hh"
0045 #include "G4GenericIon.hh"
0046
0047 #include "G4EmBuilder.hh"
0048 #include "G4BuilderType.hh"
0049 #include <CLHEP/Units/SystemOfUnits.h>
0050
0051 CMSEmNoDeltaRay::CMSEmNoDeltaRay(const G4String& name, G4int ver, const std::string& reg)
0052 : G4VPhysicsConstructor(name), region(reg) {
0053 G4EmParameters* param = G4EmParameters::Instance();
0054 param->SetDefaults();
0055 param->SetVerbose(ver);
0056 param->SetApplyCuts(true);
0057 param->SetMscRangeFactor(0.2);
0058 param->SetMscStepLimitType(fMinimal);
0059 SetPhysicsType(bElectromagnetic);
0060 }
0061
0062 CMSEmNoDeltaRay::~CMSEmNoDeltaRay() {}
0063
0064 void CMSEmNoDeltaRay::ConstructParticle() {
0065
0066 G4EmBuilder::ConstructMinimalEmSet();
0067 }
0068
0069 void CMSEmNoDeltaRay::ConstructProcess() {
0070
0071 G4Region* reg = nullptr;
0072 if (region != " ") {
0073 G4RegionStore* regStore = G4RegionStore::GetInstance();
0074 reg = regStore->GetRegion(region, false);
0075 }
0076
0077 G4ParticleTable* table = G4ParticleTable::GetParticleTable();
0078 EmParticleList emList;
0079 for (const auto& particleName : emList.PartNames()) {
0080 G4ParticleDefinition* particle = table->FindParticle(particleName);
0081 G4ProcessManager* pmanager = particle->GetProcessManager();
0082 if (verboseLevel > 1)
0083 edm::LogVerbatim("PhysicsList") << "### " << GetPhysicsName() << " instantiates for " << particleName;
0084
0085 if (particleName == "gamma") {
0086 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
0087 pmanager->AddDiscreteProcess(new G4ComptonScattering);
0088 pmanager->AddDiscreteProcess(new G4GammaConversion);
0089
0090 } else if (particleName == "e-") {
0091 G4eMultipleScattering* msc = new G4eMultipleScattering;
0092 msc->SetStepLimitType(fMinimal);
0093 if (reg != nullptr) {
0094 G4UrbanMscModel* msc_el = new G4UrbanMscModel();
0095 msc_el->SetRangeFactor(0.04);
0096 msc->AddEmModel(0, msc_el, reg);
0097 }
0098 pmanager->AddProcess(msc, -1, 1, -1);
0099 pmanager->AddProcess(new G4hhIonisation, -1, 2, 1);
0100 pmanager->AddProcess(new G4eBremsstrahlung, -1, -3, 2);
0101
0102 } else if (particleName == "e+") {
0103 G4eMultipleScattering* msc = new G4eMultipleScattering;
0104 msc->SetStepLimitType(fMinimal);
0105 if (reg != nullptr) {
0106 G4UrbanMscModel* msc_pos = new G4UrbanMscModel();
0107 msc_pos->SetRangeFactor(0.04);
0108 msc->AddEmModel(0, msc_pos, reg);
0109 }
0110 pmanager->AddProcess(msc, -1, 1, -1);
0111 pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
0112 pmanager->AddProcess(new G4eBremsstrahlung, -1, -3, 1);
0113 pmanager->AddProcess(new G4eplusAnnihilation, 0, -1, 2);
0114
0115 } else if (particleName == "mu+" || particleName == "mu-") {
0116 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0117 pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
0118 pmanager->AddProcess(new G4MuBremsstrahlung, -1, -3, 1);
0119 pmanager->AddProcess(new G4MuPairProduction, -1, -4, 2);
0120
0121 } else if (particleName == "alpha" || particleName == "He3" || particleName == "GenericIon") {
0122 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0123 pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
0124
0125 } else if (particleName == "pi+" || particleName == "kaon+" || particleName == "kaon-" ||
0126 particleName == "proton" || particleName == "pi-") {
0127 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0128 pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
0129 pmanager->AddProcess(new G4hBremsstrahlung(), -1, -3, 1);
0130 pmanager->AddProcess(new G4hPairProduction(), -1, -4, 2);
0131
0132 } else if (particle->GetPDGCharge() != 0.0) {
0133 pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
0134 pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
0135 }
0136 }
0137 }