Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FullGlaubAADataSet.cc
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 // * *
21 // * Parts of this code which have been developed by QinetiQ Ltd *
22 // * under contract to the European Space Agency (ESA) are the *
23 // * intellectual property of ESA. Rights to use, copy, modify and *
24 // * redistribute this software for general public use are granted *
25 // * in compliance with any licensing, distribution and development *
26 // * policy adopted by the Geant4 Collaboration. This code has been *
27 // * written by QinetiQ Ltd for the European Space Agency, under ESA *
28 // * contract 19770/06/NL/JD (Technology Research Programme). *
29 // * *
30 // * By using, copying, modifying or distributing the software (or *
31 // * any work based on the software) you agree to acknowledge its *
32 // * use in resulting scientific publications, and indicate your *
33 // * acceptance of all terms of the Geant4 Software license. *
34 // ********************************************************************
35 //
36 /// \file hadronic/Hadr02/src/G4FullGlaubAADataSet.cc
37 /// \brief Implementation of the G4FullGlaubAADataSet class
38 //
39 // $Id: G4FullGlaubAADataSet.cc 77519 2013-11-25 10:54:57Z gcosmo $
40 //
41 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42 //
43 // MODULE: G4FullGlaubAADataSet.cc
44 //
45 // Version: 0.B
46 // Date: 02/04/08
47 // Author: P R Truscott
48 // Organisation: QinetiQ Ltd, UK
49 // Customer: ESA/ESTEC, NOORDWIJK
50 // Contract: 19770/06/NL/JD
51 //
52 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 ///////////////////////////////////////////////////////////////////////////////
54 //
55 #ifdef G4_USE_DPMJET
56 
57 
58 #include "G4FullGlaubAADataSet.hh"
59 
60 #include "G4DPMJET2_5Interface.hh"
61 #include "G4PhysicalConstants.hh"
62 #include "G4SystemOfUnits.hh"
63 
64 #include <iomanip>
65 ///////////////////////////////////////////////////////////////////////////////
66 //
67 // G4FullGlaubAADataSet
68 //
69 // Constructor simply resets all variables to zero.
70 //
72 {
73  baseArrayPtrn = &bsiten[0][0];
74  baseArrayPtrm = &bsitem[0][0];
77 
78  for (G4int i=0; i<maxig; i++) {
79  for (G4int j=0; j<maxArray; j++) {
80  bsiten[i][j] = 0.0;
81  bsitem[i][j] = 0.0;
82  }
83  }
84 
85  wu10 = std::sqrt(10.0); // WU10=SQRT(10.)
86 
88 }
89 ///////////////////////////////////////////////////////////////////////////////
90 //
91 // G4FullGlaubAADataSet
92 //
93 // Constructor resets all variables to zero and creates data.
94 //
96 {
97  baseArrayPtrn = &bsiten[0][0];
98  baseArrayPtrm = &bsitem[0][0];
101 
102  for (G4int i=0; i<maxig; i++) {
103  for (G4int j=0; j<maxArray; j++) {
104  bsiten[i][j] = 0.0;
105  bsitem[i][j] = 0.0;
106  }
107  }
108 
109  wu10 = std::sqrt(10.0); // WU10=SQRT(10.)
110 
111  glauberDataSetType = 0;
112 
113  CreateGlauberData (AP1, AT1);
114 }
115 ///////////////////////////////////////////////////////////////////////////////
116 //
117 // ~G4FullGlaubAADataSet
118 //
119 // If you thought the contructor was boring, the destructor is even worse!.
120 // It doesn't do anything.
121 //
123 {}
124 ////////////////////////////////////////////////////////////////////////////////
125 //
126 G4bool
128 {
129 #ifdef G4VERBOSE
130  if (GetVerboseLevel()>0) {
131  G4cout <<"AT G4FullGlaubAADataSet::CreateGlauberData: BEFORE SHMAKI CALL"
132  <<G4endl;
133  }
134 #endif
135  AP = AP1;
136  AT = AT1;
137 
138  nucc_.ijproj = 1; // IJPROJ=1
139  collis_.ijprox = 1; // IJPROX=1
140  nuccc_.jjproj = 1; // JJPROJ=1
141  G4int jjprox = 1; // JJPROX=1
142  G4int ishc = 0; // ISHC=0
143 
144  G4int ZP1 = stabZ[AP];
145  G4int ZT1 = stabZ[AT];
146 
147  for (G4int ig = 0; ig < maxig; ig++)
148  {
149  G4double ppn = std::pow(wu10,ig+2); // PPN = WU10**(IG+1)
150  shmaki_ (&AP, &ZP1, &AT, &ZT1, &rptshm_.rproj, &rptshm_.rtarg, &ppn);
151  for (G4int i=0; i<maxArray; i++)
152  {
153  bsiten[ig][i] = dshm_.bsite[i][1];
154  }
155  ishc++; // ISHC = ISHC + 1
156  if (ishc == 1) { // IF(ISHC.EQ.1)THEN
157  rproj = rptshm_.rproj; // RPROJJ(MATNUM) = RPROJ
158  rtarg = rptshm_.rtarg; // RTARGG(MATNUM) = RTARG
159  bmax = dshm_.bmax; // BMAXX(MATNUM) = BMAX
160  bstep = dshm_.bstep; // BSTEPP(MATNUM) = BSTEP
161  }
162  }
163  nucc_.ijproj = 13; // IJPROJ=13
164  collis_.ijprox = 13; // IJPROX=13
165  nuccc_.jjproj = 13; // JJPROJ=13
166  jjprox = 13; // JJPROX=13
167 
168  for (G4int ig = 0; ig < maxig; ig++)
169  {
170  G4double ppn = std::pow(wu10,ig+2); // PPN = WU10**(IG+1)
171  shmaki_ (&AP, &ZP1, &AT, &ZT1, &rptshm_.rproj, &rptshm_.rtarg, &ppn);
172  for (G4int i=0; i<maxArray; i++)
173  {
174  bsitem[ig][i] = dshm_.bsite[i][1];
175  }
176  }
177 #ifdef G4VERBOSE
178  if (GetVerboseLevel()>0) {
179  G4cout <<"AT G4FullGlaubAADataSet::CreateGlauberData: AFTER SHMAKI CALL"
180  <<G4endl;
181  }
182 #endif
183 
184  return true;
185 }
186 ////////////////////////////////////////////////////////////////////////////////
187 //
189 {
190  if (ppn < 1.0E-10) {
191  return baseArrayPtrn;
192  }
193  else {
194  G4int ig = G4int(2.0*std::log10(ppn)) - 2;
195  if (ig < 0) ig = 0;
196 
197  for (G4int j=0; j<maxArray; j++) {
198  dtumat_.bsiten[0][ig][j] = bsiten[ig][j];
199  }
200  dtumat_.ntaxx[0] = AT;
201  dtumat_.nztaxx[0] = ZT;
202  dtumat_.nprxx[0] = AP;
203  dtumat_.nzprxx[0] = ZP;
204  dtumat_.rprojj[0] = rproj;
205  dtumat_.rtagg[0] = rtarg;
206  dtumat_.bstepp[0] = bstep;
207  dtumat_.bmaxx[0] = bmax;
208  arrayPtrn = baseArrayPtrn + maxArray*ig; //NOTE IS THIS A VALID OPERATION??
209  }
210  return arrayPtrn;
211 }
212 ////////////////////////////////////////////////////////////////////////////////
213 //
215 {
216  if (ppn < 1.0E-10) {
217  return baseArrayPtrm;
218  }
219  else {
220  G4int ig = G4int(2.0*std::log10(ppn)) - 2;
221  if (ig < 0) ig = 0;
222 
223  for (G4int j=0; j<maxArray; j++) {
224  dtumat_.bsitem[0][ig][j] = bsitem[ig][j];
225  }
226  dtumat_.ntaxx[0] = AT;
227  dtumat_.nztaxx[0] = ZT;
228  dtumat_.nprxx[0] = AP;
229  dtumat_.nzprxx[0] = ZP;
230  dtumat_.rprojj[0] = rproj;
231  dtumat_.rtagg[0] = rtarg;
232  dtumat_.bstepp[0] = bstep;
233  dtumat_.bmaxx[0] = bmax;
234  arrayPtrm = baseArrayPtrm + maxArray*ig; //NOTE IS THIS A VALID OPERATION??
235  }
236  return arrayPtrm;
237 }
238 ////////////////////////////////////////////////////////////////////////////////
239 //
240 // WriteDataToFile
241 //
242 // This appends the Glauber data from the arrays to the output file stream.
243 // The format is intended to match the standard GLAUBER data file format.
244 //
245 std::ofstream &
246 G4FullGlaubAADataSet::WriteDataToFile (std::ofstream &File) const
247 {
248  File.unsetf(std::ios::fixed);
249  File.setf(std::ios::scientific|std::ios::right|std::ios::adjustfield);
250 
251  for (G4int i=0; i<maxig; i++) {
252  for (G4int j=0; j<maxArray; j+=5) {
253  for (G4int k=j; k<j+5; k++) {
254  File <<std::setw(16) <<bsiten[i][k];
255  }
256  File <<G4endl;
257  }
258  }
259 
260  for (G4int i=0; i<maxig; i++) {
261  for (G4int j=0; j<maxArray; j+=5) {
262  for (G4int k=j; k<j+5; k++) {
263  File <<std::setw(16) <<bsitem[i][k];
264  }
265  File <<G4endl;
266  }
267  }
268 
269  return File;
270 }
271 ////////////////////////////////////////////////////////////////////////////////
272 //
273 // DumpData
274 //
275 // This reads the Glauber data into the arrays from the input file stream.
276 // The format is intended to match the standard GLAUBER data file format.
277 //
278 std::ifstream & G4FullGlaubAADataSet::ReadDataFromFile (std::ifstream &File)
279 {
280  for (G4int i=0; i<maxig; i++) {
281  for (G4int j=0; j<maxArray; j+=5) {
282  File >>bsiten[i][j]
283  >>bsiten[i][j+1]
284  >>bsiten[i][j+2]
285  >>bsiten[i][j+3]
286  >>bsiten[i][j+4];
287  }
288  }
289 
290  for (G4int i=0; i<maxig; i++) {
291  for (G4int j=0; j<maxArray; j+=5) {
292  File >>bsitem[i][j]
293  >>bsitem[i][j+1]
294  >>bsitem[i][j+2]
295  >>bsitem[i][j+3]
296  >>bsitem[i][j+4];
297  }
298  }
299 
300  return File;
301 }
302 ////////////////////////////////////////////////////////////////////////////////
303 //
304 #endif
G4double bsite[200][2]
void shmaki_(int *, int *, int *, int *, double *, double *, double *)
Definition of the G4FullGlaubAADataSet class.
struct ccdpm25rptshm rptshm_
virtual ~G4FullGlaubAADataSet()
int G4int
Definition: G4Types.hh:78
G4double bsiten[24][200]
G4double bsitem[50][24][200]
struct ccdpm25dtumat dtumat_
struct ccdpm25dshm dshm_
G4double * GetArrayPointerN(const G4double ppn=0.0)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
std::ofstream & WriteDataToFile(std::ofstream &File) const
std::ifstream & ReadDataFromFile(std::ifstream &File)
G4double bsiten[50][24][200]
struct ccdpm25nucc nucc_
G4double * GetArrayPointerM(const G4double ppn=0.0)
G4bool CreateGlauberData(const G4int AP1, const G4int AT1)
struct ccdpm25nuccc nuccc_
struct ccdpm25collis collis_
Definition of the G4DPMJET2_5Interface class.
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
G4int GetVerboseLevel() const
G4double bsitem[24][200]