Message: Re: Add a physics list by use case Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

None Re: Add a physics list by use case 

Keywords: physics lists by use case
Forum: Physics List
Re: None Add a physics list by use case (paolo )
Date: 20 Apr, 2004
From: Jeremy McCormick <Jeremy McCormick>

Hi, Paulo.

Actually, you are not linking with the physics lists by only including them in your Makefile.

To use the hadronic lists, I believe the simplist way is setting them in the main of your application.

For instance, to use QGSP (Quark-Gluon-String Plasma) within your main():

  #include "QGSP.hh"  
   runManager->SetUserInitialization(new QGSP);     

If you look in $G4INSTALL/hadronic_lists/lists, the directories correspond with names of "use case" physics lists you can utilize directly. So the QGSP list from above could be replaced with any of the following:

  LBE
  LHEP
  LHEP_BERT
  LHEP_BERT_HP
  LHEP_BIC
  LHEP_BIC_HP
  LHEP_GN
  LHEP_HP
  LHEP_LEAD
  LHEP_LEAD_HP
  LHEP_PRECO
  LHEP_PRECO_HP
  QGSC
  QGSC_LEAD
  QGSC_LEAD_HP
  QGSP
  QGSP_BERT
  QGSP_BIC
  QGSP_GN
  QGSP_HP

You will need to include the header for each use case you want to make available in your main(). These are found in $G4INSTALL/hadronic_lists/lists/$USECASE/include/$USECASE.hh.

For instance, LHEP's header is hadronic_lists/lists/LHEP/include/LHEP.hh.

Here is an example Makefile that sets up LHEP libraries and headers:

  ifndef G4LISTS_BASE
    EXTRALIBS += -L$(G4LIB)/.lists_build/$(G4SYSTEM)
    G4LISTS_BASE = $(G4INSTALL)/hadronic_lists
  else
    EXTRALIBS += -L$(G4LISTS_BASE)/lists/.lists_build/lib/$(G4SYSTEM)
  endif

  # libs
  EXTRALIBS += -lPackaging
  EXTRALIBS += -lLHEP

  # headers
  CPPFLAGS += -I$(G4LISTS_BASE)/lists/LHEP/include
  CPPFLAGS += -I$(G4LISTS_BASE)/lists/Packaging/include
  CPPFLAGS += -L$(G4LIB)/.lists_build/$(G4SYSTEM)

  # load libs
  LOADLIBS += -lPackaging
  LOADLIBS += -lLHEP

Note that the LHEP and Packaging headers directories are included in the compiler's search path: -I$(G4LISTS_BASE)/lists/LHEP/include.

In the above, both EXTRALIBS and LOADLIBS seem to be required for compilation and linking to work properly on my setup.

For examples on setting up additional use cases, look at hadronic_lists/lists/GNUmakefile.user.code.example, which is what my Makefile is based upon.

If you would like to actually create a custom list for your project, then you need to instantiate and register the specific drivers in your PhysicsList, which inherits from G4VModularPhysicsList:

  PhysicsList::PhysicsList():  G4VModularPhysicsList() {
    RegisterPhysics(  new HadronPhysicsLHEP("hadron"));
  }

Then you would initialize this normally in your main().

I hope that helps.

--JM

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

 Add Message Add Message
to: "Re: Add a physics list by use case"

 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 ]