00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MJGeneratorPNNLLookup_h
00022 #define MJGeneratorPNNLLookup_h 1
00023
00024 #include "globals.hh"
00025
00026
00027
00028
00029
00030
00031
00032 class MJGeneratorPNNLLookup {
00033
00034 public:
00035 MJGeneratorPNNLLookup() { };
00036 MJGeneratorPNNLLookup(G4int num_entries, G4double* x_arr, G4double* f_arr);
00037 MJGeneratorPNNLLookup(G4int num_entries, G4double* f_arr);
00038 MJGeneratorPNNLLookup(const MJGeneratorPNNLLookup& Lookup);
00039 ~MJGeneratorPNNLLookup();
00040 void operator=(const MJGeneratorPNNLLookup& Lookup);
00041
00042 G4int GetType() const {return fType; };
00043 G4double* GetXTable() const {return f_pX_table; };
00044 G4double* GetDistTable() const {return f_pDist_table; };
00045 G4double* GetLookupTable() const {return f_pSum_table; };
00046
00047 void DoCreateTable(G4int num_entries, G4double* x_arr, G4double* f_arr);
00048 void DoCreateTable(G4int num_entries, G4double* f_arr);
00049 G4double DoLookupInterp(G4double x_rnd);
00050 G4int DoLookupDiscrete(G4double x_rnd);
00051
00052 private:
00053 G4int fType;
00054 G4int fNum_entries;
00055 G4double* f_pX_table;
00056 G4double* f_pDist_table;
00057 G4double* f_pSum_table;
00058
00059 G4int Locate(double x);
00060 const static G4int kTYPE_INTERPOLATED_LOOKUP;
00061 const static G4int kTYPE_DISCRETE_LOOKUP;
00062
00063 };
00064
00065 #endif