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 #include "G4EmQExtraPhysics.hh"
00041
00042 #include "G4SystemOfUnits.hh"
00043 #include "G4SynchrotronRadiation.hh"
00044
00045 #include "G4ParticleDefinition.hh"
00046 #include "G4ParticleTable.hh"
00047 #include "G4Gamma.hh"
00048 #include "G4Electron.hh"
00049 #include "G4Positron.hh"
00050 #include "G4MuonPlus.hh"
00051 #include "G4MuonMinus.hh"
00052 #include "G4ProcessManager.hh"
00053 #include "G4BuilderType.hh"
00054 #include "G4HadronicDeprecate.hh"
00055
00056
00057 #include "G4PhysicsConstructorFactory.hh"
00058
00059 G4_DECLARE_PHYSCONSTR_FACTORY(G4EmQExtraPhysics);
00060
00061 G4EmQExtraPhysics::G4EmQExtraPhysics(G4int ver):
00062 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
00063 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
00064 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00065 verbose(ver)
00066 {
00067 G4HadronicDeprecate("G4EmQExtraPhysics");
00068 theMessenger = new G4EmQMessenger(this);
00069 SetPhysicsType(bEmExtra);
00070 }
00071
00072 G4EmQExtraPhysics::G4EmQExtraPhysics(const G4String&):
00073 G4VPhysicsConstructor("G4GammaLeptoNuclearPhys"), wasBuilt(false), gnActivated(false),
00074 munActivated(false), synActivated(false), synchOn(false), gammNucOn(true), muNucOn(false),
00075 theElectronSynch(0), thePositronSynch(0), theGNPhysics(0), muNucProcess(0), muNucModel(0),
00076 verbose(1)
00077 {
00078 G4HadronicDeprecate("G4EmQExtraPhysics");
00079 theMessenger = new G4EmQMessenger(this);
00080 SetPhysicsType(bEmExtra);
00081 }
00082
00083 G4EmQExtraPhysics::~G4EmQExtraPhysics()
00084 {
00085 delete theMessenger;
00086 delete theElectronSynch;
00087 delete thePositronSynch;
00088 delete theGNPhysics;
00089 delete muNucProcess;
00090 delete muNucModel;
00091 }
00092
00093 void G4EmQExtraPhysics::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 G4EmQExtraPhysics::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 G4EmQExtraPhysics::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 G4EmQExtraPhysics::ConstructParticle()
00118 {
00119 G4Gamma::Gamma();
00120 G4Electron::Electron();
00121 G4Positron::Positron();
00122 G4MuonPlus::MuonPlus();
00123 G4MuonMinus::MuonMinus();
00124 }
00125
00126 void G4EmQExtraPhysics::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 G4EmQExtraPhysics::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 G4EmQExtraPhysics::BuildGammaNuclear()
00154 {
00155 if(gnActivated) return;
00156 gnActivated = true;
00157
00158 theGNPhysics = new G4ElectroNuclearBuilder();
00159 theGNPhysics->Build();
00160 }
00161
00162 void G4EmQExtraPhysics::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 }