1 |
REAL FUNCTION RIDUCI |
2 |
|
3 |
IMPLICIT REAL (A-Z) |
4 |
|
5 |
INTEGER nb_ntuple, icount |
6 |
PARAMETER (nb_ntuple=6) |
7 |
character filename |
8 |
|
9 |
INCLUDE 'comcheck.txt' |
10 |
|
11 |
integer evnum, i,j,k,pre, inf,sup |
12 |
real calbase, valore, bas, dedx(2,22,96) |
13 |
|
14 |
COMMON /CALO_DAT/evnum,dedx |
15 |
|
16 |
VECTOR PEDE(2,22,96) |
17 |
vector matmip(2,22,96) |
18 |
|
19 |
* |
20 |
*-- Enter user code here |
21 |
* |
22 |
|
23 |
icount = icount + 1 |
24 |
if (icount.eq.1) then |
25 |
c print *,'Filename to save :' |
26 |
c read (*,40) filename |
27 |
CALL HROPEN(42,'NTUPLE','./tmp.rz','n',6144,istat) |
28 |
|
29 |
40 FORMAT(A40) |
30 |
|
31 |
CALL HBNT(11,'New Calo',' ') |
32 |
CALL HBSET('BSIZE',lrec,ierr) |
33 |
|
34 |
*** /* Book ntuple variables */ |
35 |
CALL HBNAME(11,'CALO_DAT',evnum,'evnum:I,dedx(2,22,96):R') |
36 |
|
37 |
endif |
38 |
C |
39 |
call vzero(dedx,2*22*96) |
40 |
C |
41 |
do i=1,2 |
42 |
do j=1,22 |
43 |
pre = 0 |
44 |
do k=1,96 |
45 |
if (mod(k+15,16).eq.0) pre = pre + 1 |
46 |
if (dexyc(i,j,k).gt.0) then |
47 |
calbase = 0. |
48 |
if (base(i,j,pre).eq.0.) then |
49 |
inf = (pre - 1) * 16 + 1 |
50 |
sup = pre * 16 |
51 |
do m = inf, sup |
52 |
valore = valore + dexyc(i,j,m) |
53 |
enddo |
54 |
bas = valore / 16. |
55 |
c bas = base(i,j,pre) |
56 |
else |
57 |
bas = base(i,j,pre) |
58 |
endif |
59 |
calbase=(dexyc(i,j,k)-bas-pede(i,j,k))/matmip(i,j,k) |
60 |
if (calbase.gt.0.7) dedx(i,j,k) = calbase |
61 |
endif |
62 |
c if (cal_rms(i,j,k).ne.0.) |
63 |
c & print *,'rms ',cal_rms(i,j,k),' i=',i,' j=',j,' k=',k |
64 |
enddo |
65 |
enddo |
66 |
enddo |
67 |
evnum = iev |
68 |
C |
69 |
call hfnt(11) |
70 |
C |
71 |
END |
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|