Geant4-11
Data Structures | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Attributes | Static Private Attributes
G4INCL::InteractionAvatar Class Referenceabstract

#include <G4INCLInteractionAvatar.hh>

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

Data Structures

class  ViolationEEnergyFunctor
 RootFunctor-derived object for enforcing energy conservation in delta production. More...
 
class  ViolationEMomentumFunctor
 RootFunctor-derived object for enforcing energy conservation in N-N. More...
 

Public Member Functions

virtual std::string dump () const =0
 
void fillFinalState (FinalState *fs)
 
FinalStategetFinalState ()
 
long getID () const
 
virtual ParticleList getParticles () const =0
 
G4double getTime () const
 
AvatarType getType () const
 
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *)
 
 InteractionAvatar (G4double, G4INCL::Nucleus *, G4INCL::Particle *, G4INCL::Particle *)
 
G4bool isACollision () const
 
G4bool isADecay () const
 
void setType (AvatarType t)
 
std::string toString ()
 
virtual ~InteractionAvatar ()
 

Static Public Member Functions

static void deleteBackupParticles ()
 Release the memory allocated for the backup particles. More...
 

Static Public Attributes

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

G4bool bringParticleInside (Particle *const p)
 
G4bool enforceEnergyConservation (FinalState *const fs)
 Enforce energy conservation. More...
 
virtual G4INCL::IChannelgetChannel ()=0
 
void postInteraction (FinalState *)
 
void preInteraction ()
 
void preInteractionBlocking ()
 Store the state of the particles before the interaction. More...
 
void preInteractionLocalEnergy (Particle *const p)
 Apply local-energy transformation, if appropriate. More...
 
void restoreParticles () const
 Restore the state of both particles. More...
 
G4bool shouldUseLocalEnergy () const
 true if the given avatar should use local energy More...
 

Protected Attributes

ThreeVector boostVector
 
ParticleList created
 
ParticleList Destroyed
 
G4bool isPiN
 
ParticleList modified
 
ParticleList modifiedAndCreated
 
ParticleList ModifiedAndDestroyed
 
G4double oldTotalEnergy
 
G4double oldXSec
 
Particleparticle1
 
Particleparticle2
 
NucleustheNucleus
 
G4double theTime
 
G4double weight
 

Static Protected Attributes

static G4ThreadLocal ParticlebackupParticle1 = NULL
 
static G4ThreadLocal ParticlebackupParticle2 = NULL
 

Private Attributes

long ID
 
AvatarType type
 
RootFunctorviolationEFunctor
 

Static Private Attributes

static G4ThreadLocal long nextID = 1
 

Detailed Description

Definition at line 61 of file G4INCLInteractionAvatar.hh.

Constructor & Destructor Documentation

◆ InteractionAvatar() [1/2]

G4INCL::InteractionAvatar::InteractionAvatar ( G4double  time,
G4INCL::Nucleus n,
G4INCL::Particle p1 
)

◆ InteractionAvatar() [2/2]

G4INCL::InteractionAvatar::InteractionAvatar ( G4double  time,
G4INCL::Nucleus n,
G4INCL::Particle p1,
G4INCL::Particle p2 
)

Definition at line 74 of file G4INCLInteractionAvatar.cc.

76 : IAvatar(time), theNucleus(n),
77 particle1(p1), particle2(p2),
78 isPiN((p1->isPion() && p2->isNucleon()) || (p2->isPion() && p1->isNucleon())),
79 weight(1.),
81 {
82 }
G4bool isPion() const
Is this a pion?
G4bool isNucleon() const

◆ ~InteractionAvatar()

G4INCL::InteractionAvatar::~InteractionAvatar ( )
virtual

Definition at line 84 of file G4INCLInteractionAvatar.cc.

84 {
85 }

Member Function Documentation

◆ bringParticleInside()

G4bool G4INCL::InteractionAvatar::bringParticleInside ( Particle *const  p)
protected

