Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:13

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 exoticphysics/monopole/src/G4MonopolePhysics.cc
0027 /// \brief Implementation of the G4MonopolePhysics class
0028 //
0029 //
0030 //---------------------------------------------------------------------------
0031 //
0032 // ClassName:   G4MonopolePhysics
0033 //
0034 // Author:      V.Ivanchenko 13.03.2005
0035 //
0036 // Modified:
0037 //
0038 //  12.07.10  S.Burdin (changed the magnetic and electric charge variables
0039 //            from integer to double)
0040 //----------------------------------------------------------------------------
0041 //
0042 //
0043 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0044 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0066 
0067 G4MonopolePhysics::G4MonopolePhysics(const G4String& nam)
0068   : G4VPhysicsConstructor(nam), fMpl(nullptr)
0069 {
0070   fMagCharge = 1.0;
0071   //  fMagCharge = -1.0;
0072   //  fElCharge  = -50.0;
0073   fElCharge = 0.0;
0074   fMonopoleMass = 100. * GeV;
0075   SetPhysicsType(bUnknown);
0076   fMessenger = new G4MonopolePhysicsMessenger(this);
0077 }
0078 
0079 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0080 
0081 G4MonopolePhysics::~G4MonopolePhysics()
0082 {
0083   delete fMessenger;
0084 }
0085 
0086 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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   // defined monopole parameters and binning
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   // dedicated trasporation
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......