146 maximumTries(20), numberOfTries(0),
168 outFile <<
"The Bertini-style cascade implements the inelastic scattering\n"
169 <<
"of hadrons by nuclei. Nucleons, pions, kaons and hyperons\n"
170 <<
"from 0 to 15 GeV may be used as projectiles in this model.\n"
171 <<
"Final state hadrons are produced by a classical cascade\n"
172 <<
"consisting of individual hadron-nucleon scatterings which use\n"
173 <<
"free-space partial cross sections, corrected for various\n"
174 <<
"nuclear medium effects. The target nucleus is modeled as a\n"
175 <<
"set of 1, 3 or 6 spherical shells, in which scattered hadrons\n"
176 <<
"travel in straight lines until they are reflected from or\n"
177 <<
"transmitted through shell boundaries.\n";
197 if (!ch || !pn || !nn || !pp)
return;
245 G4cout <<
" >>> G4CascadeInterface::ApplyYourself" <<
G4endl;
248 G4cerr <<
" >>> G4CascadeInterface got negative-energy track: "
253 #ifdef G4CASCADE_DEBUG_INTERFACE
254 static G4int counter(0);
256 G4cerr <<
"Reaction number "<< counter <<
" "
264 CLHEP::HepRandom::saveEngineStatus(
randomFile);
349 #ifdef G4CASCADE_DEBUG_INTERFACE
353 <<
"\n " << theSecondaries->size() <<
" secondaries:" <<
G4endl;
354 for (
size_t i=0; i<theSecondaries->size(); i++) {
366 CLHEP::HepRandom::saveEngineStatus(
randomFile);
423 G4cout <<
" >>> G4CascadeInterface::NoInteraction" <<
G4endl;
439 G4int bulletType = 0;
440 G4int bulletA = 0, bulletZ = 0;
449 if (0 == bulletType && 0 == bulletA*bulletZ) {
452 <<
" not usable as bullet." <<
G4endl;
468 projectileMomentum.e());
516 G4cerr <<
" ERROR: G4CascadeInterface incompatible particle type "
517 << outgoingType <<
G4endl;
552 G4cout <<
" >>> G4CascadeInterface::copyOutputToHadronicResult" <<
G4endl;
561 if (!particles.empty()) {
563 for (; ipart != particles.end(); ipart++) {
569 if (!outgoingNuclei.empty()) {
571 for (; ifrag != outgoingNuclei.end(); ifrag++) {
579 G4cout <<
" >>> G4CascadeInterface::copyOutputToReactionProducts" <<
G4endl;
590 if (!particles.empty()) {
592 for (; ipart != particles.end(); ipart++) {
596 propResult->push_back(rp);
602 if (!fragments.empty()) {
604 for (; ifrag != fragments.end(); ifrag++) {
608 propResult->push_back(rp);
624 G4cerr <<
"ERROR: no baryon number conservation, sum of baryons = "
629 G4cerr <<
"ERROR: no charge conservation, sum of charges = "
634 G4cerr <<
"Kinetic energy conservation violated by "
641 G4cout <<
"Initial energy " << eInit <<
" final energy " << eFinal
642 <<
"\nTotal energy conservation at level "
646 G4cerr <<
"FATAL ERROR: kinetic energy created "
660 const std::vector<G4InuclElementaryParticle>& p =
664 if (ipart->type() ==
proton) {
665 violated |= (ipart->getKineticEnergy() < coulumbBarrier);
675 const std::vector<G4InuclElementaryParticle>& out =
678 #ifdef G4CASCADE_DEBUG_INTERFACE
680 G4cout <<
" retryInelasticProton: number of Tries "
682 <<
"\n retryInelasticProton: AND collision type ";
685 G4cout << (out.size() == 2 ?
"ELASTIC (t)" :
"INELASTIC (f)")
686 <<
"\n retryInelasticProton: AND Leading particles bullet "
687 << (out.size() >= 2 &&
690 ?
"YES (t)" :
"NO (f)")
714 #ifdef G4CASCADE_DEBUG_INTERFACE
716 G4cout <<
" retryInelasticNucleus: numberOfTries "
718 <<
"\n retryInelasticNucleus: AND outputParticles "
719 << ((npart != 0) ?
"NON-ZERO (t)" :
"EMPTY (f)")
720 #ifdef G4CASCADE_COULOMB_DEV
721 <<
"\n retryInelasticNucleus: AND coulombBarrier (COULOMB_DEV) "
723 <<
"\n retryInelasticNucleus: AND collision type (COULOMB_DEV) "
724 << ((npart+nfrag > 2) ?
"INELASTIC (t)" :
"ELASTIC (f)")
726 <<
"\n retryInelasticNucleus: AND collsion type "
727 << ((npart+nfrag < 3) ?
"ELASTIC (t)" :
"INELASTIC (f)")
728 <<
"\n retryInelasticNucleus: AND Leading particle bullet "
731 <<
"\n retryInelasticNucleus: OR conservation "
732 << (!
balance->
okay() ?
"FAILED (t)" :
"PASSED (f)")
738 #ifdef G4CASCADE_COULOMB_DEV
741 (npart+nfrag < 3 && firstOut == bullet->getDefinition())
744 #ifndef G4CASCADE_SKIP_ECONS
758 std::ostream& errInfo =
G4cerr;
760 errInfo <<
" >>> G4CascadeInterface has non-conserving"
763 G4String throwMsg =
"G4CascadeInterface - ";
765 throwMsg +=
"Energy";
766 errInfo <<
" Energy conservation violated by " <<
balance->
deltaE()
771 throwMsg +=
"Momentum";
772 errInfo <<
" Momentum conservation violated by " <<
balance->
deltaP()
777 throwMsg +=
"Baryon number";
782 throwMsg +=
"Charge";
783 errInfo <<
" Charge conservation violated by " <<
balance->
deltaQ()
787 errInfo <<
" Final event output, for debugging:\n"
788 <<
" Bullet: \n" << *
bullet << G4endl
792 throwMsg +=
" non-conservation. More info in output.";
void useCascadeDeexcitation()
void fill(G4int a, G4int z, G4double exc=0., Model model=DefaultModel)
G4bool retryInelasticNucleus() const
void rescatter(G4InuclParticle *bullet, G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus, G4CollisionOutput &globalOutput)
void setVerboseLevel(G4int verbose)
const G4String randomFile
G4CascadeInterface(const G4String &name="BertiniCascade")
static const G4CascadeChannel * GetTable(G4int initialState)
G4bool coulombBarrierViolation() const
G4InuclNuclei nucleusTarget
G4HadFinalState * ApplyYourself(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
virtual G4int GetCharge()=0
CLHEP::Hep3Vector G4ThreeVector
const G4DynamicParticle & getDynamicParticle() const
G4LorentzVector getMomentum() const
const G4HadProjectile * GetPrimaryProjectile() const
const G4ThreeVector & GetPosition() const
G4bool baryonOkay() const
G4CascadeCheckBalance * balance
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &output)
void printCollisionOutput(std::ostream &os=G4cout) const
virtual G4int GetMassNumber()=0
const G4ParticleDefinition * getDefinition() const
G4CollisionOutput * output
G4double getEnergy() const
G4LorentzRotation bulletInLabFrame
const char * name(G4int ptype)
void setLimits(G4double relative, G4double absolute)
static G4Diproton * Definition()
const G4String & GetParticleName() const
virtual void setVerboseLevel(G4int verbose=0)
G4int GetAtomicNumber() const
G4double getKineticEnergy() const
void SetStatusChange(G4HadFinalStateStatus aS)
std::vector< G4ReactionProduct * > G4ReactionProductVector
void useCascadeDeexcitation()
void copyOutputToHadronicResult()
virtual void DumpConfiguration(std::ostream &outFile) const
G4GLOB_DLL std::ostream G4cout
ParticleList decay(Cluster *const c)
Carries out a cluster decay.
const G4ParticleDefinition * GetDefinition() const
std::vector< G4InuclElementaryParticle >::const_iterator particleIterator
G4double GetFormationTime() const
G4ReactionProductVector * Propagate(G4KineticTrackVector *theSecondaries, G4V3DNucleus *theNucleus)
G4InuclNuclei nucleusBullet
void setVerboseLevel(G4int verbose=0)
G4bool energyOkay() const
G4double GetKineticEnergy() const
G4bool createTarget(G4Nucleus &theNucleus)
G4int numberOfOutgoingParticles() const
void collide(G4InuclParticle *bullet, G4InuclParticle *target, G4CollisionOutput &globalOutput)
G4ReactionProductVector * copyOutputToReactionProducts()
G4double relativeE() const
G4DynamicParticle * makeDynamicParticle(const G4InuclElementaryParticle &iep) const
static const double perCent
void rotateEvent(const G4LorentzRotation &rotate)
static G4KaonZeroLong * Definition()
static const G4double A[nN]
const G4LorentzVector & Get4Momentum() const
G4int GetAtomicMass() const
static G4Dineutron * Definition()
G4int numberOfOutgoingNuclei() const
void SetEnergyChange(G4double anEnergy)
void usePreCompoundDeexcitation()
G4bool chargeOkay() const
const std::vector< G4InuclNuclei > & getOutgoingNuclei() const
static G4KaonZeroShort * Definition()
const std::vector< G4InuclElementaryParticle > & getOutgoingParticles() const
G4InuclElementaryParticle hadronBullet
virtual void SetVerboseLevel(G4int value)
void fill(G4int ityp, Model model=DefaultModel)
std::vector< G4InuclNuclei >::const_iterator nucleiIterator
G4HadFinalState theParticleChange
std::vector< G4InuclElementaryParticle >::iterator particleIterator
G4bool momentumOkay() const
void throwNonConservationFailure()
virtual void ModelDescription(std::ostream &outFile) const
G4bool quasi_deutron() const
void AddSecondary(G4DynamicParticle *aP, G4int mod=-1)
G4InuclElementaryParticle hadronTarget
G4InuclCollider * collider
G4double relativeP() const
G4bool createBullet(const G4HadProjectile &aTrack)
void SetVerboseLevel(G4int verbose)
G4bool retryInelasticProton() const
const G4LorentzVector & Get4Momentum() const
void SetEnergyMomentumCheckLevels(G4double relativeLevel, G4double absoluteLevel)
const G4ParticleDefinition * GetDefinition() const
void usePreCompoundDeexcitation()
static void DumpConfiguration(std::ostream &os)
static G4UnboundPN * Definition()
G4GLOB_DLL std::ostream G4cerr
G4bool IsApplicable(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
virtual ~G4CascadeInterface()
CLHEP::HepLorentzVector G4LorentzVector
G4HadFinalState * NoInteraction(const G4HadProjectile &aTrack, G4Nucleus &theNucleus)
static G4bool usePreCompound()