Message: Energy deposited and interactions within a box (random isotropic emission with GPS method) Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Question Energy deposited and interactions within a box (random isotropic emission with GPS method) 

Forum: Particles
Date: 06 Jun, 2014
From: Pierre <Pierre>

Hello G4users,

1) I would like to simulate a radiative environment around a box with the GPS method. Then I would like to know the energy deposited by the crossing particles in the box. I derived the B3 example in order to do that.

==> the problem is : my program doesn't succeed to extract the energy deposited/dose from the run. It always return the 0 value for these two parameters.

2) The second thing is that I would like to simulate all the interactions created by the crossing particles in the box. So I used the G4VModularPhysicsList() in the but I don't know exactly how to manipulate it.

==> the 3D simulation doesn't produce the traces of the interactions inside the box.

I am really blocked on this problem and I would really appreciate some help of the community.

Thank you in advance !

Here is the part of the code which can cause the problem (for more information see the attached files):

-------------Detector Construction-------------------------

void DetectorConstruction::ConstructSDandField() {


G4MultiFunctionalDetector* detector_ed = new G4MultiFunctionalDetector("detector_ed"); G4VPrimitiveScorer* ed = new G4PSEnergyDeposit("energy_deposited"); detector_ed->RegisterPrimitive(ed); SetSensitiveDetector("Box",detector_ed);

G4MultiFunctionalDetector* detector_dd = new G4MultiFunctionalDetector("detector_dd"); G4VPrimitiveScorer* dd = new G4PSDoseDeposit("dose_deposited"); detector_dd->RegisterPrimitive(dd); SetSensitiveDetector("Box",detector_dd);


---------------------Primary Generator Action---------------------------

  : G4VUserPrimaryGeneratorAction(),
  gun = new G4GeneralParticleSource();

  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
  G4ParticleDefinition* particle = particleTable->FindParticle("mu-");


G4GeneralParticleSource* PrimaryGeneratorAction::InitializeGPS()
  G4GeneralParticleSource* gps = new G4GeneralParticleSource();

  // particle type
  G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
  G4ParticleDefinition* muon = particleTable->FindParticle("mu-");  

  // set energy distribution
  G4SPSEneDistribution* energy_distribution = gps->GetCurrentSource()->GetEneDist() ;
  energy_distribution->SetEnergyDisType("Mono"); // or Gauss

  return gps; 

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
  G4ParticleDefinition* particle = gun->GetParticleDefinition();

  // Creating the primary vertex: The current event must be passed as argument.


---------------------Physics List---------------------------

:  G4VModularPhysicsList()

  defaultCutValue = 10.0*um;

  // use only the EM physics builder
  RegisterPhysics(new G4EmStandardPhysics());
  // Default physics
  RegisterPhysics(new G4DecayPhysics());
  // Radioactive decay
  RegisterPhysics(new G4RadioactiveDecayPhysics());


void PhysicsList::ConstructParticle()
  // Construct Muons
  G4LeptonConstructor pLeptonConstructor;


void PhysicsList::ConstructEM() {

   // Get the process manager for muon
  G4ParticleDefinition* particle = G4MuonMinus::MuonMinusDefinition(); 
  G4ProcessManager* pmanager = particle->GetProcessManager();

  // Construct processes for muon
  G4MuIonisation* theMuIonisation = new G4MuIonisation();      
  G4CoulombScattering* theCoulombScattering = new G4CoulombScattering();

  // Register processes to muon's process manager


void PhysicsList::ConstructProcess()
  ConstructEM() ;

void PhysicsList::SetCuts()
  G4VUserPhysicsList::SetCuts() ;


 Add Message Add Message
to: "Energy deposited and interactions within a box (random isotropic emission with GPS method)"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]