Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file exoticphysics/monopole/src/G4Monopol 26 /// \file exoticphysics/monopole/src/G4MonopolePhysics.cc 27 /// \brief Implementation of the G4MonopolePhy 27 /// \brief Implementation of the G4MonopolePhysics class 28 // 28 // 29 // 29 // 30 //-------------------------------------------- 30 //--------------------------------------------------------------------------- 31 // 31 // 32 // ClassName: G4MonopolePhysics 32 // ClassName: G4MonopolePhysics 33 // 33 // 34 // Author: V.Ivanchenko 13.03.2005 34 // Author: V.Ivanchenko 13.03.2005 35 // 35 // 36 // Modified: 36 // Modified: 37 // 37 // 38 // 12.07.10 S.Burdin (changed the magnetic a << 38 // 12.07.10 S.Burdin (changed the magnetic and electric charge variables 39 // from integer to double) 39 // from integer to double) 40 //-------------------------------------------- 40 //---------------------------------------------------------------------------- 41 // 41 // 42 // 42 // 43 //....oooOO0OOooo........oooOO0OOooo........oo 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 44 //....oooOO0OOooo........oooOO0OOooo........oo 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 45 45 46 #include "G4MonopolePhysics.hh" 46 #include "G4MonopolePhysics.hh" >> 47 #include "G4MonopolePhysicsMessenger.hh" 47 48 48 #include "G4BuilderType.hh" << 49 #include "G4Monopole.hh" 49 #include "G4Monopole.hh" 50 #include "G4MonopolePhysicsMessenger.hh" << 51 #include "G4MonopoleTransportation.hh" << 52 #include "G4ParticleDefinition.hh" 50 #include "G4ParticleDefinition.hh" 53 #include "G4PhysicsListHelper.hh" << 54 #include "G4ProcessManager.hh" 51 #include "G4ProcessManager.hh" 55 #include "G4ProcessVector.hh" 52 #include "G4ProcessVector.hh" >> 53 56 #include "G4StepLimiter.hh" 54 #include "G4StepLimiter.hh" 57 #include "G4SystemOfUnits.hh" << 58 #include "G4Transportation.hh" 55 #include "G4Transportation.hh" 59 #include "G4hIonisation.hh" << 56 #include "G4MonopoleTransportation.hh" 60 #include "G4hMultipleScattering.hh" 57 #include "G4hMultipleScattering.hh" 61 #include "G4hhIonisation.hh" << 62 #include "G4mplIonisation.hh" 58 #include "G4mplIonisation.hh" 63 #include "G4mplIonisationWithDeltaModel.hh" 59 #include "G4mplIonisationWithDeltaModel.hh" >> 60 #include "G4hhIonisation.hh" >> 61 #include "G4hIonisation.hh" >> 62 >> 63 #include "G4PhysicsListHelper.hh" >> 64 >> 65 #include "G4BuilderType.hh" >> 66 #include "G4SystemOfUnits.hh" 64 67 65 //....oooOO0OOooo........oooOO0OOooo........oo 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 66 69 67 G4MonopolePhysics::G4MonopolePhysics(const G4S 70 G4MonopolePhysics::G4MonopolePhysics(const G4String& nam) 68 : G4VPhysicsConstructor(nam), fMpl(nullptr) 71 : G4VPhysicsConstructor(nam), fMpl(nullptr) 69 { 72 { 70 fMagCharge = 1.0; 73 fMagCharge = 1.0; 71 // fMagCharge = -1.0; 74 // fMagCharge = -1.0; 72 // fElCharge = -50.0; 75 // fElCharge = -50.0; 73 fElCharge = 0.0; << 76 fElCharge = 0.0; 74 fMonopoleMass = 100. * GeV; << 77 fMonopoleMass = 100.*GeV; 75 SetPhysicsType(bUnknown); 78 SetPhysicsType(bUnknown); 76 fMessenger = new G4MonopolePhysicsMessenger( 79 fMessenger = new G4MonopolePhysicsMessenger(this); 77 } 80 } 78 81 79 //....oooOO0OOooo........oooOO0OOooo........oo 82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 80 83 81 G4MonopolePhysics::~G4MonopolePhysics() 84 G4MonopolePhysics::~G4MonopolePhysics() 82 { 85 { 83 delete fMessenger; 86 delete fMessenger; 84 } 87 } 85 88 86 //....oooOO0OOooo........oooOO0OOooo........oo 89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 87 90 88 void G4MonopolePhysics::ConstructParticle() 91 void G4MonopolePhysics::ConstructParticle() 89 { 92 { 90 if (!fMpl) { << 93 if(!fMpl) { 91 fMpl = G4Monopole::MonopoleDefinition(fMon 94 fMpl = G4Monopole::MonopoleDefinition(fMonopoleMass, fMagCharge, fElCharge); 92 } << 95 } else { 93 else { << 94 G4Monopole::Monopole(); 96 G4Monopole::Monopole(); 95 } 97 } 96 } 98 } 97 99 98 //....oooOO0OOooo........oooOO0OOooo........oo 100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 99 101 100 void G4MonopolePhysics::ConstructProcess() 102 void G4MonopolePhysics::ConstructProcess() 101 { 103 { 102 if (verboseLevel > 0) { << 104 if(verboseLevel > 0) { 103 G4cout << "G4MonopolePhysics::ConstructPro 105 G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl; 104 } 106 } 105 << 107 106 G4PhysicsListHelper* ph = G4PhysicsListHelpe 108 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); 107 G4ProcessManager* pmanager = fMpl->GetProces 109 G4ProcessManager* pmanager = fMpl->GetProcessManager(); 108 << 110 109 // defined monopole parameters and binning 111 // defined monopole parameters and binning 110 G4double magn = fMpl->MagneticCharge(); 112 G4double magn = fMpl->MagneticCharge(); 111 G4double emin = std::min(fMonopoleMass / 200 << 113 G4double emin = std::min(fMonopoleMass/20000., CLHEP::keV); 112 G4double emax = std::max(10. * TeV, fMonopol << 114 G4double emax = std::max(10.*TeV, fMonopoleMass*100); 113 G4int nbin = G4lrint(10 * std::log10(emax / << 115 G4int nbin = G4lrint(10*std::log10(emax/emin)); 114 116 115 // dedicated trasporation << 117 // dedicated trasporation 116 if (magn != 0.0) { << 118 if(magn != 0.0) { 117 G4int idxt(0); 119 G4int idxt(0); 118 pmanager->RemoveProcess(idxt); 120 pmanager->RemoveProcess(idxt); 119 pmanager->AddProcess(new G4MonopoleTranspo << 121 pmanager->AddProcess(new G4MonopoleTransportation(fMpl),-1, 0, 0); 120 } 122 } 121 123 122 if (fMpl->GetPDGCharge() != 0.0) { << 124 if(fMpl->GetPDGCharge() != 0.0) { 123 G4hIonisation* hhioni = new G4hIonisation( 125 G4hIonisation* hhioni = new G4hIonisation(); 124 hhioni->SetDEDXBinning(nbin); 126 hhioni->SetDEDXBinning(nbin); 125 hhioni->SetMinKinEnergy(emin); 127 hhioni->SetMinKinEnergy(emin); 126 hhioni->SetMaxKinEnergy(emax); 128 hhioni->SetMaxKinEnergy(emax); 127 ph->RegisterProcess(hhioni, fMpl); 129 ph->RegisterProcess(hhioni, fMpl); 128 } 130 } 129 if (magn != 0.0) { << 131 if(magn != 0.0) { 130 G4mplIonisation* mplioni = new G4mplIonisa 132 G4mplIonisation* mplioni = new G4mplIonisation(magn); 131 mplioni->SetDEDXBinning(nbin); 133 mplioni->SetDEDXBinning(nbin); 132 mplioni->SetMinKinEnergy(emin); 134 mplioni->SetMinKinEnergy(emin); 133 mplioni->SetMaxKinEnergy(emax); 135 mplioni->SetMaxKinEnergy(emax); 134 ph->RegisterProcess(mplioni, fMpl); 136 ph->RegisterProcess(mplioni, fMpl); 135 } 137 } 136 ph->RegisterProcess(new G4StepLimiter(), fMp 138 ph->RegisterProcess(new G4StepLimiter(), fMpl); 137 } 139 } 138 140 139 //....oooOO0OOooo........oooOO0OOooo........oo 141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 140 142 141 void G4MonopolePhysics::SetMagneticCharge(G4do 143 void G4MonopolePhysics::SetMagneticCharge(G4double val) 142 { 144 { 143 if (fMpl) { << 145 if ( fMpl ) { 144 G4Exception("G4MonopolePhysics", "01", Jus << 146 G4Exception("G4MonopolePhysics", "01", JustWarning, 145 "Cannot set value when monopol 147 "Cannot set value when monopole is already constructed."); 146 } << 148 } else { 147 else { << 148 fMagCharge = val; 149 fMagCharge = val; 149 } 150 } 150 } 151 } 151 152 152 //....oooOO0OOooo........oooOO0OOooo........oo 153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 154 154 void G4MonopolePhysics::SetElectricCharge(G4do 155 void G4MonopolePhysics::SetElectricCharge(G4double val) 155 { 156 { 156 if (fMpl) { << 157 if ( fMpl ) { 157 G4Exception("G4MonopolePhysics", "01", Jus << 158 G4Exception("G4MonopolePhysics", "01", JustWarning, 158 "Cannot set value when monopol 159 "Cannot set value when monopole is already constructed."); 159 } << 160 } else { 160 else { << 161 fElCharge = val; 161 fElCharge = val; 162 } 162 } 163 } 163 } 164 164 165 //....oooOO0OOooo........oooOO0OOooo........oo 165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 166 166 167 void G4MonopolePhysics::SetMonopoleMass(G4doub 167 void G4MonopolePhysics::SetMonopoleMass(G4double mass) 168 { 168 { 169 if (fMpl) { << 169 if ( fMpl ) { 170 G4Exception("G4MonopolePhysics", "01", Jus << 170 G4Exception("G4MonopolePhysics", "01", JustWarning, 171 "Cannot set value when monopol 171 "Cannot set value when monopole is already constructed."); 172 } << 172 } else { 173 else { << 174 fMonopoleMass = mass; 173 fMonopoleMass = mass; 175 } 174 } 176 } 175 } 177 176 178 //....oooOO0OOooo........oooOO0OOooo........oo 177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 178 179 179