⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mt01physicslist.cc

📁 利用linux环境下蒙特卡罗计算工具geant4实现伽玛射线与探测器乘积能量的模拟过程
💻 CC
📖 第 1 页 / 共 2 页
字号:
  theAbsorptionProcess->SetVerboseLevel(OpVerbLevel);  // theRayleighScatteringProcess->SetVerboseLevel(OpVerbLevel);  theBoundaryProcess->SetVerboseLevel(OpVerbLevel);  G4OpticalSurfaceModel themodel = unified;  theBoundaryProcess->SetModel(themodel);  theParticleIterator->reset();  while( (*theParticleIterator)() )    {      G4ParticleDefinition* particle = theParticleIterator->value();      G4ProcessManager* pmanager = particle->GetProcessManager();      G4String particleName = particle->GetParticleName();      if (theScintProcessDef->IsApplicable(*particle)) {	//      if(particle->GetPDGMass() > 5.0*GeV) 	if(particle->GetParticleName() == "GenericIon") {	  pmanager->AddProcess(theScintProcessNuc); // AtRestDiscrete	  pmanager->SetProcessOrderingToLast(theScintProcessNuc,idxAtRest);	  pmanager->SetProcessOrderingToLast(theScintProcessNuc,idxPostStep);	}	  	else if(particle->GetParticleName() == "alpha") {	  pmanager->AddProcess(theScintProcessAlpha);	  pmanager->SetProcessOrderingToLast(theScintProcessAlpha,idxAtRest);	  pmanager->SetProcessOrderingToLast(theScintProcessAlpha,idxPostStep);	}	else {	  pmanager->AddProcess(theScintProcessDef);	  pmanager->SetProcessOrderingToLast(theScintProcessDef,idxAtRest);	  pmanager->SetProcessOrderingToLast(theScintProcessDef,idxPostStep);	}	        }            if (particleName == "opticalphoton") {	pmanager->AddDiscreteProcess(theAbsorptionProcess);	//	pmanager->AddDiscreteProcess(theRayleighScatteringProcess);	pmanager->AddDiscreteProcess(theBoundaryProcess);      }    }}// Hadronic processes ////////////////////////////////////////////////////////// Elastic processes:#include "G4HadronElasticProcess.hh"// Inelastic processes:#include "G4PionPlusInelasticProcess.hh"#include "G4PionMinusInelasticProcess.hh"#include "G4KaonPlusInelasticProcess.hh"#include "G4KaonZeroSInelasticProcess.hh"#include "G4KaonZeroLInelasticProcess.hh"#include "G4KaonMinusInelasticProcess.hh"#include "G4ProtonInelasticProcess.hh"#include "G4AntiProtonInelasticProcess.hh"#include "G4NeutronInelasticProcess.hh"#include "G4AntiNeutronInelasticProcess.hh"#include "G4DeuteronInelasticProcess.hh"#include "G4TritonInelasticProcess.hh"#include "G4AlphaInelasticProcess.hh"// Low-energy Models: < 20GeV#include "G4LElastic.hh"#include "G4LEPionPlusInelastic.hh"#include "G4LEPionMinusInelastic.hh"#include "G4LEKaonPlusInelastic.hh"#include "G4LEKaonZeroSInelastic.hh"#include "G4LEKaonZeroLInelastic.hh"#include "G4LEKaonMinusInelastic.hh"#include "G4LEProtonInelastic.hh"#include "G4LEAntiProtonInelastic.hh"#include "G4LENeutronInelastic.hh"#include "G4LEAntiNeutronInelastic.hh"#include "G4LEDeuteronInelastic.hh"#include "G4LETritonInelastic.hh"#include "G4LEAlphaInelastic.hh"// High-energy Models: >20 GeV#include "G4HEPionPlusInelastic.hh"#include "G4HEPionMinusInelastic.hh"#include "G4HEKaonPlusInelastic.hh"#include "G4HEKaonZeroInelastic.hh"#include "G4HEKaonZeroInelastic.hh"#include "G4HEKaonMinusInelastic.hh"#include "G4HEProtonInelastic.hh"#include "G4HEAntiProtonInelastic.hh"#include "G4HENeutronInelastic.hh"#include "G4HEAntiNeutronInelastic.hh"// Neutron high-precision models: <20 MeV#include "G4NeutronHPElastic.hh"#include "G4NeutronHPElasticData.hh"#include "G4NeutronHPCapture.hh"#include "G4NeutronHPCaptureData.hh"#include "G4NeutronHPInelastic.hh"#include "G4NeutronHPInelasticData.hh"#include "G4LCapture.hh"// Stopping processes#include "G4PiMinusAbsorptionAtRest.hh"#include "G4KaonMinusAbsorptionAtRest.hh"#include "G4AntiProtonAnnihilationAtRest.hh"#include "G4AntiNeutronAnnihilationAtRest.hh"// ConstructHad()// Makes discrete physics processes for the hadrons, at present limited// to those particles with GHEISHA interactions (INTRC > 0).// The processes are: Elastic scattering and Inelastic scattering.// F.W.Jones  09-JUL-1998void mt01PhysicsList::ConstructHad() {  G4HadronElasticProcess* theElasticProcess = new G4HadronElasticProcess;  G4LElastic* theElasticModel = new G4LElastic;  theElasticProcess->RegisterMe(theElasticModel);    theParticleIterator->reset();  while ((*theParticleIterator)())     {      G4ParticleDefinition* particle = theParticleIterator->value();      G4ProcessManager* pmanager = particle->GetProcessManager();      G4String particleName = particle->GetParticleName();      if (particleName == "pi+") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4PionPlusInelasticProcess* theInelasticProcess = 	    new G4PionPlusInelasticProcess("inelastic");	  G4LEPionPlusInelastic* theLEInelasticModel = 	    new G4LEPionPlusInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEPionPlusInelastic* theHEInelasticModel = 	    new G4HEPionPlusInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}       else if (particleName == "pi-") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4PionMinusInelasticProcess* theInelasticProcess = 	    new G4PionMinusInelasticProcess("inelastic");	  G4LEPionMinusInelastic* theLEInelasticModel = 	    new G4LEPionMinusInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEPionMinusInelastic* theHEInelasticModel = 	    new G4HEPionMinusInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	  G4String prcNam;	  pmanager->AddRestProcess(new G4PiMinusAbsorptionAtRest, ordDefault);	}            else if (particleName == "kaon+") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4KaonPlusInelasticProcess* theInelasticProcess = 	    new G4KaonPlusInelasticProcess("inelastic");	  G4LEKaonPlusInelastic* theLEInelasticModel = 	    new G4LEKaonPlusInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEKaonPlusInelastic* theHEInelasticModel = 	    new G4HEKaonPlusInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}            else if (particleName == "kaon0S") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4KaonZeroSInelasticProcess* theInelasticProcess = 	    new G4KaonZeroSInelasticProcess("inelastic");	  G4LEKaonZeroSInelastic* theLEInelasticModel = 	    new G4LEKaonZeroSInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEKaonZeroInelastic* theHEInelasticModel = 	    new G4HEKaonZeroInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "kaon0L") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4KaonZeroLInelasticProcess* theInelasticProcess = 	    new G4KaonZeroLInelasticProcess("inelastic");	  G4LEKaonZeroLInelastic* theLEInelasticModel = 	    new G4LEKaonZeroLInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEKaonZeroInelastic* theHEInelasticModel = 	    new G4HEKaonZeroInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "kaon-") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4KaonMinusInelasticProcess* theInelasticProcess = 	    new G4KaonMinusInelasticProcess("inelastic");	  G4LEKaonMinusInelastic* theLEInelasticModel = 	    new G4LEKaonMinusInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEKaonMinusInelastic* theHEInelasticModel = 	    new G4HEKaonMinusInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	  pmanager->AddRestProcess(new G4KaonMinusAbsorptionAtRest, ordDefault);	}      else if (particleName == "proton") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4ProtonInelasticProcess* theInelasticProcess = 	    new G4ProtonInelasticProcess("inelastic");	  G4LEProtonInelastic* theLEInelasticModel = new G4LEProtonInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEProtonInelastic* theHEInelasticModel = new G4HEProtonInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "anti_proton") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4AntiProtonInelasticProcess* theInelasticProcess = 	    new G4AntiProtonInelasticProcess("inelastic");	  G4LEAntiProtonInelastic* theLEInelasticModel = 	    new G4LEAntiProtonInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEAntiProtonInelastic* theHEInelasticModel = 	    new G4HEAntiProtonInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "neutron") {	// elastic scattering	G4HadronElasticProcess* theNeutronElasticProcess = 	  new G4HadronElasticProcess;	G4LElastic* theElasticModel1 = new G4LElastic;	theElasticModel1->SetMinEnergy(10*MeV);	theNeutronElasticProcess->RegisterMe(theElasticModel1);		G4NeutronHPElastic * theElasticNeutron = new G4NeutronHPElastic;	theNeutronElasticProcess->RegisterMe(theElasticNeutron);	G4NeutronHPElasticData * theNeutronData = new G4NeutronHPElasticData;	theNeutronElasticProcess->AddDataSet(theNeutronData);		pmanager->AddDiscreteProcess(theNeutronElasticProcess);	// inelastic scattering		G4NeutronInelasticProcess* theInelasticProcess =	  new G4NeutronInelasticProcess("inelastic");	G4LENeutronInelastic* theInelasticModel = new G4LENeutronInelastic;        theInelasticModel->SetMinEnergy(10*MeV);	theInelasticProcess->RegisterMe(theInelasticModel);	G4NeutronHPInelastic * theLENeutronInelasticModel =	  new G4NeutronHPInelastic;	theInelasticProcess->RegisterMe(theLENeutronInelasticModel);	G4NeutronHPInelasticData * theNeutronData1 = 	  new G4NeutronHPInelasticData;	theInelasticProcess->AddDataSet(theNeutronData1);			pmanager->AddDiscreteProcess(theInelasticProcess);	// capture	G4HadronCaptureProcess* theCaptureProcess =	  new G4HadronCaptureProcess;	G4LCapture* theCaptureModel = new G4LCapture;	theCaptureModel->SetMinEnergy(10*MeV);	theCaptureProcess->RegisterMe(theCaptureModel);        G4NeutronHPCapture * theLENeutronCaptureModel = new G4NeutronHPCapture;	theCaptureProcess->RegisterMe(theLENeutronCaptureModel);	G4NeutronHPCaptureData * theNeutronData3 = new G4NeutronHPCaptureData;	theCaptureProcess->AddDataSet(theNeutronData3);		pmanager->AddDiscreteProcess(theCaptureProcess);//  G4ProcessManager* pmanager = G4Neutron::Neutron->GetProcessManager();	// pmanager->AddProcess(new G4UserSpecialCuts(),-1,-1,1);      }      else if (particleName == "anti_neutron") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4AntiNeutronInelasticProcess* theInelasticProcess = 	    new G4AntiNeutronInelasticProcess("inelastic");	  G4LEAntiNeutronInelastic* theLEInelasticModel = 	    new G4LEAntiNeutronInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  G4HEAntiNeutronInelastic* theHEInelasticModel = 	    new G4HEAntiNeutronInelastic;	  theInelasticProcess->RegisterMe(theHEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "deuteron") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4DeuteronInelasticProcess* theInelasticProcess = 	    new G4DeuteronInelasticProcess("inelastic");	  G4LEDeuteronInelastic* theLEInelasticModel = 	    new G4LEDeuteronInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}            else if (particleName == "triton") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4TritonInelasticProcess* theInelasticProcess = 	    new G4TritonInelasticProcess("inelastic");	  G4LETritonInelastic* theLEInelasticModel = 	    new G4LETritonInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}      else if (particleName == "alpha") 	{	  pmanager->AddDiscreteProcess(theElasticProcess);	  G4AlphaInelasticProcess* theInelasticProcess = 	    new G4AlphaInelasticProcess("inelastic");	  G4LEAlphaInelastic* theLEInelasticModel = 	    new G4LEAlphaInelastic;	  theInelasticProcess->RegisterMe(theLEInelasticModel);	  pmanager->AddDiscreteProcess(theInelasticProcess);	}    }}// Decays ///////////////////////////////////////////////////////////////////#include "G4Decay.hh"#include "G4RadioactiveDecay.hh"#include "G4IonTable.hh"#include "G4Ions.hh"void mt01PhysicsList::ConstructGeneral() {  // Add Decay Process  G4Decay* theDecayProcess = new G4Decay();  theParticleIterator->reset();  while( (*theParticleIterator)() )    {      G4ParticleDefinition* particle = theParticleIterator->value();      G4ProcessManager* pmanager = particle->GetProcessManager();            if (theDecayProcess->IsApplicable(*particle)) 	{ 	  pmanager ->AddProcess(theDecayProcess);	  // set ordering for PostStepDoIt and AtRestDoIt	  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);	  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);	}    }  // Declare radioactive decay to the GenericIon in the IonTable.  const G4IonTable *theIonTable =     G4ParticleTable::GetParticleTable()->GetIonTable();  G4RadioactiveDecay *theRadioactiveDecay = new G4RadioactiveDecay();  for (G4int i=0; i<theIonTable->Entries(); i++)     {      G4String particleName = theIonTable->GetParticle(i)->GetParticleName();      G4String particleType = theIonTable->GetParticle(i)->GetParticleType();            if (particleName == "GenericIon") 	{	  G4ProcessManager* pmanager = 	    theIonTable->GetParticle(i)->GetProcessManager();	  pmanager->SetVerboseLevel(VerboseLevel);	  pmanager ->AddProcess(theRadioactiveDecay);	  pmanager ->SetProcessOrdering(theRadioactiveDecay, idxPostStep);	  pmanager ->SetProcessOrdering(theRadioactiveDecay, idxAtRest);	}     }}// Cuts /////////////////////////////////////////////////////////////////////void mt01PhysicsList::SetCuts() {    if (verboseLevel >1)    G4cout << "mt01PhysicsList::SetCuts:";    if (verboseLevel>0){    G4cout << "mt01PhysicsList::SetCuts:";    G4cout << "CutLength : " 	   << G4BestUnit(defaultCutValue,"Length") << G4endl;  }  //special for low energy physics  G4double lowlimit=1*keV;    G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(lowlimit,50.*GeV);  // set cut values for gamma at first and for e- second and next for e+,  // because some processes for e+/e- need cut values for gamma   SetCutValue(cutForGamma, "gamma");  SetCutValue(cutForElectron, "e-");  SetCutValue(cutForPositron, "e+");  // SetCutValue(1.*MeV, "proton");  if (verboseLevel>0) DumpCutValuesTable();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -