Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ElementaryParticleCollider Class Reference

#include <G4ElementaryParticleCollider.hh>

Inheritance diagram for G4ElementaryParticleCollider:
Collaboration diagram for G4ElementaryParticleCollider:

Public Member Functions

 G4ElementaryParticleCollider ()
 
virtual ~G4ElementaryParticleCollider ()
 
void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
 
void setNucleusState (G4int a, G4int z)
 
- Public Member Functions inherited from G4CascadeColliderBase
 G4CascadeColliderBase (const G4String &name, G4int verbose=0)
 
virtual ~G4CascadeColliderBase ()
 
virtual void rescatter (G4InuclParticle *, G4KineticTrackVector *, G4V3DNucleus *, G4CollisionOutput &)
 
virtual void setVerboseLevel (G4int verbose=0)
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const G4String &name, G4int verbose=0)
 
virtual ~G4VCascadeCollider ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 74 of file G4ElementaryParticleCollider.hh.

Constructor & Destructor Documentation

G4ElementaryParticleCollider::G4ElementaryParticleCollider ( )

Definition at line 138 of file G4ElementaryParticleCollider.cc.

139  : G4CascadeColliderBase("G4ElementaryParticleCollider"),
140  nucleusA(0), nucleusZ(0) {;}
G4CascadeColliderBase(const G4String &name, G4int verbose=0)
virtual G4ElementaryParticleCollider::~G4ElementaryParticleCollider ( )
inlinevirtual

Definition at line 77 of file G4ElementaryParticleCollider.hh.

77 {};

Member Function Documentation

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

Implements G4VCascadeCollider.

Definition at line 144 of file G4ElementaryParticleCollider.cc.

