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 ()

Protected Member Functions

void deexcite (const G4Fragment &fragment, G4CollisionOutput &globalOutput)

Detailed Description

Definition at line 59 of file G4InuclCollider.hh.


Constructor & Destructor Documentation

G4InuclCollider::G4InuclCollider (  ) 

Definition at line 78 of file G4InuclCollider.cc.

00079   : G4CascadeColliderBase("G4InuclCollider"),
00080     theElementaryParticleCollider(new G4ElementaryParticleCollider),
00081     theIntraNucleiCascader(new G4IntraNucleiCascader),
00082     theDeexcitation(new G4CascadeDeexcitation) {}

G4InuclCollider::~G4InuclCollider (  )  [virtual]

Definition at line 84 of file G4InuclCollider.cc.

00084                                   {
00085   delete theElementaryParticleCollider;
00086   delete theIntraNucleiCascader;
00087   delete theDeexcitation;
00088 }


Member Function Documentation

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

Implements G4VCascadeCollider.

Definition at line 121 of file G4InuclCollider.cc.

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

Referenced by G4CascadeInterface::ApplyYourself().

00122                                                                {
00123   if (verboseLevel) G4cout << " >>> G4InuclCollider::collide" << G4endl;
00124 
00125   const G4int itry_max = 100;
00126 
00127   // Particle-on-particle collision; no nucleus involved
00128   if (useEPCollider(bullet,target)) {
00129     if (verboseLevel > 2)
00130       G4cout << " InuclCollider -> particle on particle collision" << G4endl;
00131  
00132     theElementaryParticleCollider->collide(bullet, target, globalOutput);
00133     return;
00134   }
00135   
00136   interCase.set(bullet,target);         // Classify collision type
00137   if (verboseLevel > 2) {
00138     G4cout << " InuclCollider -> inter case " << interCase.code() << G4endl;
00139   }
00140 
00141   if (!interCase.valid()) {
00142     if (verboseLevel > 1)
00143       G4cerr << " InuclCollider -> no collision possible " << G4endl;
00144 
00145     globalOutput.trivialise(bullet, target);
00146     return;
00147   }
00148 
00149   // Target must be a nucleus
00150   G4InuclNuclei* ntarget = dynamic_cast<G4InuclNuclei*>(interCase.getTarget());
00151   if (!ntarget) {
00152     G4cerr << " InuclCollider -> ERROR target is not a nucleus " << G4endl;
00153 
00154     globalOutput.trivialise(bullet, target);
00155     return;
00156   }
00157 
00158   G4int btype = 0;
00159   G4int ab = 0;
00160   G4int zb = 0;
00161   
00162   if (interCase.hadNucleus()) {         // particle with nuclei
00163     G4InuclElementaryParticle* pbullet = 
00164       dynamic_cast<G4InuclElementaryParticle*>(interCase.getBullet());
00165 
00166     if (!pbullet) {
00167       G4cerr << " InuclCollider -> ERROR bullet is not a hadron " << G4endl;
00168       globalOutput.trivialise(bullet, target);
00169       return;
00170     }
00171 
00172     if (!G4CascadeChannelTables::GetTable(pbullet->type())) {
00173       G4cerr << " InuclCollider -> ERROR can not collide with "
00174              << pbullet->getDefinition()->GetParticleName() << G4endl;
00175       globalOutput.trivialise(bullet, target);
00176       return;
00177     }
00178 
00179     btype = pbullet->type();
00180   } else {                              // nuclei with nuclei
00181     G4InuclNuclei* nbullet = 
00182       dynamic_cast<G4InuclNuclei*>(interCase.getBullet());
00183     if (!nbullet) {
00184       G4cerr << " InuclCollider -> ERROR bullet is not a nucleus " << G4endl;
00185       globalOutput.trivialise(bullet, target);
00186       return;
00187     }
00188     
00189     ab = nbullet->getA();
00190     zb = nbullet->getZ();
00191   }
00192 
00193   G4LorentzConvertor convertToTargetRestFrame(bullet, ntarget);
00194   G4double ekin = convertToTargetRestFrame.getKinEnergyInTheTRS();
00195   
00196   if (verboseLevel > 3) G4cout << " ekin in trs " << ekin << G4endl;
00197 
00198   if (!inelasticInteractionPossible(bullet, target, ekin)) {
00199     if (verboseLevel > 3)
00200       G4cout << " InuclCollider -> inelastic interaction is impossible\n"
00201              << " due to the coulomb barirer " << G4endl;
00202 
00203     globalOutput.trivialise(bullet, target);
00204     return;
00205   }
00206 
00207   // Generate interaction secondaries in rest frame of target nucleus
00208   convertToTargetRestFrame.toTheTargetRestFrame();
00209   if (verboseLevel > 3) {
00210     G4cout << " degenerated? " << convertToTargetRestFrame.trivial()
00211            << G4endl;
00212   }
00213   
00214   G4LorentzVector bmom;                 // Bullet is along local Z
00215   bmom.setZ(convertToTargetRestFrame.getTRSMomentum());
00216 
00217   // Need to make copy of bullet with momentum realigned
00218   G4InuclParticle* zbullet = 0;
00219   if (interCase.hadNucleus())
00220     zbullet = new G4InuclElementaryParticle(bmom, btype);
00221   else
00222     zbullet = new G4InuclNuclei(bmom, ab, zb);
00223 
00224   G4int itry = 0;
00225   while (itry < itry_max) {
00226     itry++;
00227     if (verboseLevel > 2)
00228       G4cout << " InuclCollider itry " << itry << G4endl;
00229 
00230     globalOutput.reset();               // Clear buffers for this attempt
00231     output.reset();
00232 
00233     theIntraNucleiCascader->collide(zbullet, target, output);
00234     
00235     if (verboseLevel > 1) G4cout << " After Cascade " << G4endl;
00236 
00237     deexcite(output.getRecoilFragment(), output);
00238     output.removeRecoilFragment();
00239 
00240     if (verboseLevel > 2)
00241       G4cout << " itry " << itry << " finished, moving to lab frame" << G4endl;
00242 
00243     // convert to the LAB frame and add to final result
00244     output.boostToLabFrame(convertToTargetRestFrame);
00245 
00246     globalOutput.add(output);
00247 
00248     // Adjust final state particles to balance momentum and energy
00249     // FIXME:  This should no longer be necessary!
00250     globalOutput.setOnShell(bullet, target);
00251     if (globalOutput.acceptable()) {
00252       if (verboseLevel) 
00253         G4cout << " InuclCollider output after trials " << itry << G4endl;
00254       delete zbullet;
00255       return;
00256     } else {
00257       if (verboseLevel>2)
00258         G4cerr << " InuclCollider setOnShell failed." << G4endl;
00259     }
00260   }     // while (itry < itry_max)
00261   
00262   if (verboseLevel) {
00263     G4cout << " InuclCollider -> can not generate acceptable inter. after " 
00264            << itry_max << " attempts " << G4endl;
00265   }
00266   
00267   globalOutput.trivialise(bullet, target);
00268 
00269   delete zbullet;
00270   return;
00271 }

