[966] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | ///////////////////////////////////////////////////////////////////////////////// |
---|
| 27 | // Module: G4AdjointCSMatrix.hh |
---|
| 28 | // Author: L. Desorgher |
---|
| 29 | // Date: 1st April 2007 |
---|
| 30 | // Organisation: SpaceIT GmbH |
---|
| 31 | // Customer: ESA/ESTEC |
---|
| 32 | ///////////////////////////////////////////////////////////////////////////////// |
---|
| 33 | // |
---|
| 34 | // CHANGE HISTORY |
---|
| 35 | // -------------- |
---|
| 36 | // ChangeHistory: |
---|
| 37 | // 1st April 2007 creation by L. Desorgher |
---|
| 38 | // |
---|
| 39 | //------------------------------------------------------------- |
---|
| 40 | // Documentation: |
---|
| 41 | // An adjoint CS matrix is used by the model of a reverse process to sample an adjoint secondary (being equivalent to a forward primary). |
---|
| 42 | // It represents the integration over the energy of the adjoint secondary (therefore the forward primary) of the differential cross section |
---|
| 43 | // of the equiavlent forward discrete process (Ionisation, Brem, PE effect, Compton,..) . Each reverse model has its own cross section matrix for a given cut, |
---|
| 44 | // material couple. It is therefore recompute after a modification of the cuts by the user. |
---|
| 45 | // |
---|
| 46 | // |
---|
| 47 | // |
---|
| 48 | |
---|
| 49 | #ifndef G4AdjointCSMatrix_h |
---|
| 50 | #define G4AdjointCSMatrix_h 1 |
---|
| 51 | |
---|
| 52 | #include"globals.hh" |
---|
| 53 | #include<vector> |
---|
| 54 | #include"G4ParticleDefinition.hh" |
---|
| 55 | |
---|
| 56 | //////////////////////////////////////////////////////////////////////////////// |
---|
| 57 | // |
---|
| 58 | class G4AdjointCSMatrix |
---|
| 59 | { |
---|
| 60 | //////////////////////////////// |
---|
| 61 | // Constructors and Destructor |
---|
| 62 | //////////////////////////////// |
---|
| 63 | public: |
---|
| 64 | G4AdjointCSMatrix(G4bool aBool); |
---|
| 65 | ~G4AdjointCSMatrix(); |
---|
| 66 | |
---|
| 67 | //////////// |
---|
| 68 | // Methods |
---|
| 69 | //////////// |
---|
| 70 | void Clear(); |
---|
| 71 | void AddData(G4double aPrimEnergy,G4double aCS, std::vector< G4double>* aLogSecondEnergyVector, |
---|
| 72 | std::vector< G4double>* aLogProbVector,size_t n_pro_decade=0); |
---|
| 73 | |
---|
| 74 | bool GetData(unsigned int i, G4double& aPrimEnergy,G4double& aCS,G4double& log0, std::vector< G4double>*& aLogSecondEnergyVector, |
---|
| 75 | std::vector< G4double>*& aLogProbVector, |
---|
| 76 | std::vector< size_t>*& aLogProbVectorIndex); |
---|
| 77 | |
---|
| 78 | inline std::vector< G4double >* GetLogPrimEnergyVector(){return &theLogPrimEnergyVector;} |
---|
| 79 | inline std::vector< G4double >* GetLogCrossSectionvector(){return &theLogCrossSectionVector;} |
---|
| 80 | inline G4double GetDlog(){return dlog;} |
---|
| 81 | inline G4bool IsScatProjToProjCase(){return is_scat_proj_to_proj_case;} |
---|
| 82 | void Write(G4String file_name); |
---|
| 83 | void Read(G4String file_name); |
---|
| 84 | |
---|
| 85 | private: |
---|
| 86 | |
---|
| 87 | // we did first try to use G4PhysicsOrderedVector but they are not general enough for our purpose |
---|
| 88 | |
---|
| 89 | std::vector< G4double > theLogPrimEnergyVector; |
---|
| 90 | std::vector< G4double > theLogCrossSectionVector; //Adjoint Cross sections in function of primary energy |
---|
| 91 | std::vector< std::vector< G4double >* > theLogSecondEnergyMatrix; |
---|
| 92 | std::vector< std::vector< G4double >* > theLogProbMatrix; //Each column represents the integrated probability of getting a secondary |
---|
| 93 | // in function of their energy |
---|
| 94 | std::vector< std::vector< size_t >* > theLogProbMatrixIndex; //index of euqidistant LogProb |
---|
| 95 | std::vector< G4double > log0Vector; |
---|
| 96 | |
---|
| 97 | unsigned int nb_of_PrimEnergy; |
---|
| 98 | G4bool is_scat_proj_to_proj_case; |
---|
| 99 | G4double dlog; |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | }; |
---|
| 103 | #endif |
---|