Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions
G4CascadeRecoilMaker Class Reference

#include <G4CascadeRecoilMaker.hh>

Inheritance diagram for G4CascadeRecoilMaker:
G4VCascadeCollider

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 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 65 of file G4CascadeRecoilMaker.hh.

Constructor & Destructor Documentation

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

Definition at line 67 of file G4CascadeRecoilMaker.cc.

References G4VCascadeCollider::theName.

68  : G4VCascadeCollider("G4CascadeRecoilMaker"),
69  excTolerance(tolerance), inputEkin(0.),
70  recoilA(0), recoilZ(0), excitationEnergy(0.) {
71  balance = new G4CascadeCheckBalance(tolerance, tolerance, theName);
72 }
G4VCascadeCollider(const char *name, G4int verbose=0)
G4CascadeRecoilMaker::~G4CascadeRecoilMaker ( )
virtual

Definition at line 74 of file G4CascadeRecoilMaker.cc.

74  {
75  delete balance;
76 }

Member Function Documentation

void G4CascadeRecoilMaker::addExcitonConfiguration ( const G4ExitonConfiguration  exciton)
inline

Definition at line 89 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::finishCascade().

89  {
90  theExcitons = exciton;
91  }
void G4CascadeRecoilMaker::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output 
)
virtual

Implements G4VCascadeCollider.

Definition at line 81 of file G4CascadeRecoilMaker.cc.

References G4CascadeCheckBalance::collide(), fillRecoil(), G4cout, G4endl, G4InuclParticle::getKineticEnergy(), G4VCascadeCollider::setVerboseLevel(), and G4VCascadeCollider::verboseLevel.

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

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 
90  balance->setVerboseLevel(verboseLevel);
91  balance->collide(bullet, target, output);
92  fillRecoil();
93 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
virtual void setVerboseLevel(G4int verbose=0)
G4double getKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void G4CascadeRecoilMaker::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output,
const std::vector< G4CascadParticle > &  cparticles 
)

Definition at line 97 of file G4CascadeRecoilMaker.cc.

References G4CascadeCheckBalance::collide(), fillRecoil(), G4cout, G4endl, G4InuclParticle::getKineticEnergy(), G4VCascadeCollider::setVerboseLevel(), and G4VCascadeCollider::verboseLevel.

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 
107  balance->setVerboseLevel(verboseLevel);
108  balance->collide(bullet, target, output, cparticles);
109  fillRecoil();
110 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
virtual void setVerboseLevel(G4int verbose=0)
G4double getKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4double G4CascadeRecoilMaker::deltaM ( ) const
protected

Definition at line 201 of file G4CascadeRecoilMaker.cc.

References G4InuclNuclei::getNucleiMass(), and CLHEP::HepLorentzVector::m().

Referenced by fillRecoil().

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

Definition at line 116 of file G4CascadeRecoilMaker.cc.

References G4ExitonConfiguration::clear(), G4CascadeCheckBalance::deltaB(), G4CascadeCheckBalance::deltaLV(), deltaM(), G4CascadeCheckBalance::deltaQ(), CLHEP::HepLorentzVector::e(), G4cout, G4endl, python.hepunit::GeV, goodFragment(), CLHEP::HepLorentzVector::m(), CLHEP::HepLorentzVector::px(), CLHEP::HepLorentzVector::py(), CLHEP::HepLorentzVector::pz(), and G4VCascadeCollider::verboseLevel.

Referenced by collide().

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
G4GLOB_DLL std::ostream G4cout
double py() const
double px() const
double pz() const
#define G4endl
Definition: G4ios.hh:61
G4int G4CascadeRecoilMaker::getRecoilA ( ) const
inline

Definition at line 94 of file G4CascadeRecoilMaker.hh.

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

94 { return recoilA; }
G4double G4CascadeRecoilMaker::getRecoilExcitation ( ) const
inline

Definition at line 96 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::finishCascade().

96 { return excitationEnergy; }
const G4LorentzVector& G4CascadeRecoilMaker::getRecoilMomentum ( ) const
inline

Definition at line 97 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::finishCascade().

97 { return recoilMomentum; }
G4int G4CascadeRecoilMaker::getRecoilZ ( ) const
inline

Definition at line 95 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::finishCascade().

95 { return recoilZ; }
G4bool G4CascadeRecoilMaker::goodFragment ( ) const

Definition at line 209 of file G4CascadeRecoilMaker.cc.

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

