G4NeutronHPEnAngCorrelation Class Reference

#include <G4NeutronHPEnAngCorrelation.hh>


Public Member Functions

 G4NeutronHPEnAngCorrelation ()
 ~G4NeutronHPEnAngCorrelation ()
void Init (std::ifstream &aDataFile)
G4ReactionProductSampleOne (G4double anEnergy)
G4ReactionProductVectorSample (G4double anEnergy)
void SetTarget (G4ReactionProduct &aTarget)
void SetNeutron (G4ReactionProduct &aNeutron)
G4bool InCharge ()
G4double GetTargetMass ()
G4double GetTotalMeanEnergy ()


Detailed Description

Definition at line 41 of file G4NeutronHPEnAngCorrelation.hh.


Constructor & Destructor Documentation

G4NeutronHPEnAngCorrelation::G4NeutronHPEnAngCorrelation (  )  [inline]

Definition at line 44 of file G4NeutronHPEnAngCorrelation.hh.

00045   {
00046     theProducts = 0;
00047     inCharge = false;
00048     theTotalMeanEnergy = -1.;
00049   }

G4NeutronHPEnAngCorrelation::~G4NeutronHPEnAngCorrelation (  )  [inline]

Definition at line 50 of file G4NeutronHPEnAngCorrelation.hh.

00051   {
00052     if(theProducts!=0) delete [] theProducts;
00053   }


Member Function Documentation

G4double G4NeutronHPEnAngCorrelation::GetTargetMass (  )  [inline]

Definition at line 87 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

00087 { return targetMass; }

G4double G4NeutronHPEnAngCorrelation::GetTotalMeanEnergy (  )  [inline]

Definition at line 89 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPInelasticBaseFS::BaseApply().

00090   {
00091      // cashed in 'sample' call
00092     return theTotalMeanEnergy; 
00093   }

G4bool G4NeutronHPEnAngCorrelation::InCharge (  )  [inline]

Definition at line 82 of file G4NeutronHPEnAngCorrelation.hh.

00083   {
00084     return inCharge;
00085   }

void G4NeutronHPEnAngCorrelation::Init ( std::ifstream &  aDataFile  )  [inline]

Definition at line 55 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPInelasticCompFS::Init(), G4NeutronHPInelasticBaseFS::Init(), and G4NeutronHPCaptureFS::Init().

00056   {
00057     inCharge = true;
00058     aDataFile>>targetMass>>frameFlag>>nProducts;
00059     theProducts = new G4NeutronHPProduct[nProducts];
00060     for(G4int i=0; i<nProducts; i++)
00061     {
00062       theProducts[i].Init(aDataFile);
00063     }
00064   }

G4ReactionProductVector * G4NeutronHPEnAngCorrelation::Sample ( G4double  anEnergy  ) 

Definition at line 62 of file G4NeutronHPEnAngCorrelation.cc.

References G4endl, G4ReactionProduct::GetKineticEnergy(), G4ReactionProduct::GetMomentum(), G4NeutronHPProduct::GetQValue(), G4ReactionProduct::GetTotalEnergy(), G4ReactionProduct::Lorentz(), G4NeutronHPProduct::MeanEnergyOfThisInteraction(), G4ReactionProduct::SetMass(), G4ReactionProduct::SetMomentum(), and G4ReactionProduct::SetTotalEnergy().

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), and G4NeutronHPInelasticCompFS::CompositeApply().

