Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GeneralPhaseSpaceDecay.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 //$Id: G4GeneralPhaseSpaceDecay.hh,v 1.1 1997/05/21
29 // ----------------------------------------------------------------
30 // GEANT 4 class header file
31 //
32 // History: first implementation, A. Feliciello, 20th May 1998
33 //
34 // Note: this class is a generalization of the
35 // G4PhaseSpaceDecayChannel one
36 // ----------------------------------------------------------------
37 #ifndef G4GeneralPhaseSpaceDecay_h
38 #define G4GeneralPhaseSpaceDecay_h 1
39 
40 #include "G4ios.hh"
41 #include "globals.hh"
42 #include "G4VDecayChannel.hh"
43 #include "G4HadronicException.hh"
44 
46 {
47  public:
48  //Constructors
49  G4GeneralPhaseSpaceDecay(G4int Verbose = 1);
50 
51  G4GeneralPhaseSpaceDecay(const G4String& theParentName,
52  G4double theBR,
53  G4int theNumberOfDaughters,
54  const G4String& theDaughterName1,
55  const G4String& theDaughterName2 = "",
56  const G4String& theDaughterName3 = "");
57 
58  G4GeneralPhaseSpaceDecay(const G4String& theParentName,
59  G4double theParentMass,
60  G4double theBR,
61  G4int theNumberOfDaughters,
62  const G4String& theDaughterName1,
63  const G4String& theDaughterName2 = "",
64  const G4String& theDaughterName3 = "");
65 
66  G4GeneralPhaseSpaceDecay(const G4String& theParentName,
67  G4double theParentMass,
68  G4double theBR,
69  G4int theNumberOfDaughters,
70  const G4String& theDaughterName1,
71  const G4String& theDaughterName2 ,
72  const G4String& theDaughterName3 ,
73  const G4double * masses);
74 
75  G4GeneralPhaseSpaceDecay(const G4String& theParentName,
76  G4double theParentMass,
77  G4double theBR,
78  G4int theNumberOfDaughters,
79  const G4String& theDaughterName1,
80  const G4String& theDaughterName2 ,
81  const G4String& theDaughterName3 ,
82  const G4String& theDaughterName4 ,
83  const G4double * masses);
84 
85  // Destructor
86  virtual ~G4GeneralPhaseSpaceDecay();
87 
88  public:
89  G4double GetParentMass() const;
90  void SetParentMass(const G4double aParentMass);
91  virtual G4DecayProducts* DecayIt(G4double mass=0.0);
92  static G4double Pmx(G4double e, G4double p1, G4double p2);
93 
94  protected:
99 
100  private:
101  G4double parentmass;
102  const G4double * theDaughterMasses;
103 
104 };
105 
106 
107 
109 {
110  return parentmass;
111 }
112 
113 inline void G4GeneralPhaseSpaceDecay::SetParentMass(const G4double aParentMass)
114 {
115  parentmass = aParentMass;
116 }
117 
118 
119 
120 inline
122 {
123  // calculate momentum of daughter particles in two-body decay
124  if (e-p1-p2 < 0 )
125  {
126  throw G4HadronicException(__FILE__, __LINE__, "G4GeneralPhaseSpaceDecay::Pmx energy in cms > mass1+mass2");
127  }
128  G4double ppp = (e+p1+p2)*(e+p1-p2)*(e-p1+p2)*(e-p1-p2)/(4.0*e*e);
129  if (ppp>0) return std::sqrt(ppp);
130  else return -1.;
131 }
132 
133 #endif
int G4int
Definition: G4Types.hh:78
virtual G4DecayProducts * DecayIt(G4double mass=0.0)
static G4double Pmx(G4double e, G4double p1, G4double p2)
double G4double
Definition: G4Types.hh:76
void SetParentMass(const G4double aParentMass)