Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4INCL::DecayAvatar Class Reference

#include <G4INCLDecayAvatar.hh>

Inheritance diagram for G4INCL::DecayAvatar:

Public Member Functions

 DecayAvatar (G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *aNucleus, G4bool force=false)
 DecayAvatar (G4INCL::Particle *aParticle, G4INCL::Particle *bParticle, G4double time, G4INCL::Nucleus *aNucleus, G4bool force=false)
virtual ~DecayAvatar ()
IChannelgetChannel ()
void fillFinalState (FinalState *fs)
virtual void preInteraction ()
virtual void postInteraction (FinalState *fs)
ParticleList getParticles () const
std::string dump () const
Public Member Functions inherited from G4INCL::InteractionAvatar
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *)
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
virtual ~InteractionAvatar ()
void setSrcPartner (Particle *p)
void preInteractionLocalEnergy (Particle *const p)
 Apply local-energy transformation, if appropriate.
ThreeVector getboostVector ()
void setboostVector (ThreeVector &v)
Public Member Functions inherited from G4INCL::IAvatar
 IAvatar ()
 IAvatar (G4double time)
virtual ~IAvatar ()
FinalStategetFinalState ()
void fillFinalState (FinalState *fs)
G4double getTime () const
G4double setTime (G4double t) const
AvatarType getType () const
G4bool isACollision () const
G4bool isADecay () const
void setType (AvatarType t)
long getID () const
std::string toString ()

Additional Inherited Members

Static Public Member Functions inherited from G4INCL::InteractionAvatar
static void deleteBackupParticles ()
 Release the memory allocated for the backup particles.
static InteractionAvatarInstance ()
Static Public Attributes inherited from G4INCL::InteractionAvatar
static const G4double locEAccuracy = 1.E-4
 Target accuracy in the determination of the local-energy Q-value.
static const G4int maxIterLocE = 50
 Max number of iterations for the determination of the local-energy Q-value.
Protected Member Functions inherited from G4INCL::InteractionAvatar
G4bool bringParticleInside (Particle *const p)
void preInteractionBlocking ()
 Store the state of the particles before the interaction.
void preInteraction ()
void postInteraction (FinalState *)
void restoreParticles () const
 Restore the state of both particles.
void restoreSrcPartner (FinalState *fs)
G4bool shouldUseLocalEnergy () const
 true if the given avatar should use local energy
G4bool enforceEnergyConservation (FinalState *const fs)
 Enforce energy conservation.
Protected Attributes inherited from G4INCL::InteractionAvatar
EventInfo theEventInfo
NucleustheNucleus
Particleparticle1
Particleparticle2
ThreeVector boostVector
G4double oldTotalEnergy
G4double oldXSec
G4bool isPiN
G4double weight
ParticleList modified
ParticleList created
ParticleList modifiedAndCreated
ParticleList Destroyed
ParticleList ModifiedAndDestroyed
Protected Attributes inherited from G4INCL::IAvatar
G4double theTime
Static Protected Attributes inherited from G4INCL::InteractionAvatar
static G4ThreadLocal ParticlebackupParticle1 = NULL
static G4ThreadLocal ParticlebackupParticle2 = NULL

Detailed Description

Decay avatar

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 55 of file G4INCLDecayAvatar.hh.

Constructor & Destructor Documentation

◆ DecayAvatar() [1/2]

G4INCL::DecayAvatar::DecayAvatar ( G4INCL::Particle * aParticle,
G4double time,
G4INCL::Nucleus * aNucleus,
G4bool force = false )

Definition at line 52 of file G4INCLDecayAvatar.cc.

53 : InteractionAvatar(time, n, aParticle), forced(force),
54 incidentDirection(aParticle->getMomentum())
55 {
57 }
void setType(AvatarType t)
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
const G4INCL::ThreeVector & getMomentum() const
@ DecayAvatarType

◆ DecayAvatar() [2/2]

