G4SampleResonance.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 //
00027 //
00028 
00029 #ifndef G4SampleResonance_h
00030 #define G4SampleResonance_h 1
00031 
00032 // ------------------------------------------------------------
00033 //      GEANT 4 class header file
00034 //
00035 //      ---------------- G4SampleResonance ----------------
00036 //             by Henning Weber, March 2001.
00037 //      helper class for sampling resonance masses
00038 // ------------------------------------------------------------
00039 
00040 #include "globals.hh"
00041 #include <map>
00042 #include "G4ParticleDefinition.hh"
00043 
00044 
00045 class G4SampleResonance
00046 {
00047 public:
00048 
00049   G4double GetMinimumMass(const G4ParticleDefinition* p) const;
00050   G4double SampleMass(const G4double poleMass, 
00051                       const G4double gamma,
00052                       const G4double minMass,
00053                       const G4double maxMass) const;
00054   G4double SampleMass(const G4ParticleDefinition* p, const G4double maxMass) const;
00055 
00056 private:  
00057 
00058   G4double BrWigInt0(const G4double x, const G4double gamma, const G4double m0) const
00059     { return 2.0*gamma*std::atan( 2.0 * (x-m0)/ gamma  ); }
00060 
00061   G4double BrWigInt1(const G4double x, const G4double gamma, const G4double m0) const
00062     { return 0.5*gamma*gamma*std::log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
00063 
00064   G4double BrWigInv(const G4double x, const G4double gamma, const G4double m0) const
00065     { return 0.5*gamma*std::tan( 0.5*x/gamma )+m0; }
00066 
00067 public:  
00068 
00069   typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> >::const_iterator minMassMapIterator; 
00070   typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> > minMassMapType;
00071 
00072 private:
00073 
00074   static minMassMapType minMassCache;
00075 
00076 };
00077 
00078 
00079 #endif
00080 
00081 
00082 
00083 
00084 
00085 

Generated on Mon May 27 17:49:47 2013 for Geant4 by  doxygen 1.4.7