Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4CascadeRecoilMaker Class Reference

#include <G4CascadeRecoilMaker.hh>

+ Inheritance diagram for G4CascadeRecoilMaker:

Public Member Functions

 G4CascadeRecoilMaker (G4double tolerance=0.001 *CLHEP::MeV)
 
virtual ~G4CascadeRecoilMaker ()
 
void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output, const std::vector< G4CascadParticle > &cparticles)
 
void setTolerance (G4double tolerance)
 
void setRecoilExcitation (G4double Eexc)
 
G4InuclNucleimakeRecoilNuclei (G4InuclParticle::Model model=G4InuclParticle::DefaultModel)
 
G4FragmentmakeRecoilFragment ()
 
void addExcitonConfiguration (const G4ExitonConfiguration exciton)
 
G4int getRecoilA () const
 
G4int getRecoilZ () const
 
G4double getRecoilExcitation () const
 
const G4LorentzVectorgetRecoilMomentum () const
 
G4bool goodFragment () const
 
G4bool goodRecoil () const
 
G4bool wholeEvent () const
 
G4bool unphysicalRecoil () const
 
G4bool goodNucleus () const
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const char *name, G4int verbose=0)
 
virtual ~G4VCascadeCollider ()
 
virtual void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)=0
 
virtual void setVerboseLevel (G4int verbose=0)
 

Protected Member Functions

void fillRecoil ()
 
G4double deltaM () const
 
- Protected Member Functions inherited from G4VCascadeCollider
virtual void setName (const char *name)
 

Additional Inherited Members

- Protected Attributes inherited from G4VCascadeCollider
const char * theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 64 of file G4CascadeRecoilMaker.hh.

Constructor & Destructor Documentation

◆ G4CascadeRecoilMaker()

G4CascadeRecoilMaker::G4CascadeRecoilMaker ( G4double  tolerance = 0.001*CLHEP::MeV)
explicit

Definition at line 67 of file G4CascadeRecoilMaker.cc.

68 : G4VCascadeCollider("G4CascadeRecoilMaker"),
69 excTolerance(tolerance), inputEkin(0.),
70 recoilA(0), recoilZ(0), excitationEnergy(0.) {
71 balance = new G4CascadeCheckBalance(tolerance, tolerance, theName);
72}

◆ ~G4CascadeRecoilMaker()

G4CascadeRecoilMaker::~G4CascadeRecoilMaker ( )
virtual

Definition at line 74 of file G4CascadeRecoilMaker.cc.

74 {
75 delete balance;
76}

Member Function Documentation

◆ addExcitonConfiguration()

void G4CascadeRecoilMaker::addExcitonConfiguration ( const G4ExitonConfiguration  exciton)
inline

Definition at line 88 of file G4CascadeRecoilMaker.hh.

88 {
89 theExcitons = exciton;
90 }

Referenced by G4IntraNucleiCascader::finishCascade().

◆ collide() [1/2]

void G4CascadeRecoilMaker::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output 
)
virtual

Implements G4VCascadeCollider.

Definition at line 81 of file G4CascadeRecoilMaker.cc.

83 {
84 if (verboseLevel > 1)
85 G4cout << " >>> G4CascadeRecoilMaker::collide" << G4endl;
86
87 // Available energy needed for "goodNucleus()" test at end
88 inputEkin = bullet ? bullet->getKineticEnergy() : 0.;
89
91 balance->collide(bullet, target, output);
92 fillRecoil();
93}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4double getKineticEnergy() const
virtual void setVerboseLevel(G4int verbose=0)

Referenced by G4IntraNucleiCascader::finishCascade(), and G4IntraNucleiCascader::generateCascade().

◆ collide() [2/2]

void G4CascadeRecoilMaker::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output,
const std::vector< G4CascadParticle > &  cparticles 
)

Definition at line 97 of file G4CascadeRecoilMaker.cc.

100 {
101 if (verboseLevel > 1)
102 G4cout << " >>> G4CascadeRecoilMaker::collide(<EP>,<CP>)" << G4endl;
103
104 // Available energy needed for "goodNucleus()" test at end
105 inputEkin = bullet ? bullet->getKineticEnergy() : 0.;
106
108 balance->collide(bullet, target, output, cparticles);
109 fillRecoil();
110}

◆ deltaM()

G4double G4CascadeRecoilMaker::deltaM ( ) const
protected

Definition at line 201 of file G4CascadeRecoilMaker.cc.

201 {
202 G4double nucMass = G4InuclNuclei::getNucleiMass(recoilA,recoilZ);
203 return (recoilMomentum.m() - nucMass);
204}
double G4double
Definition: G4Types.hh:64
G4double getNucleiMass() const

Referenced by fillRecoil().

◆ fillRecoil()

void G4CascadeRecoilMaker::fillRecoil ( )
protected

Definition at line 116 of file G4CascadeRecoilMaker.cc.

