00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "G4EmExtraPhysics.hh"
00043
00044 #include "G4SystemOfUnits.hh"
00045 #include "G4SynchrotronRadiation.hh"
00046
00047 #include "G4ParticleDefinition.hh"
00048 #include "G4ParticleTable.hh"
00049 #include "G4Gamma.hh"
00050 #include "G4Electron.hh"
00051 #include "G4Positron.hh"
00052 #include "G4MuonPlus.hh"
00053 #include "G4MuonMinus.hh"
00054 #include "G4ProcessManager.hh"
00055 #include "G4BuilderType.hh"
00056
00057
00058 #include "G4PhysicsConstructorFactory.hh"
00059
00060 G4_DECLARE_PHYSCONSTR_FACTORY(G4EmExtraPhysics);
00061
00062
00063 G4EmExtraPhysics::G4EmExtraPhysics(G4int ver):
00064 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
00065 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
00066 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00067 verbose(ver)
00068 {
00069 theMessenger = new G4EmMessenger(this);
00070 SetPhysicsType(bEmExtra);
00071 }
00072
00073 G4EmExtraPhysics::G4EmExtraPhysics(const G4String&):
00074 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
00075 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
00076 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00077 verbose(1)
00078 {
00079 theMessenger = new G4EmMessenger(this);
00080 SetPhysicsType(bEmExtra);
00081 }
00082
00083 G4EmExtraPhysics::~G4EmExtraPhysics()
00084 {
00085 delete theMessenger;
00086 delete theElectronSynch;
00087 delete thePositronSynch;
00088 delete theGNPhysics;
00089 delete muNucProcess;
00090 delete muNucModel;
00091 }
00092
00093 void G4EmExtraPhysics::Synch(G4String & newState)
00094 {
00095 if(newState == "on" || newState == "ON") {
00096 synchOn = true;
00097 if(wasBuilt) BuildSynch();
00098 } else synchOn = false;
00099 }
00100
00101 void G4EmExtraPhysics::GammaNuclear(G4String & newState)
00102 {
00103 if(newState == "on" || newState == "ON") {
00104 gammNucOn = true;
00105 if(wasBuilt) BuildGammaNuclear();
00106 } else gammNucOn = false;
00107 }
00108
00109 void G4EmExtraPhysics::MuonNuclear(G4String & newState)
00110 {
00111 if(newState == "on" || newState == "ON") {
00112 muNucOn = true;
00113 if(wasBuilt) BuildMuonNuclear();
00114 } else muNucOn = false;
00115 }
00116
00117 void G4EmExtraPhysics::ConstructParticle()
00118 {
00119 G4Gamma::Gamma();
00120 G4Electron::Electron();
00121 G4Positron::Positron();
00122 G4MuonPlus::MuonPlus();
00123 G4MuonMinus::MuonMinus();
00124 }
00125
00126 void G4EmExtraPhysics::ConstructProcess()
00127 {
00128 if(wasBuilt) return;
00129 wasBuilt = true;
00130
00131 if (synchOn) BuildSynch();
00132 if (gammNucOn) BuildGammaNuclear();
00133 if (muNucOn) BuildMuonNuclear();
00134 }
00135
00136 void G4EmExtraPhysics::BuildMuonNuclear()
00137 {
00138 if(munActivated) return;
00139 munActivated = true;
00140 G4ProcessManager * pManager = 0;
00141
00142 muNucProcess = new G4MuonNuclearProcess();
00143 muNucModel = new G4MuonVDNuclearModel();
00144 muNucProcess->RegisterMe(muNucModel);
00145
00146 pManager = G4MuonPlus::MuonPlus()->GetProcessManager();
00147 pManager->AddDiscreteProcess(muNucProcess);
00148
00149 pManager = G4MuonMinus::MuonMinus()->GetProcessManager();
00150 pManager->AddDiscreteProcess(muNucProcess);
00151 }
00152
00153 void G4EmExtraPhysics::BuildGammaNuclear()
00154 {
00155 if(gnActivated) return;
00156 gnActivated = true;
00157
00158 theGNPhysics = new G4BertiniElectroNuclearBuilder();
00159 theGNPhysics->Build();
00160 }
00161
00162 void G4EmExtraPhysics::BuildSynch()
00163 {
00164 if(synActivated) return;
00165 synActivated = true;
00166 G4ProcessManager * pManager = 0;
00167
00168 pManager = G4Electron::Electron()->GetProcessManager();
00169 theElectronSynch = new G4SynchrotronRadiation();
00170 pManager->AddDiscreteProcess(theElectronSynch);
00171
00172 pManager = G4Positron::Positron()->GetProcessManager();
00173 thePositronSynch = new G4SynchrotronRadiation();
00174 pManager->AddDiscreteProcess(thePositronSynch);
00175 }