Geant4  10.02.p03
G4INCL::DecayAvatar Class Reference

#include <G4INCLDecayAvatar.hh>

Inheritance diagram for G4INCL::DecayAvatar:
Collaboration diagram for G4INCL::DecayAvatar:

Public Member Functions

 DecayAvatar (G4INCL::Particle *aParticle, 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 ()
 
- Public Member Functions inherited from G4INCL::IAvatar
 IAvatar ()
 
 IAvatar (G4double time)
 
virtual ~IAvatar ()
 
FinalStategetFinalState ()
 
void fillFinalState (FinalState *fs)
 
G4double getTime () const
 
AvatarType getType () const
 
G4bool isACollision () const
 
G4bool isADecay () const
 
void setType (AvatarType t)
 
long getID () const
 
std::string toString ()
 

Private Member Functions

 INCL_DECLARE_ALLOCATION_POOL (DecayAvatar)
 

Private Attributes

G4bool forced
 
ThreeVector const incidentDirection
 

Additional Inherited Members

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

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

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

Definition at line 48 of file G4INCLDecayAvatar.cc.

49  : InteractionAvatar(time, n, aParticle), forced(force),
50  incidentDirection(aParticle->getMomentum())
51  {
53  }
ThreeVector const incidentDirection
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
Char_t n[5]
void setType(AvatarType t)
const G4INCL::ThreeVector & getMomentum() const
Here is the call graph for this function:

◆ ~DecayAvatar()

G4INCL::DecayAvatar::~DecayAvatar ( )
virtual

Definition at line 55 of file G4INCLDecayAvatar.cc.

55  {
56 
57  }

Member Function Documentation

◆ dump()

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

Implements G4INCL::IAvatar.

Definition at line 169 of file G4INCLDecayAvatar.cc.

169  {
170  std::stringstream ss;
171  ss << "(avatar " << theTime << " 'decay" << '\n'
172  << "(list " << '\n'
173  << particle1->dump()
174  << "))" << '\n';
175  return ss.str();
176  }
std::string dump() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ fillFinalState()

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

◆ getChannel()

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

Implements G4INCL::InteractionAvatar.

Definition at line 59 of file G4INCLDecayAvatar.cc.

59  {
60  if(particle1->isDelta()) {
61  INCL_DEBUG("DeltaDecayChannel chosen." << '\n');
62  return new DeltaDecayChannel(particle1, incidentDirection);
63  }
64  else
65  return NULL;
66  }
ThreeVector const incidentDirection
G4bool isDelta() const
Is it a Delta?
#define INCL_DEBUG(x)
Here is the call graph for this function:

◆ getParticles()

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

Implements G4INCL::IAvatar.

Definition at line 66 of file G4INCLDecayAvatar.hh.

66  {
67  ParticleList theParticleList;
68  theParticleList.push_back(particle1);
69  return theParticleList;
70  }
Here is the call graph for this function:

◆ INCL_DECLARE_ALLOCATION_POOL()

G4INCL::DecayAvatar::INCL_DECLARE_ALLOCATION_POOL ( DecayAvatar  )
private

◆ postInteraction()

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

Implements G4INCL::IAvatar.

Definition at line 72 of file G4INCLDecayAvatar.cc.

72  {
73  // Make sure we have at least two particles in the final state
74 // assert(fs->getModifiedParticles().size() + fs->getCreatedParticles().size() - fs->getDestroyedParticles().size() >= 2);
75 
76  if(!forced) { // Normal decay
77 
78  // Call the postInteraction method of the parent class
79  // (provides Pauli blocking and enforces energy conservation)
81 
82  if(fs->getValidity() == PauliBlockedFS)
83  /* If the decay was Pauli-blocked, make sure the propagation model
84  * generates a new decay avatar on the next call to propagate().
85  *
86  * \bug{Note that we don't generate new decay avatars for deltas that
87  * could not satisfy energy conservation. This is in keeping with
88  * INCL4.6, but doesn't seem to make much sense to me (DM), as energy
89  * conservation can be impossible to satisfy due to weird local-energy
90  * conditions, for example, that evolve with time.}
91  */
92  fs->addModifiedParticle(particle1);
93 
94  } else { // Forced decay
95  created = fs->getCreatedParticles();
96  modified = fs->getModifiedParticles();
97 
98  // Try to enforce energy conservation
99  fs->setTotalEnergyBeforeInteraction(oldTotalEnergy);
100  const G4bool success = enforceEnergyConservation(fs);
101  if(!success) {
102  INCL_DEBUG("Enforcing energy conservation: failed!" << '\n');
103 
104  if(theNucleus) {
105  // Restore the state of the initial particles
107 
108  // Delete newly created particles
109  for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
110  delete *i;
111 
112  fs->reset();
113  fs->makeNoEnergyConservation();
114  fs->setTotalEnergyBeforeInteraction(0.0);
115 
116  return; // Interaction is blocked. Return an empty final state.
117  } else {
118  // If there is no nucleus we have to continue anyway, even if energy
119  // conservation failed. We cannot afford producing unphysical
120  // remnants.
121  INCL_DEBUG("No nucleus, continuing anyway." << '\n');
122  }
123  } else {
124  INCL_DEBUG("Enforcing energy conservation: success!" << '\n');
125  }
126 
127  if(theNucleus) {
128  // Test CDPP blocking
130 
131  if(isCDPPBlocked) {
132  INCL_DEBUG("CDPP: Blocked!" << '\n');
133 
134  // Restore the state of both particles
136 
137  // Delete newly created particles
138  for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
139  delete *i;
140 
141  fs->reset();
142  fs->makePauliBlocked();
143  fs->setTotalEnergyBeforeInteraction(0.0);
144 
145  return; // Interaction is blocked. Return an empty final state.
146  }
147  INCL_DEBUG("CDPP: Allowed!" << '\n');
148 
149  }
150  }
151 
152  // If there is a nucleus, increment the counters
153  if(theNucleus) {
154  switch(fs->getValidity()) {
155  case PauliBlockedFS:
157  break;
160  case ParticleBelowZeroFS:
161  break;
162  case ValidFS:
164  }
165  }
166  return;
167  }
void incrementBlockedDecays()
Definition: G4INCLBook.hh:75
Store * getStore() const
void postInteraction(FinalState *)
void restoreParticles() const
Restore the state of both particles.
Book & getBook()
Definition: G4INCLStore.hh:259
bool G4bool
Definition: G4Types.hh:79
void incrementAcceptedDecays()
Definition: G4INCLBook.hh:74
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
G4bool isCDPPBlocked(ParticleList const &created, Nucleus const *const nucleus)
#define INCL_DEBUG(x)
ParticleList::const_iterator ParticleIter
Here is the call graph for this function:

◆ preInteraction()

void G4INCL::DecayAvatar::preInteraction ( )
virtual

Implements G4INCL::IAvatar.

Definition at line 68 of file G4INCLDecayAvatar.cc.

Here is the call graph for this function:

Member Data Documentation

◆ forced

G4bool G4INCL::DecayAvatar::forced
private

Definition at line 74 of file G4INCLDecayAvatar.hh.

◆ incidentDirection

ThreeVector const G4INCL::DecayAvatar::incidentDirection
private

Definition at line 75 of file G4INCLDecayAvatar.hh.


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