Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4CascadeSampler.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: G4CascadeSampler.hh 66241 2012-12-13 18:34:42Z gunter $
27 //
28 // 20100506 M. Kelsey -- Move functionality of G4CascadeChannel here,
29 // use as base class to G4CascadeFunctions<T>.
30 // 20100512 M. Kelsey -- Make this templated on energy and multiplicity
31 // binning, as base to new sampler.
32 // 20100803 M. Kelsey -- Add print function for debugging.
33 // 20110923 M. Kelsey -- Add optional ostream& argument to print()
34 
35 #ifndef G4_CASCADE_SAMPLER_HH
36 #define G4_CASCADE_SAMPLER_HH
37 
38 #include "globals.hh"
39 #include "G4CascadeInterpolator.hh"
40 #include <iosfwd>
41 #include <vector>
42 
43 template <int NBINS, int NMULT>
45 public:
46  enum { energyBins=NBINS, multBins=NMULT }; // For use in function arguments
47 
48  G4CascadeSampler(const G4double (&ebins)[energyBins])
49  : interpolator(ebins), energyScale(ebins) {}
50 
51  virtual ~G4CascadeSampler() {}
52 
53  virtual G4double
54  findCrossSection(double ke, const G4double (&xsec)[energyBins]) const;
55 
56  virtual G4int
57  findMultiplicity(G4double ke, const G4double xmult[][energyBins]) const;
58 
59  virtual G4int
60  findFinalStateIndex(G4int mult, G4double ke, const G4int index[],
61  const G4double xsec[][energyBins]) const;
62 
63  virtual void print(std::ostream& os) const;
64 
65 private:
66  // Optional start/stop arguments default to inclusive arrays
67  void fillSigmaBuffer(G4double ke, const G4double x[][energyBins],
68  G4int startBin=0, G4int stopBin=multBins) const;
69 
70  G4int sampleFlat() const;
71 
73  mutable std::vector<G4double> sigmaBuf;
75 };
76 
77 #include "G4CascadeSampler.icc"
78 
79 #endif /* G4_CASCADE_SAMPLER_HH */
Float_t x
Definition: compare.C:6
virtual G4int findMultiplicity(G4double ke, const G4double xmult[][energyBins]) const
double G4double
Definition: G4Types.hh:76
G4int sampleFlat() const
virtual ~G4CascadeSampler()
void fillSigmaBuffer(G4double ke, const G4double x[][energyBins], G4int startBin=0, G4int stopBin=multBins) const
std::vector< G4double > sigmaBuf
int G4int
Definition: G4Types.hh:78
G4CascadeInterpolator< NBINS > interpolator
virtual void print(std::ostream &os) const
const G4double(& energyScale)[energyBins]
virtual G4double findCrossSection(double ke, const G4double(&xsec)[energyBins]) const
virtual G4int findFinalStateIndex(G4int mult, G4double ke, const G4int index[], const G4double xsec[][energyBins]) const