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

#include <G4InuclCollider.hh>

Inheritance diagram for G4InuclCollider:
G4CascadeColliderBase G4VCascadeCollider

Public Member Functions

 G4InuclCollider ()
 
virtual ~G4InuclCollider ()
 
void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
 
void rescatter (G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
 
void setVerboseLevel (G4int verbose=0)
 
void useCascadeDeexcitation ()
 
void usePreCompoundDeexcitation ()
 
- Public Member Functions inherited from G4CascadeColliderBase
 G4CascadeColliderBase (const char *name, G4int verbose=0)
 
virtual ~G4CascadeColliderBase ()
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const char *name, G4int verbose=0)
 
virtual ~G4VCascadeCollider ()
 

Protected Member Functions

void deexcite (const G4Fragment &fragment, G4CollisionOutput &globalOutput)
 
- Protected Member Functions inherited from G4CascadeColliderBase
virtual G4bool useEPCollider (G4InuclParticle *bullet, G4InuclParticle *target) const
 
virtual G4bool inelasticInteractionPossible (G4InuclParticle *bullet, G4InuclParticle *target, G4double ekin) const
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
virtual G4bool validateOutput (const G4Fragment &fragment, G4CollisionOutput &output)
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, const std::vector< G4InuclElementaryParticle > &particles)
 
- Protected Member Functions inherited from G4VCascadeCollider
virtual void setName (const char *name)
 

Additional Inherited Members

- Protected Attributes inherited from G4CascadeColliderBase
G4InteractionCase interCase
 
G4CascadeCheckBalancebalance
 
- Protected Attributes inherited from G4VCascadeCollider
const char * theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 60 of file G4InuclCollider.hh.

Constructor & Destructor Documentation

G4InuclCollider::G4InuclCollider ( )

Definition at line 79 of file G4InuclCollider.cc.

80  : G4CascadeColliderBase("G4InuclCollider"),
81  theElementaryParticleCollider(new G4ElementaryParticleCollider),
82  theIntraNucleiCascader(new G4IntraNucleiCascader),
83  theDeexcitation(new G4CascadeDeexcitation) {}
G4CascadeColliderBase(const char *name, G4int verbose=0)
G4InuclCollider::~G4InuclCollider ( )
virtual

Definition at line 85 of file G4InuclCollider.cc.

85  {
86  delete theElementaryParticleCollider;
87  delete theIntraNucleiCascader;
88  delete theDeexcitation;
89 }

Member Function Documentation

void G4InuclCollider::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput globalOutput 
)
virtual

Implements G4VCascadeCollider.

Definition at line 122 of file G4InuclCollider.cc.

