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

#include <G4ElementaryParticleCollider.hh>

Inheritance diagram for G4ElementaryParticleCollider:
G4CascadeColliderBase G4VCascadeCollider

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)
 
- Public Member Functions inherited from G4VCascadeCollider
 G4VCascadeCollider (const char *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 char *name)
 
- Protected Attributes inherited from G4CascadeColliderBase
G4InteractionCase interCase
 
G4CascadeCheckBalancebalance
 
- Protected Attributes inherited from G4VCascadeCollider
const char * theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 72 of file G4ElementaryParticleCollider.hh.

Constructor & Destructor Documentation

G4ElementaryParticleCollider::G4ElementaryParticleCollider ( )

Definition at line 130 of file G4ElementaryParticleCollider.cc.

131  : G4CascadeColliderBase("G4ElementaryParticleCollider") {;}
G4CascadeColliderBase(const char *name, G4int verbose=0)
virtual G4ElementaryParticleCollider::~G4ElementaryParticleCollider ( )
inlinevirtual

Definition at line 75 of file G4ElementaryParticleCollider.hh.

75 {};

Member Function Documentation

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

Implements G4VCascadeCollider.

Definition at line 135 of file G4ElementaryParticleCollider.cc.

References G4CollisionOutput::addOutgoingParticles(), G4LorentzConvertor::backToTheLab(), G4cerr, G4cout, G4endl, G4InuclParticle::getDefinition(), G4LorentzConvertor::getKinEnergyInTheTRS(), G4InuclParticle::getMomModule(), G4ParticleDefinition::GetParticleName(), G4CascadeChannelTables::GetTable(), G4LorentzConvertor::getTotalSCMEnergy(), G4InteractionCase::hadrons(), G4CascadeColliderBase::interCase, G4InuclElementaryParticle::isMuon(), G4InuclElementaryParticle::isNeutrino(), G4InuclElementaryParticle::nucleon(), G4CascadeChannelTables::Print(), G4InuclElementaryParticle::quasi_deutron(), G4InteractionCase::set(), G4LorentzConvertor::setBullet(), G4LorentzConvertor::setTarget(), G4LorentzConvertor::setVerbose(), sort(), G4LorentzConvertor::toTheCenterOfMass(), G4InuclElementaryParticle::type(), G4CascadeColliderBase::useEPCollider(), G4NucleiModel::useQuasiDeuteron(), G4CascadeColliderBase::validateOutput(), and G4VCascadeCollider::verboseLevel.

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

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

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