Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4HadronXSDataTable.hh
이 파일의 문서화 페이지로 가기
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: G4HadronXSDataTable.hh 96794 2016-05-09 10:09:30Z gcosmo $
27 //
28 //---------------------------------------------------------------------------
29 //
30 // GEANT4 Class file
31 //
32 // Description: Data structure for cross sections per materials
33 //
34 // Author: V.Ivanchenko 31.05.2018
35 //
36 // Modifications:
37 //
38 //----------------------------------------------------------------------------
39 //
40 
41 #ifndef HadronXSDataTable_h
42 #define HadronXSDataTable_h 1
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
46 #include "globals.hh"
47 #include "G4Element.hh"
48 #include "G4ElementVector.hh"
49 #include "G4PhysicsVector.hh"
50 #include "Randomize.hh"
51 #include <vector>
52 
53 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54 
55 class G4Material;
56 class G4DynamicParticle;
58 
60 {
61 public:
62 
64  const G4Material*, G4int bins,
65  G4double emin, G4double emax, G4bool spline);
66 
68 
69  void Dump();
70 
71  inline const G4Element* SelectRandomAtom(G4double e) const
72  {
73  const G4Element* element = (*theElementVector)[nElmMinusOne];
74  if (nElmMinusOne > 0) {
76  for(G4int i=0; i<nElmMinusOne; ++i) {
77  if (x <= xSections[i]->Value(e)) {
78  element = (*theElementVector)[i];
79  break;
80  }
81  }
82  }
83  return element;
84  }
85 
86 private:
87 
90 
93  std::vector<G4PhysicsVector*> xSections;
94 };
95 
97 {
98 
99 public:
100 
101  explicit G4HadronXSDataTable();
102 
104 
106  G4int bins, G4double emin, G4double emax,
107  G4bool spline);
108 
109  inline const G4PhysicsVector* HasData(size_t idx) const
110  {
111  return xsData[idx];
112  };
113 
114  inline G4double GetCrossSection(G4double e, size_t idx) const
115  {
116  return xsData[idx]->Value(e);
117  };
118 
119  inline const G4Element* SelectRandomAtom(G4double e, size_t idx) const
120  {
121  return elmSelectors[idx]->SelectRandomAtom(e);
122  };
123 
124  void Dump();
125 
126 private:
127 
128  // Assignment operator and copy constructor
129  G4HadronXSDataTable & operator=
130  (const G4HadronXSDataTable &right) = delete;
131  G4HadronXSDataTable(const G4HadronXSDataTable&) = delete;
132 
133  std::vector<G4PhysicsVector*> xsData;
134  std::vector<G4HadElementSelector*> elmSelectors;
135 
136  size_t nMaterials;
137 };
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
141 #endif
142 
Float_t x
Definition: compare.C:6
const G4Element * SelectRandomAtom(G4double e, size_t idx) const
G4double GetCrossSection(G4double e, size_t idx) const
std::vector< G4PhysicsVector * > xSections
G4HadElementSelector(G4DynamicParticle *, G4CrossSectionDataStore *, const G4Material *, G4int bins, G4double emin, G4double emax, G4bool spline)
static const G4double emax
G4HadElementSelector & operator=(const G4HadElementSelector &right)=delete
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
const G4PhysicsVector * HasData(size_t idx) const
std::vector< G4HadElementSelector * > elmSelectors
#define G4UniformRand()
Definition: Randomize.hh:53
void Initialise(G4DynamicParticle *, G4CrossSectionDataStore *, G4int bins, G4double emin, G4double emax, G4bool spline)
const G4Element * SelectRandomAtom(G4double e) const
std::vector< G4Element * > G4ElementVector
int G4int
Definition: G4Types.hh:78
std::vector< G4PhysicsVector * > xsData
const G4ElementVector * theElementVector