References G4CollisionOutput::acceptable(), G4CollisionOutput::add(), G4CollisionOutput::boostToLabFrame(), G4InteractionCase::code(), G4ElementaryParticleCollider::collide(), G4IntraNucleiCascader::collide(), deexcite(), G4cerr, G4cout, G4endl, G4InuclNuclei::getA(), G4InteractionCase::getBullet(), G4InuclParticle::getDefinition(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4ParticleDefinition::GetParticleName(), G4CollisionOutput::getRecoilFragment(), G4CascadeChannelTables::GetTable(), G4InteractionCase::getTarget(), G4LorentzConvertor::getTRSMomentum(), G4InuclNuclei::getZ(), G4InteractionCase::hadNucleus(), G4CascadeColliderBase::inelasticInteractionPossible(), G4CascadeColliderBase::interCase, G4CollisionOutput::removeRecoilFragment(), G4CollisionOutput::reset(), G4InteractionCase::set(), G4CollisionOutput::setOnShell(), CLHEP::HepLorentzVector::setZ(), G4LorentzConvertor::toTheTargetRestFrame(), G4LorentzConvertor::trivial(), G4CollisionOutput::trivialise(), G4InuclElementaryParticle::type(), G4CascadeColliderBase::useEPCollider(), G4InteractionCase::valid(), and G4VCascadeCollider::verboseLevel.

Referenced by G4CascadeInterface::ApplyYourself().

123  {
124  if (verboseLevel) G4cout << " >>> G4InuclCollider::collide" << G4endl;
125 
126  const G4int itry_max = 100;
127 
128  // Particle-on-particle collision; no nucleus involved
129  if (useEPCollider(bullet,target)) {
130  if (verboseLevel > 2)
131  G4cout << " InuclCollider -> particle on particle collision" << G4endl;
132 
133  theElementaryParticleCollider->collide(bullet, target, globalOutput);
134  return;
135  }
136 
137  interCase.set(bullet,target); // Classify collision type
138  if (verboseLevel > 2) {
139  G4cout << " InuclCollider -> inter case " << interCase.code() << G4endl;
140  }
141 
142  if (!interCase.valid()) {
143  if (verboseLevel > 1)
144  G4cerr << " InuclCollider -> no collision possible " << G4endl;
145 
146  globalOutput.trivialise(bullet, target);
147  return;
148  }
149 
150  // Target must be a nucleus
151  G4InuclNuclei* ntarget = dynamic_cast<G4InuclNuclei*>(interCase.getTarget());
152  if (!ntarget) {
153  G4cerr << " InuclCollider -> ERROR target is not a nucleus " << G4endl;
154 
155  globalOutput.trivialise(bullet, target);
156  return;
157  }
158 
159  G4int btype = 0;
160  G4int ab = 0;
161  G4int zb = 0;
162 
163  if (interCase.hadNucleus()) { // particle with nuclei
164  G4InuclElementaryParticle* pbullet =
166 
167  if (!pbullet) {
168  G4cerr << " InuclCollider -> ERROR bullet is not a hadron " << G4endl;
169  globalOutput.trivialise(bullet, target);
170  return;
171  }
172 
173  if (!G4CascadeChannelTables::GetTable(pbullet->type())) {
174  G4cerr << " InuclCollider -> ERROR can not collide with "
175  << pbullet->getDefinition()->GetParticleName() << G4endl;
176  globalOutput.trivialise(bullet, target);
177  return;
178  }
179 
180  btype = pbullet->type();
181  } else { // nuclei with nuclei
182  G4InuclNuclei* nbullet =
183  dynamic_cast<G4InuclNuclei*>(interCase.getBullet());
184  if (!nbullet) {
185  G4cerr << " InuclCollider -> ERROR bullet is not a nucleus " << G4endl;
186  globalOutput.trivialise(bullet, target);
187  return;
188  }
189 
190  ab = nbullet->getA();
191  zb = nbullet->getZ();
192  }
193 
194  G4LorentzConvertor convertToTargetRestFrame(bullet, ntarget);
195  G4double ekin = convertToTargetRestFrame.getKinEnergyInTheTRS();
196 
197  if (verboseLevel > 3) G4cout << " ekin in trs " << ekin << G4endl;
198 
199  if (!inelasticInteractionPossible(bullet, target, ekin)) {
200  if (verboseLevel > 3)
201  G4cout << " InuclCollider -> inelastic interaction is impossible\n"
202  << " due to the coulomb barirer " << G4endl;
203 
204  globalOutput.trivialise(bullet, target);
205  return;
206  }
207 
208  // Generate interaction secondaries in rest frame of target nucleus
209  convertToTargetRestFrame.toTheTargetRestFrame();
210  if (verboseLevel > 3) {
211  G4cout << " degenerated? " << convertToTargetRestFrame.trivial()
212  << G4endl;
213  }
214 
215  G4LorentzVector bmom; // Bullet is along local Z
216  bmom.setZ(convertToTargetRestFrame.getTRSMomentum());
217 
218  // Need to make copy of bullet with momentum realigned
219  G4InuclParticle* zbullet = 0;
220  if (interCase.hadNucleus())
221  zbullet = new G4InuclElementaryParticle(bmom, btype);
222  else
223  zbullet = new G4InuclNuclei(bmom, ab, zb);
224 
225  G4int itry = 0;
226  while (itry < itry_max) {
227  itry++;
228  if (verboseLevel > 2)
229  G4cout << " InuclCollider itry " << itry << G4endl;
230 
231  globalOutput.reset(); // Clear buffers for this attempt
232  output.reset();
233 
234  theIntraNucleiCascader->collide(zbullet, target, output);
235 
236  if (verboseLevel > 1) G4cout << " After Cascade " << G4endl;
237 
238  deexcite(output.getRecoilFragment(), output);
239  output.removeRecoilFragment();
240 
241  if (verboseLevel > 2)
242  G4cout << " itry " << itry << " finished, moving to lab frame" << G4endl;
243 
244  // convert to the LAB frame and add to final result
245  output.boostToLabFrame(convertToTargetRestFrame);
246 
247  globalOutput.add(output);
248 
249  // Adjust final state particles to balance momentum and energy
250  // FIXME: This should no longer be necessary!
251  globalOutput.setOnShell(bullet, target);
252  if (globalOutput.acceptable()) {
253  if (verboseLevel)
254  G4cout << " InuclCollider output after trials " << itry << G4endl;
255  delete zbullet;
256  return;
257  } else {
258  if (verboseLevel>2)
259  G4cerr << " InuclCollider setOnShell failed." << G4endl;
260  }
261  } // while (itry < itry_max)
262 
263  if (verboseLevel) {
264  G4cout << " InuclCollider -> can not generate acceptable inter. after "
265  << itry_max << " attempts " << G4endl;
266  }
267 
268  globalOutput.trivialise(bullet, target);
269 
270  delete zbullet;
271  return;
272 }
G4bool hadNucleus() const
void trivialise(G4InuclParticle *bullet, G4InuclParticle *target)
static const G4CascadeChannel * GetTable(G4int initialState)
G4int getZ() const
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
void removeRecoilFragment(G4int index=-1)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4bool valid() const
G4int code() const
virtual G4bool inelasticInteractionPossible(G4InuclParticle *bullet, G4InuclParticle *target, G4double ekin) const
void deexcite(const G4Fragment &fragment, G4CollisionOutput &globalOutput)
int G4int
Definition: G4Types.hh:78
const G4String & GetParticleName() const
G4bool acceptable() const
void add(const G4CollisionOutput &right)
G4GLOB_DLL std::ostream G4cout
G4int getA() const
void boostToLabFrame(const G4LorentzConvertor &convertor)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
void set(G4InuclParticle *part1, G4InuclParticle *part2)
G4InuclParticle * getBullet() const
#define G4endl
Definition: G4ios.hh:61
const G4Fragment & getRecoilFragment(G4int index=0) const
double G4double
Definition: G4Types.hh:76
G4InuclParticle * getTarget() const
G4ParticleDefinition * getDefinition() const
void setOnShell(G4InuclParticle *bullet, G4InuclParticle *target)
G4GLOB_DLL std::ostream G4cerr
void G4InuclCollider::deexcite ( const G4Fragment fragment,
G4CollisionOutput globalOutput 
)
protected

Definition at line 306 of file G4InuclCollider.cc.

References G4CollisionOutput::add(), G4VCascadeDeexcitation::deExcite(), G4cout, G4endl, G4Fragment::GetA(), G4CollisionOutput::reset(), G4CascadeColliderBase::validateOutput(), and G4VCascadeCollider::verboseLevel.

Referenced by collide(), and rescatter().

307  {
308  if (fragment.GetA() <= 1) return; // Nothing real to be de-excited
309 
310  if (verboseLevel) G4cout << " >>> G4InuclCollider::deexcite" << G4endl;
311 
312  const G4int itry_max = 10; // Maximum number of attempts
313  G4int itry = 0;
314  do {
315  if (verboseLevel > 2) G4cout << " deexcite itry " << itry << G4endl;
316 
317  DEXoutput.reset();
318  theDeexcitation->deExcite(fragment, DEXoutput);
319  } while (!validateOutput(fragment, DEXoutput) && (++itry < itry_max));
320 
321  // Add de-excitation products to output buffer
322  globalOutput.add(DEXoutput);
323 }
G4double GetA() const
Definition: G4Fragment.hh:303
int G4int
Definition: G4Types.hh:78
virtual void deExcite(const G4Fragment &fragment, G4CollisionOutput &output)=0
void add(const G4CollisionOutput &right)
G4GLOB_DLL std::ostream G4cout
virtual G4bool validateOutput(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
#define G4endl
Definition: G4ios.hh:61
void G4InuclCollider::rescatter ( G4InuclParticle bullet,
G4KineticTrackVector theSecondaries,
G4V3DNucleus theNucleus,
G4CollisionOutput globalOutput 
)
virtual

Reimplemented from G4CascadeColliderBase.

Definition at line 277 of file G4InuclCollider.cc.

References G4CollisionOutput::add(), deexcite(), G4cout, G4endl, G4CollisionOutput::getRecoilFragment(), G4CollisionOutput::removeRecoilFragment(), G4IntraNucleiCascader::rescatter(), G4CollisionOutput::reset(), and G4VCascadeCollider::verboseLevel.

Referenced by G4CascadeInterface::Propagate().

280  {
281  if (verboseLevel) G4cout << " >>> G4InuclCollider::rescatter" << G4endl;
282 
283  G4int itry=1; // For diagnostic post-processing only
284  if (verboseLevel > 2) G4cout << " InuclCollider itry " << itry << G4endl;
285 
286  globalOutput.reset(); // Clear buffers for this attempt
287  output.reset();
288 
289  theIntraNucleiCascader->rescatter(bullet, theSecondaries, theNucleus,
290  output);
291 
292  if (verboseLevel > 1) G4cout << " After Rescatter" << G4endl;
293 
294  deexcite(output.getRecoilFragment(), output);
295  output.removeRecoilFragment();
296 
297  globalOutput.add(output); // Add local results to global output
298 
299  if (verboseLevel)
300  G4cout << " InuclCollider output after trials " << itry << G4endl;
301 }
void removeRecoilFragment(G4int index=-1)
void deexcite(const G4Fragment &fragment, G4CollisionOutput &globalOutput)
int G4int
Definition: G4Types.hh:78
void add(const G4CollisionOutput &right)
G4GLOB_DLL std::ostream G4cout
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
#define G4endl
Definition: G4ios.hh:61
const G4Fragment & getRecoilFragment(G4int index=0) const
void G4InuclCollider::setVerboseLevel ( G4int  verbose = 0)
virtual

Reimplemented from G4CascadeColliderBase.

Definition at line 93 of file G4InuclCollider.cc.

References G4VCascadeCollider::setVerboseLevel(), G4CollisionOutput::setVerboseLevel(), G4CascadeColliderBase::setVerboseLevel(), G4IntraNucleiCascader::setVerboseLevel(), and G4VCascadeCollider::verboseLevel.

Referenced by G4CascadeInterface::SetVerboseLevel().

93  {
95 
96  theElementaryParticleCollider->setVerboseLevel(verboseLevel);
97  theIntraNucleiCascader->setVerboseLevel(verboseLevel);
98  theDeexcitation->setVerboseLevel(verboseLevel);
99 
101  DEXoutput.setVerboseLevel(verboseLevel);
102 }
void setVerboseLevel(G4int verbose)
virtual void setVerboseLevel(G4int verbose=0)
virtual void setVerboseLevel(G4int verbose=0)
void setVerboseLevel(G4int verbose=0)
void G4InuclCollider::useCascadeDeexcitation ( )

Definition at line 107 of file G4InuclCollider.cc.

References G4VCascadeCollider::setVerboseLevel(), and G4VCascadeCollider::verboseLevel.

Referenced by G4CascadeInterface::useCascadeDeexcitation().

107  {
108  delete theDeexcitation;
109  theDeexcitation = new G4CascadeDeexcitation;
110  theDeexcitation->setVerboseLevel(verboseLevel);
111 }
virtual void setVerboseLevel(G4int verbose=0)
void G4InuclCollider::usePreCompoundDeexcitation ( )

Definition at line 113 of file G4InuclCollider.cc.

References G4VCascadeCollider::setVerboseLevel(), and G4VCascadeCollider::verboseLevel.

Referenced by G4CascadeInterface::usePreCompoundDeexcitation().

113  {
114  delete theDeexcitation;
115  theDeexcitation = new G4PreCompoundDeexcitation;
116  theDeexcitation->setVerboseLevel(verboseLevel);
117 }
virtual void setVerboseLevel(G4int verbose=0)

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