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 // $Id: G4AdjointCSMatrix.hh 69844 2013-05-16 09:19:33Z gcosmo $ 00027 // 00029 // Class: G4AdjointCSMatrix.hh 00030 // Author: L. Desorgher 00031 // Organisation: SpaceIT GmbH 00032 // Contract: ESA contract 21435/08/NL/AT 00033 // Customer: ESA/ESTEC 00035 // 00036 // CHANGE HISTORY 00037 // -------------- 00038 // ChangeHistory: 00039 // 1st April 2007 creation by L. Desorgher 00040 // 00041 //------------------------------------------------------------- 00042 // Documentation: 00043 // An adjoint CS matrix is used by the model of a reverse process to sample an adjoint secondary (being equivalent to a forward primary). 00044 // It represents the integration over the energy of the adjoint secondary (therefore the forward primary) of the differential cross section 00045 // of the equiavlent forward discrete process (Ionisation, Brem, PE effect, Compton,..) . Each reverse model has its own cross section matrix for a given cut, 00046 // material couple. It is therefore recompute after a modification of the cuts by the user. 00047 // 00048 // 00049 // 00050 00051 #ifndef G4AdjointCSMatrix_h 00052 #define G4AdjointCSMatrix_h 1 00053 00054 #include"globals.hh" 00055 #include<vector> 00056 #include"G4ParticleDefinition.hh" 00057 00059 // 00060 class G4AdjointCSMatrix 00061 { 00063 // Constructors and Destructor 00065 public: 00066 G4AdjointCSMatrix(G4bool aBool); 00067 ~G4AdjointCSMatrix(); 00068 00070 // Methods // 00072 void Clear(); 00073 void AddData(G4double aPrimEnergy,G4double aCS, std::vector< double>* aLogSecondEnergyVector, 00074 std::vector< double>* aLogProbVector,size_t n_pro_decade=0); 00075 00076 G4bool GetData(unsigned int i, G4double& aPrimEnergy,G4double& aCS,G4double& log0, std::vector< double>*& aLogSecondEnergyVector, 00077 std::vector< double>*& aLogProbVector, 00078 std::vector< size_t>*& aLogProbVectorIndex); 00079 00080 inline std::vector< double>* GetLogPrimEnergyVector(){return &theLogPrimEnergyVector;} 00081 inline std::vector< double>* GetLogCrossSectionvector(){return &theLogCrossSectionVector;} 00082 inline G4double GetDlog(){return dlog;} 00083 inline G4bool IsScatProjToProjCase(){return is_scat_proj_to_proj_case;} 00084 void Write(G4String file_name); 00085 void Read(G4String file_name); 00086 00087 private: 00088 00089 // we did first try to use G4PhysicsOrderedVector but they are not general enough for our purpose 00090 00091 std::vector< double> theLogPrimEnergyVector; 00092 std::vector< double> theLogCrossSectionVector; //Adjoint Cross sections in function of primary energy 00093 std::vector< std::vector< double>* > theLogSecondEnergyMatrix; 00094 std::vector< std::vector< double>* > theLogProbMatrix; //Each column represents the integrated probability of getting a secondary 00095 // in function of their energy 00096 std::vector< std::vector< size_t >* > theLogProbMatrixIndex; //index of equidistant LogProb 00097 std::vector< double> log0Vector; 00098 00099 unsigned int nb_of_PrimEnergy; 00100 G4bool is_scat_proj_to_proj_case; 00101 G4double dlog; 00102 00103 00104 }; 00105 #endif