Message: Problem Understanding ExN02Physics List Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Problem Understanding ExN02Physics List 

Forum: Documentation and Examples
Date: 23 Jan, 2009
From: <jdswado@yahoo.com>

Hi, I'm learning Geant and was hoping someone here could help me understand what's happening in the following code snippet from the second novice example.

#include "G4StepLimiter.hh"
#include "G4UserSpecialCuts.hh"

void ExN02PhysicsList::AddStepMax()
{
  // Step limitation seen as a process
  G4StepLimiter* stepLimiter = new G4StepLimiter();
  ////G4UserSpecialCuts* userCuts = new G4UserSpecialCuts();

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

      if (particle->GetPDGCharge() != 0.0)
        {
	  pmanager ->AddDiscreteProcess(stepLimiter);
	  ////pmanager ->AddDiscreteProcess(userCuts);
        }
  }
}

I don't understand what is accomplished by this if statement. I think it says: If the charge on the particle is not zero, invoke the normal G4steplimiter and G4userspecialcuts operations. But this doesn't make much since to me, if anyone could help me out with this that would be great.

Thanks, JStewart

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Problem Understanding ExN02Physics List   (michel maire - 24 Jan, 2009)
 Add Message Add Message
to: "Problem Understanding ExN02Physics List"

 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 ]