Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:20

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:  G4Generator2BS
0033 //
0034 // Author:     Andreia Trindade (andreia@lip.pt)
0035 //             Pedro Rodrigues  (psilva@lip.pt)
0036 //             Luis Peralta     (luis@lip.pt)
0037 // 
0038 // Creation date: 2 June 2003
0039 //
0040 // Modifications: 
0041 // 02 Jun 2003  First implementation acording with new design
0042 // 12 Oct 2010  V.Ivanchenko moved RejectionFunction inline
0043 //               
0044 //
0045 // Class Description: 
0046 //
0047 // Concrete class for Bremsstrahlung Angular Distribution Generation 
0048 // 2BS Distribution
0049 //
0050 
0051 // -------------------------------------------------------------------
0052 //
0053 
0054 #ifndef G4Generator2BS_h
0055 #define G4Generator2BS_h 1
0056 
0057 #include "G4ios.hh"
0058 #include "globals.hh"
0059 #include "G4VEmAngularDistribution.hh"
0060 #include "G4Log.hh"
0061 
0062 class G4Pow;
0063 
0064 class G4Generator2BS : public G4VEmAngularDistribution
0065 {
0066 
0067 public:
0068 
0069   explicit G4Generator2BS(const G4String& name="");
0070 
0071   virtual ~G4Generator2BS();
0072 
0073   G4ThreeVector& SampleDirection(const G4DynamicParticle* dp,
0074                  G4double out_energy,
0075                  G4int Z,
0076                  const G4Material* mat = nullptr) override;
0077 
0078   void PrintGeneratorInformation() const override;
0079 
0080   G4Generator2BS & operator=(const  G4Generator2BS &right)= delete;
0081   G4Generator2BS(const  G4Generator2BS&) = delete;
0082 
0083 protected:
0084   inline G4double RejectionFunction(G4double value) const;
0085 
0086 private:
0087   G4Pow* g4pow;
0088   
0089   G4double fz;
0090   G4double ratio;
0091   G4double ratio1;
0092   G4double ratio2;
0093   G4double delta;
0094 
0095   G4int  nwarn;
0096 
0097 };
0098 
0099 inline G4double G4Generator2BS::RejectionFunction(G4double y) const
0100 {
0101   G4double y2 = (1 + y)*(1 + y);
0102   G4double x  = 4*y*ratio/y2;
0103   return 4*x - ratio1 - (ratio2 - x)*G4Log(delta + fz/y2); 
0104 }
0105 
0106 #endif
0107