116 {
117 recoilZ = -(balance->deltaQ()); // Charge "non-conservation"
118 recoilA = -(balance->deltaB()); // Baryon "non-conservation"
119 recoilMomentum = -(balance->deltaLV());
120
121 theExcitons.clear(); // Discard previous exciton configuraiton
122
123 // Bertini uses MeV for excitation energy
124 if (!goodFragment()) excitationEnergy = 0.;
125 else excitationEnergy = deltaM() * GeV;
126
127 // Allow for very small negative mass difference, and round to zero
128 if (std::abs(excitationEnergy) < excTolerance) excitationEnergy = 0.;
129
130 if (verboseLevel > 2) {
131 G4cout << " recoil px " << recoilMomentum.px()
132 << " py " << recoilMomentum.py() << " pz " << recoilMomentum.pz()
133 << " E " << recoilMomentum.e() << " baryon " << recoilA
134 << " charge " << recoilZ
135 << "\n recoil mass " << recoilMomentum.m()
136 << " 'excitation' energy " << excitationEnergy << G4endl;
137 }
138}
G4LorentzVector deltaLV() const

Referenced by collide().

◆ getRecoilA()

G4int G4CascadeRecoilMaker::getRecoilA ( ) const
inline

Definition at line 93 of file G4CascadeRecoilMaker.hh.

93{ return recoilA; }

Referenced by G4IntraNucleiCascader::finishCascade(), and G4IntraNucleiCascader::generateCascade().

◆ getRecoilExcitation()

G4double G4CascadeRecoilMaker::getRecoilExcitation ( ) const
inline

Definition at line 95 of file G4CascadeRecoilMaker.hh.

95{ return excitationEnergy; }

Referenced by G4IntraNucleiCascader::finishCascade().

◆ getRecoilMomentum()

const G4LorentzVector & G4CascadeRecoilMaker::getRecoilMomentum ( ) const
inline

Definition at line 96 of file G4CascadeRecoilMaker.hh.

96{ return recoilMomentum; }

Referenced by G4IntraNucleiCascader::finishCascade().

◆ getRecoilZ()

G4int G4CascadeRecoilMaker::getRecoilZ ( ) const
inline

Definition at line 94 of file G4CascadeRecoilMaker.hh.

94{ return recoilZ; }

Referenced by G4IntraNucleiCascader::finishCascade().

◆ goodFragment()

G4bool G4CascadeRecoilMaker::goodFragment ( ) const

Definition at line 209 of file G4CascadeRecoilMaker.cc.

209 {
210 return (recoilA>0 && recoilZ>=0 && recoilA >= recoilZ);
211}

Referenced by fillRecoil(), G4IntraNucleiCascader::finishCascade(), goodNucleus(), and goodRecoil().

◆ goodNucleus()

G4bool G4CascadeRecoilMaker::goodNucleus ( ) const

Definition at line 235 of file G4CascadeRecoilMaker.cc.

235 {
236 if (verboseLevel > 2) {
237 G4cout << " >>> G4CascadeRecoilMaker::goodNucleus" << G4endl;
238 }
239
240 const G4double minExcitation = 0.1*keV;
241 const G4double reasonableExcitation = 7.0; // Multiple of binding energy
242 const G4double fractionalExcitation = 0.2; // Fraction of input to excite
243
244 if (!goodRecoil()) {
245 if (verboseLevel>2) {
246 if (!goodFragment()) G4cerr << " goodNucleus: invalid A/Z" << G4endl;
247 else if (excitationEnergy < -excTolerance)
248 G4cerr << " goodNucleus: negative excitation" << G4endl;
249 }
250 return false; // Not a sensible nucleus
251 }
252
253 if (excitationEnergy <= minExcitation) return true; // Effectively zero
254
255 // Maximum possible excitation energy determined by initial energy
256 G4double dm = bindingEnergy(recoilA,recoilZ);
257 G4double exc_max0z = fractionalExcitation * inputEkin*GeV;
258 G4double exc_dm = reasonableExcitation * dm;
259 G4double exc_max = (exc_max0z > exc_dm) ? exc_max0z : exc_dm;
260
261 if (verboseLevel > 3) {
262 G4cout << " eexs " << excitationEnergy << " max " << exc_max
263 << " dm " << dm << G4endl;
264 }
265
266 if (verboseLevel > 2 && excitationEnergy >= exc_max)
267 G4cerr << " goodNucleus: too much excitation" << G4endl;
268
269 return (excitationEnergy < exc_max); // Below maximum possible
270}
G4DLLIMPORT std::ostream G4cerr
G4double bindingEnergy(G4int A, G4int Z)

Referenced by G4IntraNucleiCascader::finishCascade().

◆ goodRecoil()

G4bool G4CascadeRecoilMaker::goodRecoil ( ) const

Definition at line 213 of file G4CascadeRecoilMaker.cc.

213 {
214 return (goodFragment() && excitationEnergy > -excTolerance);
215}

Referenced by goodNucleus(), makeRecoilFragment(), makeRecoilNuclei(), and unphysicalRecoil().

◆ makeRecoilFragment()

G4Fragment * G4CascadeRecoilMaker::makeRecoilFragment ( )

