| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DsG4GdNeutronHPCaptureFS Class Reference

#include <DsG4GdNeutronHPCaptureFS.h>

Collaboration diagram for DsG4GdNeutronHPCaptureFS:

[legend]
List of all members.

Public Member Functions

 DsG4GdNeutronHPCaptureFS ()
 ~DsG4GdNeutronHPCaptureFS ()
void UpdateNucleus (const G4Fragment *, G4double)
void Init (G4double A, G4double Z, G4String &dirName, G4String &aFSType)
G4HadFinalState * ApplyYourself (const G4HadProjectile &theTrack)
G4NeutronHPFinalState * New ()

Private Attributes

G4Fragment * nucleus
G4DynamicParticle * theTwo
G4ReactionProduct theTarget
G4Nucleus aNucleus
G4ReactionProduct theNeutron
G4double targetMass
G4NeutronHPPhotonDist theFinalStatePhotons
DsG4GdCaptureGammas theFinalgammas
G4NeutronHPNames theNames
G4double theCurrentA
G4double theCurrentZ

Detailed Description

Definition at line 29 of file DsG4GdNeutronHPCaptureFS.h.


Constructor & Destructor Documentation

DsG4GdNeutronHPCaptureFS::DsG4GdNeutronHPCaptureFS (  ) 

Definition at line 24 of file DsG4GdNeutronHPCaptureFS.cc.

00025 {
00026     hasXsec = false; 
00027     targetMass = 0;
00028     //    G4cerr << "DsG4GdNeutronHPCaptureFS" << G4endl; 
00029 }

DsG4GdNeutronHPCaptureFS::~DsG4GdNeutronHPCaptureFS (  ) 

Definition at line 31 of file DsG4GdNeutronHPCaptureFS.cc.

00032 { 
00033 }


Member Function Documentation

void DsG4GdNeutronHPCaptureFS::UpdateNucleus ( const G4Fragment *  ,
G4double   
)

Definition at line 140 of file DsG4GdNeutronHPCaptureFS.cc.

00141 {
00142     G4LorentzVector p4Gamma = gamma->GetMomentum();
00143     G4ThreeVector pGamma(p4Gamma.vect());
00144   
00145     G4LorentzVector p4Nucleus(nucleus->GetMomentum() );
00146   
00147     G4double m1 = G4ParticleTable::GetParticleTable()->GetIonTable()
00148         ->GetIonMass(static_cast<G4int>(nucleus->GetZ()),
00149                      static_cast<G4int>(nucleus->GetA()));
00150     G4double m2 = nucleus->GetZ() *  G4Proton::Proton()->GetPDGMass() + 
00151         (nucleus->GetA()- nucleus->GetZ())*G4Neutron::Neutron()->GetPDGMass();
00152   
00153     G4double Mass = std::min(m1,m2);
00154   
00155     G4double newExcitation = p4Nucleus.mag() - Mass - eGamma;
00156   
00157     if(newExcitation < 0)
00158         newExcitation = 0;
00159   
00160     G4ThreeVector p3Residual(p4Nucleus.vect() - pGamma);
00161     G4double newEnergy = std::sqrt(p3Residual * p3Residual +
00162                                    (Mass + newExcitation) * (Mass + newExcitation));
00163     G4LorentzVector p4Residual(p3Residual, newEnergy);
00164   
00165     // Update excited nucleus parameters
00166   
00167     nucleus->SetMomentum(p4Residual);
00168 
00169     return;
00170 }

void DsG4GdNeutronHPCaptureFS::Init ( G4double  A,
G4double  Z,
G4String &  dirName,
G4String &  aFSType 
)

Definition at line 172 of file DsG4GdNeutronHPCaptureFS.cc.

00173 {
00174     G4String tString = "/FS/";
00175     G4bool dbool;
00176     G4NeutronHPDataUsed aFile = theNames.GetName(static_cast<G4int>(A), static_cast<G4int>(Z), dirName, tString, dbool);
00177     G4String filename = aFile.GetName();
00178     theBaseA = A;
00179     theBaseZ = G4int(Z+.5);
00180     if(!dbool || ( Z<2.5 && ( std::abs(theBaseZ - Z)>0.0001 || 
00181                               std::abs(theBaseA - A)>0.0001))) {
00182         hasAnyData = false;
00183         hasFSData = false; 
00184         hasXsec = false;
00185         return;
00186     }
00187     std::ifstream theData(filename, std::ios::in);
00188     
00189     hasFSData = theFinalStatePhotons.InitMean(theData); 
00190     if(hasFSData) {
00191         targetMass = theFinalStatePhotons.GetTargetMass();
00192         theFinalStatePhotons.InitAngular(theData); 
00193         theFinalStatePhotons.InitEnergies(theData); 
00194     }
00195     theData.close();
00196 }

