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

Ok Re: Reference physics lists + StepLimiter 

Forum: Physics List
Re: None Reference physics lists + StepLimiter (Kyrre Ness Sjøbæk)
Re: Note Re: Reference physics lists + StepLimiter (Kyrre Ness Sjøbæk)
Re: Idea Re: Reference physics lists + StepLimiter (Vladimir Ivanchenko)
Date: 28 Jan, 2010
From: Kyrre Ness Sjøbæk <Kyrre Ness Sjøbæk>

Thank you for your quick and useful reply, I now got it to work. Was the primary error that I used AddProcess(...) instead of AddDiscreteProcess (...) ?

For later reference, the code used is:

StepLimiterBuilder.hh:

#ifndef StepLimiterBuilder_hh
#define StepLimiterBuilder_hh 1

/*
 * Physics list builder that adds
 * a G4StepLimiter to the Physics List
 * for charged particles.
 *
 * This is needed to use UserLimits! 
 *
 * Kyrre Ness Sjøbæk (k.n.sjobak ÆTT 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

StepLimiterBuilder.cc:

#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();

    // Add user limit processes for steps and special cuts
    // for all charged "stable" particles
    if (particle->GetPDGCharge() != 0.0 && ! particle->IsShortLived() ) {
      if (verbose > 1) {
	G4cout << "### " << GetPhysicsName() << " instantiates for " 
	       << particleName << G4endl;
      }

      pmanager->AddDiscreteProcess( new G4StepLimiter() );  
    }

    //pmanager->AddDiscreteProcess( new G4UserSpecialCuts() );
  }
}

Is there any reason such a builder is not already included in the Geant distribution (or is it?)?

I found G4PhysListFactory about five minutes after implementing my own - but then I would have to reprogram some other parts of the program - it works for now. It would be great if these physics lists where advertised more in Application Developers users guide.

About digitalization:

Do you then (in the digitalization code) uniformly (?) distribute a finite number of charge clusters between each set of pre- and postStepPoint(s) inside the silicon volume - and the calculate how each of these clusters deposits their energy on readout pads, and then thresholds and other electronics stuff? Do you assume that each charge-cloud is deposited separately, without interference from each other?

Where do I find this helper class?

What I have been trying to do is to approximate a continuous deposition by using many small steps. But what you describe her seems like a really nice way to do it - the more I think about it, the nicer it seems :)

How do you decide how many clouds to deposit?

Maybe we should discuss this off-line...

--- Kyrre Ness Sjøbæk

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

1 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: "Re: 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 ]