Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:10

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // History
0028 // 14/01/11 Alf re-adapt this file from Physiclist of testEm18
0029 //
0030 //
0031 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0032 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0033 
0034 #include "XrayFluoPhysicsList.hh"
0035 #include "XrayFluoPhysicsListMessenger.hh"
0036 
0037 #include "G4SystemOfUnits.hh"
0038 #include "G4LossTableManager.hh"
0039 #include "G4EmParameters.hh"
0040 #include "G4ProcessManager.hh"
0041 
0042 //#include "PhysListEmStandard.hh"
0043 
0044 #include "G4EmStandardPhysics.hh"
0045 #include "G4EmStandardPhysics_option1.hh"
0046 #include "G4EmStandardPhysics_option2.hh"
0047 #include "G4EmStandardPhysics_option3.hh"
0048 //#include "XrayFluoPhysListEmStandardFLUO.hh"
0049 #include "G4EmLivermorePhysics.hh"
0050 #include "G4EmPenelopePhysics.hh"
0051 //#include "G4UAtomicDeexcitation.hh"
0052 
0053 #include "G4Decay.hh"
0054 #include "XrayFluoStepMax.hh"
0055 
0056 #include "G4UnitsTable.hh"
0057 
0058 #include "G4ParticleDefinition.hh"
0059 #include "G4ProcessManager.hh"
0060 
0061 // Bosons
0062 #include "G4ChargedGeantino.hh"
0063 #include "G4Geantino.hh"
0064 #include "G4Gamma.hh"
0065 #include "G4OpticalPhoton.hh"
0066 
0067 // leptons
0068 #include "G4MuonPlus.hh"
0069 #include "G4MuonMinus.hh"
0070 #include "G4NeutrinoMu.hh"
0071 #include "G4AntiNeutrinoMu.hh"
0072 
0073 #include "G4Electron.hh"
0074 #include "G4Positron.hh"
0075 #include "G4NeutrinoE.hh"
0076 #include "G4AntiNeutrinoE.hh"
0077 
0078 // Hadrons
0079 #include "G4Proton.hh"
0080 #include "G4MesonConstructor.hh"
0081 #include "G4BaryonConstructor.hh"
0082 #include "G4IonConstructor.hh"
0083 
0084 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0085 
0086 XrayFluoPhysicsList::XrayFluoPhysicsList() : G4VModularPhysicsList()
0087 {
0088   pMessenger = new XrayFluoPhysicsListMessenger(this); 
0089    
0090   // EM physics
0091   G4LossTableManager::Instance()->SetVerbose(1);
0092       
0093   defaultCutValue = 1.*mm;
0094 
0095   cutForGamma     = defaultCutValue;
0096   cutForElectron  = defaultCutValue;
0097   cutForPositron  = defaultCutValue;
0098   cutForProton    = defaultCutValue;
0099  
0100   // set cut values for gamma at first and for e- second and next for e+,
0101   // because some processes for e+/e- need cut values for gamma
0102   SetCutValue(cutForGamma, "gamma");
0103   SetCutValue(cutForElectron, "e-");
0104   SetCutValue(cutForPositron, "e+");
0105 
0106   DumpCutValuesTable();
0107   SetVerboseLevel(1);
0108 
0109   // EM physics
0110   emName = G4String("emlivermore");
0111   emPhysicsList = new G4EmLivermorePhysics;
0112 }
0113 
0114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0115 
0116 XrayFluoPhysicsList::~XrayFluoPhysicsList()
0117 {
0118   delete emPhysicsList;
0119   delete pMessenger;  
0120 }
0121 
0122 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0123 
0124 void XrayFluoPhysicsList::ConstructParticle()
0125 {
0126   // pseudo-particles
0127   G4Geantino::GeantinoDefinition();
0128   G4ChargedGeantino::ChargedGeantinoDefinition();
0129   
0130   // gamma
0131   G4Gamma::GammaDefinition();
0132   
0133   // leptons
0134   G4Electron::ElectronDefinition();
0135   G4Positron::PositronDefinition();
0136   G4MuonPlus::MuonPlusDefinition();
0137   G4MuonMinus::MuonMinusDefinition();
0138 
0139   G4NeutrinoE::NeutrinoEDefinition();
0140   G4AntiNeutrinoE::AntiNeutrinoEDefinition();
0141   G4NeutrinoMu::NeutrinoMuDefinition();
0142   G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();  
0143 
0144   // mesons
0145   G4MesonConstructor mConstructor;
0146   mConstructor.ConstructParticle();
0147 
0148   // barions
0149   G4BaryonConstructor bConstructor;
0150   bConstructor.ConstructParticle();
0151 
0152   // ions
0153   G4IonConstructor iConstructor;
0154   iConstructor.ConstructParticle();
0155 }
0156 
0157 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0158 
0159 void XrayFluoPhysicsList::ConstructProcess()
0160 {
0161   AddTransportation();
0162   emPhysicsList->ConstructProcess();
0163   AddDecay();  
0164   AddStepMax();
0165 
0166   // Em options
0167   //
0168   G4EmParameters* param = G4EmParameters::Instance();
0169   param->SetFluo(true);
0170   param->SetAuger(true);
0171   param->SetPixe(true);
0172 }
0173 
0174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0175 
0176 void XrayFluoPhysicsList::AddDecay()
0177 {
0178   // Add Decay Process
0179 
0180   G4Decay* fDecayProcess = new G4Decay();
0181 
0182   auto particleIterator=GetParticleIterator();
0183   particleIterator->reset();
0184   while( (*particleIterator)() ){
0185     G4ParticleDefinition* particle = particleIterator->value();
0186     G4ProcessManager* pmanager = particle->GetProcessManager();
0187 
0188     if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { 
0189 
0190       pmanager ->AddProcess(fDecayProcess);
0191 
0192       // set ordering for PostStepDoIt and AtRestDoIt
0193       pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
0194       pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
0195 
0196     }
0197   }
0198 }
0199 
0200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0201 
0202 void XrayFluoPhysicsList::AddStepMax()
0203 {
0204   // Step limitation seen as a process
0205   XrayFluoStepMax* stepMaxProcess = new XrayFluoStepMax();
0206 
0207   auto particleIterator=GetParticleIterator();
0208   particleIterator->reset();
0209   while ((*particleIterator)()){
0210       G4ParticleDefinition* particle = particleIterator->value();
0211       G4ProcessManager* pmanager = particle->GetProcessManager();
0212 
0213       if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
0214         {
0215       pmanager ->AddDiscreteProcess(stepMaxProcess);
0216         }
0217   }
0218 }
0219 
0220 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0221 
0222 void XrayFluoPhysicsList::AddPhysicsList(const G4String& name)
0223 {
0224   if (verboseLevel>-1) {
0225     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
0226   }
0227 
0228   if (name == emName) return;
0229 
0230   if (name == "emlivermore") {
0231 
0232     emName = name;
0233     delete emPhysicsList;
0234     emPhysicsList = new G4EmLivermorePhysics;
0235 
0236   } else if (name == "emstandard") {
0237     emName = name;
0238     delete emPhysicsList;
0239     emPhysicsList = new G4EmStandardPhysics(); 
0240 
0241   } else if (name == "emstandard_opt1") {
0242 
0243     emName = name;
0244     delete emPhysicsList;
0245     emPhysicsList = new G4EmStandardPhysics_option1();
0246 
0247   } else if (name == "emstandard_opt2") {
0248 
0249     emName = name;
0250     delete emPhysicsList;
0251     emPhysicsList = new G4EmStandardPhysics_option2();
0252 
0253   } else if (name == "emstandard_opt3") {
0254 
0255     emName = name;
0256     delete emPhysicsList;
0257     emPhysicsList = new G4EmStandardPhysics_option3();
0258     
0259   } else if (name == "empenelope"){
0260     emName = name;
0261     delete emPhysicsList;
0262     emPhysicsList = new G4EmPenelopePhysics();
0263 
0264   } else {
0265 
0266     G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
0267            << " is not defined"
0268            << G4endl;
0269   }
0270 }
0271 
0272 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0273 
0274 void XrayFluoPhysicsList::SetCutForGamma(G4double cut)
0275 {
0276   cutForGamma = cut;
0277   SetParticleCuts(cutForGamma, G4Gamma::Gamma());
0278 }
0279 
0280 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0281 
0282 void XrayFluoPhysicsList::SetCutForElectron(G4double cut)
0283 {
0284   cutForElectron = cut;
0285   SetParticleCuts(cutForElectron, G4Electron::Electron());
0286 }
0287 
0288 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0289 
0290 void XrayFluoPhysicsList::SetCutForPositron(G4double cut)
0291 {
0292   cutForPositron = cut;
0293   SetParticleCuts(cutForPositron, G4Positron::Positron());
0294 }
0295 
0296 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0297 
0298 void XrayFluoPhysicsList::SetCutForProton(G4double cut)
0299 {
0300   cutForProton = cut;
0301   SetParticleCuts(cutForProton, G4Proton::Proton());
0302 }
0303 
0304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0305 
0306 //void XrayFluoPhysicsList::SetFluorescence(G4bool value)
0307 //{
0308 //  G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
0309 //  if(de) { de->SetFluo(value); }
0310 //}
0311 
0312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0313 
0314 //void XrayFluoPhysicsList::SetPIXE(G4bool value)
0315 //{
0316 //  G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
0317 //  if(de) { de->SetPIXE(value); }
0318 //}
0319 
0320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......