12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

User ActionsExample 6.2. G4VUserPhysicsListclass G4VUserPhysicsList{public:G4VUserPhysicsList();virtual ~G4VUserPhysicsList();public: // with description// By calling the "Construct" method,// particles and processes are createdvoid Construct();protected: // with description// These two methods of ConstructParticle() and ConstructProcess()// will be invoked in the Construct() method.// each particle type will be instantiatedvirtual void ConstructParticle() = 0;// each physics process will be instantiated and// registered to the process manager of each particle typevirtual void ConstructProcess() = 0;protected: // with description// User must invoke this method in his ConstructProcess()// implementation in order to insures particle transportation.// !! Caution: this class must not be overriden !!void AddTransportation();/////////////////////////////////////////////////////////////////public: // with description// "SetCuts" method sets a cut value <strong>for</strong> all particle types// in the particle tablevirtual void SetCuts() = 0;public: // with description// set/get the default cut value// Calling SetDefaultCutValue causes re-calcuration of cut values// and physics tables just be<strong>for</strong>e the next event loopvoid SetDefaultCutValue(G4double newCutValue);G4double GetDefaultCutValue() const;/////////////////////////////////////////////////////////////////////public: // with description// Invoke BuildPhysicsTable <strong>for</strong> all processes <strong>for</strong> all particles// In case of "Retrieve" flag is ON, PhysicsTable will be// retrieved from filesvoid BuildPhysicsTable();// do BuildPhysicsTable <strong>for</strong> specified particle typevoid BuildPhysicsTable(G4ParticleDefinition* );// Store PhysicsTable together with both material and cut value// in<strong>for</strong>mation in files under the specified directory.// (return true if files are sucessfully created)G4bool StorePhysicsTable(const G4String& directory = ".");// Return true if "Retrieve" flag is ON.// (i.e. PhysicsTable will be retrieved from files)G4bool IsPhysicsTableRetrieved() const;G4bool IsStoredInAscii() const;// Get directory path <strong>for</strong> physics table files.const G4String& GetPhysicsTableDirectory() const;// Set "Retrieve" flag// Directory path can be set together.// Null string (default) means directory is not changed// from the current valuevoid SetPhysicsTableRetrieved(const G4String& directory = "");void SetStoredInAscii();// Reset "Retrieve" flagvoid ResetPhysicsTableRetrieved();196

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!