source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeFunctions.hh @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 3.3 KB
Line 
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// $Id: G4CascadeFunctions.hh,v 1.7 2010/08/03 23:09:36 mkelsey Exp $
26// GEANT4 tag: $Name: hadr-casc-V09-03-85 $
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
41#ifndef G4_CASCADE_FUNCTIONS_HH
42#define G4_CASCADE_FUNCTIONS_HH
43
44#include "globals.hh"
45#include "Randomize.hh"
46#include <vector>
47
48
49template <class DATA, class SAMP>
50class G4CascadeFunctions : public SAMP {
51public:
52  static G4double getCrossSection(double ke) {
53    return instance.findCrossSection(ke, DATA::data.tot);
54  }
55
56  static G4double getCrossSectionSum(double ke) {
57    return instance.findCrossSection(ke, DATA::data.sum);
58  }
59
60  static G4int getMultiplicity(G4double ke);
61
62  static void
63  getOutgoingParticleTypes(std::vector<G4int>& kinds, G4int mult, G4double ke);
64
65  static void printTable();
66
67private:
68  G4CascadeFunctions() : SAMP() {}
69  static const G4CascadeFunctions<DATA,SAMP> instance;
70};
71
72#include "G4CascadeFunctions.icc"
73
74#endif  /* G4_CASCADE_FUNCTIONS_HH */
Note: See TracBrowser for help on using the repository browser.