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 G4NeutronHPEnAngCorrelation_h 00030 #define G4NeutronHPEnAngCorrelation_h 1 00031 00032 #include "globals.hh" 00033 #include "G4NeutronHPVector.hh" 00034 #include "Randomize.hh" 00035 #include "G4ios.hh" 00036 #include <fstream> 00037 #include "globals.hh" 00038 #include "G4NeutronHPProduct.hh" 00039 #include "G4ReactionProduct.hh" 00040 00041 class G4NeutronHPEnAngCorrelation 00042 { 00043 public: 00044 G4NeutronHPEnAngCorrelation() 00045 { 00046 theProducts = 0; 00047 inCharge = false; 00048 theTotalMeanEnergy = -1.; 00049 } 00050 ~G4NeutronHPEnAngCorrelation() 00051 { 00052 if(theProducts!=0) delete [] theProducts; 00053 } 00054 00055 inline void Init(std::ifstream & aDataFile) 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 } 00065 00066 G4ReactionProduct * SampleOne(G4double anEnergy); 00067 00068 G4ReactionProductVector * Sample(G4double anEnergy); 00069 00070 inline void SetTarget(G4ReactionProduct & aTarget) 00071 { 00072 theTarget = aTarget; 00073 for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget); 00074 } 00075 00076 inline void SetNeutron(G4ReactionProduct & aNeutron) 00077 { 00078 theNeutron = aNeutron; 00079 for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron); 00080 } 00081 00082 inline G4bool InCharge() 00083 { 00084 return inCharge; 00085 } 00086 00087 inline G4double GetTargetMass() { return targetMass; } 00088 00089 G4double GetTotalMeanEnergy() 00090 { 00091 // cashed in 'sample' call 00092 return theTotalMeanEnergy; 00093 } 00094 00095 private: 00096 00097 // data members 00098 00099 G4double targetMass; 00100 G4int frameFlag; // =1: Target rest frame; =2: CMS system; incident always in lab 00101 G4int nProducts; 00102 G4NeutronHPProduct * theProducts; 00103 G4bool inCharge; 00104 00105 // Utility quantities 00106 00107 G4ReactionProduct theTarget; 00108 G4ReactionProduct theNeutron; 00109 00110 // cashed values 00111 00112 G4double theTotalMeanEnergy; 00113 00114 }; 00115 00116 #endif