Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /geant4/examples/advanced/eRosita/physics/src/G4RDPhotoElectricAngularGeneratorSauterGavrila.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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:     G4RDPhotoElectricAngularGeneratorSauterGavrila
0033 //
0034 // Creation date: 10 May 2004
0035 //
0036 // Modifications: 
0037 // 10 May 2003     P. Rodrigues    First implementation acording with new design
0038 //
0039 // Class Description: 
0040 //
0041 // Concrete class for PhotoElectric Electron Angular Distribution Generation 
0042 // This model is a re-implementation of the Photolectric angular distribution
0043 // developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect 
0044 //
0045 // Class Description: End 
0046 //
0047 // -------------------------------------------------------------------
0048 //
0049 //    
0050 
0051 #include "G4RDPhotoElectricAngularGeneratorSauterGavrila.hh"
0052 #include "Randomize.hh"
0053 #include "G4PhysicalConstants.hh"
0054 
0055 //    
0056 
0057 G4RDPhotoElectricAngularGeneratorSauterGavrila::G4RDPhotoElectricAngularGeneratorSauterGavrila(const G4String& name):G4RDVPhotoElectricAngularDistribution(name)
0058 {;}
0059 
0060 //    
0061 
0062 G4RDPhotoElectricAngularGeneratorSauterGavrila::~G4RDPhotoElectricAngularGeneratorSauterGavrila() 
0063 {;}
0064 
0065 //
0066 
0067 G4ThreeVector G4RDPhotoElectricAngularGeneratorSauterGavrila::GetPhotoElectronDirection(const G4ThreeVector& direction, const G4double eKineticEnergy, const G4ThreeVector&, const G4int) const
0068 {
0069 
0070   // Compute Theta distribution of the emitted electron, with respect to the
0071   // incident Gamma.
0072   // The Sauter-Gavrila distribution for the K-shell is used. (adapted from G4PhotoElectricEffect)
0073 
0074   G4double costeta = 1.;
0075   G4double Phi     = twopi * G4UniformRand();
0076   G4double cosphi = std::cos(Phi);
0077   G4double sinphi = std::sin(Phi);
0078   G4double sinteta = 0;
0079   G4double gamma   = 1. + eKineticEnergy/electron_mass_c2;
0080 
0081   if (gamma > 5.) {
0082     G4ThreeVector direction (sinteta*cosphi, sinteta*sinphi, costeta);
0083     return direction;
0084   }
0085 
0086   G4double beta  = std::sqrt(gamma*gamma-1.)/gamma;
0087   G4double b     = 0.5*gamma*(gamma-1.)*(gamma-2);
0088     
0089   G4double rndm,term,greject,grejsup;
0090   if (gamma < 2.) grejsup = gamma*gamma*(1.+b-beta*b);
0091   else            grejsup = gamma*gamma*(1.+b+beta*b);
0092   
0093   do { rndm = 1.-2*G4UniformRand();
0094        costeta = (rndm+beta)/(rndm*beta+1.);
0095        term = 1.-beta*costeta;
0096        greject = (1.-costeta*costeta)*(1.+b*term)/(term*term);
0097   } while(greject < G4UniformRand()*grejsup);
0098        
0099 
0100   sinteta = std::sqrt(1.-costeta*costeta);
0101   G4ThreeVector photoelectrondirection (sinteta*cosphi, sinteta*sinphi, costeta);
0102   photoelectrondirection.rotateUz(direction);
0103   return photoelectrondirection;
0104 }
0105 
0106 //
0107 
0108 void G4RDPhotoElectricAngularGeneratorSauterGavrila::PrintGeneratorInformation() const
0109 {
0110   G4cout << "\n" << G4endl;
0111   G4cout << "" << G4endl;
0112   G4cout << "Re-implementation of the photolectric angular distribution" << G4endl;
0113   G4cout << "developed my M. Maire for the Standard EM Physics G4PhotoElectricEffect" << G4endl;
0114   G4cout << "It computes the theta distribution of the emitted electron, with respect to the" << G4endl;
0115   G4cout << "incident Gamma, using the Sauter-Gavrila distribution for the K-shell\n" << G4endl;
0116 }