ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MonopolePhysics.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4MonopolePhysics.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 //---------------------------------------------------------------------------
31 //
32 // ClassName: G4MonopolePhysics
33 //
34 // Author: V.Ivanchenko 13.03.2005
35 //
36 // Modified:
37 //
38 // 12.07.10 S.Burdin (changed the magnetic and electric charge variables
39 // from integer to double)
40 //----------------------------------------------------------------------------
41 //
42 //
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
46 #include "G4MonopolePhysics.hh"
48 
49 #include "G4Monopole.hh"
50 #include "G4ParticleDefinition.hh"
51 #include "G4ProcessManager.hh"
52 #include "G4ProcessVector.hh"
53 
54 #include "G4StepLimiter.hh"
55 #include "G4Transportation.hh"
57 #include "G4hMultipleScattering.hh"
58 #include "G4mplIonisation.hh"
60 #include "G4hhIonisation.hh"
61 #include "G4hIonisation.hh"
62 
63 #include "G4PhysicsListHelper.hh"
64 
65 #include "G4BuilderType.hh"
66 #include "G4SystemOfUnits.hh"
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
71  : G4VPhysicsConstructor(nam), fMpl(nullptr)
72 {
73  fMagCharge = 1.0;
74  // fMagCharge = -1.0;
75  // fElCharge = -50.0;
76  fElCharge = 0.0;
77  fMonopoleMass = 100.*GeV;
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  delete fMessenger;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  if(!fMpl) {
95  } else {
97  }
98 }
99 
100 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101 
103 {
104  if(verboseLevel > 0) {
105  G4cout << "G4MonopolePhysics::ConstructProcess" << G4endl;
106  }
107 
109  G4ProcessManager* pmanager = fMpl->GetProcessManager();
110 
111  // defined monopole parameters and binning
112  G4double magn = fMpl->MagneticCharge();
114  G4double emax = std::max(10.*TeV, fMonopoleMass*100);
115  G4int nbin = G4lrint(10*std::log10(emax/emin));
116 
117  // dedicated trasporation
118  if(magn != 0.0) {
119  G4int idxt(0);
120  pmanager->RemoveProcess(idxt);
121  pmanager->AddProcess(new G4MonopoleTransportation(fMpl),-1, 0, 0);
122  }
123 
124  if(fMpl->GetPDGCharge() != 0.0) {
125  G4hIonisation* hhioni = new G4hIonisation();
126  hhioni->SetDEDXBinning(nbin);
127  hhioni->SetMinKinEnergy(emin);
128  hhioni->SetMaxKinEnergy(emax);
129  ph->RegisterProcess(hhioni, fMpl);
130  }
131  if(magn != 0.0) {
132  G4mplIonisation* mplioni = new G4mplIonisation(magn);
133  mplioni->SetDEDXBinning(nbin);
134  mplioni->SetMinKinEnergy(emin);
135  mplioni->SetMaxKinEnergy(emax);
136  ph->RegisterProcess(mplioni, fMpl);
137  }
138  ph->RegisterProcess(new G4StepLimiter(), fMpl);
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
145  if ( fMpl ) {
146  G4Exception("G4MonopolePhysics", "01", JustWarning,
147  "Cannot set value when monopole is already constructed.");
148  } else {
149  fMagCharge = val;
150  }
151 }
152 
153 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
154 
156 {
157  if ( fMpl ) {
158  G4Exception("G4MonopolePhysics", "01", JustWarning,
159  "Cannot set value when monopole is already constructed.");
160  } else {
161  fElCharge = val;
162  }
163 }
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166 
168 {
169  if ( fMpl ) {
170  G4Exception("G4MonopolePhysics", "01", JustWarning,
171  "Cannot set value when monopole is already constructed.");
172  } else {
174  }
175 }
176 
177 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
178