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 // 070613 fix memory leaking by T. Koi 00030 // 00031 #ifndef G4NeutronHPAngular_h 00032 #define G4NeutronHPAngular_h 1 00033 00034 #include "globals.hh" 00035 #include "G4ios.hh" 00036 #include <fstream> 00037 #include "G4ReactionProduct.hh" 00038 #include "Randomize.hh" 00039 #include "G4NeutronHPLegendreStore.hh" 00040 #include "G4NeutronHPPartial.hh" 00041 00042 class G4NeutronHPAngular 00043 { 00044 public: 00045 00046 G4NeutronHPAngular() 00047 { 00048 //TKDB110511 00049 //theAngularDistributionType = 0; 00050 //theIsoFlag = false; 00051 theIsoFlag = true; 00052 // TKDB 00053 theCoefficients = 0; 00054 theProbArray = 0; 00055 } 00056 00057 ~G4NeutronHPAngular() 00058 { 00059 // TKDB 00060 delete theCoefficients; 00061 delete theProbArray; 00062 } 00063 00064 void Init(std::ifstream & aDataFile); 00065 00066 void SampleAndUpdate(G4ReactionProduct & aNeutron); 00067 00068 void SetTarget(const G4ReactionProduct & aTarget) { theTarget = aTarget; } 00069 00070 void SetNeutron(const G4ReactionProduct & aNeutron) { theNeutron = aNeutron; } 00071 00072 inline G4double GetTargetMass() { return targetMass; } 00073 00074 private: 00075 00076 // the type of distribution; currently 00077 // isotropic (0), 00078 // and legendre representation (1) 00079 // probability distribution (2) 00080 // are supported 00081 00082 G4int theAngularDistributionType; 00083 G4int frameFlag; // 1=Lab, 2=CMS 00084 00085 G4bool theIsoFlag; // isotropic or not? 00086 00087 G4NeutronHPLegendreStore * theCoefficients; // the legendre coefficients 00088 00089 G4NeutronHPPartial * theProbArray; // the probability array p,costh for energy 00090 00091 private: 00092 00093 G4double targetMass; 00094 00095 G4ReactionProduct theTarget; 00096 G4ReactionProduct theNeutron; 00097 00098 }; 00099 00100 #endif