Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-05 07:49:58

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 /// \file G4MonopolePhysics.cc
0027 /// \brief Implementation of the G4MonopolePhysics class
0028 
0029 //---------------------------------------------------------------------------
0030 //
0031 // ClassName:   G4MonopolePhysics
0032 //
0033 // Author:      V.Ivanchenko 13.03.2005
0034 //
0035 // Modified:
0036 //
0037 //  12.07.10  S.Burdin (changed the magnetic and electric charge variables
0038 //            from integer to double)
0039 //----------------------------------------------------------------------------
0040 //
0041 //
0042 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 
0045 #include "G4MonopolePhysics.hh"
0046 
0047 #include "G4BuilderType.hh"
0048 #include "G4Monopole.hh"
0049 #include "G4MonopolePhysicsMessenger.hh"
0050 #include "G4MonopoleTransportation.hh"
0051 #include "G4ParticleDefinition.hh"
0052 #include "G4PhysicsListHelper.hh"
0053 #include "G4ProcessManager.hh"
0054 #include "G4ProcessVector.hh"
0055 #include "G4StepLimiter.hh"
0056 #include "G4SystemOfUnits.hh"
0057 #include "G4Transportation.hh"
0058 #include "G4hIonisation.hh"
0059 #include "G4hMultipleScattering.hh"
0060 #include "G4hhIonisation.hh"
0061 #include "G4mplIonisation.hh"
0062 #include "G4mplIonisationWithDeltaModel.hh"
0063 
0064 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0065 
0066 G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
0067   : G4VPhysicsConstructor(nam), fMpl(nullptr)
0068 {
0069   fMagCharge = 1.0;
0070   //  fMagCharge = -1.0;
0071   //  fElCharge  = -50.0;
0072   fElCharge = 0.0;
0073   fMonopoleMass = 100. * GeV;
0074   SetPhysicsType(bUnknown);
0075   fMessenger = new G4MonopolePhysicsMessenger(this);
0076 }
0077 
0078 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0079 
0080 G4MonopolePhysics::~G4MonopolePhysics()
0081 {
0082   delete fMessenger;
0083 }
0084 
0085 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0086 
0087 void G4MonopolePhysics::ConstructParticle()
0088 {
0089   if (!fMpl) {
0090     fMpl = G4Monopole::MonopoleDefinition(fMonopoleMass, fMagCharge, fElCharge);
0091   }
0092   else {
0093     G4Monopole::Monopole();
0094   }
0095 }
0096 
0097 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0098 
0099 void G4MonopolePhysics::ConstructProcess()
0100 {
0101   if (verboseLevel > 0) {
0102     G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
0103   }
0104 
0105   G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
0106   G4ProcessManager* pmanager = fMpl->GetProcessManager();
0107 
0108   // defined monopole parameters and binning
0109   G4double magn = fMpl->MagneticCharge();
0110   G4double emin = std::min(fMonopoleMass / 20000., CLHEP::keV);
0111   G4double emax = std::max(10. * TeV, fMonopoleMass * 100);
0112   G4int nbin = G4lrint(10 * std::log10(emax / emin));
0113 
0114   // dedicated trasporation
0115   if (magn != 0.0) {
0116     G4int idxt(0);
0117     pmanager->RemoveProcess(idxt);
0118     pmanager->AddProcess(new G4MonopoleTransportation(fMpl), -1, 0, 0);
0119   }
0120 
0121   if (fMpl->GetPDGCharge() != 0.0) {
0122     G4hIonisation* hhioni = new G4hIonisation();
0123     hhioni->SetDEDXBinning(nbin);
0124     hhioni->SetMinKinEnergy(emin);
0125     hhioni->SetMaxKinEnergy(emax);
0126     ph->RegisterProcess(hhioni, fMpl);
0127   }
0128   if (magn != 0.0) {
0129     G4mplIonisation* mplioni = new G4mplIonisation(magn);
0130     mplioni->SetDEDXBinning(nbin);
0131     mplioni->SetMinKinEnergy(emin);
0132     mplioni->SetMaxKinEnergy(emax);
0133     ph->RegisterProcess(mplioni, fMpl);
0134   }
0135   ph->RegisterProcess(new G4StepLimiter(), fMpl);
0136 }
0137 
0138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0139 
0140 void G4MonopolePhysics::SetMagneticCharge(G4double val)
0141 {
0142   if (fMpl) {
0143     G4Exception("G4MonopolePhysics", "01", JustWarning,
0144                 "Cannot set value when monopole is already constructed.");
0145   }
0146   else {
0147     fMagCharge = val;
0148   }
0149 }
0150 
0151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0152 
0153 void G4MonopolePhysics::SetElectricCharge(G4double val)
0154 {
0155   if (fMpl) {
0156     G4Exception("G4MonopolePhysics", "01", JustWarning,
0157                 "Cannot set value when monopole is already constructed.");
0158   }
0159   else {
0160     fElCharge = val;
0161   }
0162 }
0163 
0164 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0165 
0166 void G4MonopolePhysics::SetMonopoleMass(G4double mass)
0167 {
0168   if (fMpl) {
0169     G4Exception("G4MonopolePhysics", "01", JustWarning,
0170                 "Cannot set value when monopole is already constructed.");
0171   }
0172   else {
0173     fMonopoleMass = mass;
0174   }
0175 }
0176 
0177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......