00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 #ifndef G4NeutronHPProduct_h 00030 #define G4NeutronHPProduct_h 1 00031 00032 #include <fstream> 00033 #include <CLHEP/Units/SystemOfUnits.h> 00034 00035 #include "globals.hh" 00036 #include "G4ios.hh" 00037 #include "Randomize.hh" 00038 #include "G4HadronicException.hh" 00039 #include "G4NeutronHPVector.hh" 00040 #include "G4VNeutronHPEnergyAngular.hh" 00041 #include "G4ReactionProductVector.hh" 00042 00043 #include "G4NeutronHPContEnergyAngular.hh" 00044 #include "G4NeutronHPDiscreteTwoBody.hh" 00045 #include "G4NeutronHPIsotropic.hh" 00046 #include "G4NeutronHPNBodyPhaseSpace.hh" 00047 #include "G4NeutronHPLabAngularEnergy.hh" 00048 00049 class G4NeutronHPProduct 00050 { 00051 public: 00052 G4NeutronHPProduct() 00053 { 00054 theDist = 0; 00055 } 00056 ~G4NeutronHPProduct() 00057 { 00058 if(theDist != 0) delete theDist; 00059 } 00060 00061 00062 //TK120515 For migration of frameFlag (MF6 LCT) = 3 in 00063 //G4NeutronHPEnAngCorrelation 00064 G4double GetMassCode(){return theMassCode;}; 00065 G4double GetMass(){return theMass;}; 00066 00067 inline void Init(std::ifstream & aDataFile) 00068 { 00069 aDataFile >> theMassCode>>theMass>>theIsomerFlag>>theDistLaw 00070 >> theGroundStateQValue>>theActualStateQValue; 00071 theGroundStateQValue*= CLHEP::eV; 00072 theActualStateQValue*= CLHEP::eV; 00073 theYield.Init(aDataFile, CLHEP::eV); 00074 if(theDistLaw==0) 00075 { 00076 // distribution not known, use E-independent, isotropic angular distribution 00077 theDist = new G4NeutronHPIsotropic; 00078 } 00079 else if(theDistLaw == 1) 00080 { 00081 // Continuum energy-angular distribution 00082 theDist = new G4NeutronHPContEnergyAngular; 00083 } 00084 else if(theDistLaw == 2) 00085 { 00086 // Discrete 2-body scattering 00087 theDist = new G4NeutronHPDiscreteTwoBody; 00088 } 00089 else if(theDistLaw == 3) 00090 { 00091 // Isotropic emission 00092 theDist = new G4NeutronHPIsotropic; 00093 } 00094 else if(theDistLaw == 4) 00095 { 00096 // Discrete 2-body recoil modification 00097 // not used for now. @@@@ 00098 theDist = new G4NeutronHPDiscreteTwoBody; 00099 // the above is only temporary; 00100 // recoils need to be addressed 00101 // properly 00102 delete theDist; 00103 theDist = 0; 00104 } 00105 else if(theDistLaw == 5) 00106 { 00107 // charged particles only, to be used in a later stage. @@@@ 00108 } 00109 else if(theDistLaw == 6) 00110 { 00111 // N-Body phase space 00112 theDist = new G4NeutronHPNBodyPhaseSpace; 00113 } 00114 else if(theDistLaw == 7) 00115 { 00116 // Laboratory angular energy paraetrisation 00117 theDist = new G4NeutronHPLabAngularEnergy; 00118 } 00119 else 00120 { 00121 throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4NeutronHPProduct"); 00122 } 00123 if(theDist!=0) 00124 { 00125 theDist->SetQValue(theActualStateQValue); 00126 theDist->Init(aDataFile); 00127 } 00128 } 00129 00130 G4ReactionProductVector * Sample(G4double anEnergy); 00131 00132 G4double GetMeanYield(G4double anEnergy) 00133 { 00134 return theYield.GetY(anEnergy); 00135 } 00136 00137 void SetNeutron(G4ReactionProduct * aNeutron) 00138 { 00139 theNeutron = aNeutron; 00140 } 00141 00142 void SetTarget(G4ReactionProduct * aTarget) 00143 { 00144 theTarget = aTarget; 00145 } 00146 00147 inline G4ReactionProduct * GetTarget() { return theTarget; } 00148 00149 inline G4ReactionProduct * GetNeutron() { return theNeutron; } 00150 00151 inline G4double MeanEnergyOfThisInteraction() 00152 { 00153 G4double result; 00154 if(theDist == 0) 00155 { 00156 result = 0; 00157 } 00158 else 00159 { 00160 result=theDist->MeanEnergyOfThisInteraction(); 00161 result *= theCurrentMultiplicity; 00162 } 00163 return result; 00164 } 00165 00166 inline G4double GetQValue() { return theActualStateQValue; } 00167 private: 00168 00169 // data members 00170 00171 G4double theMassCode; 00172 G4double theMass; 00173 G4int theIsomerFlag; 00174 G4double theGroundStateQValue; 00175 G4double theActualStateQValue; 00176 G4int theDistLaw; // redundant 00177 G4NeutronHPVector theYield; 00178 G4VNeutronHPEnergyAngular * theDist; 00179 00180 // Utility quantities 00181 00182 G4ReactionProduct * theTarget; 00183 G4ReactionProduct * theNeutron; 00184 00185 // cashed values 00186 00187 G4int theCurrentMultiplicity; 00188 00189 }; 00190 00191 #endif