Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-31 09:22:08

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 //
0027 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class file
0030 //
0031 //
0032 // File name:     G4RDModifiedTsai
0033 //
0034 // Author:        Andreia Trindade (andreia@lip.pt)
0035 //                Pedro Rodrigues  (psilva@lip.pt)
0036 //                Luis Peralta     (luis@lip.pt)
0037 // 
0038 // Creation date: 21 March 2003
0039 //
0040 // Modifications: 
0041 // 21 Mar 2003       A. Trindade    First implementation acording with new design
0042 // 24 Mar 2003                      & Fix in Tsai generator in order to prevent theta generation above pi
0043 //
0044 // Class Description: 
0045 //
0046 // Concrete base class for Bremsstrahlung Angular Distribution Generation - Tsai Model
0047 //
0048 // Class Description: End 
0049 //
0050 // -------------------------------------------------------------------
0051 //
0052 //    
0053 
0054 #include "G4RDModifiedTsai.hh"
0055 #include "Randomize.hh"
0056 #include "G4PhysicalConstants.hh"
0057 //    
0058 
0059 G4RDModifiedTsai::G4RDModifiedTsai(const G4String& name):G4RDVBremAngularDistribution(name)
0060 {;}
0061 
0062 //    
0063 
0064 G4RDModifiedTsai::~G4RDModifiedTsai() 
0065 {;}
0066 
0067 //
0068 
0069 G4double G4RDModifiedTsai::PolarAngle(const G4double initial_energy,
0070                     const G4double, // final_energy
0071                     const G4int ) // Z
0072 {
0073 
0074   // Sample gamma angle (Z - axis along the parent particle).
0075   // Universal distribution suggested by L. Urban (Geant3 manual (1993) 
0076   // Phys211) derived from Tsai distribution (Rev Mod Phys 49,421(1977))
0077 
0078   G4double totalEnergy = initial_energy + electron_mass_c2;   
0079 
0080   const G4double a1 = 0.625, a2 = 3.*a1, d = 27.;
0081   G4double u, theta = 0;
0082 
0083   do{
0084   u = - std::log(G4UniformRand()*G4UniformRand());
0085 
0086   if (9./(9.+d) > G4UniformRand()) u /= a1;
0087   else                             u /= a2;
0088     
0089   theta = u*electron_mass_c2/totalEnergy;
0090   }while(u > (totalEnergy*pi/electron_mass_c2));
0091 
0092   return theta;
0093 }
0094 //
0095 
0096 void G4RDModifiedTsai::PrintGeneratorInformation() const
0097 {
0098 
0099   G4cout << "\n" << G4endl;
0100   G4cout << "Bremsstrahlung Angular Generator is Modified Tsai" << G4endl;
0101   G4cout << "Universal distribution suggested by L. Urban (Geant3 manual (1993) Phys211)" << G4endl;
0102   G4cout << "Derived from Tsai distribution (Rev Mod Phys 49,421(1977)) \n" << G4endl;
0103 }