Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CascadeRecoilMaker.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 #ifndef G4CASCADE_RECOIL_MAKER_HH
27 #define G4CASCADE_RECOIL_MAKER_HH
28 // $Id: G4CascadeRecoilMaker.hh 71719 2013-06-21 00:01:54Z mkelsey $
29 //
30 // Collects generated cascade data (using Collider::collide() interface)
31 // and computes the nuclear recoil kinematics needed to balance the event.
32 //
33 // 20100909 M. Kelsey -- Inspired by G4CascadeCheckBalance
34 // 20100909 M. Kelsey -- Move G4IntraNucleiCascader::goodCase() here, add
35 // tolerance for "almost zero" excitation energy, add function
36 // to manually override excitation energy
37 // 20100910 M. Kelsey -- Drop getRecoilFragment() in favor of user calling
38 // makeRecoilFragment() with returned non-const pointer. Drop
39 // handling of excitons.
40 // 20100914 M. Kelsey -- Migrate to integer A and Z
41 // 20100921 M. Kelsey -- Return G4InuclNuclei using "makeRecoilNuclei()".
42 // Repurpose "makeRecoilFragment()" to return G4Fragment.
43 // 20100924 M. Kelsey -- Add raw excitation energy (mass difference) function
44 // 20110214 M. Kelsey -- Replace "model" with G4InuclParticle::Model enum
45 // 20110722 M. Kelsey -- For IntraNucleiCascader, take G4CollOut as argument
46 // 20130620 Address Coverity complaint about missing copy actions
47 
48 #include <cmath>
49 #include <vector>
51 
52 #include "G4VCascadeCollider.hh"
53 #include "globals.hh"
54 #include "G4CollisionOutput.hh"
55 #include "G4InuclNuclei.hh"
56 #include "G4Fragment.hh"
57 #include "G4LorentzVector.hh"
58 
59 class G4CascadParticle;
62 class G4InuclParticle;
63 
64 
66 public:
67  explicit G4CascadeRecoilMaker(G4double tolerance=0.001*CLHEP::MeV);
68  virtual ~G4CascadeRecoilMaker();
69 
70  // Standard Collider interface (non-const output "buffer")
72  G4CollisionOutput& output);
73 
74  // This is for use with G4IntraNucleiCascader
75  void collide(G4InuclParticle* bullet, G4InuclParticle* target,
76  G4CollisionOutput& output,
77  const std::vector<G4CascadParticle>& cparticles);
78 
79  // Modifiable parameters
80  void setTolerance(G4double tolerance) { excTolerance = tolerance; }
81 
82  void setRecoilExcitation(G4double Eexc) { excitationEnergy = Eexc; }
83 
84  // Build nucleus from current parameters, if physically reasonable
86  G4Fragment* makeRecoilFragment(); // For use with PreCompound
87 
88  // Attach exciton configuration for use by "nucleus makers"
90  theExcitons = exciton;
91  }
92 
93  // Access nuclear configuration parameters
94  G4int getRecoilA() const { return recoilA; }
95  G4int getRecoilZ() const { return recoilZ; }
96  G4double getRecoilExcitation() const { return excitationEnergy; }
97  const G4LorentzVector& getRecoilMomentum() const { return recoilMomentum; }
98 
99  // Data quality checks
100  G4bool goodFragment() const; // Verify A, Z both meaningful
101  G4bool goodRecoil() const; // And sensible four-vector
102  G4bool wholeEvent() const; // Zero recoil
103  G4bool unphysicalRecoil() const { return !wholeEvent() && !goodRecoil(); }
104 
105  G4bool goodNucleus() const; // Ensure that fragment is energetically okay
106 
107 protected:
108  void fillRecoil(); // Set recoil parameters from CheckBalance
109  G4double deltaM() const; // Mass difference from current parameters
110 
111 private:
112  G4CascadeCheckBalance* balance; // Used to do kinematics calculations
113 
114  G4double excTolerance; // Minimum excitation energy, rounds to zero
115 
116  G4double inputEkin; // Available initial kinetic energy
117 
118  G4int recoilA; // Nuclear parameters of recoil
119  G4int recoilZ;
120  G4LorentzVector recoilMomentum;
121  G4double excitationEnergy;
122 
123  G4ExitonConfiguration theExcitons; // Used by G4InuclNuclei and G4Fragment
124 
125  G4InuclNuclei theRecoilNuclei; // Reusable buffers for recoil
126  G4Fragment theRecoilFragment;
127 
128 private:
129  // Copying of modules is forbidden
131  G4CascadeRecoilMaker& operator=(const G4CascadeRecoilMaker&);
132 };
133 
134 #endif /* G4CASCADE_RECOIL_MAKER_HH */
const XML_Char * target
const G4LorentzVector & getRecoilMomentum() const
int G4int
Definition: G4Types.hh:78
G4double getRecoilExcitation() const
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
bool G4bool
Definition: G4Types.hh:79
const XML_Char XML_Content * model
G4bool unphysicalRecoil() const
G4InuclNuclei * makeRecoilNuclei(G4InuclParticle::Model model=G4InuclParticle::DefaultModel)
void setTolerance(G4double tolerance)
void setRecoilExcitation(G4double Eexc)
double G4double
Definition: G4Types.hh:76
G4CascadeRecoilMaker(G4double tolerance=0.001 *CLHEP::MeV)
void addExcitonConfiguration(const G4ExitonConfiguration exciton)
G4Fragment * makeRecoilFragment()