Geant4 10.7.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 G4String &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 G4String &name)
 

Additional Inherited Members

- Protected Attributes inherited from G4VCascadeCollider
G4String 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 66 of file G4CascadeRecoilMaker.cc.

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

◆ ~G4CascadeRecoilMaker()

G4CascadeRecoilMaker::~G4CascadeRecoilMaker ( )
virtual

Definition at line 73 of file G4CascadeRecoilMaker.cc.

73 {
74 delete balance;
75}

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 80 of file G4CascadeRecoilMaker.cc.

82 {
83 if (verboseLevel > 1)
84 G4cout << " >>> G4CascadeRecoilMaker::collide" << G4endl;
85
86 // Available energy needed for "goodNucleus()" test at end
87 inputEkin = bullet ? bullet->getKineticEnergy() : 0.;
88
90 balance->collide(bullet, target, output);
91 fillRecoil();
92}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL 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 96 of file G4CascadeRecoilMaker.cc.

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

◆ deltaM()

G4double G4CascadeRecoilMaker::deltaM ( ) const
protected

Definition at line 200 of file G4CascadeRecoilMaker.cc.

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

Referenced by fillRecoil().

◆ fillRecoil()

void G4CascadeRecoilMaker::fillRecoil ( )
protected

Definition at line 115 of file G4CascadeRecoilMaker.cc.

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

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

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

◆ goodNucleus()

G4bool G4CascadeRecoilMaker::goodNucleus ( ) const

Definition at line 234 of file G4CascadeRecoilMaker.cc.

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

Referenced by G4IntraNucleiCascader::finishCascade().

◆ goodRecoil()

G4bool G4CascadeRecoilMaker::goodRecoil ( ) const

Definition at line 212 of file G4CascadeRecoilMaker.cc.

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

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

◆ makeRecoilFragment()

G4Fragment * G4CascadeRecoilMaker::makeRecoilFragment ( )

Definition at line 164 of file G4CascadeRecoilMaker.cc.

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

Referenced by G4IntraNucleiCascader::finishCascade().

◆ makeRecoilNuclei()

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

Definition at line 143 of file G4CascadeRecoilMaker.cc.

143 {
144 if (verboseLevel > 1)
145 G4cout << " >>> G4CascadeRecoilMaker::makeRecoilNuclei" << G4endl;
146
147 if (!goodRecoil()) {
148 if (verboseLevel > 2 && !wholeEvent())
149 G4cout << theName << ": event recoil is not a physical nucleus" << G4endl;
150
151 return 0; // Null pointer means no fragment
152 }
153
154 theRecoilNuclei.fill(recoilMomentum, recoilA, recoilZ,
155 excitationEnergy, model);
156 theRecoilNuclei.setExitonConfiguration(theExcitons);
157
158 return &theRecoilNuclei;
159}
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 216 of file G4CascadeRecoilMaker.cc.

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

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


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