Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4INCL::DecayAvatar Class Reference

#include <G4INCLDecayAvatar.hh>

Inheritance diagram for G4INCL::DecayAvatar:
G4INCL::InteractionAvatar G4INCL::IAvatar

Public Member Functions

 DecayAvatar (G4INCL::Particle *aParticle, G4double time, G4INCL::Nucleus *aNucleus, G4bool force=false)
 
virtual ~DecayAvatar ()
 
G4INCL::IChannelgetChannel ()
 
G4INCL::FinalStategetFinalState ()
 
virtual void preInteraction ()
 
virtual FinalStatepostInteraction (FinalState *)
 
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 ()
 
G4INCL::FinalStategetFinalState ()
 
G4double getTime () 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. More...
 
- 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. More...
 
static const G4int maxIterLocE = 50
 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 ()
 
FinalStatepostInteraction (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...
 
- Protected Attributes inherited from G4INCL::InteractionAvatar
NucleustheNucleus
 
Particleparticle1
 
Particleparticle2
 
ThreeVector boostVector
 
G4double oldTotalEnergy
 
G4double oldXSec
 
G4bool isPiN
 
- 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 53 of file G4INCLDecayAvatar.hh.

Constructor & Destructor Documentation

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

48  : InteractionAvatar(time, n, aParticle), forced(force),
49  incidentDirection(aParticle->getMomentum())
50  {
52  }
const G4INCL::ThreeVector & getMomentum() const
InteractionAvatar(G4double, G4INCL::Nucleus *, G4INCL::Particle *)
void setType(AvatarType t)
const G4int n
G4INCL::DecayAvatar::~DecayAvatar ( )
virtual

Definition at line 54 of file G4INCLDecayAvatar.cc.

54  {
55 
56  }

Member Function Documentation

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

Implements G4INCL::IAvatar.

Definition at line 183 of file G4INCLDecayAvatar.cc.

References G4INCL::Particle::dump(), G4INCL::InteractionAvatar::particle1, and G4INCL::IAvatar::theTime.

183  {
184  std::stringstream ss;
185  ss << "(avatar " << theTime << " 'decay" << std::endl
186  << "(list " << std::endl
187  << particle1->dump()
188  << "))" << std::endl;
189  return ss.str();
190  }
std::string dump() const
G4INCL::IChannel * G4INCL::DecayAvatar::getChannel ( )
virtual

Implements G4INCL::InteractionAvatar.

Definition at line 58 of file G4INCLDecayAvatar.cc.

References INCL_DEBUG, G4INCL::Particle::isDelta(), and G4INCL::InteractionAvatar::particle1.

58  {
59  if(particle1->isDelta()) {
60  INCL_DEBUG("DeltaDecayChannel chosen." << std::endl);
61  return new DeltaDecayChannel(particle1, incidentDirection);
62  }
63  else
64  return NULL;
65  }
G4bool isDelta() const
Is it a Delta?
#define INCL_DEBUG(x)
G4INCL::FinalState* G4INCL::DecayAvatar::getFinalState ( )
ParticleList G4INCL::DecayAvatar::getParticles ( ) const
inlinevirtual

Implements G4INCL::IAvatar.

Definition at line 64 of file G4INCLDecayAvatar.hh.

References G4INCL::InteractionAvatar::particle1.

64  {
65  ParticleList theParticleList;
66  theParticleList.push_back(particle1);
67  return theParticleList;
68  }
UnorderedVector< Particle * > ParticleList
FinalState * G4INCL::DecayAvatar::postInteraction ( FinalState fs)
virtual

Implements G4INCL::IAvatar.

Definition at line 71 of file G4INCLDecayAvatar.cc.

References G4INCL::FinalState::addModifiedParticle(), G4INCL::InteractionAvatar::enforceEnergyConservation(), G4INCL::Store::getBook(), G4INCL::FinalState::getCreatedParticles(), G4INCL::FinalState::getModifiedParticles(), G4INCL::Nucleus::getStore(), G4INCL::FinalState::getValidity(), INCL_DEBUG, 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.

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

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