G4INCL::DecayAvatar::DecayAvatar ( G4INCL::Particle * aParticle,
G4INCL::Particle * bParticle,
G4double time,
G4INCL::Nucleus * aNucleus,
G4bool force = false )

Definition at line 59 of file G4INCLDecayAvatar.cc.

60 : InteractionAvatar(time, n, aParticle, bParticle), forced(force),
61 incidentDirection(aParticle->getMomentum())
62 {
64 }

◆ ~DecayAvatar()

G4INCL::DecayAvatar::~DecayAvatar ( )
virtual

Definition at line 66 of file G4INCLDecayAvatar.cc.

66 {
67
68 }

Member Function Documentation

◆ dump()

std::string G4INCL::DecayAvatar::dump ( ) const
virtual

Implements G4INCL::IAvatar.

Definition at line 207 of file G4INCLDecayAvatar.cc.

207 {
208 std::stringstream ss;
209 ss << "(avatar " << theTime << " 'decay" << '\n'
210 << "(list " << '\n'
211 << particle1->dump()
212 << "))" << '\n';
213 return ss.str();
214 }

◆ fillFinalState()

void G4INCL::DecayAvatar::fillFinalState ( FinalState * fs)

◆ getChannel()

G4INCL::IChannel * G4INCL::DecayAvatar::getChannel ( )
virtual

Implements G4INCL::InteractionAvatar.

Definition at line 70 of file G4INCLDecayAvatar.cc.

70 {
71 if(!particle2){
72 if(particle1->isDelta()) {
73 INCL_DEBUG("DeltaDecayChannel chosen." << '\n');
74 return new DeltaDecayChannel(particle1, incidentDirection);
75 }
76 else if(particle1->isEta() || particle1->isOmega()) {
77 INCL_DEBUG("PionResonanceDecayChannel chosen." << '\n');
78 return new PionResonanceDecayChannel(particle1, incidentDirection);
79 }
80 else if(particle1->getType() == SigmaZero) {
81 INCL_DEBUG("SigmaZeroDecayChannel chosen." << '\n');
82 return new SigmaZeroDecayChannel(particle1, incidentDirection);
83 }
84 else if(particle1->getType() == KZero || particle1->getType() == KZeroBar) {
85 INCL_DEBUG("NeutralKaonDecayChannel chosen." << '\n');
86 return new NeutralKaonDecayChannel(particle1);
87 }
88 }
89 else if(((particle1->isAntiKaon() || particle1->isSigma()) && particle2->isNucleon()) || ((particle2->isAntiKaon() || particle2->isSigma()) && particle1->isNucleon())){
90 INCL_DEBUG("StrangeAbsorbtion." << '\n');
91 return new StrangeAbsorbtionChannel(particle1, particle2);
92 }
93 return NULL;
94 }
#define INCL_DEBUG(x)

◆ getParticles()

ParticleList G4INCL::DecayAvatar::getParticles ( ) const
inlinevirtual

Implements G4INCL::IAvatar.

Definition at line 67 of file G4INCLDecayAvatar.hh.

67 {
68 ParticleList theParticleList;
69 theParticleList.push_back(particle1);
70 return theParticleList;
71 }
std::vector< Base * > ParticleList
Definition PoPI.hpp:186

◆ postInteraction()

void G4INCL::DecayAvatar::postInteraction ( FinalState * fs)
virtual

Implements G4INCL::IAvatar.

Definition at line 100 of file G4INCLDecayAvatar.cc.