Definition at line 137 of file G4INCLInteractionAvatar.cc.

137 {
138 if(!theNucleus)
139 return false;
140
141 ThreeVector pos = p->getPosition();
142 p->rpCorrelate();
143 G4double pos2 = pos.mag2();
145 short iterations=0;
146 const short maxIterations=50;
147
148 if(pos2 < r*r) return true;
149
150 while( pos2 >= r*r && iterations<maxIterations ) /* Loop checking, 10.07.2015, D.Mancusi */
151 {
152 pos *= std::sqrt(r*r*0.9801/pos2); // 0.9801 == 0.99*0.99
153 pos2 = pos.mag2();
154 iterations++;
155 }
156 if( iterations < maxIterations)
157 {
158 INCL_DEBUG("Particle position vector length was : " << p->getPosition().mag() << ", rescaled to: " << pos.mag() << '\n');
159 p->setPosition(pos);
160 return true;
161 }
162 else
163 return false;
164 }
static const G4double pos
#define INCL_DEBUG(x)
double G4double
Definition: G4Types.hh:83
G4double getSurfaceRadius(Particle const *const particle) const
Get the maximum allowed radius for a given particle.
const G4int maxIterations
Maximum number of iterations for convergence.

References G4INCL::Particle::getPosition(), G4INCL::Nucleus::getSurfaceRadius(), INCL_DEBUG, G4INCL::ThreeVector::mag(), G4INCL::RootFinder::anonymous_namespace{G4INCLRootFinder.cc}::maxIterations, pos, G4INCL::Particle::rpCorrelate(), G4INCL::Particle::setPosition(), and theNucleus.

Referenced by postInteraction().

◆ deleteBackupParticles()

void G4INCL::InteractionAvatar::deleteBackupParticles ( )
static

Release the memory allocated for the backup particles.

Definition at line 87 of file G4INCLInteractionAvatar.cc.

87 {
88 delete backupParticle1;
90 delete backupParticle2;
91 backupParticle1 = NULL;
92 backupParticle2 = NULL;
93 }
static G4ThreadLocal Particle * backupParticle2
static G4ThreadLocal Particle * backupParticle1

References backupParticle1, and backupParticle2.

Referenced by G4INCL::INCL::~INCL().

◆ dump()

virtual std::string G4INCL::IAvatar::dump ( ) const
pure virtualinherited

◆ enforceEnergyConservation()

G4bool G4INCL::InteractionAvatar::enforceEnergyConservation ( FinalState *const  fs)
protected

Enforce energy conservation.

Final states generated by the channels might violate energy conservation because of different reasons (energy-dependent potentials, local energy...). This conservation law must therefore be enforced by hand. We do so by rescaling the momenta of the final-state particles in the CM frame. If this turns out to be impossible, this method returns false.

Returns
true if the algorithm succeeded

Definition at line 359 of file G4INCLInteractionAvatar.cc.

359 {
360 // Set up the violationE calculation
361 const G4bool manyBodyFinalState = (modifiedAndCreated.size() > 1);
362
363 if(manyBodyFinalState)
364 violationEFunctor = new ViolationEMomentumFunctor(theNucleus, modifiedAndCreated, fs->getTotalEnergyBeforeInteraction(), boostVector, shouldUseLocalEnergy());
365 else {
366 Particle * const p = modified.front();
367 // The following condition is necessary for the functor to work
368 // correctly. A similar condition exists in INCL4.6.
369 if(p->getMass() < ParticleTable::minDeltaMass)
370 return false;
371 violationEFunctor = new ViolationEEnergyFunctor(theNucleus, p, fs->getTotalEnergyBeforeInteraction(), shouldUseLocalEnergy());
372 }
373
374 // Apply the root-finding algorithm
375 const RootFinder::Solution theSolution = RootFinder::solve(violationEFunctor, 1.0);
376 if(theSolution.success) { // Apply the solution
377 (*violationEFunctor)(theSolution.x);
378 } else if(theNucleus){
379 INCL_DEBUG("Couldn't enforce energy conservation after an interaction, root-finding algorithm failed." << '\n');
381 }
382 delete violationEFunctor;
383 violationEFunctor = NULL;
384 return theSolution.success;
385 }
bool G4bool
Definition: G4Types.hh:86
void incrementEnergyViolationInteraction()
Definition: G4INCLBook.hh:80
G4bool shouldUseLocalEnergy() const
true if the given avatar should use local energy
Store * getStore() const
Book & getBook()
Definition: G4INCLStore.hh:259
G4ThreadLocal G4double minDeltaMass
Solution solve(RootFunctor const *const f, const G4double x0)
Numerically solve a one-dimensional equation.

