00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
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
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
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
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