00063 {
00064   G4ReactionProductVector * result = new G4ReactionProductVector;
00065   G4int i;
00066   G4ReactionProductVector * it;
00067   G4ReactionProduct theCMS;
00068   G4LorentzRotation toZ;
00069   //TK120515 migrate frameFlag (MF6 LCT) = 3 
00070   //if(frameFlag==2)
00071   if(frameFlag==2||frameFlag==3)
00072   {
00073     // simplify and double check @
00074     G4ThreeVector the3Neutron = theNeutron.GetMomentum(); //theNeutron has value in LAB
00075     G4double nEnergy = theNeutron.GetTotalEnergy();
00076     G4ThreeVector the3Target = theTarget.GetMomentum();  //theTarget has value in LAB
00077     G4double tEnergy = theTarget.GetTotalEnergy();
00078     G4double totE = nEnergy+tEnergy;
00079     G4ThreeVector the3CMS = the3Target+the3Neutron;
00080     theCMS.SetMomentum(the3CMS);
00081     G4double cmsMom = std::sqrt(the3CMS*the3CMS);
00082     G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
00083     theCMS.SetMass(sqrts);
00084     theCMS.SetTotalEnergy(totE);
00085     G4ReactionProduct aNeutron;
00086     aNeutron.Lorentz(theNeutron, theCMS);
00087     //TKDB 100413 
00088     //ENDF-6 Formats Manual ENDF-102
00089     //CHAPTER 6. FILE 6: PRODUCT ENERGY-ANGLE DISTRIBUTIONS
00090     //LCT Reference system for secondary energy and angle (incident energy is always given in the LAB system)
00091     //anEnergy = aNeutron.GetKineticEnergy();
00092     anEnergy = theNeutron.GetKineticEnergy(); //should be same argumment of "anEnergy"
00093 
00094     G4LorentzVector Ptmp (aNeutron.GetMomentum(), aNeutron.GetTotalEnergy());
00095 
00096     toZ.rotateZ(-1*Ptmp.phi());
00097     toZ.rotateY(-1*Ptmp.theta());
00098   }
00099   theTotalMeanEnergy=0;
00100   G4LorentzRotation toLab(toZ.inverse()); //toLab only change axis NOT to LAB system
00101   for(i=0; i<nProducts; i++)
00102   {
00103     it = theProducts[i].Sample(anEnergy);
00104     G4double aMeanEnergy = theProducts[i].MeanEnergyOfThisInteraction();
00105     if(aMeanEnergy>0)
00106     {
00107       theTotalMeanEnergy += aMeanEnergy;
00108     }
00109     else
00110     {
00111       theTotalMeanEnergy = anEnergy/nProducts+theProducts[i].GetQValue();
00112     }
00113     if(it!=0)
00114     {
00115       for(unsigned int ii=0; ii<it->size(); ii++)
00116       {
00117         G4LorentzVector pTmp1 (it->operator[](ii)->GetMomentum(),
00118                                it->operator[](ii)->GetTotalEnergy());
00119         pTmp1 = toLab*pTmp1;
00120         it->operator[](ii)->SetMomentum(pTmp1.vect());
00121         it->operator[](ii)->SetTotalEnergy(pTmp1.e());
00122         if(frameFlag==1) // target rest //TK 100413 should be LAB?
00123         {
00124           it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theTarget); //TK 100413 Is this really need?
00125         }
00126         else if(frameFlag==2) // CMS
00127         {
00128 #ifdef G4_NHP_DEBUG
00129           cout <<"G4NeutronHPEnAngCorrelation: "<<
00130                  it->at(ii)->GetTotalEnergy()<<" "<<
00131                  it->at(ii)->GetMomentum()<<G4endl;
00132 #endif
00133           it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
00134         }
00135         //TK120515 migrate frameFlag (MF6 LCT) = 3 
00136         else if(frameFlag==3) // CMS A<=4 other LAB
00137         {
00138            if ( theProducts[i].GetMassCode() > 4 ) //Alpha AWP 3.96713
00139            {
00140               //LAB
00141               it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theTarget); //TK 100413 Is this really need?
00142            }
00143            else
00144            {
00145               //CMS
00146               it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
00147            }
00148         }
00149         else
00150         {
00151           throw G4HadronicException(__FILE__, __LINE__, "G4NeutronHPEnAngCorrelation::Sample: The frame of the finalstate is not specified");
00152         }
00153         result->push_back(it->operator[](ii));
00154       }
00155     delete it;
00156     }
00157   }   
00158   return result;
00159 }

G4ReactionProduct * G4NeutronHPEnAngCorrelation::SampleOne ( G4double  anEnergy  ) 

Definition at line 37 of file G4NeutronHPEnAngCorrelation.cc.

References G4NeutronHPProduct::Sample().

00038 {  
00039   G4ReactionProduct * result = new G4ReactionProduct;
00040   
00041   // do we have an appropriate distribution
00042   if(nProducts!=1) throw G4HadronicException(__FILE__, __LINE__, "More than one product in SampleOne");
00043   
00044   // get the result
00045   G4ReactionProductVector * temp=0;
00046   G4int i=0;
00047   while(temp == 0) temp = theProducts[i++].Sample(anEnergy);
00048   
00049   // is the multiplicity correct
00050   if(temp->size()!=1) throw G4HadronicException(__FILE__, __LINE__, "SampleOne: Yield not correct");
00051   
00052   // fill result
00053   result = temp->operator[](0);
00054   
00055   // some garbage collection
00056   delete temp;
00057   
00058   // return result
00059   return result;
00060 }

void G4NeutronHPEnAngCorrelation::SetNeutron ( G4ReactionProduct aNeutron  )  [inline]

Definition at line 76 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), and G4NeutronHPInelasticCompFS::InitDistributionInitialState().

00077   {
00078     theNeutron = aNeutron;
00079     for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron);
00080   }

void G4NeutronHPEnAngCorrelation::SetTarget ( G4ReactionProduct aTarget  )  [inline]

Definition at line 70 of file G4NeutronHPEnAngCorrelation.hh.

Referenced by G4NeutronHPCaptureFS::ApplyYourself(), G4NeutronHPInelasticBaseFS::BaseApply(), and G4NeutronHPInelasticCompFS::InitDistributionInitialState().

00071   {
00072     theTarget = aTarget;
00073     for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
00074   }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:37 2013 for Geant4 by  doxygen 1.4.7