#include <G4INCLDecayAvatar.hh>
Inheritance diagram for G4INCL::DecayAvatar:
Public Member Functions | |
DecayAvatar (G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *aNucleus, G4bool force=false) | |
virtual | ~DecayAvatar () |
G4INCL::IChannel * | getChannel () const |
G4INCL::FinalState * | getFinalState () const |
virtual void | preInteraction () |
virtual FinalState * | postInteraction (FinalState *) |
ParticleList | getParticles () const |
std::string | dump () const |
The reflection avatar is created when a particle reaches the boundary of the nucleus. At this point it can either be reflected from the boundary or exit the nucleus.
Definition at line 53 of file G4INCLDecayAvatar.hh.
G4INCL::DecayAvatar::DecayAvatar | ( | G4INCL::Particle * | aParticle, | |
G4double | time, | |||
G4INCL::Nucleus * | aNucleus, | |||
G4bool | force = false | |||
) |
Definition at line 47 of file G4INCLDecayAvatar.cc.
References G4INCL::DecayAvatarType, and G4INCL::IAvatar::setType().
00048 : InteractionAvatar(time, n, aParticle), forced(force), 00049 incidentDirection(aParticle->getMomentum()) 00050 { 00051 setType(DecayAvatarType); 00052 }
G4INCL::DecayAvatar::~DecayAvatar | ( | ) | [virtual] |
std::string G4INCL::DecayAvatar::dump | ( | ) | const [virtual] |
Implements G4INCL::IAvatar.
Definition at line 184 of file G4INCLDecayAvatar.cc.
References G4INCL::Particle::dump(), G4INCL::InteractionAvatar::particle1, and G4INCL::IAvatar::theTime.
00184 { 00185 std::stringstream ss; 00186 ss << "(avatar " << theTime << " 'decay" << std::endl 00187 << "(list " << std::endl 00188 << particle1->dump() 00189 << "))" << std::endl; 00190 return ss.str(); 00191 }
G4INCL::IChannel * G4INCL::DecayAvatar::getChannel | ( | ) | const [virtual] |
Implements G4INCL::InteractionAvatar.
Definition at line 58 of file G4INCLDecayAvatar.cc.
References DEBUG, G4INCL::Particle::isDelta(), G4INCL::InteractionAvatar::particle1, and G4INCL::InteractionAvatar::theNucleus.
00059 { 00060 if(particle1->isDelta()) { 00061 DEBUG("DeltaDecayChannel chosen." << std::endl); 00062 return new DeltaDecayChannel(theNucleus, particle1, incidentDirection); 00063 } 00064 else 00065 return NULL; 00066 }
G4INCL::FinalState* G4INCL::DecayAvatar::getFinalState | ( | ) | const |
ParticleList G4INCL::DecayAvatar::getParticles | ( | ) | const [inline, virtual] |
Implements G4INCL::IAvatar.
Definition at line 64 of file G4INCLDecayAvatar.hh.
References G4INCL::InteractionAvatar::particle1.
00064 { 00065 ParticleList theParticleList; 00066 theParticleList.push_back(particle1); 00067 return theParticleList; 00068 }
FinalState * G4INCL::DecayAvatar::postInteraction | ( | FinalState * | ) | [virtual] |
Reimplemented from G4INCL::InteractionAvatar.
Definition at line 72 of file G4INCLDecayAvatar.cc.
References G4INCL::FinalState::addModifiedParticle(), DEBUG, G4INCL::InteractionAvatar::enforceEnergyConservation(), G4INCL::Store::getBook(), G4INCL::FinalState::getCreatedParticles(), G4INCL::FinalState::getModifiedParticles(), G4INCL::Nucleus::getStore(), G4INCL::FinalState::getValidity(), G4INCL::Book::incrementAcceptedDecays(), G4INCL::Book::incrementBlockedDecays(), G4INCL::Pauli::isCDPPBlocked(), G4INCL::FinalState::makeNoEnergyConservation(), G4INCL::FinalState::makePauliBlocked(), G4INCL::NoEnergyConservationFS, G4INCL::InteractionAvatar::oldTotalEnergy, G4INCL::InteractionAvatar::particle1, G4INCL::ParticleBelowFermiFS, G4INCL::ParticleBelowZeroFS, G4INCL::PauliBlockedFS, G4INCL::InteractionAvatar::postInteraction(), G4INCL::InteractionAvatar::restoreParticles(), G4INCL::FinalState::setBlockedDelta(), G4INCL::FinalState::setTotalEnergyBeforeInteraction(), G4INCL::InteractionAvatar::theNucleus, and G4INCL::ValidFS.
00072 { 00073 // Make sure we have at least two particles in the final state 00074 // assert(fs->getModifiedParticles().size() + fs->getCreatedParticles().size() - fs->getDestroyedParticles().size() >= 2); 00075 00076 if(!forced) { // Normal decay 00077 00078 // Call the postInteraction method of the parent class 00079 // (provides Pauli blocking and enforces energy conservation) 00080 fs = InteractionAvatar::postInteraction(fs); 00081 00082 if(fs->getValidity() == PauliBlockedFS) 00083 /* If the decay was Pauli-blocked, make sure the propagation model 00084 * generates a new decay avatar on the next call to propagate(). 00085 * 00086 * \bug{Note that we don't generate new decay avatars for deltas that 00087 * could not satisfy energy conservation. This is in keeping with 00088 * INCL4.6, but doesn't seem to make much sense to me (DM), as energy 00089 * conservation can be impossible to satisfy due to weird local-energy 00090 * conditions, for example, that evolve with time.} 00091 */ 00092 fs->setBlockedDelta(particle1); 00093 00094 } else { // Forced decay 00095 ParticleList created = fs->getCreatedParticles(); 00096 00097 // Try to enforce energy conservation 00098 fs->setTotalEnergyBeforeInteraction(oldTotalEnergy); 00099 const G4bool success = enforceEnergyConservation(fs); 00100 if(!success) { 00101 DEBUG("Enforcing energy conservation: failed!" << std::endl); 00102 00103 if(theNucleus) { 00104 // Restore the state of the initial particles 00105 restoreParticles(); 00106 00107 // Delete newly created particles 00108 for( ParticleIter i = created.begin(); i != created.end(); ++i ) 00109 delete *i; 00110 00111 FinalState *fsBlocked = new FinalState; 00112 delete fs; 00113 fsBlocked->makeNoEnergyConservation(); 00114 fsBlocked->setTotalEnergyBeforeInteraction(0.0); 00115 00116 return fsBlocked; // Interaction is blocked. Return an empty final state. 00117 } else { 00118 // If there is no nucleus we have to continue anyway, even if energy 00119 // conservation failed. We cannot afford producing unphysical 00120 // remnants. 00121 DEBUG("No nucleus, continuing anyway." << std::endl); 00122 } 00123 } else { 00124 DEBUG("Enforcing energy conservation: success!" << std::endl); 00125 } 00126 00127 if(theNucleus) { 00128 ParticleList modified = fs->getModifiedParticles(); 00129 00130 // Copy the final state, but don't include the pion (as if it had been 00131 // emitted right away). 00132 FinalState *emissionFS = new FinalState; 00133 for(ParticleIter i=modified.begin(); i!=modified.end(); ++i) 00134 emissionFS->addModifiedParticle(*i); 00135 00136 // Test CDPP blocking 00137 G4bool isCDPPBlocked = Pauli::isCDPPBlocked(created, theNucleus); 00138 00139 if(isCDPPBlocked) { 00140 DEBUG("CDPP: Blocked!" << std::endl); 00141 00142 // Restore the state of both particles 00143 restoreParticles(); 00144 00145 // Delete newly created particles 00146 for( ParticleIter i = created.begin(); i != created.end(); ++i ) 00147 delete *i; 00148 00149 FinalState *fsBlocked = new FinalState; 00150 delete fs; 00151 delete emissionFS; 00152 00153 fsBlocked->makePauliBlocked(); 00154 fsBlocked->setTotalEnergyBeforeInteraction(0.0); 00155 00156 return fsBlocked; // Interaction is blocked. Return an empty final state. 00157 } 00158 DEBUG("CDPP: Allowed!" << std::endl); 00159 00160 // If all went well (energy conservation enforced and CDPP satisfied), 00161 // delete the auxiliary final state 00162 delete emissionFS; 00163 00164 } 00165 } 00166 00167 // If there is a nucleus, increment the counters 00168 if(theNucleus) { 00169 switch(fs->getValidity()) { 00170 case PauliBlockedFS: 00171 theNucleus->getStore()->getBook()->incrementBlockedDecays(); 00172 break; 00173 case NoEnergyConservationFS: 00174 case ParticleBelowFermiFS: 00175 case ParticleBelowZeroFS: 00176 break; 00177 case ValidFS: 00178 theNucleus->getStore()->getBook()->incrementAcceptedDecays(); 00179 } 00180 } 00181 return fs; 00182 }
void G4INCL::DecayAvatar::preInteraction | ( | ) | [virtual] |
Reimplemented from G4INCL::InteractionAvatar.
Definition at line 68 of file G4INCLDecayAvatar.cc.
References G4INCL::InteractionAvatar::preInteraction().
00068 { 00069 InteractionAvatar::preInteraction(); 00070 }