File indexing completed on 2025-01-31 09:22:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #include "PurgMagPhysicsList.hh"
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4ParticleDefinition.hh"
0039 #include "G4ParticleWithCuts.hh"
0040 #include "G4ProcessManager.hh"
0041 #include "G4ParticleTypes.hh"
0042 #include "G4ParticleTable.hh"
0043 #include "G4Material.hh"
0044 #include "G4UnitsTable.hh"
0045 #include "G4ios.hh"
0046 #include "G4EmStandardPhysics_option4.hh"
0047 #include "G4VPhysicsConstructor.hh"
0048 #include "G4DecayPhysics.hh"
0049
0050 PurgMagPhysicsList::PurgMagPhysicsList(): G4VUserPhysicsList()
0051 {
0052 defaultCutValue = 1*micrometer;
0053 cutForGamma = defaultCutValue;
0054 cutForElectron = defaultCutValue;
0055 cutForPositron = defaultCutValue;
0056 cutForProton = defaultCutValue;
0057
0058 fEmPhysicsList = new G4EmStandardPhysics_option4();
0059 fDecPhysicsList = new G4DecayPhysics();
0060 SetVerboseLevel(1);
0061 }
0062
0063 PurgMagPhysicsList::~PurgMagPhysicsList()
0064 {
0065 delete fDecPhysicsList;
0066 delete fEmPhysicsList;
0067 }
0068
0069 void PurgMagPhysicsList::ConstructParticle()
0070 {
0071 fDecPhysicsList -> ConstructParticle();
0072 }
0073
0074 void PurgMagPhysicsList::ConstructProcess()
0075 {
0076 AddTransportation();
0077 fEmPhysicsList -> ConstructProcess();
0078
0079
0080
0081
0082
0083
0084
0085 }
0086
0087 void PurgMagPhysicsList::SetCuts()
0088 {
0089 if (verboseLevel >0){
0090 G4cout << "PurgMagPhysicsList::SetCuts:";
0091 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
0092 }
0093
0094
0095
0096 SetCutValue(cutForGamma, "gamma");
0097 SetCutValue(cutForElectron, "e-");
0098 SetCutValue(cutForPositron, "e+");
0099
0100
0101
0102 SetCutValue(cutForProton, "proton");
0103 SetCutValue(cutForProton, "anti_proton");
0104
0105
0106
0107 if (verboseLevel>0) DumpCutValuesTable();
0108 }
0109
0110 void PurgMagPhysicsList::SetGammaLowLimit(G4double lowcut)
0111 {
0112 if (verboseLevel >0){
0113 G4cout << "PurgMagPhysicsList::SetCuts:";
0114 G4cout << "Gamma cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0115 }
0116
0117
0118 SetGELowLimit(lowcut);
0119 }
0120
0121 void PurgMagPhysicsList::SetElectronLowLimit(G4double lowcut)
0122 {
0123 if (verboseLevel >0){
0124
0125 G4cout << "PurgMagPhysicsList::SetCuts:";
0126 G4cout << "Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0127 }
0128
0129
0130 SetGELowLimit(lowcut);
0131 }
0132
0133 void PurgMagPhysicsList::SetPositronLowLimit(G4double lowcut)
0134 {
0135 if (verboseLevel >0){
0136
0137 G4cout << "PurgMagPhysicsList::SetCuts:";
0138 G4cout << "Positron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0139 }
0140
0141 G4cerr << "PurgMagPhysicsList::SetPositronLowLimit: Not currently able to set Positron LowLimit." << G4endl;
0142 G4Exception("PurgMagPhysicsList::SetPositronLowLimit()","PurMag001",
0143 FatalException,"Positron Low Limit: not implemented in PurgMagPhysicsList");
0144
0145
0146 }
0147
0148
0149 void PurgMagPhysicsList::SetProtonLowLimit(G4double lowcut)
0150 {
0151 if (verboseLevel >0){
0152
0153 G4cout << "PurgMagPhysicsList::SetCuts:";
0154 G4cout << "Proton cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0155 }
0156
0157 G4cerr << "PurgMagPhysicsList::SetProtonLowLimit: Not currently able to set Proton LowLimit." << G4endl;
0158 G4Exception("PurgMagPhysicsList::SetProtonLowLimit()","PurMag002",
0159 FatalException,"Proton Low Limit: not implemented in PurgMagPhysicsList");
0160
0161
0162
0163 }
0164
0165 void PurgMagPhysicsList::SetGEPLowLimit(G4double lowcut)
0166 {
0167 if (verboseLevel >0){
0168 G4cout << "PurgMagPhysicsList::SetGEPLowLimit:";
0169 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0170 }
0171
0172
0173
0174
0175 this->SetGELowLimit(lowcut);
0176
0177 G4cerr << " SetGEPLowLimit : Uncertain whether setting Positron low limit " << G4endl;
0178 }
0179
0180 void PurgMagPhysicsList::SetGELowLimit(G4double lowcut)
0181 {
0182 if (verboseLevel >0){
0183 G4cout << "PurgMagPhysicsList::SetGELowLimit:";
0184 G4cout << "Gamma and Electron cut in energy: " << lowcut*MeV << " (MeV)" << G4endl;
0185 }
0186
0187 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowcut,1e5);
0188 }
0189 void PurgMagPhysicsList::SetGammaCut(G4double val)
0190 {
0191 cutForGamma = val;
0192 }
0193
0194 void PurgMagPhysicsList::SetElectronCut(G4double val)
0195 {
0196 cutForElectron = val;
0197 }
0198
0199 void PurgMagPhysicsList::SetPositronCut(G4double val)
0200 {
0201 cutForPositron = val;
0202 }
0203
0204 void PurgMagPhysicsList::SetProtonCut(G4double val)
0205 {
0206 cutForProton = val;
0207 }
0208
0209
0210
0211
0212
0213