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 // 00030 // PhysicsOrderedFreeVector Class Definition 00032 // 00033 // File: G4PhysicsOrderedFreeVector.hh 00034 // Created: 1996-08-13 00035 // Author: Juliet Armstrong 00036 // Updated: 1997-03-25 by Peter Gumplinger 00037 // > cosmetics (only) 00038 // 2000-11-11 by H.Kurashige 00039 // > use STL vector for dataVector and binVector 00040 // mail: gum@triumf.ca 00041 // 00042 // Class description: 00043 // 00044 // A physics ordered free vector inherits from G4PhysicsVector which 00045 // has values of energy-loss, cross-section, and other physics values 00046 // of a particle in matter in a given range of the energy, momentum, 00047 // etc.). In addition, the ordered free vector provides a method for 00048 // the user to insert energy/value pairs in sequence. Methods to 00049 // Retrieve the Max and Min energies and values from the vector are 00050 // also provided. 00051 00053 00054 #ifndef G4PhysicsOrderedFreeVector_h 00055 #define G4PhysicsOrderedFreeVector_h 1 00056 00058 // Includes 00060 00061 #include "G4PhysicsVector.hh" 00062 00064 // Class Definition 00066 00067 class G4PhysicsOrderedFreeVector : public G4PhysicsVector 00068 { 00069 00070 public: // with description 00071 00073 // Constructors and Destructor 00075 00076 G4PhysicsOrderedFreeVector(); 00077 G4PhysicsOrderedFreeVector(G4double* Energies, 00078 G4double* Values, 00079 size_t VectorLength); 00080 00081 virtual ~G4PhysicsOrderedFreeVector(); 00082 00084 // Methods 00086 00087 void InsertValues(G4double energy, G4double value); 00088 00089 G4double GetLowEdgeEnergy(size_t binNumber) const; 00090 00091 G4double GetMaxValue(); 00092 00093 G4double GetMinValue(); 00094 00095 G4double GetEnergy(G4double aValue); 00096 00097 G4double GetMaxLowEdgeEnergy(); 00098 00099 G4double GetMinLowEdgeEnergy(); 00100 00101 void DumpValues(); 00102 00103 private: 00104 00105 virtual size_t FindBinLocation(G4double theEnergy) const; 00106 00107 size_t FindValueBinLocation(G4double aValue); 00108 00109 G4double LinearInterpolationOfEnergy(G4double aValue, size_t theLocBin); 00110 }; 00111 00112 #include "G4PhysicsOrderedFreeVector.icc" 00113 00114 #endif /* G4PhysicsOrderedFreeVector_h */ 00115 00116 00117 00118 00119 00120