Geant4  10.02.p03
g3tog4.F File Reference
#include "G3toG4.inc"
Include dependency graph for g3tog4.F:

Go to the source code of this file.

Functions/Subroutines

subroutine g3tog4 (luni, lunc, chopt)
 
subroutine g4init
 
subroutine g3header
 
subroutine g3source
 
subroutine g3main
 
subroutine g3context (cntxt)
 
subroutine ctocp (string)
 
subroutine rtocp (string, x)
 
subroutine artocp (string, ax, n)
 
subroutine aitocp (string, ai, n)
 
subroutine astocp (string, ac, n)
 
subroutine g3ldpar (par, npar)
 
subroutine check_lines
 

Function/Subroutine Documentation

◆ aitocp()

subroutine aitocp ( character*(*)  string,
integer, dimension(*)  ai,
integer  n 
)

Definition at line 261 of file g3tog4.F.

261 ************************************************************************
262 ************************************************************************
263  implicit none
264  character*(*) string
265  integer ai(*)
266  integer n,i
267 #include "G3toG4.inc"
268  do i=1,n
269  write(luncode,'('' '',a,''['',i3,''] = '',i10,'';'')')
270  + string, i-1, ai(i)
271  enddo
Char_t n[5]
Here is the caller graph for this function:

◆ artocp()

subroutine artocp ( character*(*)  string,
real, dimension(*)  ax,
integer  n 
)

Definition at line 247 of file g3tog4.F.

247 ************************************************************************
248 ************************************************************************
249  implicit none
250  character*(*) string
251  real ax(*)
252  integer n,i
253 #include "G3toG4.inc"
254  do i=1,n
255  write(luncode,'('' '',a,''['',i3,''] = '',e14.8,'';'')')
256  + string, i-1, ax(i)
257  enddo
Char_t n[5]
Here is the caller graph for this function:

◆ astocp()

subroutine astocp ( character*(*)  string,
character*(*), dimension(*)  ac,
integer  n 
)

Definition at line 275 of file g3tog4.F.

275 ************************************************************************
276 ************************************************************************
277  implicit none
278  character*(*) string, ac(*)
279  integer n,i
280 #include "G3toG4.inc"
281 c write(luncode,'('' G4String '',a,''['',i3,''];'')') string, n
282  do i=1,n
283  write(luncode,'('' '',a,''['',i3,''] = "'',a,''";'')')
284  + string, i-1, ac(i)
285  enddo
Char_t n[5]
Here is the caller graph for this function:

◆ check_lines()

subroutine check_lines ( )

Definition at line 307 of file g3tog4.F.

307 ************************************************************************
308 ************************************************************************
309  implicit none
310 #include "G3toG4.inc"
311  if (luncode.ne.0) then
312  nlines = nlines +1
313  if (nlines.gt.maxlines) then
314  nfile = nfile +1
315  call g3source
316  nlines = 0
317  endif
318  endif
subroutine g3source
Definition: g3tog4.F:148
nlines
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ctocp()

subroutine ctocp ( character*(*)  string)

Definition at line 227 of file g3tog4.F.

227 ************************************************************************
228 ************************************************************************
229  implicit none
230  character*(*) string
231 #include "G3toG4.inc"
232  write (luncode,*) string
Here is the caller graph for this function:

◆ g3context()

subroutine g3context ( character*(*)  cntxt)

Definition at line 210 of file g3tog4.F.

210 ************************************************************************
211 *
212 * g3context
213 *
214 * Set the current geometry code context. eg. context can be used
215 * to distinguish code for different subdetectors. The Geant4
216 * call list interpreter can then execute the code selectively for
217 * a particular context only, if desired. Spaces not allowed.
218 *
219 ************************************************************************
220  implicit none
221  character*(*) cntxt
222 #include "G3toG4.inc"
223  context = cntxt

◆ g3header()

subroutine g3header ( )

Definition at line 140 of file g3tog4.F.

140 ************************************************************************
141 *
142 ************************************************************************
143  implicit none
144  call g4init
subroutine g4init
Definition: g3tog4.F:126
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g3ldpar()

subroutine g3ldpar ( real, dimension(*)  par,
integer  npar 
)

Definition at line 289 of file g3tog4.F.

289 ************************************************************************
290 *
291 * g3ldpar
292 *
293 ************************************************************************
294  implicit none
295 *
296  integer npar, i
297  real par(*)
298 #include "G3toG4.inc"
299 *
300  if (npar.gt.0) then
301  write(luncode,'('' par['',i4,''] = '',e14.8,'';'')')
302  + (i-1,par(i),i=1,npar)
303  endif
Here is the caller graph for this function:

◆ g3main()

subroutine g3main ( )

Definition at line 189 of file g3tog4.F.

189 ************************************************************************
190 ************************************************************************
191  implicit none
192 #include "G3toG4.inc"
193  integer i
194 *
195  close(luncode)
196  open(unit=luncode,file='G3toG4code.cc',status='unknown')
197  do i=1,nfile
198  write(luncode,'('' void G3toG4code_'',i2.2,''();'')') i
199  enddo
200  call ctocp('void G3toG4code()')
201  call ctocp('{')
202  do i=1,nfile
203  write(luncode,'('' G3toG4code_'',i2.2,''();'')') i
204  enddo
205  call ctocp('}')
206  close(luncode)
TFile * file
subroutine ctocp(string)
Definition: g3tog4.F:227
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g3source()

subroutine g3source ( )

Definition at line 148 of file g3tog4.F.

