Physics.cc

Go to the documentation of this file.
00001 //! \file
00002 //!
00003 //! Source file for the Physics class.
00004 //!
00005 //! The Physics class is used for defining the particles and physics
00006 //! processes which will be active in the OLYMPUS Monte Carlo simulation.
00007 //!
00008 //! \author D.K. Hasell
00009 //! \version 1.0
00010 //! \date 2010-10-13
00011 //!
00012 //! \ingroup physics
00013 
00014 // *+****1****+****2****+****3****+****4****+****5****+****6****+****7****+****
00015 
00016 // Include the Physics header file.
00017 
00018 #include "Physics.h"
00019 
00020 // Include the GEANT4 header files referenced here.
00021 
00022 #include "globals.hh"
00023 
00024 #include "G4ProcessManager.hh"
00025 #include "G4ParticleTypes.hh"
00026 
00027 #include "G4ComptonScattering.hh"
00028 #include "G4GammaConversion.hh"
00029 #include "G4PhotoElectricEffect.hh"
00030 
00031 #include "G4eMultipleScattering.hh"
00032 #include "G4eIonisation.hh"
00033 #include "G4eBremsstrahlung.hh"
00034 #include "G4eplusAnnihilation.hh"
00035 
00036 #include "G4MuMultipleScattering.hh"
00037 #include "G4MuIonisation.hh"
00038 #include "G4MuBremsstrahlung.hh"
00039 #include "G4MuPairProduction.hh"
00040 
00041 #include "G4hMultipleScattering.hh"
00042 #include "G4hIonisation.hh"
00043 
00044 #include "G4StepLimiter.hh"
00045 #include "G4UserSpecialCuts.hh"
00046 
00047 #include "G4Decay.hh"
00048 
00049 // Constructor.
00050 
00051 Physics::Physics():  G4VUserPhysicsList() {
00052 
00053    // Set the default cut value.
00054 
00055    defaultCutValue = 1.0 * cm;
00056 
00057    // Set the verbosity.
00058 
00059    SetVerboseLevel(0);
00060 }
00061 
00062 // Destructor.
00063 
00064 Physics::~Physics() {}
00065 
00066 // Member function to construct the particles used.
00067 
00068 void Physics::ConstructParticle() {
00069 
00070    // Construct the various families of particles.
00071 
00072    ConstructBosons();
00073    ConstructLeptons();
00074    ConstructMesons();
00075    ConstructBaryons();
00076 }
00077 
00078 // Method to construct the boson family of particles.
00079  
00080 void Physics::ConstructBosons() {
00081 
00082    // Pseudo particles.
00083 
00084    G4Geantino::GeantinoDefinition();
00085    G4ChargedGeantino::ChargedGeantinoDefinition();
00086 
00087    // Photon.
00088 
00089    G4Gamma::GammaDefinition();
00090 }
00091 
00092 // Method to construct the lepton family of particles.
00093  
00094 void Physics::ConstructLeptons() {
00095 
00096    // Electron and positron.
00097 
00098    G4Electron::ElectronDefinition();
00099    G4Positron::PositronDefinition();
00100 
00101    // Charged muons.
00102 
00103    G4MuonPlus::MuonPlusDefinition();
00104    G4MuonMinus::MuonMinusDefinition();
00105 
00106    // Electron neutrinos.
00107 
00108    G4NeutrinoE::NeutrinoEDefinition();
00109    G4AntiNeutrinoE::AntiNeutrinoEDefinition();
00110 
00111    // Muon neutrinos.
00112 
00113    G4NeutrinoMu::NeutrinoMuDefinition();
00114    G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
00115 }
00116 
00117 // Method to construct the meson family of particles.
00118  
00119 void Physics::ConstructMesons() {
00120 
00121    // Mesons.
00122 
00123    G4PionPlus::PionPlusDefinition();
00124    G4PionMinus::PionMinusDefinition();
00125    G4PionZero::PionZeroDefinition();
00126 
00127    G4Eta::EtaDefinition();
00128    G4EtaPrime::EtaPrimeDefinition();
00129 
00130    G4KaonPlus::KaonPlusDefinition();
00131    G4KaonMinus::KaonMinusDefinition();
00132    G4KaonZero::KaonZeroDefinition();
00133    G4AntiKaonZero::AntiKaonZeroDefinition();
00134    G4KaonZeroLong::KaonZeroLongDefinition();
00135    G4KaonZeroShort::KaonZeroShortDefinition();
00136 }
00137 
00138 // Method to construct the baryon family of particles.
00139  
00140 void Physics::ConstructBaryons() {
00141 
00142    // Baryons.
00143 
00144    G4Proton::ProtonDefinition();
00145    G4AntiProton::AntiProtonDefinition();
00146 
00147    G4Neutron::NeutronDefinition();
00148    G4AntiNeutron::AntiNeutronDefinition();
00149 }
00150 
00151 // Member function to construct the processes used.
00152 
00153 void Physics::ConstructProcess() {
00154    AddTransportation();
00155    ConstructEM();
00156    ConstructGeneral();
00157 }
00158 
00159 // Method to construct the general physics processes.
00160 
00161 void Physics::ConstructGeneral() {
00162 
00163    // Add Decay Process
00164 
00165    G4Decay* theDecayProcess = new G4Decay();
00166    theParticleIterator->reset();
00167 
00168    while( ( *theParticleIterator )() ){
00169 
00170       G4ParticleDefinition* particle = theParticleIterator->value();
00171       G4ProcessManager* pmanager = particle->GetProcessManager();
00172 
00173       if( theDecayProcess->IsApplicable(*particle) ) {
00174  
00175          pmanager ->AddProcess(theDecayProcess);
00176          // set ordering for PostStepDoIt and AtRestDoIt
00177          pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
00178          pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
00179       }
00180    }
00181 }
00182 
00183 // Method to construct the electromagnetic physics processes.
00184 
00185 void Physics::ConstructEM() {
00186 
00187    theParticleIterator->reset();
00188 
00189    while( ( *theParticleIterator )() ) {
00190 
00191       G4ParticleDefinition * particle = theParticleIterator->value();
00192       G4ProcessManager * pmanager = particle->GetProcessManager();
00193       G4String particleName = particle->GetParticleName();
00194      
00195       if (particleName == "gamma") {
00196 
00197          pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
00198          pmanager->AddDiscreteProcess(new G4ComptonScattering); 
00199          pmanager->AddDiscreteProcess(new G4GammaConversion);
00200       
00201       }
00202       else if( particleName == "e-" ) {
00203 
00204          pmanager->AddProcess(new G4eMultipleScattering,-1,  1, 1 );
00205          pmanager->AddProcess(new G4eIonisation,        -1,  2, 2 );
00206          pmanager->AddProcess(new G4eBremsstrahlung,    -1, -3, 3 );      
00207 
00208       }
00209       else if( particleName == "e+" ) {
00210 
00211          pmanager->AddProcess(new G4eMultipleScattering, -1,  1, 1 );
00212          pmanager->AddProcess(new G4eIonisation,         -1,  2, 2 );
00213          pmanager->AddProcess(new G4eBremsstrahlung,     -1, -3, 3 );
00214          pmanager->AddProcess(new G4eplusAnnihilation,    0, -1, 4 );
00215 
00216       }
00217       else if( particleName == "mu+" || particleName == "mu-" ) {
00218 
00219          pmanager->AddProcess(new G4MuMultipleScattering, -1,  1, 1 );
00220          pmanager->AddProcess(new G4MuIonisation,         -1,  2, 2 );
00221          pmanager->AddProcess(new G4MuBremsstrahlung,     -1, -3, 3 );
00222          pmanager->AddProcess(new G4MuPairProduction,     -1, -4, 4 );       
00223      
00224       }
00225       else if( !( particle->IsShortLived() ) && 
00226                particle->GetPDGCharge() != 0.0 && 
00227                particle->GetParticleName() != "chargedgeantino" ) {
00228 
00229          //all others charged particles except geantino
00230          pmanager->AddProcess(new G4hMultipleScattering, -1,  1, 1 );
00231          pmanager->AddProcess(new G4hIonisation,         -1,  2, 2 );
00232          pmanager->AddProcess(new G4MuBremsstrahlung,    -1, -3, 3 );
00233          pmanager->AddProcess(new G4MuPairProduction,    -1, -4, 4 );       
00234          //step limit
00235          //pmanager->AddProcess(new G4StepLimiter,         -1, -1, 3 );         
00236          //pmanager->AddProcess(new G4UserSpecialCuts,     -1, -1, 4 );  
00237       }
00238    }
00239 }
00240 
00241 // Member function to set the cuts.
00242 
00243 void Physics::SetCuts() {
00244 
00245    // G4VUserPhysicsList::SetCutsWithDefault method sets 
00246    // the default cut value for all particle types.
00247 
00248    SetCutsWithDefault();
00249      
00250    if( verboseLevel > 0 ) DumpCutValuesTable();
00251 }