Presentation is loading. Please wait.

Presentation is loading. Please wait.

Physics Lists Design.

Similar presentations


Presentation on theme: "Physics Lists Design."— Presentation transcript:

1 Physics Lists Design

2 Design choices, my personal opinion
Readability Maintainability try a new option in a new PL variant Model Cross section Consistency checks Have all physics, no duplicates Performance less important

3 G4VModularPhysicsList
Physics list needs to implement using public: // with description // This method will be invoked in the Construct() method. // each particle type will be instantiated virtual void ConstructParticle(); // each physics process will be instantiated and // registered to the process manager of each particle type virtual void ConstructProcess(); void RegisterPhysics(G4VPhysicsConstructor* ); // Replace Physics Constructor // The existing physics constructor with same physics_type as one of // the given physics constructor is replaced // (existing physics will be deleted) // If any corresponding physics constructor is found, // the given physics constructor is just added void ReplacePhysics(G4VPhysicsConstructor* );

4 Hierarchy in constrcuting
Physics list Example FTFP_BERT Checks user environment for needed data Constructs physics using  Physics Constructors HadronPhysicsFTFP_BERT, G4EmStandardPhysics, ….  Physics Builders now only for hadron inelastic

5 An example: HadronPhysicsFTFP_BERT
ConstructProcess: G4NeutronBuilder has processes for Neutron CreateModels() registers (G4VNeutronBuilder) ‘models’ to G4NeutronBuilder G4FTFPNeutronBuilder G4BertiniNeutronBuilder G4LEPNeutronBuilder ( using capture & fission) G4NeutronBuilder::Build() calls Build() for all ‘models’ and physics (elastic,inelastic, capture, fission) and then registers the process with the particle G4LEPNeutronBuilder::Build(G4Hadron”physics” Process) HadronPhysicsFTFP_BERT(G4int verbose =1); HadronPhysicsFTFP_BERT(const G4String& name, G4bool quasiElastic=false); virtual ~HadronPhysicsFTFP_BERT(); public: virtual void ConstructParticle(); virtual void ConstructProcess(); private: void CreateModels(); CreateModels(); (G4NeutronBuilder*) theNeutrons->Build(); thePro->Build(); //may add cross section data sets

6 Strong & weak points Is strongly typed
strong typing in part forces to repeat similar code Some checks on completeness of a physics list Keeps types of physics in one class per particle Forces to implement all physics components This contributes to code repetition as well. Cross sections not handled consistently Cross section added in builder for a model Could be or partially is done in Physics Constructor But HP cross sections are model cross sections, valid over the energy of the model


Download ppt "Physics Lists Design."

Similar presentations


Ads by Google