References boostVector, G4INCL::Store::getBook(), G4INCL::Particle::getMass(), G4INCL::Nucleus::getStore(), G4INCL::FinalState::getTotalEnergyBeforeInteraction(), INCL_DEBUG, G4INCL::Book::incrementEnergyViolationInteraction(), G4INCL::ParticleTable::minDeltaMass, modified, modifiedAndCreated, shouldUseLocalEnergy(), G4INCL::RootFinder::solve(), G4INCL::RootFinder::Solution::success, theNucleus, violationEFunctor, and G4INCL::RootFinder::Solution::x.

Referenced by postInteraction(), and G4INCL::DecayAvatar::postInteraction().

◆ fillFinalState()

void G4INCL::IAvatar::fillFinalState ( FinalState fs)
inherited

Definition at line 96 of file G4INCLIAvatar.cc.

96 {
97 INCL_DEBUG("Random seeds before preInteraction: " << Random::getSeeds() << '\n');
99 INCL_DEBUG("Random seeds before getChannel: " << Random::getSeeds() << '\n');
100 IChannel *c = getChannel();
101 if( !c )
102 return;
103 INCL_DEBUG("Random seeds before getFinalState: " << Random::getSeeds() << '\n');
104 c->fillFinalState(fs);
105 INCL_DEBUG("Random seeds before postInteraction: " << Random::getSeeds() << '\n');
106 postInteraction(fs);
107 delete c;
108 }
virtual void postInteraction(FinalState *)=0
virtual void preInteraction()=0
virtual G4INCL::IChannel * getChannel()=0
SeedVector getSeeds()
Definition: G4INCLRandom.cc:89

References G4INCL::IChannel::fillFinalState(), G4INCL::IAvatar::getChannel(), G4INCL::Random::getSeeds(), INCL_DEBUG, G4INCL::IAvatar::postInteraction(), and G4INCL::IAvatar::preInteraction().

Referenced by G4INCL::INCL::cascade(), and G4INCL::IAvatar::getFinalState().

◆ getChannel()

virtual G4INCL::IChannel * G4INCL::InteractionAvatar::getChannel ( )
protectedpure virtual

◆ getFinalState()

FinalState * G4INCL::IAvatar::getFinalState ( )
inherited

Definition at line 90 of file G4INCLIAvatar.cc.

90 {
91 FinalState *fs = new FinalState;
93 return fs;
94 }
void fillFinalState(FinalState *fs)

References G4INCL::IAvatar::fillFinalState().

Referenced by G4INCL::INCL::makeCompoundNucleus().

◆ getID()

long G4INCL::IAvatar::getID ( ) const
inlineinherited

◆ getParticles()

virtual ParticleList G4INCL::IAvatar::getParticles ( ) const
pure virtualinherited

◆ getTime()

G4double G4INCL::IAvatar::getTime ( ) const
inlineinherited

◆ getType()

AvatarType G4INCL::IAvatar::getType ( ) const
inlineinherited

◆ isACollision()

G4bool G4INCL::IAvatar::isACollision ( ) const
inlineinherited

Definition at line 91 of file G4INCLIAvatar.hh.

91{ return (type==CollisionAvatarType); };
@ CollisionAvatarType

