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 // 00030 //-------------------------------------------------------------------- 00031 // GEANT 4 class header file 00032 // 00033 // G4PhysicsFreeVector.hh 00034 // 00035 // Class description: 00036 // 00037 // A physics vector which has values of energy-loss, cross-section, 00038 // and other physics values of a particle in matter in a given 00039 // range of the energy, momentum, etc. The scale of energy/momentum 00040 // bins is in free, ie. it is NOT need to be linear or log. Only 00041 // restrication is that bin values alway have to increase from 00042 // a lower bin to a higher bin. This is necessary for the binary 00043 // search to work correctly. 00044 00045 // History: 00046 // 02 Dec. 1995, G.Cosmo : Structure created based on object model 00047 // 06 Jun. 1996, K.Amako : Implemented the 1st version 00048 // 01 Jul. 1996, K.Amako : Cache mechanism and hidden bin from the 00049 // user introduced 00050 // 26 Sep. 1996, K.Amako : Constructor with only 'bin size' added 00051 // 11 Nov. 2000, H.Kurashige : Use STL vector for dataVector and binVector 00052 // 00053 //-------------------------------------------------------------------- 00054 00055 #ifndef G4PhysicsFreeVector_h 00056 #define G4PhysicsFreeVector_h 1 00057 00058 #include "globals.hh" 00059 #include "G4PhysicsVector.hh" 00060 #include "G4DataVector.hh" 00061 00062 class G4PhysicsFreeVector : public G4PhysicsVector 00063 { 00064 public: // with description 00065 00066 G4PhysicsFreeVector(); 00067 explicit G4PhysicsFreeVector(size_t theNbin); 00068 G4PhysicsFreeVector(const G4DataVector& binVector, 00069 const G4DataVector& dataVector); 00070 // Constructors: 00071 // 'binVector' has the low edge value of each scale bin. 00072 // 'dataVector' has the cross-section/energy-loss/etc at 00073 // the energy/momenturm of the corresponding a bin of 00074 // 'binVector'. 'binVector' and 'dataVector' need to have 00075 // the same vector length. 00076 00077 virtual ~G4PhysicsFreeVector(); 00078 // Destructor 00079 00080 void PutValue( size_t binNumber, G4double binValue, 00081 G4double dataValue ); 00082 // To use this method to fill a PhysicsFreeVector, you have 00083 // to Construct a PhysicsFreeVector of the size you need 00084 // using G4PhysicsFreeVector(size_t theNbin). Also take 00085 // note that you have to fill all bin values and data 00086 // values before you the PhysicsFreeVector. 00087 00088 protected: 00089 00090 virtual size_t FindBinLocation(G4double theEnergy) const; 00091 // Find bin# in which theEnergy belongs - virtual function 00092 }; 00093 00094 00095 #endif