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.

Toolkit Fundamentals...G4RadioactiveDecay* theRadioactiveDecay =new G4RadioactiveDecay();}G4ProcessManager* pmanager = ...pmanager ->AddProcess(theRadioactiveDecay);...The biasing can be controlled either in compiled code or through interactive commands. Extensive documentationcan be found in Radioactive decay biasing example and Radioactive decay biasing .Radioactive decay biasing examples are also distributed with the <strong>Geant4</strong> distribution in examples/extended/radioactivedecay/exrdm.3.7.2.1.3. Hadronic Leading Particle BiasingOne hadronic leading particle biasing technique is implemented in the G4HadLeadBias utility. This method keepsonly the most important part of the event, as well as representative tracks of each given particle type. So the trackwith the highest energy as well as one of each of Baryon, pi0, mesons and leptons. As usual, appropriate weightsare assigned to the particles. Setting the SwitchLeadBiasOn environmental variable will activate this utility.3.7.2.1.4. Hadronic Cross Section BiasingCross section biasing artificially enhances/reduces the cross section of a process. This may be useful <strong>for</strong> studyingthin layer interactions or thick layer shielding. The built in hadronic cross section biasing applies to photoninelastic, electron nuclear and positron nuclear processes.The biasing is controlled through the BiasCrossSectionByFactor method in G4HadronicProcess, as demonstratedbelow.void MyPhysicsList::ConstructProcess(){...G4ElectroNuclearReaction * theElectroReaction =new G4ElectroNuclearReaction;G4ElectronNuclearProcess theElectronNuclearProcess;theElectronNuclearProcess.RegisterMe(theElectroReaction);theElectronNuclearProcess.BiasCrossSectionByFactor(100);}pManager->AddDiscreteProcess(&theElectronNuclearProcess);...3.7.2.2. G4WrapperProcessG4WrapperProcess can be used to implement user defined event biasing. G4WrapperProcess, which is a processitself, wraps an existing process. By default, all function calls are <strong>for</strong>wared to the wrapped process. It is a noninvasiveway to modify the behaviour of an existing process.To use this utility, first create a derived class inheriting from G4WrapperProcess. Override the methods whosebehaviour you would like to modify, <strong>for</strong> example, PostStepDoIt, and register the derived class in place of theprocess to be wrapped. Finally, register the wrapped process with G4WrapperProcess. The code snippets belowdemonstrate its use.class MyWrapperProcess : public G4WrapperProcess {...G4VParticleChange* PostStepDoIt(const G4Track& track,const G4Step& step) {// Do something interesting}};void MyPhysicsList::ConstructProcess()59

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

Saved successfully!

Ooh no, something went wrong!