File indexing completed on 2025-02-23 09:21:13
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
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 #include "G4MonopolePhysics.hh"
0047
0048 #include "G4BuilderType.hh"
0049 #include "G4Monopole.hh"
0050 #include "G4MonopolePhysicsMessenger.hh"
0051 #include "G4MonopoleTransportation.hh"
0052 #include "G4ParticleDefinition.hh"
0053 #include "G4PhysicsListHelper.hh"
0054 #include "G4ProcessManager.hh"
0055 #include "G4ProcessVector.hh"
0056 #include "G4StepLimiter.hh"
0057 #include "G4SystemOfUnits.hh"
0058 #include "G4Transportation.hh"
0059 #include "G4hIonisation.hh"
0060 #include "G4hMultipleScattering.hh"
0061 #include "G4hhIonisation.hh"
0062 #include "G4mplIonisation.hh"
0063 #include "G4mplIonisationWithDeltaModel.hh"
0064
0065
0066
0067 G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
0068 : G4VPhysicsConstructor(nam), fMpl(nullptr)
0069 {
0070 fMagCharge = 1.0;
0071
0072
0073 fElCharge = 0.0;
0074 fMonopoleMass = 100. * GeV;
0075 SetPhysicsType(bUnknown);
0076 fMessenger = new G4MonopolePhysicsMessenger(this);
0077 }
0078
0079
0080
0081 G4MonopolePhysics::~G4MonopolePhysics()
0082 {
0083 delete fMessenger;
0084 }
0085
0086
0087
0088 void G4MonopolePhysics::ConstructParticle()
0089 {
0090 if (!fMpl) {
0091 fMpl = G4Monopole::MonopoleDefinition(fMonopoleMass, fMagCharge, fElCharge);
0092 }
0093 else {
0094 G4Monopole::Monopole();
0095 }
0096 }
0097
0098
0099
0100 void G4MonopolePhysics::ConstructProcess()
0101 {
0102 if (verboseLevel > 0) {
0103 G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
0104 }
0105
0106 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0107 G4ProcessManager* pmanager = fMpl->GetProcessManager();
0108
0109
0110 G4double magn = fMpl->MagneticCharge();
0111 G4double emin = std::min(fMonopoleMass / 20000., CLHEP::keV);
0112 G4double emax = std::max(10. * TeV, fMonopoleMass * 100);
0113 G4int nbin = G4lrint(10 * std::log10(emax / emin));
0114
0115
0116 if (magn != 0.0) {
0117 G4int idxt(0);
0118 pmanager->RemoveProcess(idxt);
0119 pmanager->AddProcess(new G4MonopoleTransportation(fMpl), -1, 0, 0);
0120 }
0121
0122 if (fMpl->GetPDGCharge() != 0.0) {
0123 G4hIonisation* hhioni = new G4hIonisation();
0124 hhioni->SetDEDXBinning(nbin);
0125 hhioni->SetMinKinEnergy(emin);
0126 hhioni->SetMaxKinEnergy(emax);
0127 ph->RegisterProcess(hhioni, fMpl);
0128 }
0129 if (magn != 0.0) {
0130 G4mplIonisation* mplioni = new G4mplIonisation(magn);
0131 mplioni->SetDEDXBinning(nbin);
0132 mplioni->SetMinKinEnergy(emin);
0133 mplioni->SetMaxKinEnergy(emax);
0134 ph->RegisterProcess(mplioni, fMpl);
0135 }
0136 ph->RegisterProcess(new G4StepLimiter(), fMpl);
0137 }
0138
0139
0140
0141 void G4MonopolePhysics::SetMagneticCharge(G4double val)
0142 {
0143 if (fMpl) {
0144 G4Exception("G4MonopolePhysics", "01", JustWarning,
0145 "Cannot set value when monopole is already constructed.");
0146 }
0147 else {
0148 fMagCharge = val;
0149 }
0150 }
0151
0152
0153
0154 void G4MonopolePhysics::SetElectricCharge(G4double val)
0155 {
0156 if (fMpl) {
0157 G4Exception("G4MonopolePhysics", "01", JustWarning,
0158 "Cannot set value when monopole is already constructed.");
0159 }
0160 else {
0161 fElCharge = val;
0162 }
0163 }
0164
0165
0166
0167 void G4MonopolePhysics::SetMonopoleMass(G4double mass)
0168 {
0169 if (fMpl) {
0170 G4Exception("G4MonopolePhysics", "01", JustWarning,
0171 "Cannot set value when monopole is already constructed.");
0172 }
0173 else {
0174 fMonopoleMass = mass;
0175 }
0176 }
0177
0178