Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // >> 26 // $Id: G4Generator2BS.hh,v 1.5 2010-10-14 14:00:29 vnivanch Exp $ >> 27 // GEANT4 tag $Name: not supported by cvs2svn $ 26 // 28 // 27 // ------------------------------------------- 29 // ------------------------------------------------------------------- 28 // 30 // 29 // GEANT4 Class file 31 // GEANT4 Class file 30 // 32 // 31 // 33 // 32 // File name: G4Generator2BS 34 // File name: G4Generator2BS 33 // 35 // 34 // Author: Andreia Trindade (andreia@lip.p 36 // Author: Andreia Trindade (andreia@lip.pt) 35 // Pedro Rodrigues (psilva@lip.pt 37 // Pedro Rodrigues (psilva@lip.pt) 36 // Luis Peralta (luis@lip.pt) 38 // Luis Peralta (luis@lip.pt) 37 // 39 // 38 // Creation date: 2 June 2003 40 // Creation date: 2 June 2003 39 // 41 // 40 // Modifications: 42 // Modifications: 41 // 02 Jun 2003 First implementation acording 43 // 02 Jun 2003 First implementation acording with new design 42 // 12 Oct 2010 V.Ivanchenko moved RejectionFu 44 // 12 Oct 2010 V.Ivanchenko moved RejectionFunction inline 43 // 45 // 44 // 46 // 45 // Class Description: 47 // Class Description: 46 // 48 // 47 // Concrete class for Bremsstrahlung Angular D 49 // Concrete class for Bremsstrahlung Angular Distribution Generation 48 // 2BS Distribution 50 // 2BS Distribution 49 // 51 // 50 52 51 // ------------------------------------------- 53 // ------------------------------------------------------------------- 52 // 54 // 53 55 54 #ifndef G4Generator2BS_h 56 #ifndef G4Generator2BS_h 55 #define G4Generator2BS_h 1 57 #define G4Generator2BS_h 1 56 58 57 #include "G4ios.hh" 59 #include "G4ios.hh" 58 #include "globals.hh" 60 #include "globals.hh" 59 #include "G4VEmAngularDistribution.hh" << 61 #include "G4VBremAngularDistribution.hh" 60 #include "G4Log.hh" << 61 62 62 class G4Pow; 63 class G4Pow; 63 64 64 class G4Generator2BS : public G4VEmAngularDist << 65 class G4Generator2BS : public G4VBremAngularDistribution 65 { 66 { 66 67 67 public: 68 public: 68 69 69 explicit G4Generator2BS(const G4String& name << 70 G4Generator2BS(const G4String& name=""); 70 71 71 virtual ~G4Generator2BS(); 72 virtual ~G4Generator2BS(); 72 73 73 G4ThreeVector& SampleDirection(const G4Dynam << 74 G4double PolarAngle(const G4double initial_energy, 74 G4double out_energy, << 75 const G4double final_energy, 75 G4int Z, << 76 const G4int Z); 76 const G4Material* mat = nullptr) over << 77 77 78 void PrintGeneratorInformation() const overr << 78 void PrintGeneratorInformation() const; 79 << 80 G4Generator2BS & operator=(const G4Generato << 81 G4Generator2BS(const G4Generator2BS&) = del << 82 79 83 protected: 80 protected: >> 81 84 inline G4double RejectionFunction(G4double v 82 inline G4double RejectionFunction(G4double value) const; 85 83 86 private: 84 private: >> 85 >> 86 G4double z; >> 87 G4double rejection_argument1, rejection_argument2, rejection_argument3; >> 88 G4double EnergyRatio; >> 89 87 G4Pow* g4pow; 90 G4Pow* g4pow; 88 << 89 G4double fz; << 90 G4double ratio; << 91 G4double ratio1; << 92 G4double ratio2; << 93 G4double delta; << 94 91 95 G4int nwarn; << 92 // hide assignment operator >> 93 G4Generator2BS & operator=(const G4Generator2BS &right); >> 94 G4Generator2BS(const G4Generator2BS&); 96 95 97 }; 96 }; 98 97 99 inline G4double G4Generator2BS::RejectionFunct << 98 inline G4double G4Generator2BS::RejectionFunction(G4double value) const 100 { 99 { 101 G4double y2 = (1 + y)*(1 + y); << 100 G4double argument = (1+value)*(1+value); 102 G4double x = 4*y*ratio/y2; << 101 return (4+std::log(rejection_argument3+(z/argument)))* 103 return 4*x - ratio1 - (ratio2 - x)*G4Log(del << 102 ((4*EnergyRatio*value/argument)-rejection_argument1)+rejection_argument2; 104 } 103 } 105 104 106 #endif 105 #endif 107 106 108 107