References G4INCL::CollisionAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ isADecay()

G4bool G4INCL::IAvatar::isADecay ( ) const
inlineinherited

Definition at line 92 of file G4INCLIAvatar.hh.

92{ return (type==DecayAvatarType); };
@ DecayAvatarType

References G4INCL::DecayAvatarType.

Referenced by G4INCL::CascadeAction::afterAvatarDefaultAction().

◆ postInteraction()

void G4INCL::InteractionAvatar::postInteraction ( FinalState fs)
protectedvirtual

Implements G4INCL::IAvatar.

Definition at line 166 of file G4INCLInteractionAvatar.cc.

166 {
167 INCL_DEBUG("postInteraction: final state: " << '\n' << fs->print() << '\n');
168 modified = fs->getModifiedParticles();
169 created = fs->getCreatedParticles();
170 Destroyed = fs->getDestroyedParticles();
172 modifiedAndCreated.insert(modifiedAndCreated.end(), created.begin(), created.end());
174 ModifiedAndDestroyed.insert(ModifiedAndDestroyed.end(), Destroyed.begin(), Destroyed.end());
175
176 // Boost back to lab
178
179 // If there is no Nucleus, just return
180 if(!theNucleus) return;
181
182 // Mark pions and kaons that have been created outside their well (we will force them
183 // to be emitted later).
184 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
185 if(((*i)->isPion() || (*i)->isKaon() || (*i)->isAntiKaon()) && (*i)->getPosition().mag() > theNucleus->getSurfaceRadius(*i)) {
186 (*i)->makeParticipant();
187 (*i)->setOutOfWell();
188 fs->addOutgoingParticle(*i);
189 INCL_DEBUG("Pion was created outside its potential well." << '\n'
190 << (*i)->print());
191 }
192
193 // Try to enforce energy conservation
194 fs->setTotalEnergyBeforeInteraction(oldTotalEnergy);
195 G4bool success = enforceEnergyConservation(fs);
196 if(!success) {
197 INCL_DEBUG("Enforcing energy conservation: failed!" << '\n');
198
199 // Restore the state of the initial particles
201
202 // Delete newly created particles
203 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
204 delete *i;
205
206 fs->reset();
207 fs->makeNoEnergyConservation();
208 fs->setTotalEnergyBeforeInteraction(0.0);
209
210 return; // Interaction is blocked. Return an empty final state.
211 }
212 INCL_DEBUG("Enforcing energy conservation: success!" << '\n');
213
214 INCL_DEBUG("postInteraction after energy conservation: final state: " << '\n' << fs->print() << '\n');
215
216 // Check that outgoing delta resonances can decay to pi-N
217 for(ParticleIter i=modified.begin(), e=modified.end(); i!=e; ++i )
218 if((*i)->isDelta() &&
219 (*i)->getMass() < ParticleTable::minDeltaMass) {
220 INCL_DEBUG("Mass of the produced delta below decay threshold; forbidding collision. deltaMass=" <<
221 (*i)->getMass() << '\n');
222
223 // Restore the state of the initial particles
225
226 // Delete newly created particles
227 for(ParticleIter j=created.begin(), end=created.end(); j!=end; ++j )
228 delete *j;
229
230 fs->reset();
231 fs->makeNoEnergyConservation();
232 fs->setTotalEnergyBeforeInteraction(0.0);
233
234 return; // Interaction is blocked. Return an empty final state.
235 }
236
237 INCL_DEBUG("Random seeds before Pauli blocking: " << Random::getSeeds() << '\n');
238 // Test Pauli blocking
240
241 if(isBlocked) {
242 INCL_DEBUG("Pauli: Blocked!" << '\n');
243
244 // Restore the state of the initial particles
246
247 // Delete newly created particles
248 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
249 delete *i;
250
251 fs->reset();
252 fs->makePauliBlocked();
253 fs->setTotalEnergyBeforeInteraction(0.0);
254
255 return; // Interaction is blocked. Return an empty final state.
256 }
257 INCL_DEBUG("Pauli: Allowed!" << '\n');
258
259 // Test CDPP blocking
261
262 if(isCDPPBlocked) {
263 INCL_DEBUG("CDPP: Blocked!" << '\n');
264
265 // Restore the state of the initial particles
267
268 // Delete newly created particles
269 for(ParticleIter i=created.begin(), e=created.end(); i!=e; ++i )
270 delete *i;
271
272 fs->reset();
273 fs->makePauliBlocked();
274 fs->setTotalEnergyBeforeInteraction(0.0);
275
276 return; // Interaction is blocked. Return an empty final state.
277 }
278 INCL_DEBUG("CDPP: Allowed!" << '\n');
279
280 // If all went well, try to bring particles inside the nucleus...
281 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i )
282 {
283 // ...except for pions beyond their surface radius.
284 if((*i)->isOutOfWell()) continue;
285
286 const G4bool successBringParticlesInside = bringParticleInside(*i);
287 if( !successBringParticlesInside ) {
288 INCL_ERROR("Failed to bring particle inside the nucleus!" << '\n');
289 }
290 }
291
292 // Collision accepted!
293 // Biasing of the final state
294 std::vector<G4int> newBiasCollisionVector;
295 newBiasCollisionVector = ModifiedAndDestroyed.getParticleListBiasVector();
296 if(std::fabs(weight-1.) > 1E-6){
297 newBiasCollisionVector.push_back(Particle::nextBiasedCollisionID);
299 weight = 1.; // useless?
300 }
301 for(ParticleIter i=modifiedAndCreated.begin(), e=modifiedAndCreated.end(); i!=e; ++i ) {
302 (*i)->setBiasCollisionVector(newBiasCollisionVector);
303 if(!(*i)->isOutOfWell()) {
304 // Decide if the particle should be made into a spectator
305 // (Back to spectator)
306 G4bool goesBackToSpectator = false;
307 if((*i)->isNucleon() && theNucleus->getStore()->getConfig()->getBackToSpectator()) {
308 G4double threshold = (*i)->getPotentialEnergy();
309 if((*i)->getType()==Proton)
311 if((*i)->getKineticEnergy() < threshold)
312 goesBackToSpectator = true;
313 }
314 // Thaw the particle propagation
315 (*i)->thawPropagation();
316
317 // Increment or decrement the participant counters
318 if(goesBackToSpectator) {
319 INCL_DEBUG("The following particle goes back to spectator:" << '\n'
320 << (*i)->print() << '\n');
321 if(!(*i)->isTargetSpectator()) {
323 }
324 (*i)->makeTargetSpectator();
325 } else {
326 if((*i)->isTargetSpectator()) {
328 }
329 (*i)->makeParticipant();
330 }
331 }
332 }
333 ParticleList destroyed = fs->getDestroyedParticles();
334 for(ParticleIter i=destroyed.begin(), e=destroyed.end(); i!=e; ++i )
335 if(!(*i)->isTargetSpectator())
337 return;
338 }
#define INCL_ERROR(x)
void decrementCascading()
Definition: G4INCLBook.hh:78
void incrementCascading()
Definition: G4INCLBook.hh:77
G4bool getBackToSpectator() const
Get back-to-spectator.
void restoreParticles() const
Restore the state of both particles.
G4bool enforceEnergyConservation(FinalState *const fs)
Enforce energy conservation.
G4bool bringParticleInside(Particle *const p)
G4double getTransmissionBarrier(Particle const *const p)
Get the transmission barrier.
std::vector< G4int > getParticleListBiasVector() const
void boost(const ThreeVector &b) const
static void FillINCLBiasVector(G4double newBias)
static G4ThreadLocal G4int nextBiasedCollisionID
Config const * getConfig()
Definition: G4INCLStore.hh:273
const G4double twoThirds
G4bool isBlocked(ParticleList const &p, Nucleus const *const n)
Check Pauli blocking.
G4bool isCDPPBlocked(ParticleList const &p, Nucleus const *const n)
Check CDPP blocking.
ParticleList::const_iterator ParticleIter

References G4INCL::FinalState::addOutgoingParticle(), G4INCL::ParticleList::boost(), boostVector, bringParticleInside(), created, G4INCL::Book::decrementCascading(), Destroyed, enforceEnergyConservation(), G4INCL::Particle::FillINCLBiasVector(), G4INCL::Config::getBackToSpectator(), G4INCL::Store::getBook(), G4INCL::Store::getConfig(), G4INCL::FinalState::getCreatedParticles(), G4INCL::FinalState::getDestroyedParticles(), G4INCL::FinalState::getModifiedParticles(), G4INCL::ParticleList::getParticleListBiasVector(), G4INCL::Random::getSeeds(), G4INCL::Nucleus::getStore(), G4INCL::Nucleus::getSurfaceRadius(), G4INCL::Nucleus::getTransmissionBarrier(), INCL_DEBUG, INCL_ERROR, G4INCL::Book::incrementCascading(), G4INCL::Pauli::isBlocked(), G4INCL::Pauli::isCDPPBlocked(), G4INCL::FinalState::makeNoEnergyConservation(), G4INCL::FinalState::makePauliBlocked(), G4INCL::ParticleTable::minDeltaMass, modified, modifiedAndCreated, ModifiedAndDestroyed, G4INCL::Particle::nextBiasedCollisionID, oldTotalEnergy, G4INCL::FinalState::print(), G4INCL::Proton, G4INCL::FinalState::reset(), restoreParticles(), G4INCL::FinalState::setTotalEnergyBeforeInteraction(), theNucleus, G4INCL::Math::twoThirds, and weight.

Referenced by G4INCL::BinaryCollisionAvatar::postInteraction(), and G4INCL::DecayAvatar::postInteraction().

◆ preInteraction()

void G4INCL::InteractionAvatar::preInteraction ( )
protectedvirtual

Implements G4INCL::IAvatar.

Definition at line 122 of file G4INCLInteractionAvatar.cc.

122 {
124
126
127 if(particle2) {
131 } else {
133 }
135 }
void preInteractionBlocking()
Store the state of the particles before the interaction.
void preInteractionLocalEnergy(Particle *const p)
Apply local-energy transformation, if appropriate.
G4double getEnergy() const
const G4INCL::ThreeVector & getMomentum() const
void boost(const ThreeVector &aBoostVector)
ThreeVector makeBoostVector(Particle const *const p1, Particle const *const p2)

References G4INCL::Particle::boost(), boostVector, G4INCL::Particle::getEnergy(), G4INCL::Particle::getMomentum(), G4INCL::KinematicsUtils::makeBoostVector(), particle1, particle2, preInteractionBlocking(), and preInteractionLocalEnergy().

Referenced by G4INCL::BinaryCollisionAvatar::preInteraction(), and G4INCL::DecayAvatar::preInteraction().

◆ preInteractionBlocking()

void G4INCL::InteractionAvatar::preInteractionBlocking ( )
protected

Store the state of the particles before the interaction.

If the interaction cannot be realised for any reason, we will need to restore the particle state as it was before. This is done by calling the restoreParticles() method.

Definition at line 95 of file G4INCLInteractionAvatar.cc.

95 {
97 (*backupParticle1) = (*particle1);
98 else
99 backupParticle1 = new Particle(*particle1);
100
101 if(particle2) {
103 (*backupParticle2) = (*particle2);
104 else
105 backupParticle2 = new Particle(*particle2);
106
110 } else {
112 }
113 }
G4double getPotentialEnergy() const
Get the particle potential energy.
G4double total(Particle const *const p1, Particle const *const p2)

References backupParticle1, backupParticle2, G4INCL::Particle::getEnergy(), G4INCL::Particle::getPotentialEnergy(), oldTotalEnergy, oldXSec, particle1, particle2, and G4INCL::CrossSections::total().

Referenced by preInteraction().

◆ preInteractionLocalEnergy()

void G4INCL::InteractionAvatar::preInteractionLocalEnergy ( Particle *const  p)
protected

Apply local-energy transformation, if appropriate.

Parameters
pparticle to apply the transformation to

Definition at line 115 of file G4INCLInteractionAvatar.cc.

115 {
116 if(!theNucleus || p->isMeson()) return; // Local energy does not make any sense without a nucleus
117
120 }
G4bool isMeson() const
Is this a Meson?
void transformToLocalEnergyFrame(Nucleus const *const n, Particle *const p)

References G4INCL::Particle::isMeson(), shouldUseLocalEnergy(), theNucleus, and G4INCL::KinematicsUtils::transformToLocalEnergyFrame().

Referenced by preInteraction().

◆ restoreParticles()

void G4INCL::InteractionAvatar::restoreParticles ( ) const
protected

Restore the state of both particles.

The state must first be stored by calling preInteractionBlocking().

Definition at line 340 of file G4INCLInteractionAvatar.cc.

340 {
341 (*particle1) = (*backupParticle1);
342 if(particle2)
343 (*particle2) = (*backupParticle2);
344 }

References particle2.

Referenced by G4INCL::BinaryCollisionAvatar::getChannel(), postInteraction(), and G4INCL::DecayAvatar::postInteraction().

◆ setType()

void G4INCL::IAvatar::setType ( AvatarType  t)
inlineinherited

◆ shouldUseLocalEnergy()

G4bool G4INCL::InteractionAvatar::shouldUseLocalEnergy ( ) const
protected

true if the given avatar should use local energy

Definition at line 346 of file G4INCLInteractionAvatar.cc.

346 {
347 if(!theNucleus) return false;
348 LocalEnergyType theLocalEnergyType;
350 theLocalEnergyType = theNucleus->getStore()->getConfig()->getLocalEnergyPiType();
351 else
352 theLocalEnergyType = theNucleus->getStore()->getConfig()->getLocalEnergyBBType();
353
354 const G4bool firstAvatar = (theNucleus->getStore()->getBook().getAcceptedCollisions() == 0);
355 return ((theLocalEnergyType == FirstCollisionLocalEnergy && firstAvatar) ||
356 theLocalEnergyType == AlwaysLocalEnergy);
357 }
G4int getAcceptedCollisions() const
Definition: G4INCLBook.hh:100
LocalEnergyType getLocalEnergyPiType() const
Get the type of local energy for pi-N and decay avatars.
LocalEnergyType getLocalEnergyBBType() const
Get the type of local energy for N-N avatars.
AvatarType getType() const
@ FirstCollisionLocalEnergy

References G4INCL::AlwaysLocalEnergy, G4INCL::DecayAvatarType, G4INCL::FirstCollisionLocalEnergy, G4INCL::Book::getAcceptedCollisions(), G4INCL::Store::getBook(), G4INCL::Store::getConfig(), G4INCL::Config::getLocalEnergyBBType(), G4INCL::Config::getLocalEnergyPiType(), G4INCL::Nucleus::getStore(), G4INCL::IAvatar::getType(), isPiN, and theNucleus.

Referenced by enforceEnergyConservation(), preInteractionLocalEnergy(), G4INCL::InteractionAvatar::ViolationEMomentumFunctor::scaleParticleMomenta(), and G4INCL::InteractionAvatar::ViolationEEnergyFunctor::setParticleEnergy().

◆ toString()

std::string G4INCL::IAvatar::toString ( )
inherited

Definition at line 73 of file G4INCLIAvatar.cc.