Definition at line 165 of file G4CascadeRecoilMaker.cc.

165 {
166 if (verboseLevel > 1)
167 G4cout << " >>> G4CascadeRecoilMaker::makeRecoilFragment" << G4endl;
168
169 if (!goodRecoil()) {
170 if (verboseLevel > 2 && !wholeEvent())
171 G4cout << theName << ": event recoil is not a physical nucleus" << G4endl;
172
173 return 0; // Null pointer means no fragment
174 }
175
176 theRecoilFragment.SetZandA_asInt(recoilZ, recoilA); // Note convention!
177
178 // User may have overridden excitation energy; force four-momentum to match
179 G4double fragMass =
180 G4InuclNuclei::getNucleiMass(recoilA,recoilZ) + excitationEnergy/GeV;
181
182 G4LorentzVector fragMom; fragMom.setVectM(recoilMomentum.vect(), fragMass);
183 theRecoilFragment.SetMomentum(fragMom*GeV); // Bertini uses GeV!
184
185 // Note: exciton configuration has to be set piece by piece
186 // (arguments are Ntotal,Nproton in both cases)
187 G4int nholes = theExcitons.protonHoles+theExcitons.neutronHoles;
188 theRecoilFragment.SetNumberOfHoles(nholes, theExcitons.protonHoles);
189
190 G4int nexcit = (theExcitons.protonQuasiParticles
191 + theExcitons.neutronQuasiParticles);
192 theRecoilFragment.SetNumberOfExcitedParticle(nexcit,
193 theExcitons.protonQuasiParticles);
194
195 return &theRecoilFragment;
196}
int G4int
Definition: G4Types.hh:66
void setVectM(const Hep3Vector &spatial, double mass)
Hep3Vector vect() const
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
Definition: G4Fragment.hh:335
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:256
void SetNumberOfExcitedParticle(G4int valueTot, G4int valueP)
Definition: G4Fragment.hh:316
void SetZandA_asInt(G4int Znew, G4int Anew)
Definition: G4Fragment.hh:228

Referenced by G4IntraNucleiCascader::finishCascade().

◆ makeRecoilNuclei()

G4InuclNuclei * G4CascadeRecoilMaker::makeRecoilNuclei ( G4InuclParticle::Model  model = G4InuclParticle::DefaultModel)

Definition at line 144 of file G4CascadeRecoilMaker.cc.

144 {
145 if (verboseLevel > 1)
146 G4cout << " >>> G4CascadeRecoilMaker::makeRecoilNuclei" << G4endl;
147
148 if (!goodRecoil()) {
149 if (verboseLevel > 2 && !wholeEvent())
150 G4cout << theName << ": event recoil is not a physical nucleus" << G4endl;
151
152 return 0; // Null pointer means no fragment
153 }
154
155 theRecoilNuclei.fill(recoilMomentum, recoilA, recoilZ,
156 excitationEnergy, model);
157 theRecoilNuclei.setExitonConfiguration(theExcitons);
158
159 return &theRecoilNuclei;
160}
void setExitonConfiguration(const G4ExitonConfiguration &config)
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)

◆ setRecoilExcitation()

void G4CascadeRecoilMaker::setRecoilExcitation ( G4double  Eexc)
inline

Definition at line 81 of file G4CascadeRecoilMaker.hh.

81{ excitationEnergy = Eexc; }

Referenced by G4IntraNucleiCascader::finishCascade().

◆ setTolerance()

void G4CascadeRecoilMaker::setTolerance ( G4double  tolerance)
inline

Definition at line 79 of file G4CascadeRecoilMaker.hh.

79{ excTolerance = tolerance; }

Referenced by G4IntraNucleiCascader::initialize().

◆ unphysicalRecoil()

G4bool G4CascadeRecoilMaker::unphysicalRecoil ( ) const
inline

Definition at line 102 of file G4CascadeRecoilMaker.hh.

102{ return !wholeEvent() && !goodRecoil(); }

◆ wholeEvent()

G4bool G4CascadeRecoilMaker::wholeEvent ( ) const

Definition at line 217 of file G4CascadeRecoilMaker.cc.

217 {
218 if (verboseLevel > 2) {
219 G4cout << " >>> G4CascadeRecoilMaker::wholeEvent:"
220 << " A " << recoilA << " Z " << recoilZ
221 << " P " << recoilMomentum.rho() << " E " << recoilMomentum.e()
222 << "\n wholeEvent returns "
223 << (recoilA==0 && recoilZ==0 &&
224 recoilMomentum.rho() < excTolerance/GeV &&
225 std::abs(recoilMomentum.e()) < excTolerance/GeV) << G4endl;
226 }
227
228 return (recoilA==0 && recoilZ==0 &&
229 recoilMomentum.rho() < excTolerance/GeV &&
230 std::abs(recoilMomentum.e()) < excTolerance/GeV);
231}

Referenced by G4IntraNucleiCascader::finishCascade(), makeRecoilFragment(), makeRecoilNuclei(), and unphysicalRecoil().


The documentation for this class was generated from the following files: