![]() |
|
|||
File indexing completed on 2025-02-23 09:20:44
0001 // 0002 // ******************************************************************** 0003 // * License and Disclaimer * 0004 // * * 0005 // * The Geant4 software is copyright of the Copyright Holders of * 0006 // * the Geant4 Collaboration. It is provided under the terms and * 0007 // * conditions of the Geant4 Software License, included in the file * 0008 // * LICENSE and available at http://cern.ch/geant4/license . These * 0009 // * include a list of copyright holders. * 0010 // * * 0011 // * Neither the authors of this software system, nor their employing * 0012 // * institutes,nor the agencies providing financial support for this * 0013 // * work make any representation or warranty, express or implied, * 0014 // * regarding this software system or assume any liability for its * 0015 // * use. Please see the license in the file LICENSE and URL above * 0016 // * for the full disclaimer and the limitation of liability. * 0017 // * * 0018 // * This code implementation is the result of the scientific and * 0019 // * technical work of the GEANT4 collaboration. * 0020 // * By using, copying, modifying or distributing the software (or * 0021 // * any work based on the software) you agree to acknowledge its * 0022 // * use in resulting scientific publications, and indicate your * 0023 // * acceptance of all terms of the Geant4 Software license. * 0024 // ******************************************************************** 0025 // 0026 /// \file GB01/include/GB01BOptrMultiParticleChangeCrossSection.hh 0027 /// \brief Definition of the GB01BOptrMultiParticleChangeCrossSection class 0028 // 0029 //----------------------------------------------------------------- 0030 // 0031 // GB01BOptrMultiParticleChangeCrossSection 0032 // 0033 // Class Description: 0034 // A G4VBiasingOperator concrete implementation example to 0035 // illustrate how an operator can make use of an other operator. 0036 // In the present case, the GB01BOptrChangeCrossSection 0037 // operator, that is made to bias processes of one particle 0038 // type is instancied several times, one for each particle type 0039 // to bias. 0040 // 0041 //----------------------------------------------------------------- 0042 // 0043 0044 #ifndef GB01BOptrMultiParticleChangeCrossSection_hh 0045 #define GB01BOptrMultiParticleChangeCrossSection_hh 1 0046 0047 #include "G4VBiasingOperator.hh" 0048 class GB01BOptrChangeCrossSection; 0049 class G4ParticleDefinition; 0050 0051 #include <map> 0052 0053 class GB01BOptrMultiParticleChangeCrossSection : public G4VBiasingOperator 0054 { 0055 public: 0056 GB01BOptrMultiParticleChangeCrossSection(); 0057 virtual ~GB01BOptrMultiParticleChangeCrossSection() {} 0058 0059 // --------------------------------- 0060 // -- Method specific to this class: 0061 // --------------------------------- 0062 // -- Each particle type for which its name is passed will be biased; *provided* 0063 // -- that the proper calls to biasingPhysics->Bias(particleName) have been done 0064 // -- in the main program. 0065 void AddParticle(G4String particleName); 0066 0067 private: 0068 // ----------------------------- 0069 // -- Mandatory from base class: 0070 // ----------------------------- 0071 // -- This method returns a biasing operation that will bias the physics process occurence: 0072 virtual G4VBiasingOperation* 0073 ProposeOccurenceBiasingOperation(const G4Track* track, 0074 const G4BiasingProcessInterface* callingProcess); 0075 // -- Methods not used: 0076 virtual G4VBiasingOperation* ProposeFinalStateBiasingOperation(const G4Track*, 0077 const G4BiasingProcessInterface*) 0078 { 0079 return 0; 0080 } 0081 virtual G4VBiasingOperation* ProposeNonPhysicsBiasingOperation(const G4Track*, 0082 const G4BiasingProcessInterface*) 0083 { 0084 return 0; 0085 } 0086 0087 private: 0088 // -- ("using" is to avoid compiler complaining against (false) method shadowing.) 0089 using G4VBiasingOperator::OperationApplied; 0090 0091 // -- Optionnal base class method implementation. 0092 // -- This method is called to inform the operator that a proposed operation has been applied. 0093 // -- In the present case, it means that a physical interaction occured (interaction at 0094 // -- PostStepDoIt level): 0095 virtual void OperationApplied(const G4BiasingProcessInterface* callingProcess, 0096 G4BiasingAppliedCase biasingCase, 0097 G4VBiasingOperation* occurenceOperationApplied, 0098 G4double weightForOccurenceInteraction, 0099 G4VBiasingOperation* finalStateOperationApplied, 0100 const G4VParticleChange* particleChangeProduced); 0101 0102 public: 0103 // -- Optionnal base class method. It is called at the time a tracking of a particle starts: 0104 void StartTracking(const G4Track* track); 0105 0106 private: 0107 // -- List of associations between particle types and biasing operators: 0108 std::map<const G4ParticleDefinition*, GB01BOptrChangeCrossSection*> fBOptrForParticle; 0109 std::vector<const G4ParticleDefinition*> fParticlesToBias; 0110 GB01BOptrChangeCrossSection* fCurrentOperator; 0111 0112 // -- count number of biased interations for current track: 0113 G4int fnInteractions; 0114 }; 0115 0116 #endif
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
![]() ![]() |