11#include <simulation/monopoles/G4MonopolePhysics.h>
12#include <simulation/monopoles/G4mplIonisation.h>
13#include <simulation/monopoles/G4Monopole.h>
14#include <simulation/monopoles/G4MonopoleTransportation.h>
15#include <framework/logging/Logger.h>
17#include <TDatabasePDG.h>
19#include <G4ProcessManager.hh>
20#include <G4StepLimiter.hh>
21#include <G4hIonisation.hh>
22#include <G4PhysicsListHelper.hh>
23#include <G4BuilderType.hh>
24#include <CLHEP/Units/SystemOfUnits.h>
29using namespace Belle2::Monopoles;
33 : G4VPhysicsConstructor(
"Monopole physics"),
34 fMagCharge(magneticCharge),
40 const auto monopoleInPDG = TDatabasePDG::Instance()->GetParticle(c_monopolePDGCode);
41 const auto antiMonopoleInPDG = TDatabasePDG::Instance()->GetParticle(-c_monopolePDGCode);
42 if (!monopoleInPDG || !antiMonopoleInPDG) {
43 B2FATAL(
"Monopole physics was requested, but the monopole parameters"
44 "were not registered in local PDG database under PID code " << c_monopolePDGCode);
46 fElCharge = monopoleInPDG->Charge() / 3.0;
48 SetPhysicsType(bUnknown);
65 if (verboseLevel > 0) {
66 G4cout <<
"G4MonopolePhysics::ConstructProcess" << G4endl;
69 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
70 G4ProcessManager* pmanager[2] = {
fMpl->GetProcessManager(),
fApl->GetProcessManager()};
75 G4double elec =
fMpl->GetPDGCharge();
77 if (emin < keV) { emin = keV; }
79 G4int nbin = G4lrint(10 * std::log10(emax / emin));
83 pmanager[0]->RemoveProcess(0);
85 pmanager[1]->RemoveProcess(0);
93 G4double chg =
sqrt(magn * magn + elec * elec);
95 mplioni->SetDEDXBinning(nbin);
96 mplioni->SetMinKinEnergy(emin);
97 mplioni->SetMaxKinEnergy(emax);
98 ph->RegisterProcess(mplioni,
fMpl);
99 ph->RegisterProcess(mplioni,
fApl);
101 if (elec != 0.0 && magn == 0.0) {
102 G4hIonisation* hhioni =
new G4hIonisation();
103 hhioni->SetDEDXBinning(nbin);
104 hhioni->SetMinKinEnergy(emin);
105 hhioni->SetMaxKinEnergy(emax);
106 ph->RegisterProcess(hhioni,
fMpl);
107 ph->RegisterProcess(hhioni,
fApl);
109 ph->RegisterProcess(
new G4StepLimiter(),
fMpl);
110 ph->RegisterProcess(
new G4StepLimiter(),
fApl);
G4Monopole * fMpl
Pointer to the monopole definition in GEANT4.
virtual void ConstructProcess()
This method will be invoked in the Construct() method.
~G4MonopolePhysics()
Destructor.
G4double fElCharge
Electric charge in case of dyon.
G4double fMagCharge
Magnetic charge of the monopole, in e+ units.
G4double fMonopoleMass
Mass of the monopole.
virtual void ConstructParticle()
Adds monopole and anti-monopole to GEANT4 with a pdg of +/-99666 and parameters taken from current cl...
G4Monopole * fApl
Pointer to the anti-monopole definition in GEANT4.
G4MonopolePhysics(double magneticCharge=1.0)
Constructor.
Concrete class that does the geometrical transport.
A class to hold monopole description as a particle.
G4double MagneticCharge() const
Returns magnetic charge of the monopole.
Monopole ionisation class.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.