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

#include <G4ElementaryParticleCollider.hh>

+ Inheritance diagram for G4ElementaryParticleCollider:

Public Member Functions

 G4ElementaryParticleCollider ()
 
virtual ~G4ElementaryParticleCollider ()
 
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 60 of file G4ElementaryParticleCollider.hh.

Constructor & Destructor Documentation

◆ G4ElementaryParticleCollider()

G4ElementaryParticleCollider::G4ElementaryParticleCollider ( )

Definition at line 110 of file G4ElementaryParticleCollider.cc.

111 : G4CascadeColliderBase("G4ElementaryParticleCollider") {}

◆ ~G4ElementaryParticleCollider()

virtual G4ElementaryParticleCollider::~G4ElementaryParticleCollider ( )
inlinevirtual

Definition at line 63 of file G4ElementaryParticleCollider.hh.

63{};

Member Function Documentation

◆ collide()

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

Implements G4VCascadeCollider.

Definition at line 115 of file G4ElementaryParticleCollider.cc.

118{
119 if (verboseLevel > 1)
120 G4cout << " >>> G4ElementaryParticleCollider::collide" << G4endl;
121
122 if (!useEPCollider(bullet,target)) { // Sanity check
123 G4cerr << " ElementaryParticleCollider -> can collide only particle with particle "
124 << G4endl;
125 return;
126 }
127
128#ifdef G4CASCADE_DEBUG_SAMPLER
129 static G4bool doPrintTables = true; // Once and only once per job
130 if (doPrintTables) {
131 printFinalStateTables(); // For diagnostic reporting
132 doPrintTables = false;
133 }
134#endif
135
136 interCase.set(bullet, target); // To identify kind of collision
137
138 if (verboseLevel > 1) G4cout << *bullet << G4endl << *target << G4endl;
139
140 G4InuclElementaryParticle* particle1 =
141 dynamic_cast<G4InuclElementaryParticle*>(bullet);
142 G4InuclElementaryParticle* particle2 =
143 dynamic_cast<G4InuclElementaryParticle*>(target);
144
145 if (!particle1 || !particle2) { // Redundant with useEPCollider()
146 G4cerr << " ElementaryParticleCollider -> can only collide hadrons"
147 << G4endl;
148 return;
149 }
150
151 // Check for available interaction, or pion+dibaryon special case
153 !particle1->quasi_deutron() && !particle2->quasi_deutron()) {
154 G4cerr << " ElementaryParticleCollider -> cannot collide "
155 << particle1->getDefinition()->GetParticleName() << " with "
156 << particle2->getDefinition()->GetParticleName() << G4endl;
157 return;
158 }
159 // Generate nucleon or pion collision with nucleon
160 // or pion with quasi-deuteron
161
162 if (particle1->nucleon() || particle2->nucleon()) { // ok
163 G4LorentzConvertor convertToSCM;
164 if(particle2->nucleon()) {
165 convertToSCM.setBullet(particle1);
166 convertToSCM.setTarget(particle2);
167 } else {
168 convertToSCM.setBullet(particle2);
169 convertToSCM.setTarget(particle1);
170 };
171
172 convertToSCM.setVerbose(verboseLevel);
173
174 convertToSCM.toTheCenterOfMass();
175 G4double ekin = convertToSCM.getKinEnergyInTheTRS();
176 G4double etot_scm = convertToSCM.getTotalSCMEnergy();
177 G4double pscm = convertToSCM.getSCMMomentum();
178
179 generateSCMfinalState(ekin, etot_scm, pscm, particle1, particle2,
180 &convertToSCM);
181
182 if (particles.empty()) { // No final state possible, pass bullet through
183 if (verboseLevel) {
184 G4cerr << " ElementaryParticleCollider -> failed to collide "
185 << particle1->getMomModule() << " GeV/c "
186 << particle1->getDefinition()->GetParticleName() << " with "
187 << particle2->getDefinition()->GetParticleName() << G4endl;
188 }
189 } else { // convert back to Lab
190 G4LorentzVector mom; // Buffer to avoid memory churn
191 particleIterator ipart;
192 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
193 mom = convertToSCM.backToTheLab(ipart->getMomentum());
194 ipart->setMomentum(mom);
195 };
196
197 // Check conservation in multibody final state
198 if (verboseLevel && !validateOutput(bullet, target, particles)) {
199 G4cout << " incoming particles: \n" << *particle1 << G4endl
200 << *particle2 << G4endl
201 << " outgoing particles: " << G4endl;
202 for(ipart = particles.begin(); ipart != particles.end(); ipart++)
203 G4cout << *ipart << G4endl;
204
205 G4cout << " <<< Non-conservation in G4ElementaryParticleCollider"
206 << G4endl;
207 }
208
209 std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin());
210 output.addOutgoingParticles(particles);
211 }
212 } else { // neither particle is nucleon: pion on quasideuteron
213 if (particle1->quasi_deutron() || particle2->quasi_deutron()) {
214 if (particle1->pion() || particle2->pion() ||
215 particle1->isPhoton() || particle2->isPhoton()) {
216 G4LorentzConvertor convertToSCM;
217 if(particle2->quasi_deutron()) { // Quasideuteron is target
218 convertToSCM.setBullet(particle1);
219 convertToSCM.setTarget(particle2);
220 } else {
221 convertToSCM.setBullet(particle2);
222 convertToSCM.setTarget(particle1);
223 };
224 convertToSCM.toTheCenterOfMass();
225 G4double etot_scm = convertToSCM.getTotalSCMEnergy();
226
227 generateSCMpionAbsorption(etot_scm, particle1, particle2);
228
229 if (particles.empty()) { // Failed to generate final state
230 if (verboseLevel) {
231 G4cerr << " ElementaryParticleCollider -> failed to collide "
232 << particle1->getMomModule() << " GeV/c "
233 << particle1->getDefinition()->GetParticleName() << " with "
234 << particle2->getDefinition()->GetParticleName() << G4endl;
235 }
236 } else { // convert back to Lab
237 G4LorentzVector mom; // Buffer to avoid memory churn
238 particleIterator ipart;
239 for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
240 mom = convertToSCM.backToTheLab(ipart->getMomentum());
241 ipart->setMomentum(mom);
242 };
243
244 validateOutput(bullet, target, particles); // Check conservation
245
246 std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin());
247 output.addOutgoingParticles(particles);
248 };
249 } else {
250 G4cerr << " ElementaryParticleCollider -> can only collide pions with dibaryons "
251 << G4endl;
252 };
253 } else {
254 G4cerr << " ElementaryParticleCollider -> can only collide something with nucleon or dibaryon "
255 << G4endl;
256 };
257 };
258}
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:60
double G4double
Definition: G4Types.hh:64
bool G4bool
Definition: G4Types.hh:67
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
static const G4CascadeChannel * GetTable(G4int initialState)
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
virtual G4bool validateOutput(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
G4int hadrons() const
void set(G4InuclParticle *part1, G4InuclParticle *part2)
G4ParticleDefinition * getDefinition() const
G4double getMomModule() const
G4double getTotalSCMEnergy() const
void setVerbose(G4int vb=0)
void setBullet(const G4InuclParticle *bullet)
G4double getSCMMomentum() const
G4LorentzVector backToTheLab(const G4LorentzVector &mom) const
G4double getKinEnergyInTheTRS() const
void setTarget(const G4InuclParticle *target)
const G4String & GetParticleName() const

Referenced by G4InuclCollider::collide(), and G4NucleiModel::generateParticleFate().


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