This commit was generated by cvs2svn to compensate for changes in r2,
[u/mrichter/AliRoot.git] / GEANT321 / gtrak / gnckov.F
CommitLineData
fe4da5cc 1*
2* $Id$
3*
4* $Log$
5* Revision 1.1.1.1 1995/10/24 10:21:41 cernlib
6* Geant
7*
8*
9#include "geant321/pilot.h"
10*CMZ : 3.21/02 29/03/94 15.41.23 by S.Giani
11*-- Author :
12 SUBROUTINE GNCKOV
13C.
14C. ******************************************************************
15C. * *
16C. * This routine calculates the number of Cerenkov photons *
17C. * produced per centimeter in the current medium. *
18C. * *
19C. * ==>Called by : GRANGI *
20C. * Authors R.Jones, F.Carminati ******** *
21C. * *
22C. ******************************************************************
23C.
24#include "geant321/gcbank.inc"
25#include "geant321/gcjloc.inc"
26#include "geant321/gctmed.inc"
27#include "geant321/gcunit.inc"
28#include "geant321/gctrak.inc"
29#include "geant321/gckine.inc"
30#include "geant321/gconsp.inc"
31*
32 PARAMETER (RFACT=369.81E9)
33*
34* ------------------------------------------------------------------
35*
36* *** See whether we generate at least one photon
37*
38 THRIND = GETOT/VECT(7)
39 IF(Q(JINDEX+NPCKOV).LT.THRIND) THEN
40 DP = 0.
41 GE = 0.
42 ELSEIF(Q(JINDEX+1).GE.THRIND) THEN
43 PMIN = Q(JTCKOV+2)
44 DP = Q(JTCKOV+NPCKOV+1)-PMIN
45 GE = Q(JCURIN+NPCKOV)
46 JMIN = 1
47 ELSE
48 JMIN = 1
49 JMAX = NPCKOV
50 10 JMED = (JMIN+JMAX)/2
51 IF(Q(JINDEX+JMED).LT.THRIND) THEN
52 JMIN = JMED
53 ELSE
54 JMAX = JMED
55 ENDIF
56 IF(JMAX-JMIN.GT.1) GO TO 10
57 RATIO =
58 + (THRIND-Q(JINDEX+JMIN))/(Q(JINDEX+JMIN+1)-Q(JINDEX+JMIN))
59 RATI1 = 1.-RATIO
60 PMIN = Q(JTCKOV+JMIN+1)*RATI1+Q(JTCKOV+JMIN+2)*RATIO
61 DP = Q(JTCKOV+NPCKOV+1)-PMIN
62 GEMIN = Q(JCURIN+JMIN)*RATI1+Q(JCURIN+JMIN+1)*RATIO
63 GE = Q(JCURIN+NPCKOV)-GEMIN
64 ENDIF
65 DNDL = RFACT*(CHARGE**2)*(DP-GE*THRIND**2)
66 999 END