100 {
101 // Make sure we have at least two particles in the final state
102 // Removed because of neutral kaon decay
103
104// assert((fs->getModifiedParticles().size() + fs->getCreatedParticles().size() - fs->getDestroyedParticles().size() >= 2) || ((*fs->getModifiedParticles().begin())->getType() == KShort || (*fs->getModifiedParticles().begin())->getType() == KLong ));
105 //assert((fs->getModifiedParticles().size() + fs->getCreatedParticles().size() - fs->getDestroyedParticles().size() >= 1));
106 if(!forced) { // Normal decay
107 // Call the postInteraction method of the parent class
108 // (provides Pauli blocking and enforces energy conservation)
110
111 if(fs->getValidity() == PauliBlockedFS)
112 /* If the decay was Pauli-blocked, make sure the propagation model
113 * generates a new decay avatar on the next call to propagate().
114 *
115 * \bug{Note that we don't generate new decay avatars for deltas that
116 * could not satisfy energy conservation. This is in keeping with
117 * INCL4.6, but doesn't seem to make much sense to me (DM), as energy
118 * conservation can be impossible to satisfy due to weird local-energy
119 * conditions, for example, that evolve with time.}
120 */
121 fs->addModifiedParticle(particle1);
122 } else { // Forced decay
123 modified = fs->getModifiedParticles();
124 created = fs->getCreatedParticles();
125 Destroyed = fs->getDestroyedParticles();
127 modifiedAndCreated.insert(modifiedAndCreated.end(), created.begin(), created.end());
129 ModifiedAndDestroyed.insert(ModifiedAndDestroyed.end(), Destroyed.begin(), Destroyed.end());
130
131 std::vector<G4int> newBiasCollisionVector;
132 newBiasCollisionVector = ModifiedAndDestroyed.getParticleListBiasVector();
133 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i ) {
134 (*i)->setBiasCollisionVector(newBiasCollisionVector);
135 }
136 // Try to enforce energy conservation
137 fs->setTotalEnergyBeforeInteraction(oldTotalEnergy);
138 const G4bool success = enforceEnergyConservation(fs);
139 if(!success) {
140 INCL_DEBUG("Enforcing energy conservation: failed!" << '\n');
141
142 if(theNucleus) {
143 // Restore the state of the initial particles
145
146 // Delete newly created particles
147 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
148 delete *i;
149
150 fs->reset();
151 fs->makeNoEnergyConservation();
152 fs->setTotalEnergyBeforeInteraction(0.0);
153
154 return; // Interaction is blocked. Return an empty final state.
155 } else {
156 // If there is no nucleus we have to continue anyway, even if energy
157 // conservation failed. We cannot afford producing unphysical
158 // remnants.
159 INCL_DEBUG("No nucleus, continuing anyway." << '\n');
160 }
161 } else {
162 INCL_DEBUG("Enforcing energy conservation: success!" << '\n');
163 }
164
165 if(theNucleus) {
166 // Test CDPP blocking
168
169 if(isCDPPBlocked) {
170 INCL_DEBUG("CDPP: Blocked!" << '\n');
171
172 // Restore the state of both particles
174
175 // Delete newly created particles
176 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
177 delete *i;
178
179 fs->reset();
180 fs->makePauliBlocked();
181 fs->setTotalEnergyBeforeInteraction(0.0);
182
183 return; // Interaction is blocked. Return an empty final state.
184 }
185 INCL_DEBUG("CDPP: Allowed!" << '\n');
186
187 }
188 }
189 // If there is a nucleus, increment the counters
190 if(theNucleus) {
191 switch(fs->getValidity()) {
192 case PauliBlockedFS:
193 theNucleus->getStore()->getBook().incrementBlockedDecays();
194 break;
198 break;
199 case ValidFS:
200 theNucleus->getStore()->getBook().incrementAcceptedDecays();
201 }
202 }
203
204 return;
205 }
bool G4bool
Definition G4Types.hh:86
void restoreParticles() const
Restore the state of both particles.
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
G4bool isCDPPBlocked(ParticleList const &p, Nucleus const *const n)
Check CDPP blocking.
ParticleList::const_iterator ParticleIter
@ NoEnergyConservationFS

◆ preInteraction()

void G4INCL::DecayAvatar::preInteraction ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 96 of file G4INCLDecayAvatar.cc.


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