source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4CascadeData.hh @ 967

Last change on this file since 967 was 967, checked in by garnier, 15 years ago

fichier ajoutes

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//
26#ifndef G4_CASCADE_DATA_HH
27#define G4_CASCADE_DATA_HH
28
29#include "globals.hh"
30
31template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs>
32struct G4CascadeData
33{
34  G4double *  tot;
35
36  typedef G4double multiplicities_t[31];
37  multiplicities_t * multiplicities;
38
39  typedef G4int index_t[2];
40  index_t const * index;
41
42  typedef G4int x2bfs_t[2];
43  x2bfs_t const * x2bfs;
44
45  typedef G4int x3bfs_t[3];
46  x3bfs_t const * x3bfs;
47
48  typedef G4int x4bfs_t[4];
49  x4bfs_t const * x4bfs;
50
51  typedef G4int x5bfs_t[5];
52  x5bfs_t const * x5bfs;
53
54  typedef G4int x6bfs_t[6];
55  x6bfs_t const * x6bfs;
56
57  typedef G4int x7bfs_t[7];
58  x7bfs_t const * x7bfs;
59
60  typedef G4float crossSections_t[31];
61  crossSections_t const * crossSections;
62
63  void initialize();
64
65//   G4double tot[31];
66//   G4double multiplicities[6][31];
67
68//   G4int index[6][2];
69//   G4int x2bfs[n2][2];
70//   G4int x3bfs[n3][3];
71//   G4int x4bfs[n4][4];
72//   G4int x5bfs[n5][5];
73//   G4int x6bfs[n6][6];
74//   G4int x7bfs[n7][7];
75
76//   G4float crossSections[nxs][31];
77};
78
79template <int n2, int n3, int n4, int n5, int n6, int n7, int nxs>
80inline
81void
82G4CascadeData<n2, n3, n4, n5, n6, n7, nxs>::initialize()
83{
84  // Initialize multiplicity array
85 
86  for (G4int m = 0; m < 6; m++) {
87    G4int start = index[m][0];
88    G4int stop = index[m][1];
89    for (G4int k = 0; k < 31; k++) {
90      multiplicities[m][k] = 0.0;
91      for (G4int i = start; i < stop; i++) {
92        multiplicities[m][k] += crossSections[i][k];
93      }
94    }
95  }
96 
97  // Initialize total cross section array
98 
99  for (G4int k = 0; k < 31; k++) {
100    tot[k] = 0.0;
101    for (G4int m = 0; m < 6; m++) {
102      tot[k] += multiplicities[m][k];
103    }
104  }
105}
106
107#endif
Note: See TracBrowser for help on using the repository browser.