#include <G4ProjectileDiffractiveChannel.hh>
Public Member Functions | |
G4ProjectileDiffractiveChannel () | |
~G4ProjectileDiffractiveChannel () | |
G4double | GetFraction (G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary) |
G4KineticTrackVector * | Scatter (G4Nucleus &theNucleus, const G4DynamicParticle &thePrimary) |
Definition at line 47 of file G4ProjectileDiffractiveChannel.hh.
G4ProjectileDiffractiveChannel::G4ProjectileDiffractiveChannel | ( | ) |
Definition at line 49 of file G4ProjectileDiffractiveChannel.cc.
References G4QDiffractionRatio::GetPointer().
00050 { 00051 theQDiffraction=G4QDiffractionRatio::GetPointer(); 00052 }
G4ProjectileDiffractiveChannel::~G4ProjectileDiffractiveChannel | ( | ) |
G4double G4ProjectileDiffractiveChannel::GetFraction | ( | G4Nucleus & | theNucleus, | |
const G4DynamicParticle & | thePrimary | |||
) |
Definition at line 57 of file G4ProjectileDiffractiveChannel.cc.
References G4cout, G4endl, G4DynamicParticle::GetDefinition(), G4Nucleus::GetN_asInt(), G4ParticleDefinition::GetPDGEncoding(), G4QDiffractionRatio::GetRatio(), G4DynamicParticle::GetTotalMomentum(), and G4Nucleus::GetZ_asInt().
Referenced by G4TheoFSGenerator::ApplyYourself().
00059 { 00060 G4double ratio; 00061 ratio=theQDiffraction->GetRatio(thePrimary.GetTotalMomentum(), 00062 thePrimary.GetDefinition()->GetPDGEncoding(), 00063 theNucleus.GetZ_asInt(), theNucleus.GetN_asInt() ); 00064 #ifdef debug_getFraction 00065 G4cout << "G4ProjectileDiffractiveChannel::ratio " << ratio << G4endl; 00066 #endif 00067 00068 return ratio; 00069 }
G4KineticTrackVector * G4ProjectileDiffractiveChannel::Scatter | ( | G4Nucleus & | theNucleus, | |
const G4DynamicParticle & | thePrimary | |||
) |
Definition at line 71 of file G4ProjectileDiffractiveChannel.cc.
References G4ParticleTable::FindParticle(), G4cout, G4endl, G4DynamicParticle::Get4Momentum(), G4Nucleus::GetA_asInt(), G4DynamicParticle::GetDefinition(), G4ParticleTable::GetIon(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGEncoding(), G4Nucleus::GetZ_asInt(), G4Lambda::Lambda(), G4Neutron::Neutron(), ns, and G4QDiffractionRatio::ProjFragment().
Referenced by G4TheoFSGenerator::ApplyYourself().
00073 { 00074 00075 00076 G4int A=theNucleus.GetA_asInt(); 00077 G4int Z=theNucleus.GetZ_asInt(); 00078 00079 G4ParticleDefinition * pDef=thePrimary.GetDefinition(); 00080 #ifdef debug_scatter 00081 G4cout << " ProjectileDiffractive: A, Z, proj-pdg" <<" "<< A <<" "<<Z 00082 << " "<<" " << pDef->GetParticleName()<< G4endl; 00083 #endif 00084 00085 G4QHadronVector * result(0); 00086 G4KineticTrackVector * ktv(0); 00087 G4bool tryAgain; 00088 00089 do { 00090 tryAgain = false; 00091 result=theQDiffraction->ProjFragment(pDef->GetPDGEncoding(), 00092 thePrimary.Get4Momentum(),Z, A-Z); 00093 00094 if ( result && result->size() > 0 ) 00095 { 00096 ktv=new G4KineticTrackVector(); 00097 std::vector<G4QHadron *>::iterator i; 00098 #ifdef debug_scatter 00099 G4int count(0); 00100 #endif 00101 for (i=result->begin(); i!=result->end(); i++) 00102 { 00103 G4int pdgCode=(*i)->GetPDGCode(); 00104 G4ParticleDefinition * secDef(0); 00105 if ( pdgCode < 80000000) { // check if ion; should be 90Million, but 89Million is possible 00106 secDef= G4ParticleTable::GetParticleTable()->FindParticle(pdgCode); 00107 }else { 00108 G4int qN = pdgCode % 1000; 00109 G4int qZ = (pdgCode/1000) %1000; 00110 if ( qZ < 500 && qN < 500){ // protect for delta being coded as/in nucleus 00111 secDef = G4ParticleTable::GetParticleTable()->GetIon(qZ,qN+qZ, 0); 00112 if ( ! secDef ) 00113 { // exceptions to the rule! 00114 if ( pdgCode == 90000001 ) secDef= G4Neutron::Neutron(); 00115 if ( pdgCode == 91000000 ) secDef= G4Lambda::Lambda(); 00116 } 00117 } 00118 } 00119 00120 if ( secDef ){ 00121 00122 G4ThreeVector pos=(*i)->GetPosition(); //GetPosition returns const & 00123 G4LorentzVector mom=(*i)->Get4Momentum(); 00124 00125 G4KineticTrack * sPrim=new G4KineticTrack(secDef, 00126 (*i)->GetFormationTime(), pos, mom); 00127 ktv->push_back(sPrim); 00128 00129 #ifdef debug_scatter 00130 G4cout << "G4ProjectileDiffractive sec # " << ++count << ", " 00131 << "ChipsPDGCode=" << pdgCode << ", " 00132 << secDef->GetParticleName() 00133 << ", time(ns) " << (*i)->GetFormationTime()/ns 00134 << ", pos " << pos 00135 << ", 4mom " << (*i)->Get4Momentum() 00136 << G4endl; 00137 #endif 00138 } else { 00139 #ifdef debug_scatter 00140 G4cout << "G4ProjectileDiffractiveChannel: Particle with PDG code "<< pdgCode <<" does not converted!!!"<<G4endl; 00141 #endif 00142 tryAgain=true; 00143 } 00144 } 00145 std::for_each(result->begin(), result->end(), DeleteQHadron()); 00146 delete result; 00147 result=0; 00148 } 00149 00150 if ( result ) delete result; 00151 if ( tryAgain ) { // QDiffraction returned a "difficult" particle in nucleus 00152 std::for_each(ktv->begin(), ktv->end(), DeleteKineticTrack()); 00153 delete ktv; 00154 ktv=0; 00155 } 00156 } while ( ! ktv); 00157 00158 return ktv; 00159 }