ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4SFDecay.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4SFDecay.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 //
27 // //
28 // File: G4SFDecay.cc //
29 // Author: D.H. Wright (SLAC) //
30 // Date: 27 March 2019 //
31 // //
33 
34 #include "G4SFDecay.hh"
35 #include "G4fissionEvent.hh"
36 #include "G4IonTable.hh"
37 #include "G4ThreeVector.hh"
38 #include "G4LorentzVector.hh"
39 #include "G4DynamicParticle.hh"
40 #include "G4DecayProducts.hh"
41 #include "G4Neutron.hh"
42 #include "G4Gamma.hh"
43 #include "G4SystemOfUnits.hh"
44 #include "G4PhysicalConstants.hh"
45 
46 
48  const G4double& branch, const G4double& Qvalue,
49  const G4double& excitationE,
50  const G4Ions::G4FloatLevelBase& flb)
51  : G4NuclearDecay("SF decay", SpFission, excitationE, flb), transitionQ(Qvalue)
52 {
53  SetParent(theParentNucleus); // Store name of parent nucleus, delete G4MT_parent
54  SetBR(branch);
55 
56  parentZ = theParentNucleus->GetAtomicNumber();
57  parentA = theParentNucleus->GetAtomicMass();
58 
59 // SetNumberOfDaughters(0); doesn't seem to work
60 // Set to 1 for now
61 // When we later install proper fragment generation, set this to 2
62 // and modify Z and A in DecayIt()
64  G4IonTable* theIonTable =
66  SetDaughter(0, theIonTable->GetIon(parentZ, parentA, excitationE, flb) );
67 }
68 
69 
71 {}
72 
73 
75 {
76  // Fill G4MT_parent with theParentNucleus (stored by SetParent in ctor)
78 
79  // Set up final state
80  // parentParticle is set at rest here because boost with correct momentum
81  // is done later
83  G4ThreeVector(0.,0.,0.) );
84  G4DynamicParticle parentParticle(G4MT_parent, atRest);
85  G4DecayProducts* products = new G4DecayProducts(parentParticle);
86 
87  // Generate LLNL code for parent nucleus
90 
91  // Let G4fissionEvent do the decay
92  // Argument 2 : time, passed through to set time of secondary
93  // Argument 3 : nubar, when set to -1, selects spontaneous fission
94  // Argument 4 : energy used in Watt spectrum
95  G4fissionEvent aFission(code, 10.0, -1, 0.);
96  G4int nNeut = aFission.getNeutronNu();
97  G4int nGam = aFission.getPhotonNu();
98 
99  G4DynamicParticle* dynPart = 0;
100  G4ThreeVector direction(0.,0.,0.);
101  G4double KE = 0.; // energy from generator is in MeV
102 
103  if (nNeut > 0) {
104  // Put neutrons on the stack
105  for (G4int i = 0; i < nNeut; i++) {
106  KE = aFission.getNeutronEnergy(i);
107  direction.setX(aFission.getNeutronDircosu(i) );
108  direction.setY(aFission.getNeutronDircosv(i) );
109  direction.setZ(aFission.getNeutronDircosw(i) );
110 
111  dynPart = new G4DynamicParticle(G4Neutron::Neutron(), direction, KE);
112 
113  // Not needed - time comes from parent track
114  // dynPart->SetProperTime(aFission.getNeutronAge(i) );
115 
116  products->PushProducts(dynPart);
117  }
118 
119  // Put gammas on the stack
120  for (G4int i = 0; i < nGam; i++) {
121  KE = aFission.getPhotonEnergy(i);
122  direction.setX(aFission.getPhotonDircosu(i) );
123  direction.setY(aFission.getPhotonDircosv(i) );
124  direction.setZ(aFission.getPhotonDircosw(i) );
125 
126  dynPart = new G4DynamicParticle(G4Gamma::Gamma(), direction, KE);
127 
128  // Not needed - time comes from parent track
129  // dynPart->SetProperTime(aFission.getPhotonAge(i) );
130 
131  products->PushProducts(dynPart);
132  // No residual nucleus in this model
133  }
134 
135  } else {
136  // No data for this isotope, return parent nucleus for now
137 // G4cout << " No fission data for this isotope " << G4endl;
138  G4DynamicParticle* parent =
140  products->PushProducts(parent);
141  }
142 
143  // Energy conservation check not valid in this model
144 
145  return products;
146 }
147 
148 
150 {
151  G4cout << " G4SFDecay for parent nucleus " << GetParentName() << G4endl;
152  G4cout << " decays to neutrons and gammas, with branching ratio " << GetBR()
153  << "% and Q value " << transitionQ << G4endl;
154 }
155