G4Generator2BS.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 // $Id$
00027 //
00028 // -------------------------------------------------------------------
00029 //
00030 // GEANT4 Class file
00031 //
00032 //
00033 // File name:  G4Generator2BS
00034 //
00035 // Author:     Andreia Trindade (andreia@lip.pt)
00036 //             Pedro Rodrigues  (psilva@lip.pt)
00037 //             Luis Peralta     (luis@lip.pt)
00038 // 
00039 // Creation date: 2 June 2003
00040 //
00041 // Modifications: 
00042 // 02 Jun 2003  First implementation acording with new design
00043 // 12 Oct 2010  V.Ivanchenko moved RejectionFunction inline
00044 //               
00045 //
00046 // Class Description: 
00047 //
00048 // Concrete class for Bremsstrahlung Angular Distribution Generation 
00049 // 2BS Distribution
00050 //
00051 
00052 // -------------------------------------------------------------------
00053 //
00054 
00055 #ifndef G4Generator2BS_h
00056 #define G4Generator2BS_h 1
00057 
00058 #include "G4ios.hh"
00059 #include "globals.hh"
00060 #include "G4VEmAngularDistribution.hh"
00061 
00062 class G4Pow;
00063 
00064 class G4Generator2BS : public G4VEmAngularDistribution
00065 {
00066 
00067 public:
00068 
00069   G4Generator2BS(const G4String& name="");
00070 
00071   virtual ~G4Generator2BS();
00072 
00073   virtual G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
00074                                          G4double out_energy,
00075                                          G4int Z,
00076                                          const G4Material* mat = 0);
00077 
00078   void PrintGeneratorInformation() const;
00079 
00080 protected:
00081 
00082   inline G4double RejectionFunction(G4double value) const;
00083 
00084 private:
00085 
00086   // hide assignment operator 
00087   G4Generator2BS & operator=(const  G4Generator2BS &right);
00088   G4Generator2BS(const  G4Generator2BS&);
00089 
00090   G4double fz;
00091   G4double ratio;
00092   G4double ratio1;
00093   G4double ratio2;
00094   G4double delta;
00095 
00096   G4Pow* g4pow;
00097   G4int  nwarn;
00098 
00099 };
00100 
00101 inline G4double G4Generator2BS::RejectionFunction(G4double y) const
00102 {
00103   G4double y2 = (1 + y)*(1 + y);
00104   G4double x  = 4*y*ratio/y2;
00105   return 4*x - ratio1 - (ratio2 - x)*std::log(delta + fz/y2); 
00106 }
00107 
00108 #endif
00109 

Generated on Mon May 27 17:48:21 2013 for Geant4 by  doxygen 1.4.7