138 using namespace G4InuclParticleNames;
149 maximumTries(20), numberOfTries(0),
174 outFile <<
"The Bertini-style cascade implements the inelastic scattering\n"
175 <<
"of hadrons by nuclei. Nucleons, pions, kaons and hyperons\n"
176 <<
"from 0 to 15 GeV may be used as projectiles in this model.\n"
177 <<
"Final state hadrons are produced by a classical cascade\n"
178 <<
"consisting of individual hadron-nucleon scatterings which use\n"
179 <<
"free-space partial cross sections, corrected for various\n"
180 <<
"nuclear medium effects. The target nucleus is modeled as a\n"
181 <<
"set of 1, 3 or 6 spherical shells, in which scattered hadrons\n"
182 <<
"travel in straight lines until they are reflected from or\n"
183 <<
"transmitted through shell boundaries.\n";
203 if (!ch || !pn || !nn || !pp)
return;
251 G4cout <<
" >>> G4CascadeInterface::ApplyYourself" <<
G4endl;
254 G4cerr <<
" >>> G4CascadeInterface got negative-energy track: "
259 #ifdef G4CASCADE_DEBUG_INTERFACE
260 static G4int counter(0);
262 G4cerr <<
"Reaction number "<< counter <<
" "
357 #ifdef G4CASCADE_DEBUG_INTERFACE
361 <<
"\n " << theSecondaries->size() <<
" secondaries:" <<
G4endl;
362 for (
size_t i=0; i<theSecondaries->size(); i++) {
431 G4cout <<
" >>> G4CascadeInterface::NoInteraction" <<
G4endl;
447 G4int bulletType = 0;
448 G4int bulletA = 0, bulletZ = 0;
457 if (0 == bulletType && 0 == bulletA*bulletZ) {
460 <<
" not usable as bullet." <<
G4endl;
478 projectileMomentum.
e());
526 G4cerr <<
" ERROR: G4CascadeInterface incompatible particle type "
527 << outgoingType <<
G4endl;
562 G4cout <<
" >>> G4CascadeInterface::copyOutputToHadronicResult" <<
G4endl;
571 if (!particles.empty()) {
573 for (; ipart != particles.end(); ipart++) {
579 if (!outgoingNuclei.empty()) {
581 for (; ifrag != outgoingNuclei.end(); ifrag++) {
589 G4cout <<
" >>> G4CascadeInterface::copyOutputToReactionProducts" <<
G4endl;
600 if (!particles.empty()) {
602 for (; ipart != particles.end(); ipart++) {
606 propResult->push_back(rp);
612 if (!fragments.empty()) {
614 for (; ifrag != fragments.end(); ifrag++) {
618 propResult->push_back(rp);
634 G4cerr <<
"ERROR: no baryon number conservation, sum of baryons = "
639 G4cerr <<
"ERROR: no charge conservation, sum of charges = "
644 G4cerr <<
"Kinetic energy conservation violated by "
651 G4cout <<
"Initial energy " << eInit <<
" final energy " << eFinal
652 <<
"\nTotal energy conservation at level "
656 G4cerr <<
"FATAL ERROR: kinetic energy created "
670 const std::vector<G4InuclElementaryParticle>&
p =
675 violated |= (
ipart->getKineticEnergy() < coulumbBarrier);
685 const std::vector<G4InuclElementaryParticle>& out =
688 #ifdef G4CASCADE_DEBUG_INTERFACE
690 G4cout <<
" retryInelasticProton: number of Tries "
692 <<
"\n retryInelasticProton: AND collision type ";
695 G4cout << (out.size() == 2 ?
"ELASTIC (t)" :
"INELASTIC (f)")
696 <<
"\n retryInelasticProton: AND Leading particles bullet "
697 << (out.size() >= 2 &&
700 ?
"YES (t)" :
"NO (f)")
724 #ifdef G4CASCADE_DEBUG_INTERFACE
726 G4cout <<
" retryInelasticNucleus: numberOfTries "
728 <<
"\n retryInelasticNucleus: AND outputParticles "
729 << ((npart != 0) ?
"NON-ZERO (t)" :
"EMPTY (f)")
730 #ifdef G4CASCADE_COULOMB_DEV
731 <<
"\n retryInelasticNucleus: AND coulombBarrier (COULOMB_DEV) "
733 <<
"\n retryInelasticNucleus: AND collision type (COULOMB_DEV) "
734 << ((npart+nfrag > 2) ?
"INELASTIC (t)" :
"ELASTIC (f)")
736 <<
"\n retryInelasticNucleus: AND collsion type "
737 << ((npart+nfrag < 3) ?
"ELASTIC (t)" :
"INELASTIC (f)")
738 <<
"\n retryInelasticNucleus: AND Leading particle bullet "
741 <<
"\n retryInelasticNucleus: OR conservation "
742 << (!
balance->
okay() ?
"FAILED (t)" :
"PASSED (f)")
748 #ifdef G4CASCADE_COULOMB_DEV
751 (npart+nfrag < 3 && firstOut == bullet->getDefinition())
754 #ifndef G4CASCADE_SKIP_ECONS
768 std::ostream& errInfo =
G4cerr;
770 errInfo <<
" >>> G4CascadeInterface has non-conserving"
773 G4String throwMsg =
"G4CascadeInterface - ";
775 throwMsg +=
"Energy";
776 errInfo <<
" Energy conservation violated by " <<
balance->
deltaE()
781 throwMsg +=
"Momentum";
782 errInfo <<
" Momentum conservation violated by " <<
balance->
deltaP()
787 throwMsg +=
"Baryon number";
792 throwMsg +=
"Charge";
793 errInfo <<
" Charge conservation violated by " <<
balance->
deltaQ()
797 errInfo <<
" Final event output, for debugging:\n"
798 <<
" Bullet: \n" << *
bullet << G4endl
802 throwMsg +=
" non-conservation. More info in output.";
static G4Dineutron * Definition()
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
std::vector< G4InuclNuclei >::const_iterator nucleiIterator
G4DynamicParticle * makeDynamicParticle(const G4InuclElementaryParticle &iep) const
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
G4int GetAtomicNumber() const
const G4LorentzVector & Get4Momentum() const
static constexpr double MeV
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
G4bool momentumOkay() const
void fill(G4int ityp, Model model=DefaultModel)
virtual ~G4CascadeInterface()
static G4Diproton * Definition()
G4bool quasi_deutron() const
const G4HadProjectile * GetPrimaryProjectile() const
static constexpr double perCent
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
const G4String & GetParticleName() const
void usePreCompoundDeexcitation()
const G4DynamicParticle & getDynamicParticle() const
const G4ParticleDefinition * GetDefinition() const
void copyOutputToHadronicResult()
static G4KaonZeroLong * Definition()
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
static void saveEngineStatus(const char filename[]="Config.conf")
static void DumpConfiguration(std::ostream &os)
const G4ParticleDefinition * getDefinition() const
G4InuclElementaryParticle hadronBullet
virtual void DumpConfiguration(std::ostream &outFile) const
G4HadFinalState * NoInteraction(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4bool createTarget(G4Nucleus &theNucleus)
void setVerboseLevel(G4int verbose=0)
void SetEnergyChange(G4double anEnergy)
void useCascadeDeexcitation()
static const G4CascadeChannel * GetTable(G4int initialState)
G4double getKineticEnergy() const
G4CascadeInterface(const G4String &name="BertiniCascade")
void usePreCompoundDeexcitation()
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
G4bool chargeOkay() const
void SetVerboseLevel(G4int value)
void setLimits(G4double relative, G4double absolute)
const G4String randomFile
G4bool baryonOkay() const
G4int numberOfOutgoingNuclei() const
double A(double temperature)
void setVerboseLevel(G4int verbose)
G4double relativeE() const
G4bool retryInelasticProton() const
virtual G4int GetCharge()=0
G4InuclNuclei nucleusTarget
G4CascadeCheckBalance * balance
G4bool retryInelasticNucleus() const
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cerr
G4int numberOfOutgoingParticles() const
const G4LorentzVector & Get4Momentum() const
virtual G4int GetMassNumber()=0
G4double GetKineticEnergy() const
G4double relativeP() const
const G4ParticleDefinition * GetDefinition() const
G4CollisionOutput * output
G4double GetFormationTime() const
static G4bool usePreCompound()
G4ReactionProductVector * copyOutputToReactionProducts()
static G4KaonZeroShort * Definition()
G4int GetAtomicMass() const
G4LorentzVector getMomentum() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
G4GLOB_DLL std::ostream G4cout
virtual void setVerboseLevel(G4int verbose=0)
G4bool IsApplicable(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
G4bool createBullet(const G4HadProjectile &aTrack)
virtual void ModelDescription(std::ostream &outFile) const
const G4ThreeVector & GetPosition() const
void useCascadeDeexcitation()
void throwNonConservationFailure()
void SetVerboseLevel(G4int verbose)
void printCollisionOutput(std::ostream &os=G4cout) const
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
G4bool coulombBarrierViolation() const
G4double getEnergy() const
static G4UnboundPN * Definition()
G4bool energyOkay() const
static constexpr double GeV
G4InuclElementaryParticle hadronTarget
G4HadFinalState theParticleChange
G4InuclCollider * collider
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
void SetStatusChange(G4HadFinalStateStatus aS)
G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)
G4InuclNuclei nucleusBullet