Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4FermiPhaseSpaceDecay.cc
이 파일의 문서화 페이지로 가기
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 // $Id: G4ExcitationHandler.hh,v 1.13 2010-11-17 16:20:31 vnivanch Exp $
27 //
28 // Hadronic Process: Phase space decay for the Fermi BreakUp model
29 // by V. Lara
30 //
31 // Modifications:
32 // 01.04.2011 General cleanup by V.Ivanchenko:
33 // - IsotropicVector is inlined
34 // - Momentum computation return zero or positive value
35 // - DumpProblem method is added providing more information
36 // - Reduced usage of exotic std functions
37 
39 #include "G4SystemOfUnits.hh"
40 #include "G4RandomDirection.hh"
41 #include "G4HadronicException.hh"
42 
44 {
46 }
47 
49 {}
50 
51 std::vector<G4LorentzVector*>*
53  const std::vector<G4double>& mr) const
54  // Calculates momentum for N fragments (Kopylov's method of sampling is used)
55 {
56  size_t N = mr.size();
57 
58  std::vector<G4LorentzVector*>* P =
59  new std::vector<G4LorentzVector*>(N, 0);
60 
61  G4double mtot = 0.0;
62  for(size_t k=0; k<N; ++k) { mtot += mr[k]; }
63  G4double mu = mtot;
64  G4double PFragMagCM = 0.0;
65  G4double Mass = M;
66  G4double T = Mass-mtot;
67  G4LorentzVector PFragCM(0.0,0.0,0.0,0.0);
68  G4LorentzVector PRestCM(0.0,0.0,0.0,0.0);
69  G4LorentzVector PRestLab(0.0,0.0,0.0,Mass);
70 
71  CLHEP::HepRandomEngine* rndmEngine = G4Random::getTheEngine();
72 
73  for (size_t k = N-1; k>0; --k)
74  {
75  mu -= mr[k];
76  if (k>1) { T *= BetaKopylov(k, rndmEngine); }
77  else { T = 0.0; }
78 
79  G4double RestMass = mu + T;
80 
81  PFragMagCM = PtwoBody(Mass,mr[k],RestMass);
82 
83  // Create a unit vector with a random direction isotropically distributed
84  G4ThreeVector RandVector = PFragMagCM*G4RandomDirection();
85 
86  PFragCM.setVect(RandVector);
87  PFragCM.setE(std::sqrt(PFragMagCM*PFragMagCM + mr[k]*mr[k]));
88 
89  PRestCM.setVect(-RandVector);
90  PRestCM.setE(std::sqrt(PFragMagCM*PFragMagCM + RestMass*RestMass));
91 
92 
93  G4ThreeVector BoostV = PRestLab.boostVector();
94 
95  PFragCM.boost(BoostV);
96  PRestCM.boost(BoostV);
97  PRestLab = PRestCM;
98 
99  (*P)[k] = new G4LorentzVector(PFragCM);
100 
101  Mass = RestMass;
102  }
103 
104  (*P)[0] = new G4LorentzVector(PRestLab);
105 
106  return P;
107 }
108 
109 void
111  G4double P) const
112 {
113  G4cout << "G4FermiPhaseSpaceDecay: problem of decay of M(GeV)= " << E/GeV
114  << " on M1(GeV)= " << P1/GeV << " and M2(GeV)= " << P2/GeV
115  << " P(MeV)= " << P/MeV << " < 0" << G4endl;
116  // exception only if the problem is numerically significant
117  if(P < -CLHEP::eV) {
118  throw G4HadronicException(__FILE__, __LINE__,"Error in decay kinematics");
119  }
120 }
121 
122 
static constexpr double MeV
Definition: G4SIunits.hh:214
#define G4endl
Definition: G4ios.hh:61
static const G4double * P2[nN]
void setVect(const Hep3Vector &)
G4ThreeVector G4RandomDirection()
void DumpProblem(G4double E, G4double P1, G4double P2, G4double P) const
double G4double
Definition: G4Types.hh:76
static G4Pow * GetInstance()
Definition: G4Pow.cc:57
**D E S C R I P T I O N
static constexpr double eV
static double P[]
static const G4double * P1[nN]
G4GLOB_DLL std::ostream G4cout
Hep3Vector boostVector() const
CLHEP::HepLorentzVector G4LorentzVector
static constexpr double GeV
Definition: G4SIunits.hh:217
std::vector< G4LorentzVector * > * KopylovNBodyDecay(G4double, const std::vector< G4double > &) const
HepLorentzVector & boost(double, double, double)