/[PAMELA software]/PamVMC/trk/src/f77/gprnhran.F
ViewVC logotype

Contents of /PamVMC/trk/src/f77/gprnhran.F

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Fri Jun 12 18:39:58 2009 UTC (15 years, 7 months ago) by pam-rm2
Branch: MAIN
CVS Tags: v1r0, HEAD
Changes since 1.1: +4 -1 lines
Error occurred while calculating annotation data.
- Introduced user-defined names of output files and random seeds number.
Users can do it use options of PamVMCApplication constructor:
PamVMCApplication(const char* name,  const char *title, const char*
filename="pamtest", Int_t seed=0).
The Random object that I use is TRandom3 object which has astronomical
large period (in case of default initialization 0). All random generators
in the code use this object by calling of gRandom singleton which keeps
it.

- Corrected TOF digitization routine. No problems with TDC hits due to
hadronic interactions anymore.

- Some small changes was done to compile code under Root 5.23. +
geant4_vmc v. 2.6 without any warnings

- Some classes of PamG4RunConfiguartion was changed for geant4_vmc v.
2.6.Some obsolete classes was deleted as soon as developers implemented
regions.

- Navigation was changed from "geomRootToGeant4" to "geomRoot", because on
VMC web page written that as soon as Geant4 has no option ONLY/MANY
translation of overlapped geometry to Geant4 through VGM could be wrong.
I'd like to stay with Root navigation:
http://root.cern.ch/root/vmc/Geant4VMC.html. This should be default
option.

- New Tracker digitization routine written by Sergio was implemented

- PamVMC again became compatible with geant4_vmc v.2.5 and ROOT 5.20.
 The problem was that ROOT developers introduced in TVirtualMC class a new
method SetMagField and new base class:TVirtualMagField from which
user-defined classes shoukd be derived

1 *
2 * $Id: gprnhran.F,v 1.1 2009-02-19 17:46:26 nikolas Exp $
3 *
4 * $Log: gprnhran.F,v $
5 * Revision 1.1 2009-02-19 17:46:26 nikolas
6 * Cleaning up before releasing
7 *
8 * Revision 3.1 2005/12/06 01:06:42 cafagna
9 * Adding new magnetic field routines
10 *
11 * Revision 1.2 1996/04/10 16:31:41 mclareni
12 * NAME given dimension 2
13 *
14 * Revision 1.1 1996/04/09 13:34:34 mclareni
15 * Add new routine rnhran.F (V149), also to Imakefile
16 *
17 * 27/05/2005 Sergio Bottai
18 * MODIFIED IN ORDER TO USE GEANT RANDOM NUMBERS
19 *
20 *
21 SUBROUTINE GPRNHRAN(Y,N,XLO,XWID,XRAN)
22 CHARACTER*8 NAME(2)
23
24 DIMENSION Y(*)
25
26 DATA IERR /0/
27 DATA NAME /'GPRNHRAN','GPRNHPRE'/
28
29 NTRY=1
30 IF(Y(N) .EQ. 1) GOTO 4
31 WRITE(6,101) NAME(1),Y(N)
32 GOTO 5
33
34 ENTRY GPRNHPRE(Y,N)
35 NTRY=2
36
37 5 YTOT=0
38 DO 1 I = 1,N
39 IF(Y(I) .LT. 0) GOTO 9
40 YTOT=YTOT+Y(I)
41 1 Y(I)=YTOT
42 IF(YTOT .LE. 0) GOTO 9
43 YINV=1/YTOT
44 DO 2 I = 1,N
45 2 Y(I)=Y(I)*YINV
46 Y(N)=1
47 IF(NTRY .EQ. 2) RETURN
48
49 c 4 CALL RANLUX(YR,1)
50 4 CALL GRNDM(YR,1)
51
52 L=LOCATR(Y,N,YR)
53 IF(L .LT. 0) THEN
54 L=-L
55 XRAN=XLO+XWID*(L+((YR-Y(L))/(Y(L+1)-Y(L))))
56 ELSEIF(L .EQ. 0) THEN
57 XRAN=XLO+XWID*(YR/Y(1))
58 ELSE
59 XRAN=XLO+L*XWID
60 ENDIF
61 RETURN
62
63 9 IERR=IERR+1
64 IF(IERR .LT. 6) WRITE(6,102) NAME(NTRY)
65 WRITE(6,'(1X,10F13.7)') (Y(K),K=1,N)
66 XRAN=0
67 RETURN
68 101 FORMAT(/7X,'+++++ CERN V149 ',A6,' : Y(N) = ',E15.6,' .NE. 1; ',
69 1 'Y(I) NOT IN CUMULATIVE FORM.'/)
70 102 FORMAT(/7X,'+++++ CERN V149 ',A6,' : NOT ALL VALUES Y(I) > 0'/)
71 END
72

  ViewVC Help
Powered by ViewVC 1.1.23