Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4BigBanger Class Reference

#include <G4BigBanger.hh>

+ Inheritance diagram for G4BigBanger:

Public Member Functions

 G4BigBanger ()
 
virtual ~G4BigBanger ()
 
void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
- Public Member Functions inherited from G4CascadeColliderBase
 G4CascadeColliderBase (const char *name, G4int verbose=0)
 
virtual ~G4CascadeColliderBase ()
 
virtual void rescatter (G4InuclParticle *, G4KineticTrackVector *, G4V3DNucleus *, G4CollisionOutput &)
 
virtual void setVerboseLevel (G4int verbose=0)
 
virtual void setConservationChecks (G4bool doBalance=true)
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const char *name, G4int verbose=0)
 
virtual ~G4VCascadeCollider ()
 
virtual void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)=0
 
virtual void setVerboseLevel (G4int verbose=0)
 

Additional Inherited Members

- Protected Member Functions inherited from G4CascadeColliderBase
virtual G4bool useEPCollider (G4InuclParticle *bullet, G4InuclParticle *target) const
 
virtual G4bool explosion (G4InuclNuclei *target) const
 
virtual G4bool explosion (G4Fragment *target) const
 
virtual G4bool explosion (G4int A, G4int Z, G4double excitation) const
 
virtual G4bool inelasticInteractionPossible (G4InuclParticle *bullet, G4InuclParticle *target, G4double ekin) const
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, const std::vector< G4InuclElementaryParticle > &particles)
 
virtual G4bool validateOutput (G4InuclParticle *bullet, G4InuclParticle *target, const std::vector< G4InuclNuclei > &fragments)
 
- Protected Member Functions inherited from G4VCascadeCollider
virtual void setName (const char *name)
 
- Protected Attributes inherited from G4CascadeColliderBase
G4InteractionCase interCase
 
G4bool doConservationChecks
 
G4CascadeCheckBalancebalance
 
- Protected Attributes inherited from G4VCascadeCollider
const char * theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 47 of file G4BigBanger.hh.

Constructor & Destructor Documentation

◆ G4BigBanger()

G4BigBanger::G4BigBanger ( )

Definition at line 62 of file G4BigBanger.cc.

◆ ~G4BigBanger()

virtual G4BigBanger::~G4BigBanger ( )
inlinevirtual

Definition at line 50 of file G4BigBanger.hh.

50{};

Member Function Documentation

◆ collide()

void G4BigBanger::collide ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output 
)
virtual

Implements G4VCascadeCollider.

Definition at line 65 of file G4BigBanger.cc.

66 {
67
68 if (verboseLevel) G4cout << " >>> G4BigBanger::collide" << G4endl;
69
70 // primitive explosion model A -> nucleons to prevent too exotic evaporation
71
72 G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target);
73 if (!nuclei_target) {
74 G4cerr << " BigBanger -> try to bang not nuclei " << G4endl;
75 return;
76 }
77
78 G4int A = nuclei_target->getA();
79 G4int Z = nuclei_target->getZ();
80
81 G4LorentzVector PEX = nuclei_target->getMomentum();
82 G4double EEXS = nuclei_target->getExitationEnergy();
83
84 G4ThreeVector toTheLabFrame = PEX.boostVector(); // From rest to lab
85
86 // This "should" be difference between E-target and sum of m(nucleons)
87 G4double etot = (EEXS - bindingEnergy(A,Z)) * MeV/GeV; // To Bertini units
88 if (etot < 0.0) etot = 0.0;
89
90 if (verboseLevel > 2) {
91 G4cout << " BigBanger: target\n" << *nuclei_target
92 << "\n etot " << etot << G4endl;
93 }
94
95 if (verboseLevel > 3) {
96 G4LorentzVector PEXrest = PEX;
97 PEXrest.boost(-toTheLabFrame);
98 G4cout << " target rest frame: px " << PEXrest.px() << " py "
99 << PEXrest.py() << " pz " << PEXrest.pz() << " E " << PEXrest.e()
100 << G4endl;
101 }
102
103 generateBangInSCM(etot, A, Z);
104
105 if (verboseLevel > 2) {
106 G4cout << " particles " << particles.size() << G4endl;
107 for(G4int i = 0; i < G4int(particles.size()); i++)
108 G4cout << particles[i] << G4endl;
109 }
110
111 if (particles.empty()) { // No bang! Don't know why...
112 G4cerr << " >>> G4BigBanger unable to process fragment "
113 << nuclei_target->getDefinition()->GetParticleName() << G4endl;
114
115 // FIXME: This will violate baryon number, momentum, energy, etc.
116 return;
117 }
118
119 // convert back to Lab
120 G4LorentzVector totscm;
121 G4LorentzVector totlab;
122
123 if (verboseLevel > 2) G4cout << " BigBanger: boosting to lab" << G4endl;
124
125 particleIterator ipart;
126 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
127 G4LorentzVector mom = ipart->getMomentum();
128 if (verboseLevel > 2) totscm += mom;
129
130 mom.boost(toTheLabFrame);
131 if (verboseLevel > 2) totlab += mom;
132
133 ipart->setMomentum(mom);
134 if (verboseLevel > 2) G4cout << *ipart << G4endl;
135 }
136
137 std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin());
138
139 validateOutput(0, target, particles); // Checks <vector> directly
140
141 if (verboseLevel > 2) {
142 G4cout << " In SCM: total outgoing momentum " << G4endl
143 << " E " << totscm.e() << " px " << totscm.x()
144 << " py " << totscm.y() << " pz " << totscm.z() << G4endl;
145 G4cout << " In Lab: mom cons " << G4endl
146 << " E " << PEX.e() - totlab.e() // PEX now includes EEXS
147 << " px " << PEX.x() - totlab.x()
148 << " py " << PEX.y() - totlab.y()
149 << " pz " << PEX.z() - totlab.z() << G4endl;
150 }
151
152 output.addOutgoingParticles(particles);
153}
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:60
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
Hep3Vector boostVector() const
HepLorentzVector & boost(double, double, double)
virtual G4bool validateOutput(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4int getZ() const
G4double getExitationEnergy() const
G4int getA() const
G4ParticleDefinition * getDefinition() const
G4LorentzVector getMomentum() const
const G4String & GetParticleName() const
G4double bindingEnergy(G4int A, G4int Z)

Referenced by G4CascadeDeexcitation::collide(), and G4EquilibriumEvaporator::collide().


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