73 {
74 std::stringstream entry;
75 std::stringstream particleString;
76 ParticleList const &pl = getParticles();
78 for(ParticleIter i=pl.begin(), e=pl.end(); i!=e; ++i) {
80 particleString << (*i)->getID() << " ";
81 }
82 if(numberOfParticles == 1) particleString << "-1";
83 entry << getID() << " "
84 << getType() << " "
85 << getTime() << " "
86 << particleString.str();
87 return entry.str();
88 }
int G4int
Definition: G4Types.hh:85
static int numberOfParticles
long getID() const
virtual ParticleList getParticles() const =0
G4double getTime() const

References G4INCL::IAvatar::getID(), G4INCL::IAvatar::getParticles(), G4INCL::IAvatar::getTime(), G4INCL::IAvatar::getType(), and numberOfParticles.

Field Documentation

◆ backupParticle1

G4ThreadLocal Particle * G4INCL::InteractionAvatar::backupParticle1 = NULL
staticprotected

◆ backupParticle2

G4ThreadLocal Particle * G4INCL::InteractionAvatar::backupParticle2 = NULL
staticprotected

◆ boostVector

ThreeVector G4INCL::InteractionAvatar::boostVector
protected

◆ created

ParticleList G4INCL::InteractionAvatar::created
protected

◆ Destroyed

ParticleList G4INCL::InteractionAvatar::Destroyed
protected

◆ ID

long G4INCL::IAvatar::ID
privateinherited

Definition at line 98 of file G4INCLIAvatar.hh.

Referenced by G4INCL::IAvatar::IAvatar().

◆ isPiN

G4bool G4INCL::InteractionAvatar::isPiN
protected

◆ locEAccuracy

const G4double G4INCL::InteractionAvatar::locEAccuracy = 1.E-4
static

Target accuracy in the determination of the local-energy Q-value.

Definition at line 68 of file G4INCLInteractionAvatar.hh.

Referenced by G4INCL::InteractionAvatar::ViolationEMomentumFunctor::scaleParticleMomenta(), and G4INCL::InteractionAvatar::ViolationEEnergyFunctor::setParticleEnergy().

◆ maxIterLocE

const G4int G4INCL::InteractionAvatar::maxIterLocE = 50
static

Max number of iterations for the determination of the local-energy Q-value.

Definition at line 70 of file G4INCLInteractionAvatar.hh.

Referenced by G4INCL::InteractionAvatar::ViolationEMomentumFunctor::scaleParticleMomenta(), and G4INCL::InteractionAvatar::ViolationEEnergyFunctor::setParticleEnergy().

◆ modified

ParticleList G4INCL::InteractionAvatar::modified
protected

◆ modifiedAndCreated

ParticleList G4INCL::InteractionAvatar::modifiedAndCreated
protected

◆ ModifiedAndDestroyed

ParticleList G4INCL::InteractionAvatar::ModifiedAndDestroyed
protected

◆ nextID

G4ThreadLocal long G4INCL::IAvatar::nextID = 1
staticprivateinherited

Definition at line 100 of file G4INCLIAvatar.hh.

Referenced by G4INCL::IAvatar::IAvatar().

◆ oldTotalEnergy

G4double G4INCL::InteractionAvatar::oldTotalEnergy
protected

◆ oldXSec

G4double G4INCL::InteractionAvatar::oldXSec
protected

◆ particle1

Particle* G4INCL::InteractionAvatar::particle1
protected

◆ particle2

Particle * G4INCL::InteractionAvatar::particle2
protected

◆ theNucleus

Nucleus* G4INCL::InteractionAvatar::theNucleus
protected

◆ theTime

G4double G4INCL::IAvatar::theTime
protectedinherited

◆ type

AvatarType G4INCL::IAvatar::type
privateinherited

Definition at line 99 of file G4INCLIAvatar.hh.

◆ violationEFunctor

RootFunctor* G4INCL::InteractionAvatar::violationEFunctor
private

Definition at line 208 of file G4INCLInteractionAvatar.hh.

Referenced by enforceEnergyConservation().

◆ weight

G4double G4INCL::InteractionAvatar::weight
protected

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