Message: ADDING EXTRA PHYSICS TO THE PHYSICS LISTS Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback ADDING EXTRA PHYSICS TO THE PHYSICS LISTS 

Keywords: How to get extra physics in the pre-packaged physics lists
Forum: Physics List
Date: 23 Mar, 2004
From: Wellisch, J.P. <Wellisch, J.P.>

Hi folks,

  due to popular request, here for more general consumption:

A number of people ended up in a situation, where they were quite happy with the pre-packaged "educated guess" physics lists for what these do, but they needed to add something extra.

The simplest way is to write a physics constructor, inheriting from G4VPhysicsConstructor (let's call it MyAdditionalPhysics for the sake of this discussion), that constructs for example the Cerencov process, and registers it with the process managers in the particles for which you want Cerencov radiation.

Then, in your main, you can simply use the RegisterPhysics interface of ModularPhysicsList to register this.

Many greetings,

Hans-Peter.

P.S.: A few code snippets:

#ifndef MyAdditionalPhysics_hh
#define MyAdditionalPhysics_hh

class MyAdditionalPhysics : public G4VPhysicsConstructor
{
  public:
    MyAdditionalPhysics(G4String aS) : G4VPhysicsConstructor(aS) {}
    virtual void ConstructParticle() 
    {
     // here we do nothing - or may be optical photons?
    }
    virtual void ConstructProcess() 
    {
     // here we can construct and register Cerencov and other stuff.
     // Make sure nothing is there twice, though !!!
    }

  private:

};

#endif

and from the main:

...etc...

#include "MyAdditionalPhysics.hh"

...etc...

  QGSP * theQGSP = new QGSP;
  theQGSP->RegisterPhysics(new MyAdditionalPhysics("Cerencov") );
  runManager->SetUserInitialization(theQGSP);

...etc...

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

 Add Message Add Message
to: "ADDING EXTRA PHYSICS TO THE PHYSICS LISTS"

 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 ]