G4GeneralPhaseSpaceDecay.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 //$Id: G4GeneralPhaseSpaceDecay.hh,v 1.1 1997/05/21
00029 // ----------------------------------------------------------------
00030 //      GEANT 4 class header file
00031 //
00032 //      History: first implementation, A. Feliciello, 20th May 1998
00033 //
00034 //      Note: this class is a generalization of the 
00035 //            G4PhaseSpaceDecayChannel one
00036 // ----------------------------------------------------------------
00037 #ifndef G4GeneralPhaseSpaceDecay_h
00038 #define G4GeneralPhaseSpaceDecay_h 1
00039 
00040 #include "G4ios.hh"
00041 #include "globals.hh"
00042 #include "G4VDecayChannel.hh"
00043 #include "G4HadronicException.hh"
00044 
00045 class G4GeneralPhaseSpaceDecay : public G4VDecayChannel
00046 {
00047   public:
00048     //Constructors 
00049       G4GeneralPhaseSpaceDecay(G4int Verbose = 1);
00050 
00051       G4GeneralPhaseSpaceDecay(const G4String& theParentName,
00052                                G4double        theBR,
00053                                G4int           theNumberOfDaughters,
00054                                const G4String& theDaughterName1,
00055                                const G4String& theDaughterName2 = "",
00056                                const G4String& theDaughterName3 = "");
00057 
00058       G4GeneralPhaseSpaceDecay(const G4String& theParentName,
00059                                G4double        theParentMass,
00060                                G4double        theBR,
00061                                G4int           theNumberOfDaughters,
00062                                const G4String& theDaughterName1,
00063                                const G4String& theDaughterName2 = "",
00064                                const G4String& theDaughterName3 = "");
00065 
00066       G4GeneralPhaseSpaceDecay(const G4String& theParentName,
00067                                G4double        theParentMass,
00068                                G4double        theBR,
00069                                G4int           theNumberOfDaughters,
00070                                const G4String& theDaughterName1,
00071                                const G4String& theDaughterName2 ,
00072                                const G4String& theDaughterName3 ,
00073                                const G4double * masses);
00074 
00075     //  Destructor
00076       virtual ~G4GeneralPhaseSpaceDecay();
00077 
00078   public:
00079      G4double GetParentMass() const;
00080      void SetParentMass(const G4double aParentMass);
00081      virtual G4DecayProducts* DecayIt(G4double mass=0.0);   
00082      static G4double Pmx(G4double e, G4double p1, G4double p2);
00083 
00084   protected:
00085      G4DecayProducts* OneBodyDecayIt();
00086      G4DecayProducts* TwoBodyDecayIt();
00087      G4DecayProducts* ThreeBodyDecayIt();
00088      G4DecayProducts* ManyBodyDecayIt();
00089      
00090   private:
00091      G4double parentmass;
00092      const G4double * theDaughterMasses;
00093     
00094 };  
00095 
00096 
00097 
00098 inline G4double G4GeneralPhaseSpaceDecay::GetParentMass() const
00099 {
00100   return parentmass;
00101 }
00102 
00103 inline void G4GeneralPhaseSpaceDecay::SetParentMass(const G4double aParentMass)
00104 {
00105   parentmass = aParentMass;
00106 }
00107 
00108 
00109 
00110 inline
00111  G4double G4GeneralPhaseSpaceDecay::Pmx(G4double e, G4double p1, G4double p2)
00112 {
00113    // calculate momentum of daughter particles in two-body decay
00114    if (e-p1-p2 < 0 )
00115    {  
00116         G4HadronicException(__FILE__, __LINE__, "G4GeneralPhaseSpaceDecay::Pmx energy in cms > mass1+mass2");   
00117    }
00118    G4double ppp = (e+p1+p2)*(e+p1-p2)*(e-p1+p2)*(e-p1-p2)/(4.0*e*e);
00119    if (ppp>0) return std::sqrt(ppp);
00120    else       return -1.;
00121 }
00122 
00123 #endif

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