Message: Re: GEANT470 G4StepLimiter Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: GEANT470 G4StepLimiter 

Keywords: G4StepLimiter
Forum: Physics List
Re: Question GEANT470 G4StepLimiter (Christophe Inguimbert)
Date: 28 Apr, 2005
From: Jeremy McCormick <Jeremy McCormick>

Hi,

A good question, actually.  When enabling step limits and 
range cuts, I had to confer closely with a Geant4 developer
to get all the details right.

In order to use step limits and range cuts, the corresponding 
processes need to be assigned to individual particles first.

Here is how to do it for all particles.

--

G4ParticleTable* ptbl = G4ParticleTable::GetParticleTable();
    
G4ParticleTable::G4PTblDicIterator* piter = ptbl->GetIterator();

G4UserSpecialCuts* cuts = new G4UserSpecialCuts("UserSpecialCuts");
G4StepLimiter* slim = new G4StepLimiter("StepLimiter");    

piter->reset();
while ( (*piter)() ) {
    G4ParticleDefinition* pdef = piter->value();
    G4ProcessManager* pmgr = pdef->GetProcessManager();

    // add user limit processes for steps and special cuts
    if ( pmgr ) {      
        pmgr->AddProcess( slim,
			    -1,
			    -1,
			    3);
      
        pmgr->AddProcess( cuts,
			    -1,
			    -1,
			    4);
    }
}

--

You way want to check G4ParticleDefinition->GetParticleName()
to assign these only to certain particles, e.g. "electron", etc.

Then you can assign step limits to a logical volume 

  aG4LogicalVolume->SetUserLimits( new G4UserLimits( [...] ) );

and range cuts to a region

  aG4Region->SetProductionCuts( new G4ProductionCuts( 1.0*mm ) )

For G4UserLimits arguments, see this Doxygen page.

  http://lcsim.org/software/geant4/doxygen/html/classG4UserLimits.html  

In the future, you will also be able to assign range cuts on the 
logical volume.

Good luck.

--Jeremy

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

1 None: Re: GEANT470 G4StepLimiter   (Makoto Asai - 28 Apr, 2005)
3 None: Re: GEANT470 G4StepLimiter   (Makoto Asai - 28 Apr, 2005)
 Add Message Add Message
to: "Re: GEANT470 G4StepLimiter"

 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 ]