G4NeutronHPLegendreStore.hh

Go to the documentation of this file.
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 G4NeutronHPLegendreStore_h
00030 #define G4NeutronHPLegendreStore_h 1
00031 
00032 #include "G4NeutronHPLegendreTable.hh"
00033 #include "G4InterpolationManager.hh"
00034 #include "G4ios.hh"
00035 #include <fstream>
00036 
00037 class G4NeutronHPLegendreStore
00038 {
00039   public:
00040   
00041   G4NeutronHPLegendreStore(G4int n)
00042   {
00043     theCoeff = new G4NeutronHPLegendreTable[n];
00044     nEnergy = n;
00045   }
00046   
00047   ~G4NeutronHPLegendreStore()
00048   {
00049     delete [] theCoeff;
00050   }
00051   
00052   inline void Init(G4int i, G4double e, G4int n)
00053   {
00054     theCoeff[i].Init(e, n);
00055   }
00056   inline void SetNPoints(G4int n) { nEnergy = n; }
00057   inline void SetEnergy(G4int i, G4double energy) { theCoeff[i].SetEnergy(energy); }
00058   inline void SetTemperature(G4int i, G4double temp) { theCoeff[i].SetTemperature(temp); }
00059   inline void SetCoeff(G4int i, G4int l, G4double coeff) {theCoeff[i].SetCoeff(l, coeff); }
00060   inline void SetCoeff(G4int i, G4NeutronHPLegendreTable * theTable)
00061   {
00062     if(i>nEnergy) throw G4HadronicException(__FILE__, __LINE__, "LegendreTableIndex out of range");
00063     theCoeff[i] = *theTable;
00064 // not here -- see G4NeutronHPPhotonDist.cc line 275
00065 //    delete theTable;
00066   }
00067   
00068   inline G4double GetCoeff(G4int i, G4int l) {return theCoeff[i].GetCoeff(l);}
00069   inline G4double GetEnergy(G4int i){return theCoeff[i].GetEnergy();}
00070   inline G4double GetTemperature(G4int i){return theCoeff[i].GetTemperature();}
00071   inline G4int GetNumberOfPoly(G4int i) {return theCoeff[i].GetNumberOfPoly();}
00072   
00073   G4double SampleDiscreteTwoBody (G4double anEnergy);
00074   G4double SampleElastic (G4double anEnergy);
00075   G4double Sample (G4double energy);
00076   G4double SampleMax (G4double energy);
00077   G4double Integrate(G4int k, G4double costh);
00078   
00079   void InitInterpolation(std::ifstream & aDataFile)
00080   {
00081     theManager.Init(aDataFile);
00082   }
00083   
00084   void SetManager(G4InterpolationManager & aManager)
00085   {
00086     theManager = aManager;
00087   }
00088 
00089   private:
00090   
00091   G4int nEnergy;
00092   G4NeutronHPLegendreTable * theCoeff;
00093   G4InterpolationManager theManager; // interpolate between different Tables
00094 };
00095 #endif

Generated on Mon May 27 17:49:02 2013 for Geant4 by  doxygen 1.4.7