147 {
148  if (verboseLevel > 1)
149  G4cout << " >>> G4ElementaryParticleCollider::collide" << G4endl;
150 
151  if (!useEPCollider(bullet,target)) { // Sanity check
152  G4cerr << " ElementaryParticleCollider -> can collide only particle with particle "
153  << G4endl;
154  return;
155  }
156 
157 #ifdef G4CASCADE_DEBUG_SAMPLER
158  static G4bool doPrintTables = true; // Once and only once per job
159  if (doPrintTables) {
161  doPrintTables = false;
162  }
163 #endif
164 
165  interCase.set(bullet, target); // To identify kind of collision
166 
167  if (verboseLevel > 1) G4cout << *bullet << G4endl << *target << G4endl;
168 
169  G4InuclElementaryParticle* particle1 =
170  dynamic_cast<G4InuclElementaryParticle*>(bullet);
171  G4InuclElementaryParticle* particle2 =
172  dynamic_cast<G4InuclElementaryParticle*>(target);
173 
174  if (!particle1 || !particle2) { // Redundant with useEPCollider()
175  G4cerr << " ElementaryParticleCollider -> can only collide hadrons"
176  << G4endl;
177  return;
178  }
179 
180  if (particle1->isNeutrino() || particle2->isNeutrino()) return;
181 
182  // Check for available interaction, or pion+dibaryon special case
184  !particle1->quasi_deutron() && !particle2->quasi_deutron()) {
185  G4cerr << " ElementaryParticleCollider -> cannot collide "
186  << particle1->getDefinition()->GetParticleName() << " with "
187  << particle2->getDefinition()->GetParticleName() << G4endl;
188  return;
189  }
190 
191  G4LorentzConvertor convertToSCM; // Utility to handle frame manipulation
192  if (particle2->nucleon() || particle2->quasi_deutron()) {
193  convertToSCM.setBullet(particle1);
194  convertToSCM.setTarget(particle2);
195  } else {
196  convertToSCM.setBullet(particle2);
197  convertToSCM.setTarget(particle1);
198  }
199 
200  convertToSCM.setVerbose(verboseLevel);
201  convertToSCM.toTheCenterOfMass();
202 
203  G4double etot_scm = convertToSCM.getTotalSCMEnergy();
204 
205  // Generate any particle collision with nucleon
206  if (particle1->nucleon() || particle2->nucleon()) {
207  G4double ekin = convertToSCM.getKinEnergyInTheTRS();
208 
209  // SPECIAL: Very low energy pions may be absorbed by a nucleon
210  if (pionNucleonAbsorption(ekin)) {
211  generateSCMpionNAbsorption(etot_scm, particle1, particle2);
212  } else {
213  generateSCMfinalState(ekin, etot_scm, particle1, particle2);
214  }
215  }
216 
217  // Generate pion or photon collision with quasi-deuteron
218  if (particle1->quasi_deutron() || particle2->quasi_deutron()) {
219  if (!G4NucleiModel::useQuasiDeuteron(particle1->type(),particle2->type()) &&
220  !G4NucleiModel::useQuasiDeuteron(particle2->type(),particle1->type())) {
221  G4cerr << " ElementaryParticleCollider -> can only collide pi,mu,gamma with"
222  << " dibaryons " << G4endl;
223  return;
224  }
225 
226  if (particle1->isMuon() || particle2->isMuon()) {
227  generateSCMmuonAbsorption(etot_scm, particle1, particle2);
228  } else { // Currently, pion absoprtion also handles gammas
229  generateSCMpionAbsorption(etot_scm, particle1, particle2);
230  }
231  }
232 
233  if (particles.empty()) { // No final state possible, pass bullet through
234  if (verboseLevel) {
235  G4cerr << " ElementaryParticleCollider -> failed to collide "
236  << particle1->getMomModule() << " GeV/c "
237  << particle1->getDefinition()->GetParticleName() << " with "
238  << particle2->getDefinition()->GetParticleName() << G4endl;
239  }
240  return;
241  }
242 
243  // Convert final state back to lab frame
244  G4LorentzVector mom; // Buffer to avoid memory churn
245  particleIterator ipart;
246  for(ipart = particles.begin(); ipart != particles.end(); ipart++) {
247  mom = convertToSCM.backToTheLab(ipart->getMomentum());
248  ipart->setMomentum(mom);
249  };
250 
251  // Check conservation in multibody final state
252  if (verboseLevel && !validateOutput(bullet, target, particles)) {
253  G4cout << " incoming particles: \n" << *particle1 << G4endl
254  << *particle2 << G4endl
255  << " outgoing particles: " << G4endl;
256  for(ipart = particles.begin(); ipart != particles.end(); ipart++)
257  G4cout << *ipart << G4endl;
258 
259  G4cout << " <<< Non-conservation in G4ElementaryParticleCollider"
260  << G4endl;
261  }
262 
263  std::sort(particles.begin(), particles.end(), G4ParticleLargerEkin());
264  output.addOutgoingParticles(particles);
265 }
static const G4CascadeChannel * GetTable(G4int initialState)
const XML_Char * target
Definition: expat.h:268
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
const G4ParticleDefinition * getDefinition() const
G4int hadrons() const
static G4bool useQuasiDeuteron(G4int ptype, G4int qdtype=0)
void setBullet(const G4InuclParticle *bullet)
G4double getTotalSCMEnergy() const
G4LorentzVector backToTheLab(const G4LorentzVector &mom) const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
void setVerbose(G4int vb=0)
bool G4bool
Definition: G4Types.hh:79
G4double getKinEnergyInTheTRS() const
static void Print(std::ostream &os=G4cout)
void addOutgoingParticles(const std::vector< G4InuclElementaryParticle > &particles)
void set(G4InuclParticle *part1, G4InuclParticle *part2)
virtual G4bool validateOutput(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4double getMomModule() const
G4GLOB_DLL std::ostream G4cerr
void setTarget(const G4InuclParticle *target)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ElementaryParticleCollider::setNucleusState ( G4int  a,
G4int  z 
)
inline

Definition at line 82 of file G4ElementaryParticleCollider.hh.

82  { // Nucleus to use for recoil
83  nucleusA = a; nucleusZ = z;
84  }

Here is the caller graph for this function:


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