Geant4  10.02.p03
G4CascadeRecoilMaker Class Reference

#include <G4CascadeRecoilMaker.hh>

Inheritance diagram for G4CascadeRecoilMaker:
Collaboration 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 setVerboseLevel (G4int verbose=0)
 

Protected Member Functions

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

Private Member Functions

 G4CascadeRecoilMaker (const G4CascadeRecoilMaker &)
 
G4CascadeRecoilMakeroperator= (const G4CascadeRecoilMaker &)
 

Private Attributes

G4CascadeCheckBalancebalance
 
G4double excTolerance
 
G4double inputEkin
 
G4int recoilA
 
G4int recoilZ
 
G4LorentzVector recoilMomentum
 
G4double excitationEnergy
 
G4ExitonConfiguration theExcitons
 
G4InuclNuclei theRecoilNuclei
 
G4Fragment theRecoilFragment
 

Additional Inherited Members

- Protected Attributes inherited from G4VCascadeCollider
G4String theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 65 of file G4CascadeRecoilMaker.hh.

Constructor & Destructor Documentation

◆ G4CascadeRecoilMaker() [1/2]

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

Definition at line 67 of file G4CascadeRecoilMaker.cc.

◆ ~G4CascadeRecoilMaker()

G4CascadeRecoilMaker::~G4CascadeRecoilMaker ( )
virtual

Definition at line 74 of file G4CascadeRecoilMaker.cc.

74  {
75  delete balance;
76 }
G4CascadeCheckBalance * balance

◆ G4CascadeRecoilMaker() [2/2]

G4CascadeRecoilMaker::G4CascadeRecoilMaker ( const G4CascadeRecoilMaker )
private

Member Function Documentation

◆ addExcitonConfiguration()

void G4CascadeRecoilMaker::addExcitonConfiguration ( const G4ExitonConfiguration  exciton)
inline

Definition at line 89 of file G4CascadeRecoilMaker.hh.

89  {
90  theExcitons = exciton;
91  }
G4ExitonConfiguration theExcitons
Here is the caller graph for this function:

◆ 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 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
virtual void setVerboseLevel(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
G4double getKineticEnergy() const
#define G4endl
Definition: G4ios.hh:61
G4CascadeCheckBalance * balance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
virtual void setVerboseLevel(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
G4double getKineticEnergy() const
#define G4endl
Definition: G4ios.hh:61
G4CascadeCheckBalance * balance
Here is the call graph for this function:

◆ deltaM()

G4double G4CascadeRecoilMaker::deltaM ( ) const
protected

Definition at line 201 of file G4CascadeRecoilMaker.cc.

201  {
203  return (recoilMomentum.m() - nucMass);
204 }
G4double getNucleiMass() const
double G4double
Definition: G4Types.hh:76
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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"
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
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
G4ExitonConfiguration theExcitons
#define G4endl
Definition: G4ios.hh:61
G4CascadeCheckBalance * balance
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRecoilA()

G4int G4CascadeRecoilMaker::getRecoilA ( ) const
inline

Definition at line 94 of file G4CascadeRecoilMaker.hh.

94 { return recoilA; }
Here is the caller graph for this function:

◆ getRecoilExcitation()

G4double G4CascadeRecoilMaker::getRecoilExcitation ( ) const
inline

Definition at line 96 of file G4CascadeRecoilMaker.hh.

96 { return excitationEnergy; }
Here is the caller graph for this function:

◆ getRecoilMomentum()

const G4LorentzVector& G4CascadeRecoilMaker::getRecoilMomentum ( ) const
inline

Definition at line 97 of file G4CascadeRecoilMaker.hh.

97 { return recoilMomentum; }
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRecoilZ()

G4int G4CascadeRecoilMaker::getRecoilZ ( ) const
inline

Definition at line 95 of file G4CascadeRecoilMaker.hh.

95 { return recoilZ; }
Here is the caller graph for this function:

◆ goodFragment()

G4bool G4CascadeRecoilMaker::goodFragment ( ) const

Definition at line 209 of file G4CascadeRecoilMaker.cc.

209  {
210  return (recoilA>0 && recoilZ>=0 && recoilA >= recoilZ);
211 }
Here is the caller graph for this function:

◆ 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 }
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
#define G4endl
Definition: G4ios.hh:61
static const double keV
Definition: G4SIunits.hh:213
double G4double
Definition: G4Types.hh:76
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ goodRecoil()

G4bool G4CascadeRecoilMaker::goodRecoil ( ) const

Definition at line 213 of file G4CascadeRecoilMaker.cc.

213  {
214  return (goodFragment() && excitationEnergy > -excTolerance);
215 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 =
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)
189 
194 
195  return &theRecoilFragment;
196 }
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
Definition: G4Fragment.hh:357
int G4int
Definition: G4Types.hh:78
Hep3Vector vect() const
void setVectM(const Hep3Vector &spatial, double mass)
void SetNumberOfExcitedParticle(G4int valueTot, G4int valueP)
Definition: G4Fragment.hh:338
G4GLOB_DLL std::ostream G4cout
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:294
static const double GeV
Definition: G4SIunits.hh:214
G4double getNucleiMass() const
G4ExitonConfiguration theExcitons
void SetZandA_asInt(G4int Znew, G4int Anew)
Definition: G4Fragment.hh:266
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 
156  excitationEnergy, model);
158 
159  return &theRecoilNuclei;
160 }
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
G4GLOB_DLL std::ostream G4cout
void setExitonConfiguration(const G4ExitonConfiguration &config)
G4ExitonConfiguration theExcitons
#define G4endl
Definition: G4ios.hh:61
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

