|
|
|||
File indexing completed on 2026-07-31 09:04:58
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 // G4AdjointPrimaryGenerator 0027 // 0028 // Class description: 0029 // 0030 // This class represents the Primary Generator that generates vertex 0031 // (energy, position and direction) of primary adjoint particles. 0032 // It is used by G4AdjointPrimaryGeneratorAction. If the adjoint source is 0033 // selected by the user as being on the external boundary of a volume, 0034 // it uses the class G4AdjointPosOnPhysVolGenerator to generate the vertex 0035 // positions and directions. Otherwise G4SingleParticleSource is used. 0036 0037 // Author: L. Desorgher, SpaceIT GmbH - November 2009 0038 // Contract: ESA contract 21435/08/NL/AT 0039 // Customer: ESA/ESTEC 0040 // -------------------------------------------------------------------- 0041 #ifndef G4AdjointPrimaryGenerator_hh 0042 #define G4AdjointPrimaryGenerator_hh 1 0043 0044 #include <vector> 0045 #include <map> 0046 #include <iterator> 0047 0048 #include "globals.hh" 0049 #include "G4ThreeVector.hh" 0050 #include"G4PhysicsFreeVector.hh" 0051 0052 class G4AdjointPosOnPhysVolGenerator; 0053 class G4Event; 0054 class G4SingleParticleSource; 0055 class G4ParticleDefinition; 0056 class G4Navigator; 0057 0058 class G4AdjointPrimaryGenerator 0059 { 0060 public: 0061 static G4AdjointPrimaryGenerator* GetInstance(); 0062 0063 0064 public: 0065 0066 G4AdjointPrimaryGenerator(); 0067 ~G4AdjointPrimaryGenerator(); 0068 0069 void GenerateAdjointPrimaryVertex(G4Event* anEvt, 0070 G4ParticleDefinition* adj_part, 0071 G4double E1, G4double E2); 0072 void GenerateFwdPrimaryVertex(G4Event* anEvt, 0073 G4ParticleDefinition* adj_part, 0074 G4double E1, G4double E2); 0075 void SetSphericalAdjointPrimarySource(G4double radius, G4ThreeVector pos); 0076 void SetAdjointPrimarySourceOnAnExtSurfaceOfAVolume(const G4String& v_name); 0077 void ComputeAccumulatedDepthVectorAlongBackRay(G4ThreeVector glob_pos, 0078 G4ThreeVector direction, 0079 G4double ekin, 0080 G4ParticleDefinition* aPDef); 0081 G4double SampleDistanceAlongBackRayAndComputeWeightCorrection(G4double& weight_corr); 0082 0083 private: // attributes 0084 0085 // The class responsible for the random generation of positions 0086 // and direction of primaries for adjoint source set on the external 0087 // surface of a G4 volume 0088 // 0089 //static G4ThreadLocal G4AdjointPrimaryGenerator* theInstance; 0090 G4AdjointPosOnPhysVolGenerator* theG4AdjointPosOnPhysVolGenerator = nullptr; 0091 0092 G4SingleParticleSource* theSingleParticleSource = nullptr; 0093 0094 // Type of adjoint source 0095 // ---------------------- 0096 G4String type_of_adjoint_source; // Spherical ExtSurfaceOfAVolume 0097 G4double radius_spherical_source = 0.0; 0098 G4ThreeVector center_spherical_source; 0099 G4Navigator* fLinearNavigator = nullptr; 0100 G4PhysicsFreeVector* theAccumulatedDepthVector = nullptr; 0101 }; 0102 0103 #endif
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|