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 | // $Id: G4AdjointCSMatrix.hh,v 1.4 2009/11/20 10:31:20 ldesorgh Exp $ |
---|
27 | // GEANT4 tag $Name: geant4-09-04-beta-01 $ |
---|
28 | // |
---|
29 | ///////////////////////////////////////////////////////////////////////////////// |
---|
30 | // Class: G4AdjointCSMatrix.hh |
---|
31 | // Author: L. Desorgher |
---|
32 | // Organisation: SpaceIT GmbH |
---|
33 | // Contract: ESA contract 21435/08/NL/AT |
---|
34 | // Customer: ESA/ESTEC |
---|
35 | ///////////////////////////////////////////////////////////////////////////////// |
---|
36 | // |
---|
37 | // CHANGE HISTORY |
---|
38 | // -------------- |
---|
39 | // ChangeHistory: |
---|
40 | // 1st April 2007 creation by L. Desorgher |
---|
41 | // |
---|
42 | //------------------------------------------------------------- |
---|
43 | // Documentation: |
---|
44 | // An adjoint CS matrix is used by the model of a reverse process to sample an adjoint secondary (being equivalent to a forward primary). |
---|
45 | // It represents the integration over the energy of the adjoint secondary (therefore the forward primary) of the differential cross section |
---|
46 | // of the equiavlent forward discrete process (Ionisation, Brem, PE effect, Compton,..) . Each reverse model has its own cross section matrix for a given cut, |
---|
47 | // material couple. It is therefore recompute after a modification of the cuts by the user. |
---|
48 | // |
---|
49 | // |
---|
50 | // |
---|
51 | |
---|
52 | #ifndef G4AdjointCSMatrix_h |
---|
53 | #define G4AdjointCSMatrix_h 1 |
---|
54 | |
---|
55 | #include"globals.hh" |
---|
56 | #include<vector> |
---|
57 | #include"G4ParticleDefinition.hh" |
---|
58 | |
---|
59 | //////////////////////////////////////////////////////////////////////////////// |
---|
60 | // |
---|
61 | class G4AdjointCSMatrix |
---|
62 | { |
---|
63 | //////////////////////////////// |
---|
64 | // Constructors and Destructor |
---|
65 | //////////////////////////////// |
---|
66 | public: |
---|
67 | G4AdjointCSMatrix(G4bool aBool); |
---|
68 | ~G4AdjointCSMatrix(); |
---|
69 | |
---|
70 | ////////////// |
---|
71 | // Methods // |
---|
72 | ////////////// |
---|
73 | void Clear(); |
---|
74 | void AddData(G4double aPrimEnergy,G4double aCS, std::vector< double>* aLogSecondEnergyVector, |
---|
75 | std::vector< double>* aLogProbVector,size_t n_pro_decade=0); |
---|
76 | |
---|
77 | G4bool GetData(unsigned int i, G4double& aPrimEnergy,G4double& aCS,G4double& log0, std::vector< double>*& aLogSecondEnergyVector, |
---|
78 | std::vector< double>*& aLogProbVector, |
---|
79 | std::vector< size_t>*& aLogProbVectorIndex); |
---|
80 | |
---|
81 | inline std::vector< double>* GetLogPrimEnergyVector(){return &theLogPrimEnergyVector;} |
---|
82 | inline std::vector< double>* GetLogCrossSectionvector(){return &theLogCrossSectionVector;} |
---|
83 | inline G4double GetDlog(){return dlog;} |
---|
84 | inline G4bool IsScatProjToProjCase(){return is_scat_proj_to_proj_case;} |
---|
85 | void Write(G4String file_name); |
---|
86 | void Read(G4String file_name); |
---|
87 | |
---|
88 | private: |
---|
89 | |
---|
90 | // we did first try to use G4PhysicsOrderedVector but they are not general enough for our purpose |
---|
91 | |
---|
92 | std::vector< double> theLogPrimEnergyVector; |
---|
93 | std::vector< double> theLogCrossSectionVector; //Adjoint Cross sections in function of primary energy |
---|
94 | std::vector< std::vector< double>* > theLogSecondEnergyMatrix; |
---|
95 | std::vector< std::vector< double>* > theLogProbMatrix; //Each column represents the integrated probability of getting a secondary |
---|
96 | // in function of their energy |
---|
97 | std::vector< std::vector< size_t >* > theLogProbMatrixIndex; //index of equidistant LogProb |
---|
98 | std::vector< double> log0Vector; |
---|
99 | |
---|
100 | unsigned int nb_of_PrimEnergy; |
---|
101 | G4bool is_scat_proj_to_proj_case; |
---|
102 | G4double dlog; |
---|
103 | |
---|
104 | |
---|
105 | }; |
---|
106 | #endif |
---|