Exemplo n.º 1
0
void Geant4ExtraParticles::constructProcess(Constructor& ctor) {
  G4ParticleTable::G4PTblDicIterator* ParticleIterator = ctor.particleIterator();
#if G4VERSION_NUMBER < 940
  if ( 0 == _scatter ) _scatter=new G4hMultipleScattering();
  if ( 0 == _ionise ) _ionise=new G4hIonisation()
  if ( 0 == _decay ) _decay=new G4Decay()
#endif
  while((*ParticleIterator)()) {
    G4ParticleDefinition* pdef = ParticleIterator->value();
    G4ProcessManager* pmgr = pdef->GetProcessManager();
    if (pdef->GetParticleType() == "extra") {
      if (pdef->GetPDGCharge() != 0) {
#if G4VERSION_NUMBER < 940
        pmgr->AddProcess(_scatter, -1,  1, 1); // multiple scattering
        pmgr->AddProcess(_ionise,  -1,  2, 2); // ionisation
        pmgr->AddProcess(_decay,   -1, -1, 2); // decay
#else
        pmgr->AddProcess(new G4hMultipleScattering(), -1,  1, 1); //multiple scattering
        pmgr->AddProcess(new G4hIonisation(),  -1,  2, 2); // ionisation
        pmgr->AddProcess(new G4Decay(),   -1, -1, 2); // decay 
#endif

      } else {

#if G4VERSION_NUMBER < 940
        pmgr->AddProcess(_scatter=new G4hMultipleScattering(), -1,  1, 1); // multiple scattering
        pmgr->AddProcess(_decay=new G4Decay(),   -1, -1, 2); // decay
#else
        //	pmgr->AddProcess(new G4hMultipleScattering(), -1,  1, 1); // multiple scattering
        pmgr->AddProcess(new G4Decay(),   -1, -1, 2); // decay 
#endif

      }
    }
  }
}
Exemplo n.º 2
0
G4bool FastSimModelTracker::IsApplicable(const G4ParticleDefinition& aParticleType) {
  return aParticleType.GetPDGCharge() != 0;
}
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);
}
Exemplo n.º 4
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
}