00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "G4CascadeColliderBase.hh"
00039 #include "G4CascadeCheckBalance.hh"
00040 #include "G4CollisionOutput.hh"
00041 #include "G4Fragment.hh"
00042 #include "G4InteractionCase.hh"
00043 #include "G4InuclElementaryParticle.hh"
00044 #include "G4InuclNuclei.hh"
00045 #include "G4InuclSpecialFunctions.hh"
00046 #include "G4ios.hh"
00047
00048 using namespace G4InuclSpecialFunctions;
00049
00050
00051
00052
00053 G4CascadeColliderBase::G4CascadeColliderBase(const char* name, G4int verbose)
00054 : G4VCascadeCollider(name, verbose),
00055 #ifdef G4CASCADE_CHECK_ECONS
00056 doConservationChecks(true),
00057 #else
00058 doConservationChecks(false),
00059 #endif
00060 balance(new G4CascadeCheckBalance(0.001, 0.001, name)) {}
00061
00062 G4CascadeColliderBase::~G4CascadeColliderBase() {
00063 delete balance;
00064 }
00065
00066 void G4CascadeColliderBase::setVerboseLevel(G4int verbose) {
00067 G4VCascadeCollider::setVerboseLevel(verbose);
00068 balance->setVerboseLevel(verbose);
00069 }
00070
00071
00072
00073
00074 G4bool G4CascadeColliderBase::useEPCollider(G4InuclParticle* bullet,
00075 G4InuclParticle* target) const {
00076 return (dynamic_cast<G4InuclElementaryParticle*>(bullet) &&
00077 dynamic_cast<G4InuclElementaryParticle*>(target));
00078 }
00079
00080
00081
00082
00083 G4bool G4CascadeColliderBase::explosion(G4InuclNuclei* target) const {
00084 return target && explosion(target->getA(), target->getZ(),
00085 target->getExitationEnergy());
00086 }
00087
00088 G4bool G4CascadeColliderBase::explosion(G4Fragment* fragment) const {
00089 return fragment && explosion(fragment->GetA_asInt(), fragment->GetZ_asInt(),
00090 fragment->GetExcitationEnergy());
00091 }
00092
00093 G4bool
00094 G4CascadeColliderBase::explosion(G4int A, G4int Z,
00095 G4double excitation) const {
00096 if (verboseLevel) G4cout << " >>> " << theName << "::explosion ?" << G4endl;
00097
00098 const G4int a_cut = 20;
00099 const G4double be_cut = 3.0;
00100
00101
00102 return ((A <= a_cut || Z==0) &&
00103 (excitation >= be_cut * bindingEnergy(A,Z))
00104 );
00105 }
00106
00107
00108
00109
00110 G4bool
00111 G4CascadeColliderBase::inelasticInteractionPossible(G4InuclParticle* bullet,
00112 G4InuclParticle* target,
00113 G4double ekin) const {
00114 if (verboseLevel) {
00115 G4cout << " >>> " << theName << "::inelasticInteractionPossible" << G4endl;
00116 }
00117
00118
00119 if (useEPCollider(bullet, target)) return true;
00120
00121
00122
00123 G4InuclNuclei* nuclei_bullet = dynamic_cast<G4InuclNuclei*>(bullet);
00124 G4double ab = nuclei_bullet ? nuclei_bullet->getA() : 1;
00125 G4double zb = nuclei_bullet ? nuclei_bullet->getZ() : bullet->getCharge();
00126
00127 G4InuclNuclei* nuclei_target = dynamic_cast<G4InuclNuclei*>(target);
00128 G4double at = nuclei_target ? nuclei_target->getA() : 1;
00129 G4double zt = nuclei_target ? nuclei_target->getZ() : target->getCharge();
00130
00131
00132 const G4double coeff = 0.001 * 1.2;
00133
00134 G4double VCOL = coeff * zt * zb / (G4cbrt(at) + G4cbrt(ab));
00135
00136 G4bool possible = true;
00137
00138 if (verboseLevel > 3) {
00139 G4cout << " VCOL: " << VCOL << " ekin: " << ekin << " inelastic possible: "
00140 << possible << G4endl;
00141 }
00142
00143 return possible;
00144 }
00145
00146
00147
00148
00149 G4bool G4CascadeColliderBase::validateOutput(G4InuclParticle* bullet,
00150 G4InuclParticle* target,
00151 G4CollisionOutput& output) {
00152 if (!doConservationChecks) return true;
00153
00154 if (verboseLevel > 1)
00155 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
00156
00157
00158 if (verboseLevel > 2) output.printCollisionOutput();
00159
00160 balance->setVerboseLevel(verboseLevel);
00161 balance->collide(bullet, target, output);
00162 return balance->okay();
00163 }
00164
00165 G4bool G4CascadeColliderBase::validateOutput(G4InuclParticle* bullet,
00166 G4InuclParticle* target,
00167 const std::vector<G4InuclElementaryParticle>& particles) {
00168 if (!doConservationChecks) return true;
00169
00170 if (verboseLevel > 1)
00171 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
00172
00173 balance->setVerboseLevel(verboseLevel);
00174 balance->collide(bullet, target, particles);
00175 return balance->okay();
00176 }
00177
00178 G4bool G4CascadeColliderBase::validateOutput(G4InuclParticle* bullet,
00179 G4InuclParticle* target,
00180 const std::vector<G4InuclNuclei>& fragments) {
00181 if (!doConservationChecks) return true;
00182
00183 if (verboseLevel > 1)
00184 G4cout << " >>> " << theName << "::validateOutput" << G4endl;
00185
00186 balance->setVerboseLevel(verboseLevel);
00187 balance->collide(bullet, target, fragments);
00188 return balance->okay();
00189 }