Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:04

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 #ifndef G4SampleResonance_h
0028 #define G4SampleResonance_h 1
0029 
0030 // ------------------------------------------------------------
0031 //      GEANT 4 class header file
0032 //
0033 //      ---------------- G4SampleResonance ----------------
0034 //             by Henning Weber, March 2001.
0035 //      helper class for sampling resonance masses
0036 // ------------------------------------------------------------
0037 
0038 #include "globals.hh"
0039 #include <map>
0040 #include "G4ParticleDefinition.hh"
0041 #include "G4Log.hh"
0042 
0043 class G4SampleResonance
0044 {
0045 public:
0046 
0047   G4double GetMinimumMass(const G4ParticleDefinition* p) const;
0048   G4double SampleMass(const G4double poleMass, 
0049               const G4double gamma,
0050               const G4double minMass,
0051               const G4double maxMass) const;
0052   G4double SampleMass(const G4ParticleDefinition* p, const G4double maxMass) const;
0053 
0054 private:  
0055 
0056   G4double BrWigInt0(const G4double x, const G4double gamma, const G4double m0) const
0057     { return 2.0*gamma*std::atan( 2.0 * (x-m0)/ gamma  ); }
0058 
0059   G4double BrWigInt1(const G4double x, const G4double gamma, const G4double m0) const
0060     { return 0.5*gamma*gamma*G4Log( (x-m0)*(x-m0)+gamma*gamma/4.0 ) + m0*BrWigInt0(x,gamma,m0); }
0061 
0062   G4double BrWigInv(const G4double x, const G4double gamma, const G4double m0) const
0063     { return 0.5*gamma*std::tan( 0.5*x/gamma )+m0; }
0064 
0065 public:  
0066 
0067   typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> >::const_iterator minMassMapIterator; 
0068   typedef std::map<const G4ParticleDefinition*, G4double, std::less<const G4ParticleDefinition*> > minMassMapType;
0069 
0070 private:
0071 
0072   static G4ThreadLocal minMassMapType *minMassCache_G4MT_TLS_;
0073 
0074 };
0075 
0076 
0077 #endif
0078 
0079 
0080 
0081 
0082 
0083