G4HadFinalState * DsG4GdNeutronHPCaptureFS::ApplyYourself ( const G4HadProjectile &  theTrack  ) 

Definition at line 35 of file DsG4GdNeutronHPCaptureFS.cc.

00036 {
00037     G4int i;
00038     theResult.Clear();
00039     // prepare neutron
00040     G4double eKinetic = theTrack.GetKineticEnergy();
00041     const G4HadProjectile *incidentParticle = &theTrack;
00042     theNeutron = const_cast<G4ParticleDefinition *>(incidentParticle->GetDefinition()) ;
00043     theNeutron.SetMomentum( incidentParticle->Get4Momentum().vect() );
00044     theNeutron.SetKineticEnergy( eKinetic );
00045 
00046     // prepare target
00047     G4double eps = 0.0001;
00048     if(targetMass<500*MeV) {
00049         targetMass = G4NucleiProperties::GetNuclearMass(static_cast<G4int>(theBaseA+eps),
00050                                                         static_cast<G4int>(theBaseZ+eps))
00051             / G4Neutron::Neutron()->GetPDGMass();
00052     }
00053     G4ThreeVector neutronVelocity = 1./G4Neutron::Neutron()->GetPDGMass()*theNeutron.GetMomentum();
00054     G4double temperature = theTrack.GetMaterial()->GetTemperature();
00055     theTarget = aNucleus.GetBiasedThermalNucleus(targetMass, neutronVelocity, temperature);
00056 
00057     // go to nucleus rest system
00058     theNeutron.Lorentz(theNeutron, -1*theTarget);
00059     eKinetic = theNeutron.GetKineticEnergy();
00060 
00061     // dice the photons
00062     // get the emission gammas
00063     G4ReactionProductVector * thePhotons = NULL; 
00064     thePhotons = theFinalgammas.GetGammas();    
00065 
00066     // update the nucleus, calculate the target state after gamma emission.
00067     G4ThreeVector aCMSMomentum = theNeutron.GetMomentum()+theTarget.GetMomentum();
00068     G4LorentzVector p4(aCMSMomentum, theTarget.GetTotalEnergy() + theNeutron.GetTotalEnergy());
00069     nucleus = new G4Fragment(static_cast<G4int>(theBaseA+1), static_cast<G4int>(theBaseZ) ,p4);
00070 
00071     G4int nPhotons = 0;
00072     if(thePhotons!=NULL) nPhotons=thePhotons->size();
00073   
00074     for(i=0;i<nPhotons;i++) {
00075         G4ThreeVector pGamma(thePhotons->operator[](i)->GetMomentum());
00076         G4LorentzVector gamma(pGamma,thePhotons->operator[](i)->GetTotalEnergy());
00077         G4Fragment* theOne= new G4Fragment(gamma,G4Gamma::GammaDefinition());
00078         UpdateNucleus(theOne,thePhotons->operator[](i)->GetTotalEnergy());
00079     }
00080 
00081     theTwo = new G4DynamicParticle;
00082     theTwo->SetDefinition(G4ParticleTable::GetParticleTable()
00083                           ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 0, static_cast<G4int>(theBaseZ)));
00084     theTwo->SetMomentum(nucleus->GetMomentum());
00085 
00086     // add them to the final state
00087 
00088     G4int nParticles = nPhotons;
00089     if(1==nPhotons) nParticles = 2;
00090 
00091     // back to lab system
00092     for(i=0; i<nPhotons; i++)
00093         thePhotons->operator[](i)->Lorentz(*(thePhotons->operator[](i)), theTarget);
00094         
00095     // Recoil, if only one gamma
00096     if (1==nPhotons) {
00097         G4DynamicParticle * theOne = new G4DynamicParticle;
00098         G4ParticleDefinition * aRecoil = G4ParticleTable::GetParticleTable()
00099             ->FindIon(static_cast<G4int>(theBaseZ), static_cast<G4int>(theBaseA+1), 
00100                       0, static_cast<G4int>(theBaseZ));
00101         theOne->SetDefinition(aRecoil);
00102     
00103         // Now energy; 
00104         // Can be done slightly better @
00105         G4ThreeVector aMomentum =  theTrack.Get4Momentum().vect()
00106             +theTarget.GetMomentum()
00107             -thePhotons->operator[](0)->GetMomentum();
00108 
00109         G4ThreeVector theMomUnit = aMomentum.unit();
00110         G4double aKinEnergy =  theTrack.GetKineticEnergy()
00111             +theTarget.GetKineticEnergy(); // gammas come from Q-value
00112         G4double theResMass = aRecoil->GetPDGMass();
00113         G4double theResE = aRecoil->GetPDGMass()+aKinEnergy;
00114         G4double theAbsMom = std::sqrt(theResE*theResE - theResMass*theResMass);
00115         G4ThreeVector theMomentum = theAbsMom*theMomUnit;
00116         theOne->SetMomentum(theMomentum);
00117         theResult.AddSecondary(theOne);     
00118     }else{
00119       //Add deexcited nucleus
00120       theResult.AddSecondary(theTwo);
00121     }
00122 
00123     // Now fill in the gammas.
00124      for(i=0; i<nPhotons; i++) {
00125         // back to lab system
00126         G4DynamicParticle * theOne = new G4DynamicParticle;
00127         theOne->SetDefinition(thePhotons->operator[](i)->GetDefinition());
00128         theOne->SetMomentum(thePhotons->operator[](i)->GetMomentum());
00129         theResult.AddSecondary(theOne);
00130         delete thePhotons->operator[](i);
00131     }
00132     delete thePhotons; 
00133     
00134     // clean up the primary neutron
00135     theResult.SetStatusChange(stopAndKill);
00136     return &theResult;
00137 }

