Geant4  9.6.p02
 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  // Destructor
76  virtual ~G4GeneralPhaseSpaceDecay();
77 
78  public:
79  G4double GetParentMass() const;
80  void SetParentMass(const G4double aParentMass);
81  virtual G4DecayProducts* DecayIt(G4double mass=0.0);
82  static G4double Pmx(G4double e, G4double p1, G4double p2);
83 
84  protected:
89 
90  private:
91  G4double parentmass;
92  const G4double * theDaughterMasses;
93 
94 };
95 
96 
97 
99 {
100  return parentmass;
101 }
102 
103 inline void G4GeneralPhaseSpaceDecay::SetParentMass(const G4double aParentMass)
104 {
105  parentmass = aParentMass;
106 }
107 
108 
109 
110 inline
112 {
113  // calculate momentum of daughter particles in two-body decay
114  if (e-p1-p2 < 0 )
115  {
116  G4HadronicException(__FILE__, __LINE__, "G4GeneralPhaseSpaceDecay::Pmx energy in cms > mass1+mass2");
117  }
118  G4double ppp = (e+p1+p2)*(e+p1-p2)*(e-p1+p2)*(e-p1-p2)/(4.0*e*e);
119  if (ppp>0) return std::sqrt(ppp);
120  else return -1.;
121 }
122 
123 #endif