void G4InuclCollider::deexcite ( const G4Fragment fragment,
G4CollisionOutput globalOutput 
) [protected]

Definition at line 305 of file G4InuclCollider.cc.

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

Referenced by collide(), and rescatter().

00306                                                                 {
00307   if (fragment.GetA() <= 1) return;     // Nothing real to be de-excited
00308 
00309   if (verboseLevel) G4cout << " >>> G4InuclCollider::deexcite" << G4endl;
00310 
00311   G4InuclNuclei frag(fragment);         // Eventually unnecessary
00312 
00313   const G4int itry_max = 10;            // Maximum number of attempts
00314   G4int itry = 0;
00315   do {
00316     if (verboseLevel > 2) G4cout << " deexcite itry " << itry << G4endl;
00317 
00318     DEXoutput.reset();
00319     theDeexcitation->collide(0, &frag, DEXoutput);
00320   } while (!validateOutput(0, &frag, DEXoutput) && (++itry < itry_max));
00321 
00322   // Add de-excitation products to output buffer
00323   globalOutput.add(DEXoutput);
00324 }

void G4InuclCollider::rescatter ( G4InuclParticle bullet,
G4KineticTrackVector theSecondaries,
G4V3DNucleus theNucleus,
G4CollisionOutput globalOutput 
) [virtual]

Reimplemented from G4CascadeColliderBase.

Definition at line 276 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().

00279                                                                  {
00280   if (verboseLevel) G4cout << " >>> G4InuclCollider::rescatter" << G4endl;
00281 
00282   G4int itry=1;         // For diagnostic post-processing only
00283   if (verboseLevel > 2) G4cout << " InuclCollider itry " << itry << G4endl;
00284 
00285   globalOutput.reset();         // Clear buffers for this attempt
00286   output.reset();
00287 
00288   theIntraNucleiCascader->rescatter(bullet, theSecondaries, theNucleus, 
00289                                     output);
00290 
00291   if (verboseLevel > 1) G4cout << " After Rescatter" << G4endl;
00292 
00293   deexcite(output.getRecoilFragment(), output);
00294   output.removeRecoilFragment();
00295 
00296   globalOutput.add(output);     // Add local results to global output
00297 
00298   if (verboseLevel) 
00299     G4cout << " InuclCollider output after trials " << itry << G4endl;
00300 }

void G4InuclCollider::setVerboseLevel ( G4int  verbose = 0  )  [virtual]

Reimplemented from G4CascadeColliderBase.

Definition at line 92 of file G4InuclCollider.cc.

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

Referenced by G4CascadeInterface::SetVerboseLevel().

00092                                                    {
00093   G4CascadeColliderBase::setVerboseLevel(verbose);
00094 
00095   theElementaryParticleCollider->setVerboseLevel(verboseLevel);
00096   theIntraNucleiCascader->setVerboseLevel(verboseLevel);
00097   theDeexcitation->setVerboseLevel(verboseLevel);
00098 
00099   output.setVerboseLevel(verboseLevel);
00100   DEXoutput.setVerboseLevel(verboseLevel);
00101 }

void G4InuclCollider::useCascadeDeexcitation (  ) 

Definition at line 106 of file G4InuclCollider.cc.

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

Referenced by G4CascadeInterface::useCascadeDeexcitation().

00106                                              {
00107   delete theDeexcitation;
00108   theDeexcitation = new G4CascadeDeexcitation;
00109   theDeexcitation->setVerboseLevel(verboseLevel);
00110 }

void G4InuclCollider::usePreCompoundDeexcitation (  ) 

Definition at line 112 of file G4InuclCollider.cc.

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

Referenced by G4CascadeInterface::usePreCompoundDeexcitation().

00112                                                  {
00113   delete theDeexcitation;
00114   theDeexcitation = new G4PreCompoundDeexcitation;
00115   theDeexcitation->setVerboseLevel(verboseLevel);
00116 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:17 2013 for Geant4 by  doxygen 1.4.7