CMS 3D CMS Logo

CMSEmNoDeltaRay.cc
Go to the documentation of this file.
3 
5 
6 #include "G4EmParameters.hh"
7 #include "G4ParticleTable.hh"
8 
9 #include "G4ParticleDefinition.hh"
10 #include "G4ProcessManager.hh"
11 #include "G4LossTableManager.hh"
12 #include "G4RegionStore.hh"
13 
14 #include "G4ComptonScattering.hh"
15 #include "G4GammaConversion.hh"
16 #include "G4PhotoElectricEffect.hh"
17 #include "G4UrbanMscModel.hh"
18 
19 #include "G4hMultipleScattering.hh"
20 #include "G4eMultipleScattering.hh"
21 #include "G4MscStepLimitType.hh"
22 
23 #include "G4hhIonisation.hh"
24 
25 #include "G4eBremsstrahlung.hh"
26 #include "G4eplusAnnihilation.hh"
27 
28 #include "G4MuBremsstrahlung.hh"
29 #include "G4MuPairProduction.hh"
30 
31 #include "G4hBremsstrahlung.hh"
32 #include "G4hPairProduction.hh"
33 
34 #include "G4Gamma.hh"
35 #include "G4Electron.hh"
36 #include "G4Positron.hh"
37 #include "G4MuonPlus.hh"
38 #include "G4MuonMinus.hh"
39 #include "G4PionPlus.hh"
40 #include "G4PionMinus.hh"
41 #include "G4KaonPlus.hh"
42 #include "G4KaonMinus.hh"
43 #include "G4Proton.hh"
44 #include "G4AntiProton.hh"
45 #include "G4GenericIon.hh"
46 
47 #include "G4EmBuilder.hh"
48 #include "G4BuilderType.hh"
49 #include "G4SystemOfUnits.hh"
50 
51 CMSEmNoDeltaRay::CMSEmNoDeltaRay(const G4String& name, G4int ver, const std::string& reg)
52  : G4VPhysicsConstructor(name), region(reg) {
53  G4EmParameters* param = G4EmParameters::Instance();
54  param->SetDefaults();
55  param->SetVerbose(ver);
56  param->SetApplyCuts(true);
57  param->SetMscRangeFactor(0.2);
58  param->SetMscStepLimitType(fMinimal);
59  SetPhysicsType(bElectromagnetic);
60 }
61 
63 
65  // minimal set of particles for EM physics
66  G4EmBuilder::ConstructMinimalEmSet();
67 }
68 
70  // Add standard EM Processes
71  G4Region* reg = nullptr;
72  if (region != " ") {
73  G4RegionStore* regStore = G4RegionStore::GetInstance();
74  reg = regStore->GetRegion(region, false);
75  }
76 
77  G4ParticleTable* table = G4ParticleTable::GetParticleTable();
78  EmParticleList emList;
79  for (const auto& particleName : emList.PartNames()) {
80  G4ParticleDefinition* particle = table->FindParticle(particleName);
81  G4ProcessManager* pmanager = particle->GetProcessManager();
82  if (verboseLevel > 1)
83  edm::LogVerbatim("PhysicsList") << "### " << GetPhysicsName() << " instantiates for " << particleName;
84 
85  if (particleName == "gamma") {
86  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
87  pmanager->AddDiscreteProcess(new G4ComptonScattering);
88  pmanager->AddDiscreteProcess(new G4GammaConversion);
89 
90  } else if (particleName == "e-") {
91  G4eMultipleScattering* msc = new G4eMultipleScattering;
92  msc->SetStepLimitType(fMinimal);
93  if (reg != nullptr) {
94  G4UrbanMscModel* msc_el = new G4UrbanMscModel();
95  msc_el->SetRangeFactor(0.04);
96  msc->AddEmModel(0, msc_el, reg);
97  }
98  pmanager->AddProcess(msc, -1, 1, -1);
99  pmanager->AddProcess(new G4hhIonisation, -1, 2, 1);
100  pmanager->AddProcess(new G4eBremsstrahlung, -1, -3, 2);
101 
102  } else if (particleName == "e+") {
103  G4eMultipleScattering* msc = new G4eMultipleScattering;
104  msc->SetStepLimitType(fMinimal);
105  if (reg != nullptr) {
106  G4UrbanMscModel* msc_pos = new G4UrbanMscModel();
107  msc_pos->SetRangeFactor(0.04);
108  msc->AddEmModel(0, msc_pos, reg);
109  }
110  pmanager->AddProcess(msc, -1, 1, -1);
111  pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
112  pmanager->AddProcess(new G4eBremsstrahlung, -1, -3, 1);
113  pmanager->AddProcess(new G4eplusAnnihilation, 0, -1, 2);
114 
115  } else if (particleName == "mu+" || particleName == "mu-") {
116  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
117  pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
118  pmanager->AddProcess(new G4MuBremsstrahlung, -1, -3, 1);
119  pmanager->AddProcess(new G4MuPairProduction, -1, -4, 2);
120 
121  } else if (particleName == "alpha" || particleName == "He3" || particleName == "GenericIon") {
122  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
123  pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
124 
125  } else if (particleName == "pi+" || particleName == "kaon+" || particleName == "kaon-" ||
126  particleName == "proton" || particleName == "pi-") {
127  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
128  pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
129  pmanager->AddProcess(new G4hBremsstrahlung(), -1, -3, 1);
130  pmanager->AddProcess(new G4hPairProduction(), -1, -4, 2);
131 
132  } else if (particle->GetPDGCharge() != 0.0) {
133  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, -1);
134  pmanager->AddProcess(new G4hhIonisation, -1, 2, -1);
135  }
136  }
137 }
Log< level::Info, true > LogVerbatim
~CMSEmNoDeltaRay() override
void ConstructParticle() override
std::string region
void ConstructProcess() override
CMSEmNoDeltaRay(const G4String &name, G4int ver, const std::string &reg)
const std::vector< G4String > & PartNames() const