G4NeutronHPFinalState* DsG4GdNeutronHPCaptureFS::New (  )  [inline]

Definition at line 41 of file DsG4GdNeutronHPCaptureFS.h.

00041                                   {
00042         DsG4GdNeutronHPCaptureFS * theNew = new DsG4GdNeutronHPCaptureFS;
00043         return theNew;
00044     }


Member Data Documentation

G4Fragment* DsG4GdNeutronHPCaptureFS::nucleus [private]

Definition at line 48 of file DsG4GdNeutronHPCaptureFS.h.

G4DynamicParticle* DsG4GdNeutronHPCaptureFS::theTwo [private]

Definition at line 50 of file DsG4GdNeutronHPCaptureFS.h.

G4ReactionProduct DsG4GdNeutronHPCaptureFS::theTarget [private]

Definition at line 51 of file DsG4GdNeutronHPCaptureFS.h.

G4Nucleus DsG4GdNeutronHPCaptureFS::aNucleus [private]

Definition at line 52 of file DsG4GdNeutronHPCaptureFS.h.

G4ReactionProduct DsG4GdNeutronHPCaptureFS::theNeutron [private]

Definition at line 53 of file DsG4GdNeutronHPCaptureFS.h.

G4double DsG4GdNeutronHPCaptureFS::targetMass [private]

Definition at line 55 of file DsG4GdNeutronHPCaptureFS.h.

G4NeutronHPPhotonDist DsG4GdNeutronHPCaptureFS::theFinalStatePhotons [private]

Definition at line 57 of file DsG4GdNeutronHPCaptureFS.h.

DsG4GdCaptureGammas DsG4GdNeutronHPCaptureFS::theFinalgammas [private]

Definition at line 58 of file DsG4GdNeutronHPCaptureFS.h.

G4NeutronHPNames DsG4GdNeutronHPCaptureFS::theNames [private]

Definition at line 59 of file DsG4GdNeutronHPCaptureFS.h.

G4double DsG4GdNeutronHPCaptureFS::theCurrentA [private]

Definition at line 61 of file DsG4GdNeutronHPCaptureFS.h.

G4double DsG4GdNeutronHPCaptureFS::theCurrentZ [private]

Definition at line 62 of file DsG4GdNeutronHPCaptureFS.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:53:27 2011 for DetSim by doxygen 1.4.7