[967] | 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 | // ******************************************************************** |
---|
[1315] | 25 | // $Id: G4CascadeFunctions.hh,v 1.5 2010/05/14 21:05:03 mkelsey Exp $ |
---|
| 26 | // GEANT4 tag: $Name: geant4-09-04-beta-cand-01 $ |
---|
[967] | 27 | // |
---|
[1315] | 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 | |
---|
[967] | 40 | #ifndef G4_CASCADE_FUNCTIONS_HH |
---|
| 41 | #define G4_CASCADE_FUNCTIONS_HH |
---|
| 42 | |
---|
[1315] | 43 | #include "globals.hh" |
---|
| 44 | #include "Randomize.hh" |
---|
[967] | 45 | #include <vector> |
---|
| 46 | |
---|
[1315] | 47 | |
---|
| 48 | template <class DATA, class SAMP> |
---|
| 49 | class G4CascadeFunctions : public SAMP { |
---|
[967] | 50 | public: |
---|
[1315] | 51 | static G4double getCrossSection(double ke) { |
---|
| 52 | return instance.findCrossSection(ke, DATA::data.tot); |
---|
| 53 | } |
---|
[967] | 54 | |
---|
[1315] | 55 | static G4double getCrossSectionSum(double ke) { |
---|
| 56 | return instance.findCrossSection(ke, DATA::data.sum); |
---|
[967] | 57 | } |
---|
| 58 | |
---|
[1315] | 59 | static G4int getMultiplicity(G4double ke); |
---|
[967] | 60 | |
---|
[1315] | 61 | static void |
---|
| 62 | getOutgoingParticleTypes(std::vector<G4int>& kinds, G4int mult, G4double ke); |
---|
[967] | 63 | |
---|
[1315] | 64 | private: |
---|
| 65 | G4CascadeFunctions() : SAMP() {} |
---|
| 66 | static const G4CascadeFunctions<DATA,SAMP> instance; |
---|
| 67 | }; |
---|
[967] | 68 | |
---|
[1315] | 69 | #include "G4CascadeFunctions.icc" |
---|
[967] | 70 | |
---|
[1315] | 71 | #endif /* G4_CASCADE_FUNCTIONS_HH */ |
---|