209  {
210  return (recoilA>0 && recoilZ>=0 && recoilA >= recoilZ);
211 }
G4bool G4CascadeRecoilMaker::goodNucleus ( ) const

Definition at line 235 of file G4CascadeRecoilMaker.cc.

References G4InuclSpecialFunctions::bindingEnergy(), G4cerr, G4cout, G4endl, python.hepunit::GeV, goodFragment(), goodRecoil(), python.hepunit::keV, and G4VCascadeCollider::verboseLevel.

Referenced by G4IntraNucleiCascader::finishCascade().

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
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double bindingEnergy(G4int A, G4int Z)
G4GLOB_DLL std::ostream G4cerr
G4bool G4CascadeRecoilMaker::goodRecoil ( ) const

Definition at line 213 of file G4CascadeRecoilMaker.cc.

References goodFragment().

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

213  {
214  return (goodFragment() && excitationEnergy > -excTolerance);
215 }
G4Fragment * G4CascadeRecoilMaker::makeRecoilFragment ( )

Definition at line 165 of file G4CascadeRecoilMaker.cc.

References G4cout, G4endl, G4InuclNuclei::getNucleiMass(), python.hepunit::GeV, goodRecoil(), G4ExitonConfiguration::neutronHoles, G4ExitonConfiguration::neutronQuasiParticles, G4ExitonConfiguration::protonHoles, G4ExitonConfiguration::protonQuasiParticles, G4Fragment::SetMomentum(), G4Fragment::SetNumberOfExcitedParticle(), G4Fragment::SetNumberOfHoles(), CLHEP::HepLorentzVector::setVectM(), G4Fragment::SetZandA_asInt(), G4VCascadeCollider::theName, CLHEP::HepLorentzVector::vect(), G4VCascadeCollider::verboseLevel, and wholeEvent().

Referenced by G4IntraNucleiCascader::finishCascade().

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 }
void SetNumberOfHoles(G4int valueTot, G4int valueP=0)
Definition: G4Fragment.hh:355
int G4int
Definition: G4Types.hh:78
void setVectM(const Hep3Vector &spatial, double mass)
void SetNumberOfExcitedParticle(G4int valueTot, G4int valueP)
Definition: G4Fragment.hh:336
Hep3Vector vect() const
G4GLOB_DLL std::ostream G4cout
void SetMomentum(const G4LorentzVector &value)
Definition: G4Fragment.hh:276
G4double getNucleiMass() const
void SetZandA_asInt(G4int Znew, G4int Anew)
Definition: G4Fragment.hh:248
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4InuclNuclei * G4CascadeRecoilMaker::makeRecoilNuclei ( G4InuclParticle::Model  model = G4InuclParticle::DefaultModel)

Definition at line 144 of file G4CascadeRecoilMaker.cc.

References G4InuclNuclei::fill(), G4cout, G4endl, goodRecoil(), G4InuclNuclei::setExitonConfiguration(), G4VCascadeCollider::theName, G4VCascadeCollider::verboseLevel, and wholeEvent().

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 fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
G4GLOB_DLL std::ostream G4cout
const XML_Char XML_Content * model
void setExitonConfiguration(const G4ExitonConfiguration &config)
#define G4endl
Definition: G4ios.hh:61
void G4CascadeRecoilMaker::setRecoilExcitation ( G4double  Eexc)
inline

Definition at line 82 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::finishCascade().

82 { excitationEnergy = Eexc; }
void G4CascadeRecoilMaker::setTolerance ( G4double  tolerance)
inline

Definition at line 80 of file G4CascadeRecoilMaker.hh.

Referenced by G4IntraNucleiCascader::initialize().

80 { excTolerance = tolerance; }
G4bool G4CascadeRecoilMaker::unphysicalRecoil ( ) const
inline

Definition at line 103 of file G4CascadeRecoilMaker.hh.

References goodRecoil(), and wholeEvent().

103 { return !wholeEvent() && !goodRecoil(); }
G4bool G4CascadeRecoilMaker::wholeEvent ( ) const

Definition at line 217 of file G4CascadeRecoilMaker.cc.

References CLHEP::HepLorentzVector::e(), G4cout, G4endl, python.hepunit::GeV, CLHEP::HepLorentzVector::rho(), and G4VCascadeCollider::verboseLevel.

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

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 }
G4GLOB_DLL std::ostream G4cout
double rho() const
#define G4endl
Definition: G4ios.hh:61

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