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

#include <G4CascadeColliderBase.hh>

Inheritance diagram for G4CascadeColliderBase:
G4VCascadeCollider G4ElementaryParticleCollider G4IntraNucleiCascader G4InuclCollider

Public Member Functions

 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 ()
 
virtual void collide (G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)=0
 

Protected Member Functions

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

G4InteractionCase interCase
 
G4CascadeCheckBalancebalance
 
- Protected Attributes inherited from G4VCascadeCollider
const char * theName
 
G4int verboseLevel
 

Detailed Description

Definition at line 62 of file G4CascadeColliderBase.hh.

Constructor & Destructor Documentation

G4CascadeColliderBase::G4CascadeColliderBase ( const char *  name,
G4int  verbose = 0 
)

Definition at line 57 of file G4CascadeColliderBase.cc.

References balance, and G4CascadeParameters::checkConservation().

58  : G4VCascadeCollider(name, verbose), balance(0) {
61 }
G4CascadeCheckBalance * balance
const XML_Char * name
static G4bool checkConservation()
G4VCascadeCollider(const char *name, G4int verbose=0)
G4CascadeColliderBase::~G4CascadeColliderBase ( )
virtual

Definition at line 63 of file G4CascadeColliderBase.cc.

References balance.

63  {
64  delete balance;
65 }
G4CascadeCheckBalance * balance

Member Function Documentation

G4bool G4CascadeColliderBase::inelasticInteractionPossible ( G4InuclParticle bullet,
G4InuclParticle target,
G4double  ekin 
) const
protectedvirtual

Definition at line 85 of file G4CascadeColliderBase.cc.

References G4InuclSpecialFunctions::G4cbrt(), G4cout, G4endl, G4InuclNuclei::getA(), G4InuclParticle::getCharge(), G4InuclNuclei::getZ(), G4VCascadeCollider::theName, useEPCollider(), and G4VCascadeCollider::verboseLevel.

Referenced by G4InuclCollider::collide().

87  {
88  if (verboseLevel) {
89  G4cout << " >>> " << theName << "::inelasticInteractionPossible" << G4endl;
90  }
91 
92  // If hadron-hadron collision, defer to ElementaryParticleCollider
93  if (useEPCollider(bullet, target)) return true;
94 
95  // See which one of the two (or both) is a nucleus, get properties
96  // FIXME: Should set a = baryon() for both, but that's not in base
97  G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
98  G4double ab = nuclei_bullet ? nuclei_bullet->getA() : 1; // FIXME
99  G4double zb = nuclei_bullet ? nuclei_bullet->getZ() : bullet->getCharge();
100 
101  G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target);
102  G4double at = nuclei_target ? nuclei_target->getA() : 1; // FIXME
103  G4double zt = nuclei_target ? nuclei_target->getZ() : target->getCharge();
104 
105  // VCOL (Coulomb barrier) used for testing if elastic collision necessary
106  const G4double coeff = 0.001 * 1.2;
107 
108  G4double VCOL = coeff * zt * zb / (G4cbrt(at) + G4cbrt(ab));
109 
110  G4bool possible = true; // Force inelastic; should be (ekin >= VCOL)
111 
112  if (verboseLevel > 3) {
113  G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: "
114  << possible << G4endl;
115  }
116 
117  return possible;
118 }
G4int getZ() const
virtual G4bool useEPCollider(G4InuclParticle *bullet, G4InuclParticle *target) const
const XML_Char * target
G4GLOB_DLL std::ostream G4cout
G4int getA() const
bool G4bool
Definition: G4Types.hh:79
G4double getCharge() const
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
virtual void G4CascadeColliderBase::rescatter ( G4InuclParticle ,
G4KineticTrackVector ,
G4V3DNucleus ,
G4CollisionOutput  
)
inlinevirtual

Reimplemented in G4IntraNucleiCascader, and G4InuclCollider.

Definition at line 68 of file G4CascadeColliderBase.hh.

71  { ; }
void G4CascadeColliderBase::setVerboseLevel ( G4int  verbose = 0)
virtual

Reimplemented from G4VCascadeCollider.