G4CascadeRecoilMaker& G4CascadeRecoilMaker::operator= ( const G4CascadeRecoilMaker )
private

◆ setRecoilExcitation()

void G4CascadeRecoilMaker::setRecoilExcitation ( G4double  Eexc)
inline

Definition at line 82 of file G4CascadeRecoilMaker.hh.

82 { excitationEnergy = Eexc; }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTolerance()

void G4CascadeRecoilMaker::setTolerance ( G4double  tolerance)
inline

Definition at line 80 of file G4CascadeRecoilMaker.hh.

static const G4double tolerance
Here is the caller graph for this function:

◆ unphysicalRecoil()

G4bool G4CascadeRecoilMaker::unphysicalRecoil ( ) const
inline

Definition at line 103 of file G4CascadeRecoilMaker.hh.

103 { return !wholeEvent() && !goodRecoil(); }
Here is the call graph for this function:

◆ 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 &&
225  std::abs(recoilMomentum.e()) < excTolerance/GeV) << G4endl;
226  }
227 
228  return (recoilA==0 && recoilZ==0 &&
230  std::abs(recoilMomentum.e()) < excTolerance/GeV);
231 }
G4GLOB_DLL std::ostream G4cout
static const double GeV
Definition: G4SIunits.hh:214
#define G4endl
Definition: G4ios.hh:61
G4LorentzVector recoilMomentum
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ balance

G4CascadeCheckBalance* G4CascadeRecoilMaker::balance
private

Definition at line 112 of file G4CascadeRecoilMaker.hh.

◆ excitationEnergy

G4double G4CascadeRecoilMaker::excitationEnergy
private

Definition at line 121 of file G4CascadeRecoilMaker.hh.

◆ excTolerance

G4double G4CascadeRecoilMaker::excTolerance
private

Definition at line 114 of file G4CascadeRecoilMaker.hh.

◆ inputEkin

G4double G4CascadeRecoilMaker::inputEkin
private

Definition at line 116 of file G4CascadeRecoilMaker.hh.

◆ recoilA

G4int G4CascadeRecoilMaker::recoilA
private

Definition at line 118 of file G4CascadeRecoilMaker.hh.

◆ recoilMomentum

G4LorentzVector G4CascadeRecoilMaker::recoilMomentum
private

Definition at line 120 of file G4CascadeRecoilMaker.hh.

◆ recoilZ

G4int G4CascadeRecoilMaker::recoilZ
private

Definition at line 119 of file G4CascadeRecoilMaker.hh.

◆ theExcitons

G4ExitonConfiguration G4CascadeRecoilMaker::theExcitons
private

Definition at line 123 of file G4CascadeRecoilMaker.hh.

◆ theRecoilFragment

G4Fragment G4CascadeRecoilMaker::theRecoilFragment
private

Definition at line 126 of file G4CascadeRecoilMaker.hh.

◆ theRecoilNuclei

G4InuclNuclei G4CascadeRecoilMaker::theRecoilNuclei
private

Definition at line 125 of file G4CascadeRecoilMaker.hh.


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