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
00039
00040
00041
00042 #include "G4PreCompoundDeexcitation.hh"
00043 #include "globals.hh"
00044 #include "G4InuclElementaryParticle.hh"
00045 #include "G4InuclNuclei.hh"
00046 #include "G4InuclParticle.hh"
00047 #include "G4InuclParticleNames.hh"
00048 #include "G4PreCompoundModel.hh"
00049 #include "G4ReactionProductVector.hh"
00050
00051 using namespace G4InuclParticleNames;
00052
00053
00054
00055
00056 G4PreCompoundDeexcitation::G4PreCompoundDeexcitation()
00057 : G4VCascadeDeexcitation("G4PreCompoundDeexcitation"),
00058 theExcitationHandler(new G4ExcitationHandler),
00059 theDeExcitation(new G4PreCompoundModel(theExcitationHandler)) {}
00060
00061 G4PreCompoundDeexcitation::~G4PreCompoundDeexcitation() {
00062
00063
00064
00065
00066
00067 }
00068
00069
00070
00071 void G4PreCompoundDeexcitation::collide(G4InuclParticle* ,
00072 G4InuclParticle* target,
00073 G4CollisionOutput& globalOutput) {
00074 if (verboseLevel)
00075 G4cout << " >>> G4PreCompoundDeexcitation::collide" << G4endl;
00076
00077
00078 G4InuclNuclei* ntarget = dynamic_cast<G4InuclNuclei*>(target);
00079 if (!ntarget) {
00080 G4cerr << " G4PreCompoundDeexcitation ERROR: residual fragment must be G4InuclNuclei"
00081 << G4endl;
00082 return;
00083 }
00084
00085
00086 if (ntarget->getA() == 1) {
00087 G4int type = (ntarget->getZ() == 0) ? neutron : proton;
00088 G4InuclElementaryParticle ptarget(target->getMomentum(), type,
00089 G4InuclParticle::PreCompound);
00090
00091 globalOutput.addOutgoingParticle(ptarget);
00092 return;
00093 }
00094
00095 G4Fragment frag(*ntarget);
00096
00097 output.reset();
00098 deExcite(&frag, output);
00099 validateOutput(0, target, output);
00100
00101 globalOutput.add(output);
00102 }
00103
00104 void G4PreCompoundDeexcitation::deExcite(G4Fragment* fragment,
00105 G4CollisionOutput& globalOutput) {
00106 if (verboseLevel)
00107 G4cout << " >>> G4PreCompoundDeexcitation::deExcite" << G4endl;
00108
00109 if (!fragment) {
00110 if (verboseLevel > 1) G4cerr << " NULL pointer fragment" << G4endl;
00111 return;
00112 }
00113
00114 if (verboseLevel > 1) G4cout << *fragment << G4endl;
00115
00116 G4ReactionProductVector* precompoundProducts = 0;
00117
00118
00119
00120 if (explosion(fragment) && theExcitationHandler) {
00121 if (verboseLevel) G4cout << " calling BreakItUp" << G4endl;
00122 precompoundProducts = theExcitationHandler->BreakItUp(*fragment);
00123 } else {
00124 if (verboseLevel) G4cout << " calling DeExcite" << G4endl;
00125 precompoundProducts = theDeExcitation->DeExcite(*fragment);
00126 }
00127
00128
00129 if (precompoundProducts) {
00130 if (verboseLevel>1) {
00131 G4cout << " Got " << precompoundProducts->size()
00132 << " secondaries back from PreCompound:" << G4endl;
00133 }
00134
00135 globalOutput.setVerboseLevel(verboseLevel);
00136 globalOutput.addOutgoingParticles(precompoundProducts);
00137 globalOutput.setVerboseLevel(0);
00138
00139 precompoundProducts->clear();
00140 delete precompoundProducts;
00141 }
00142 }