Reimplemented in G4IntraNucleiCascader, and G4InuclCollider.

Definition at line 67 of file G4CascadeColliderBase.cc.

References balance, and G4VCascadeCollider::setVerboseLevel().

Referenced by G4InuclCollider::setVerboseLevel(), and G4IntraNucleiCascader::setVerboseLevel().

67  {
69  if (balance) balance->setVerboseLevel(verbose);
70 }
G4CascadeCheckBalance * balance
virtual void setVerboseLevel(G4int verbose=0)
G4bool G4CascadeColliderBase::useEPCollider ( G4InuclParticle bullet,
G4InuclParticle target 
) const
protectedvirtual

Definition at line 75 of file G4CascadeColliderBase.cc.

Referenced by G4InuclCollider::collide(), G4ElementaryParticleCollider::collide(), and inelasticInteractionPossible().

76  {
77  return (dynamic_cast<G4InuclElementaryParticle*>(bullet) &&
78  dynamic_cast<G4InuclElementaryParticle*>(target));
79 }
G4bool G4CascadeColliderBase::validateOutput ( G4InuclParticle bullet,
G4InuclParticle target,
G4CollisionOutput output 
)
protectedvirtual

Definition at line 123 of file G4CascadeColliderBase.cc.

References balance, G4CascadeCheckBalance::collide(), G4cout, G4endl, G4CascadeCheckBalance::okay(), G4CollisionOutput::printCollisionOutput(), G4VCascadeCollider::setVerboseLevel(), G4VCascadeCollider::theName, and G4VCascadeCollider::verboseLevel.

Referenced by G4ElementaryParticleCollider::collide(), and G4InuclCollider::deexcite().

125  {
126  if (!balance) return true; // Skip checks unless requested
127 
128  if (verboseLevel > 1)
129  G4cout << " >>> " << theName << "::validateOutput" << G4endl;
130 
131  // Show final state particles
132  if (verboseLevel > 2) output.printCollisionOutput();
133 
135  balance->collide(bullet, target, output);
136  return balance->okay(); // Returns false if violations
137 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4CascadeCheckBalance * balance
void printCollisionOutput(std::ostream &os=G4cout) const
virtual void setVerboseLevel(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4bool G4CascadeColliderBase::validateOutput ( const G4Fragment fragment,
G4CollisionOutput output 
)
protectedvirtual

Definition at line 139 of file G4CascadeColliderBase.cc.

References balance, G4CascadeCheckBalance::collide(), G4cout, G4endl, G4CascadeCheckBalance::okay(), G4VCascadeCollider::setVerboseLevel(), G4VCascadeCollider::theName, and G4VCascadeCollider::verboseLevel.

140  {
141  if (!balance) return true; // Skip checks unless requested
142 
143  if (verboseLevel > 1)
144  G4cout << " >>> " << theName << "::validateOutput" << G4endl;
145 
147  balance->collide(fragment, output);
148  return balance->okay(); // Returns false if violations
149 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4CascadeCheckBalance * balance
virtual void setVerboseLevel(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4bool G4CascadeColliderBase::validateOutput ( G4InuclParticle bullet,
G4InuclParticle target,
const std::vector< G4InuclElementaryParticle > &  particles 
)
protectedvirtual

Definition at line 151 of file G4CascadeColliderBase.cc.

References balance, G4CascadeCheckBalance::collide(), G4cout, G4endl, G4CascadeCheckBalance::okay(), G4VCascadeCollider::setVerboseLevel(), G4VCascadeCollider::theName, and G4VCascadeCollider::verboseLevel.

153  {
154  if (!balance) return true; // Skip checks unless requested
155 
156  if (verboseLevel > 1)
157  G4cout << " >>> " << theName << "::validateOutput" << G4endl;
158 
160  balance->collide(bullet, target, particles);
161  return balance->okay(); // Returns false if violations
162 }
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4CascadeCheckBalance * balance
virtual void setVerboseLevel(G4int verbose=0)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Field Documentation

G4CascadeCheckBalance* G4CascadeColliderBase::balance
protected
G4InteractionCase G4CascadeColliderBase::interCase
protected

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