Message: Reference physics lists + StepLimiter Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Reference physics lists + StepLimiter 

Forum: Physics List
Date: 28 Jan, 2010
From: Kyrre Ness Sjøbæk <Kyrre Ness Sjøbæk>

I am trying to make G4StepLimiter work together with the reference physics lists, but it does not seem to work.

To do this, I have defined a G4VPhysicsConstructor as follows:

**Header**

#ifndef StepLimiterBuilder_hh
#define StepLimiterBuilder_hh 1

/*
 * Physics list builder that adds
 * a G4StepLimiter and a G4UserSpecialCuts
 * to the Physics List for all particles defined.
 *
 * This is needed to use UserLimits! 
 *
 * Kyrre Ness Sjøbæk (k.n.sjobak@fys.uio.no)
 * 27/1-2010
 */

#include "G4VPhysicsConstructor.hh"

class StepLimiterBuilder : public G4VPhysicsConstructor {
public:
  StepLimiterBuilder(G4int ver=0, const G4String& name = "StepLimitBuilder");
  virtual ~StepLimiterBuilder();

  virtual void ConstructParticle();
  virtual void ConstructProcess();
private:
  G4int verbose;
};

#endif

** Implementation **

#include "StepLimiterBuilder.hh"
#include "G4StepLimiter.hh"
#include "G4UserSpecialCuts.hh"
#include "G4ProcessManager.hh"

StepLimiterBuilder::StepLimiterBuilder(G4int ver, const G4String& name) :
  G4VPhysicsConstructor(name), verbose(ver) {
}

StepLimiterBuilder::~StepLimiterBuilder(){ }

void StepLimiterBuilder::ConstructParticle(){ }

void StepLimiterBuilder::ConstructProcess(){

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

    if (verbose > 1) {
      G4cout << "### " << GetPhysicsName() << " instantiates for " 
	     << particleName << G4endl;
    }
    // Add user limit processes for steps and special cuts
    // for all registered particles
    pmanager->AddProcess( new G4StepLimiter() );  
    pmanager->AddProcess( new G4UserSpecialCuts() );
  }
}

I have attached this to my physics processes as follows:
/*
 * PhysicsList factory - spits out reference physics lists.
 * This handles phID 11-20
 */
G4VUserPhysicsList* TestBeamSimPhysicsListFactory::CreatePhList(G4int phID, G4double phCut) {

  G4VModularPhysicsList* list = NULL;

  if (phID == 11) {
    //list = new TQGSC<G4VModularPhysicsList>();
    list = new QGSC();
    list->SetDefaultCutValue(phCut);

    G4cout << G4endl
	   << "*** TestBeamSimPhysicsListFactory::CreatePhList(...):"    << G4endl
	   << "\t Physics ID 11 created: QGSC (reference physics list);" << G4endl
	   << "\t Physics default production cut = " << phCut/mm << " [mm] ***"             << G4endl
	   << G4endl;
  }

   // MORE PHYSICS LISTS  

  else {
    G4cout << "Error: In TestBeamSimPhysicsListFactory::CreatePhList(...):" << G4endl
	   << "\t Unknown Physics List ID (" << phID << ")" << G4endl;
    exit(1);
  }

  //Add the step limiter
  list->RegisterPhysics(new StepLimiterBuilder() );

  return list;
}

And I have setup the maximum steplength in the silicon pixel detectors under test + beam telescope as follows:

  //Set limit on maximum step length
  G4double maxStep = TBSmess.GetStepLimitSensor();
  if ( maxStep > 0) {
    LV_BAT_sensor_sensitive -> SetUserLimits(new G4UserLimits(maxStep));
    G4cout << "Setting max steplength = " << maxStep << G4endl;
  }

I can see the printed message when running the program.

However, looking at the output of verbose tracking or output files, it seems to only take one single step in the DUT. This is bad, because I want to have multiple ionization clusters for proper simulation of charge drift/diffusion in the sensors (in a separate digitalization code).

I am using Geant 9.2.p01.

--- Kyrre Ness Sjøbæk

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

1 Note: Re: Reference physics lists + StepLimiter   (Kyrre Ness Sjøbæk - 28 Jan, 2010)
(_ Idea: Re: Reference physics lists + StepLimiter   (Vladimir Ivanchenko - 28 Jan, 2010)
(_ Ok: Re: Reference physics lists + StepLimiter   (Kyrre Ness Sjøbæk - 28 Jan, 2010)
(_ None: Re: Reference physics lists + StepLimiter   (John Allison - 28 Jan, 2010)
(_ More: Re: Reference physics lists + StepLimiter   (Vladimir Ivanchenko - 28 Jan, 2010)
(_ Ok: Re: Reference physics lists + StepLimiter   (Kyrre Ness Sjøbæk - 29 Jan, 2010)
(_ None: Re: Reference physics lists + StepLimiter   (Colin Paul Gloster - 29 Jan, 2010)
 Add Message Add Message
to: "Reference physics lists + StepLimiter"

 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 ]