148 ************************************************************************
149 *
150 ************************************************************************
151  implicit none
152 #include "G3toG4.inc"
153  character fname*30
154  if (luncode.le.0) return
155  if (nfile.gt.1) write(luncode,'(''}'')')
156  close(luncode)
157  write (fname,'(''G3toG4code_'',i2.2,''.cc'')') nfile
158  open(unit=luncode,file=fname,status='unknown')
159  write(luncode,'(''#include "G3toG4.hh"'')')
160  if (nfile.eq.1) call g3header
161  write(luncode,'(/''void G3toG4code_'',i2.2,''()'')') nfile
162  write(luncode,'(''{'')')
163  call ctocp('// init to 0 avoids "unused" warnings')
164  call ctocp('G4int nd=0,nh=0,nv=0,imate=0,itmed=0,nmat=0,')
165  call ctocp(' isvol=0,ifield=0,nwhi=0,nwdi=0,idtyp=0,ipart=0,')
166  call ctocp(' itrtyp=0,nlmat=0,npar=0,ndvmx=0,numed=0,iaxis=0,')
167  call ctocp(
168  + ' ndiv=0,irot=0,ival=0,num=0,nmed=0,nbits[100],mode[6];')
169  call ctocp('G4String chnam[100];')
170  call ctocp('G4String name="",moth="",attr="",only="",shape="";')
171  call ctocp('G4String chset="",chdet="",chali="",chpar="";')
172  call ctocp('G4double amass=0.,charge=0.,tlife=0.,parval=0.;')
173  call ctocp('G4double c0=0.,step=0.,a=0.,dens=0.,radl=0.,x=0.;')
174  call ctocp('G4double y=0.,z=0.,theta1=0.,phi1=0.,theta2=0.;')
175  call ctocp('G4double phi2=0.,theta3=0.,phi3=0.,fieldm=0.;')
176  call ctocp('G4double tmaxfd=0.,stemax=0.,deemax=0.,epsil=0.;')
177  call ctocp('G4double stmin=0.,par[100],fact[100],orig[100];')
178  call ctocp('G4double bratio[6],aa[100],zz[100],wmat[100];')
179  call ctocp('nbits[0]=mode[0]=0;chnam[0]="";par[0]=0.;')
180  call ctocp('fact[0]=orig[0]=bratio[0]=aa[0]=zz[0]=wmat[0]=0.;')
181  call ctocp(' ')
182  if (nfile.eq.1) then
183 * call ctocp('G3G4init();')
184  call ctocp(' ')
185  endif
TFile * file
subroutine g3header
Definition: g3tog4.F:140
subroutine ctocp(string)
Definition: g3tog4.F:227
Here is the call graph for this function:
Here is the caller graph for this function:

◆ g3tog4()

subroutine g3tog4 ( integer  luni,
integer  lunc,
character, dimension(*)  chopt 
)

Definition at line 62 of file g3tog4.F.

62 ************************************************************************
63 *
64 * G3toG4
65 *
66 * Initialization/setup routine
67 *
68 * luni (call list), lunc (C++ code) logical unit numbers:
69 * lun>0: Open output file on unit lun. Filenames used:
70 * g3calls.dat Call list file
71 * g4geom.cc Geant4 C++ geometry code
72 * lun<0: File open has been done by the user. Just write to |lun|
73 * lun=0: Don't generate this output.
74 * ie. luni=0: Don't generate the call list
75 * lunc=0: Don't generate the Geant4 code
76 *
77 * chopt options:
78 * 'G' execute the actual Geant calls as well as building the
79 * code/call list. In case users use info obtained from Geant
80 * during the geometry building process. THIS IS THE DEFAULT
81 * at present:
82 #define CALL_GEANT
83 *
84 ************************************************************************
85  implicit none
86  integer luni, lunc
87  character chopt*(*)
88 #include "G3toG4.inc"
89 *
90  print *,'Initializing Geant3 to Geant4 conversion'
91 #ifdef CALL_GEANT
92 c dogeom = index(chopt,'G') + index(chopt,'g') .ne. 0
93  dogeom = .true.
94 #else
95  dogeom = .false.
96 #endif
97  context = '----'
98  if (luni.eq.0.and.lunc.eq.0) then
99  print *,'G3TOG4: No output requested by user. No output'//
100  + ' will be generated.'
101  endif
102  lunlist = abs(luni)
103  luncode = abs(lunc)
104  if (lunlist.ne.0) then
105  doclist = .true.
106  else
107  doclist = .false.
108  endif
109  if (luncode.ne.0) then
110  docode = .true.
111  else
112  docode = .false.
113  endif
114 *** If lun>0, open the file
115  if (lunlist.gt.0) then
116  open(unit=lunlist,file='g3calls.dat',status='unknown')
117  endif
118  if (luncode.gt.0) then
119  nfile = 1
120  call g3source
121  endif
122 *
TFile * file
void print(G4double elem)
subroutine g3source
Definition: g3tog4.F:148
Here is the call graph for this function:

◆ g4init()

subroutine g4init ( )

Definition at line 126 of file g3tog4.F.

126 ************************************************************************
127 ************************************************************************
128  implicit none
129 #include "G3toG4.inc"
130 *
131  if (luncode.ne.0) then
132  write(luncode,
133  + '(''//G4GeometryManager* GeoMgr = new G4GeometryManager();'')')
134 * call ctocp('void G3G4init();')
135  endif
136 *
Here is the caller graph for this function:

◆ rtocp()

subroutine rtocp ( character*(*)  string,
real  x 
)

Definition at line 236 of file g3tog4.F.

236 ************************************************************************
237 ************************************************************************
238  implicit none
239  character*(*) string
240  real x
241 #include "G3toG4.inc"
242  write(luncode,'(4x,a,'' = '',e14.8,'';'')')
243  + string, x
Double_t x
Here is the caller graph for this function: