Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CascadeFunctions.hh
Go to the documentation of this file.
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: G4CascadeFunctions.hh 67796 2013-03-08 06:18:39Z mkelsey $
27 //
28 // 20100407 M. Kelsey -- Return particle types std::vector<> by const ref,
29 // using a static variable in the function as a buffer.
30 // 20100505 M. Kelsey -- Use new interpolator class, drop std::pair<>, move
31 // sampleFlat(...) from G4CascadeChannel, move functionality
32 // to new base class, to allow data-member buffers. Move
33 // function definitions to .icc file (needed with templating).
34 // 20100510 M. Kelsey -- Use both summed and inclusive cross-sections for
35 // multiplicity, as done in G4{Pion,Nucleon}Sampler. Support
36 // up to 9-body final states. Add second argument specifying
37 // which Sampler is used. Move implementations to .icc file.
38 // 20100511 M. Kelsey -- Pass "kinds" buffer as input to getOutputPartTypes
39 // 20100803 M. Kelsey -- Add printing function for debugging
40 // 20110719 M. Kelsey -- Add inheritance from non-template base for factory,
41 // change static's to virtual (no more direct access)
42 // 20110725 M. Kelsey -- Move ctor to .icc file for registration in lookup
43 // 20110923 M. Kelsey -- Add optional ostream& argument to printTable()
44 
45 #ifndef G4_CASCADE_FUNCTIONS_HH
46 #define G4_CASCADE_FUNCTIONS_HH
47 
48 #include "G4CascadeChannel.hh"
49 #include "globals.hh"
50 #include "Randomize.hh"
51 #include <vector>
52 
53 
54 template <class DATA, class SAMP>
55 class G4CascadeFunctions : public G4CascadeChannel, public SAMP {
56 public:
58  virtual ~G4CascadeFunctions() {}
59 
60  virtual G4double getCrossSection(double ke) const {
61  return this->findCrossSection(ke, DATA::data.tot);
62  }
63 
64  virtual G4double getCrossSectionSum(double ke) const {
65  return this->findCrossSection(ke, DATA::data.sum);
66  }
67 
68  virtual G4int getMultiplicity(G4double ke) const;
69 
70  virtual void getOutgoingParticleTypes(std::vector<G4int>& kinds,
71  G4int mult, G4double ke) const;
72 
73  virtual void printTable(std::ostream& os=G4cout) const;
74 };
75 
76 #include "G4CascadeFunctions.icc"
77 
78 #endif /* G4_CASCADE_FUNCTIONS_HH */
virtual G4int getMultiplicity(G4double ke) const
int G4int
Definition: G4Types.hh:78
virtual G4double getCrossSection(double ke) const
G4GLOB_DLL std::ostream G4cout
virtual void getOutgoingParticleTypes(std::vector< G4int > &kinds, G4int mult, G4double ke) const
virtual G4double getCrossSectionSum(double ke) const
virtual void printTable(std::ostream &os=G4cout) const
double G4double
Definition: G4Types.hh:76
const XML_Char const XML_Char * data