void PhysicsList::AddDecay() {
  // Add Decay Process

  G4Decay* fDecayProcess = new G4Decay();

  theParticleIterator->reset();
  while( (*theParticleIterator)() ){
    G4ParticleDefinition* particle = theParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();

    if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { 

      pmanager->AddProcess(fDecayProcess);

      // set ordering for PostStepDoIt and AtRestDoIt
      pmanager->SetProcessOrdering(fDecayProcess, idxPostStep);
      pmanager->SetProcessOrdering(fDecayProcess, idxAtRest);

    }
  }
}
void PhysListEmStandardSS::ConstructProcess()
{
  // Add standard EM Processes

  aParticleIterator->reset();
  while( (*aParticleIterator)() ){
    G4ParticleDefinition* particle = aParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();
    G4String particleName = particle->GetParticleName();
     
    if (particleName == "gamma") {
      // gamma
      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
      pmanager->AddDiscreteProcess(new G4ComptonScattering);
      pmanager->AddDiscreteProcess(new G4GammaConversion);
      
    } else if (particleName == "e-") {
      //electron
      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
            
    } else if (particleName == "e+") {
      //positron
      pmanager->AddProcess(new G4eIonisation,        -1, 1, 1);
      pmanager->AddProcess(new G4eBremsstrahlung,    -1, 2, 2);
      pmanager->AddProcess(new G4eplusAnnihilation,   0,-1, 3);
      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
            
    } else if (particleName == "mu+" || 
               particleName == "mu-"    ) {
      //muon
      pmanager->AddProcess(new G4MuIonisation,       -1, 1, 1);
      pmanager->AddProcess(new G4MuBremsstrahlung,   -1, 2, 2);
      pmanager->AddProcess(new G4MuPairProduction,   -1, 3, 3);
      pmanager->AddDiscreteProcess(new G4CoulombScattering);              
             
    } else if (particleName == "alpha" || particleName == "He3") {
      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);
      G4CoulombScattering* cs = new G4CoulombScattering();
      //cs->AddEmModel(0, new G4IonCoulombScatteringModel());
      cs->SetBuildTableFlag(false);
      pmanager->AddDiscreteProcess(cs);

    } else if (particleName == "GenericIon" ) { 
      pmanager->AddProcess(new G4ionIonisation,      -1, 1, 1);      
      G4CoulombScattering* cs = new G4CoulombScattering();
      cs->AddEmModel(0, new G4IonCoulombScatteringModel());
      cs->SetBuildTableFlag(false);
      pmanager->AddDiscreteProcess(cs);
     
    } else if ((!particle->IsShortLived()) &&
               (particle->GetPDGCharge() != 0.0) && 
               (particle->GetParticleName() != "chargedgeantino")) {
      //all others charged particles except geantino
      pmanager->AddDiscreteProcess(new G4CoulombScattering);            
      pmanager->AddProcess(new G4hIonisation,        -1, 1, 1);
    }
  }
  
  // Em options
  //
  // Main options and setting parameters are shown here.
  // Several of them have default values.
  //
  G4EmProcessOptions emOptions;
  
  //physics tables
  //
  emOptions.SetMinEnergy(100*eV);        //default    
  emOptions.SetMaxEnergy(100*TeV);        //default  
  emOptions.SetDEDXBinning(12*20);        //default=12*7  
  emOptions.SetLambdaBinning(12*20);        //default=12*7
  emOptions.SetSplineFlag(true);        //default
      
  //energy loss
  //
  emOptions.SetStepFunction(0.2, 100*um);        //default=(0.2, 1*mm)      
  emOptions.SetLinearLossLimit(1.e-2);                //default
   
  //ionization
  //
  emOptions.SetSubCutoff(false);        //default  

  // scattering
  emOptions.SetPolarAngleLimit(0.0);
}
Exemple #3
0
void Physics::ConstructEM() {

   theParticleIterator->reset();

   while( ( *theParticleIterator )() ) {

      G4ParticleDefinition * particle = theParticleIterator->value();
      G4ProcessManager * pmanager = particle->GetProcessManager();
      G4String particleName = particle->GetParticleName();
     
      if (particleName == "gamma") {

         pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
         pmanager->AddDiscreteProcess(new G4ComptonScattering); 
         pmanager->AddDiscreteProcess(new G4GammaConversion);
         pmanager->AddDiscreteProcess(new G4CoulombScattering);
         pmanager->AddDiscreteProcess(new G4RayleighScattering);
      
      }
      else if( particleName == "e-" ) {

         if( Run_Type == "Recon" ) {
            pmanager->AddProcess(new G4eIonisation,          -1,  1, 1 );
         }
         else {
            pmanager->AddProcess(new G4eMultipleScattering,  -1,  1, 1 );
            pmanager->AddProcess(new G4eIonisation,          -1,  2, 2 );
				if (fullBrem && supBrem)
				{
					std::cout<<"\n\nCANNOT USE FULL AND SUPPRESSED PHOTON BREMSSTRAHLUNG SIMULTANEOUSLY!\n\n";
					std::cout<<"USING FULL BREMSSTRAHLUNG FOR ELECTRONS!\n\n";
					supBrem = false;
				}
				else if (fullBrem)
				{
					pmanager->AddProcess(new G4eBremsstrahlung,     -1, -1, 3 );
				}
				else if (supBrem)
				{
					G4eBremsstrahlung * eBremP = new G4eBremsstrahlung;
            	bremPhotonSuppression * bremSup = new bremPhotonSuppression;
					bremSup->RegisterProcess(eBremP);
       			pmanager->AddProcess(bremSup,                    -1, -1, 3 );
				}
				else
				{
					std::cout<<"\n\nNO ELECTRON BREMSSTRAHLUNG INCLUDED!\n\n";
				}
         }

      }
      else if( particleName == "e+" ) {

         if( Run_Type == "Recon" ) {
            pmanager->AddProcess(new G4eIonisation,          -1,  1, 1 );
         }
         else {
            pmanager->AddProcess(new G4eMultipleScattering,  -1,  1, 1 );
            pmanager->AddProcess(new G4eIonisation,          -1,  2, 2 );
		if (fullBrem && supBrem)
		{
			std::cout<<"\n\nCANNOT USE FULL AND SUPPRESSED PHOTON BREMSSTRAHLUNG SIMULTANEOUSLY!\n\n";
			std::cout<<"USING FULL BREMSSTRAHLUNG FOR POSITRONS!\n\n";
			supBrem = false;
		}
		else if (fullBrem)
		{
			pmanager->AddProcess(new G4eBremsstrahlung,     -1, -1, 3 );
		}
		else if (supBrem)
		{
			G4eBremsstrahlung * eBremP = new G4eBremsstrahlung;
			bremPhotonSuppression * bremSup = new bremPhotonSuppression;
			bremSup->RegisterProcess(eBremP);
			pmanager->AddProcess(bremSup,                    -1, -1, 3 );
		}
		else
		{
			std::cout<<"\n\nNO POSITRON BREMSSTRAHLUNG INCLUDED!\n\n";
		}
            pmanager->AddProcess(new G4eplusAnnihilation,     0, -1, 4 );
         }

      }
      else if( particleName == "mu+" ||
               particleName == "mu-" ) {

         pmanager->AddProcess(new G4MuMultipleScattering, -1,  1, 1 );
         pmanager->AddProcess(new G4MuIonisation,         -1,  2, 2 );
			if (fullBrem && supBrem)
			{
				std::cout<<"\n\nCANNOT USE FULL AND SUPPRESSED PHOTON BREMSSTRAHLUNG SIMULTANEOUSLY!\n\n";
				std::cout<<"USING FULL BREMSSTRAHLUNG FOR MUONS!\n\n";
				supBrem = false;
			}
			else if (fullBrem)
			{
				pmanager->AddProcess(new G4MuBremsstrahlung,     -1, -1, 3 );
			}
			else if (supBrem)
			{
				G4MuBremsstrahlung * eBremP = new G4MuBremsstrahlung;
         	bremPhotonSuppression * bremSup = new bremPhotonSuppression;
				bremSup->RegisterProcess(eBremP);
    			pmanager->AddProcess(bremSup,                    -1, -1, 3 );
			}
			else
			{
				std::cout<<"\n\nNO MUON BREMSSTRAHLUNG INCLUDED!\n\n";
			}

         pmanager->AddProcess(new G4MuPairProduction,     -1, -1, 4 );       
     
      }

      // All others charged particles except chargedgeantino.

      else if( !( particle->IsShortLived() ) && 
               particle->GetPDGCharge() != 0.0 && 
               particle->GetParticleName() != "chargedgeantino" ) {

         if( Run_Type == "Recon" ) {
            pmanager->AddProcess(new G4hIonisation,          -1,  1, 1 );
         }
         else {
            pmanager->AddProcess(new G4hMultipleScattering,  -1,  1, 1 );
            pmanager->AddProcess(new G4hIonisation,          -1,  2, 2 );
				if (fullBrem && supBrem)
				{
					std::cout<<"\n\nCANNOT USE FULL AND SUPPRESSED PHOTON BREMSSTRAHLUNG SIMULTANEOUSLY!\n\n";
					std::cout<<"USING FULL BREMSSTRAHLUNG FOR HADRONS!\n\n";
					supBrem = false;
				}
				else if (fullBrem)
				{
					pmanager->AddProcess(new G4hBremsstrahlung,     -1, -1, 3 );
				}
				else if (supBrem)
				{
					G4hBremsstrahlung * eBremP = new G4hBremsstrahlung;
            	bremPhotonSuppression * bremSup = new bremPhotonSuppression;
					bremSup->RegisterProcess(eBremP);
       			pmanager->AddProcess(bremSup,                    -1, -1, 3 );
				}
				else
				{
					std::cout<<"\n\nNO HADRON BREMSSTRAHLUNG INCLUDED!\n\n";
				}

            pmanager->AddProcess(new G4hPairProduction,      -1, -1, 4 );
         }

         // Step limit.
         //pmanager->AddProcess(new G4StepLimiter,         -1, -1, 3 );         
         //pmanager->AddProcess(new G4UserSpecialCuts,     -1, -1, 4 );  
      }
   }
}
void PhysListEmStandardGS::ConstructProcess()
{
  // Add standard EM Processes
  //

  aParticleIterator->reset();
  while( (*aParticleIterator)() ){
    G4ParticleDefinition* particle = aParticleIterator->value();
    G4ProcessManager* pmanager = particle->GetProcessManager();
    G4String particleName = particle->GetParticleName();
     
    if (particleName == "gamma") {
      // gamma
      pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
      pmanager->AddDiscreteProcess(new G4ComptonScattering);
      pmanager->AddDiscreteProcess(new G4GammaConversion);
      
    } else if (particleName == "e-") {
      //electron
      G4eMultipleScattering* msc = new G4eMultipleScattering();
      msc->AddEmModel(0, new G4GoudsmitSaundersonMscModel());
      pmanager->AddProcess(msc,                       -1, 1, 1);      
      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
            
    } else if (particleName == "e+") {
      //positron
      G4eMultipleScattering* msc = new G4eMultipleScattering();
      msc->AddEmModel(0, new G4GoudsmitSaundersonMscModel());      
      pmanager->AddProcess(msc,                       -1, 1, 1);            
      pmanager->AddProcess(new G4eIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4eBremsstrahlung,     -1, 3, 3);
      pmanager->AddProcess(new G4eplusAnnihilation,    0,-1, 4);
            
    } else if (particleName == "mu+" || 
               particleName == "mu-"    ) {
      //muon  
      pmanager->AddProcess(new G4MuMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4MuIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4MuBremsstrahlung,     -1, 3, 3);
      pmanager->AddProcess(new G4MuPairProduction,     -1, 4, 4);
             
    } else if( particleName == "proton" ||
               particleName == "pi-" ||
               particleName == "pi+"    ) {
      //proton  
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
      pmanager->AddProcess(new G4hBremsstrahlung,     -1, 3, 3);
      pmanager->AddProcess(new G4hPairProduction,     -1, 4, 4);       
     
    } else if( particleName == "alpha" || 
               particleName == "He3"    ) {
      //alpha 
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4ionIonisation,       -1, 2, 2);
      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);
            
    } else if( particleName == "GenericIon" ) {
      //Ions 
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      G4ionIonisation* ionIoni = new G4ionIonisation();
      ionIoni->SetEmModel(new G4IonParametrisedLossModel());
      pmanager->AddProcess(ionIoni,                   -1, 2, 2);      
      pmanager->AddProcess(new G4NuclearStopping,     -1, 3,-1);      
      
    } else if ((!particle->IsShortLived()) &&
               (particle->GetPDGCharge() != 0.0) && 
               (particle->GetParticleName() != "chargedgeantino")) {
      //all others charged particles except geantino
      pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
      pmanager->AddProcess(new G4hIonisation,         -1, 2, 2);
    }
  }

  // Em options
  //
  // Main options and setting parameters are shown here.
  // Several of them have default values.
  //
  G4EmProcessOptions emOptions;
  
  //physics tables
  //
  emOptions.SetMinEnergy(100*eV);        //default    
  emOptions.SetMaxEnergy(100*TeV);        //default  
  emOptions.SetDEDXBinning(12*20);        //default=12*7
  emOptions.SetLambdaBinning(12*20);        //default=12*7
  emOptions.SetSplineFlag(true);        //default
      
  //multiple coulomb scattering
  //
  emOptions.SetMscStepLimitation(fUseDistanceToBoundary);  //default=fUseSafety
  emOptions.SetMscRangeFactor(0.04);        //default
  emOptions.SetMscGeomFactor (2.5);        //default       
  emOptions.SetSkin(3.);                //default
      
  //energy loss
  //
  emOptions.SetStepFunction(0.2, 100*um);        //default=(0.2, 1*mm)   
  emOptions.SetLinearLossLimit(1.e-2);                //default
   
  //ionization
  //
  emOptions.SetSubCutoff(false);        //default
}