| 1 |
|
|---|
| 2 | SUBROUTINE UGLAST
|
|---|
| 3 | *
|
|---|
| 4 | * Termination routine to print histograms and statistics
|
|---|
| 5 | *
|
|---|
| 6 | #include "geant321/gcflag.inc"
|
|---|
| 7 | #include "geant321/gctrak.inc"
|
|---|
| 8 | #include "calor.inc"
|
|---|
| 9 | #include "celoss.inc"
|
|---|
| 10 | #include "histo.inc"
|
|---|
| 11 | *
|
|---|
| 12 | DIMENSION EdepTot(MaxAbs)
|
|---|
| 13 | *
|
|---|
| 14 | CHARACTER*20 matnam
|
|---|
| 15 | CHARACTER*4 unit1, unit2
|
|---|
| 16 | *
|
|---|
| 17 | data aMeV /1.e-3/
|
|---|
| 18 | *
|
|---|
| 19 | * *** mean energy deposit and track length
|
|---|
| 20 | PRINT 749
|
|---|
| 21 | PRINT 750,IEVENT
|
|---|
| 22 | PRINT 751
|
|---|
| 23 | fnorm = 1./IEVENT
|
|---|
| 24 | do k=1,NbAbsor
|
|---|
| 25 | call GFMATE (materAbs(k),matnam,dua,duz,dud,dur,dui,udu,idu)
|
|---|
| 26 | aveEdep = fnorm*sumEdep(k)
|
|---|
| 27 | aveEdep2 = fnorm*su2Edep(k)
|
|---|
| 28 | rmsEdep = sqrt(abs(aveEdep2-aveEdep**2))
|
|---|
| 29 | aveTrck = fnorm*sumTrck(k)
|
|---|
| 30 | aveTrck2 = fnorm*su2Trck(k)
|
|---|
| 31 | rmsTrck = sqrt(abs(aveTrck2-aveTrck**2))
|
|---|
| 32 | *
|
|---|
| 33 | CALL GEVKEV (aveEdep,Edmean,unit1)
|
|---|
| 34 | CALL GEVKEV (rmsEdep,Edrms ,unit2)
|
|---|
| 35 | PRINT 752,k,matnam,Edmean,unit1,Edrms,unit2,aveTrck,rmsTrck
|
|---|
| 36 | enddo
|
|---|
| 37 | PRINT 749
|
|---|
| 38 | *
|
|---|
| 39 | * *** Energy flow
|
|---|
| 40 | Iplmax = NbAbsor*NbLayer + 1
|
|---|
| 41 | do k=1,Iplmax
|
|---|
| 42 | fk = k
|
|---|
| 43 | EnerFlow(k) = EnerFlow(k)*fnorm
|
|---|
| 44 | EleakLat(k) = EleakLat(k)*fnorm
|
|---|
| 45 | ih = 2*MaxAbs + 1
|
|---|
| 46 | if (histo(ih)) call hfill (ih, fk, 0., EnerFlow(k)/aMeV)
|
|---|
| 47 | ih = 2*MaxAbs + 2
|
|---|
| 48 | if (histo(ih)) call hfill (ih, fk, 0., EleakLat(k)/aMeV)
|
|---|
| 49 | enddo
|
|---|
| 50 | *
|
|---|
| 51 | * *** Energy deposit from energy flow balance
|
|---|
| 52 | do k=1,NbAbsor
|
|---|
| 53 | EdepTot(k) = 0.
|
|---|
| 54 | enddo
|
|---|
| 55 | *
|
|---|
| 56 | Idmax = NbAbsor*NbLayer
|
|---|
| 57 | do k=1,Idmax
|
|---|
| 58 | iAbsor = mod(k,NbAbsor)
|
|---|
| 59 | if (iAbsor.eq.0) iAbsor = NbAbsor
|
|---|
| 60 | Ebalance = EnerFlow(k) - EnerFlow(k+1) - EleakLat(k)
|
|---|
| 61 | EdepTot (iAbsor) = EdepTot (iAbsor) + Ebalance
|
|---|
| 62 | enddo
|
|---|
| 63 |
|
|---|
| 64 | PRINT 761
|
|---|
| 65 | do k=1,NbAbsor
|
|---|
| 66 | call GFMATE (materAbs(k),matnam,dua,duz,dud,dur,dui,udu,idu)
|
|---|
| 67 | CALL GEVKEV (abs(EdepTot (k)),Edtot,unit1)
|
|---|
| 68 | if (EdepTot (k).lt.0.) Edtot = -Edtot
|
|---|
| 69 | PRINT 762,k,matnam,Edtot,unit1
|
|---|
| 70 | enddo
|
|---|
| 71 | PRINT 749
|
|---|
| 72 | *
|
|---|
| 73 | *
|
|---|
| 74 | * *** geant termination
|
|---|
| 75 | CALL GLAST
|
|---|
| 76 | *
|
|---|
| 77 | * *** close HIGZ
|
|---|
| 78 | CALL HPLEND
|
|---|
| 79 | *
|
|---|
| 80 | * *** Save histo
|
|---|
| 81 | CALL HRPUT(0,fileName,'N')
|
|---|
| 82 |
|
|---|
| 83 | *
|
|---|
| 84 | *
|
|---|
| 85 | * *** formats
|
|---|
| 86 | 749 FORMAT(/, 60(1H-),/)
|
|---|
| 87 | 750 FORMAT(1X,'Nb of events:',I6)
|
|---|
| 88 | 751 FORMAT(1X,'AbsNo Material',5X,'Energy deposit',14X,'Trck length')
|
|---|
| 89 | 752 FORMAT(I5,3X,A10,F8.3,A4,' +- ',F6.2,A4,F9.3,' cm +- ',F6.2,' cm')
|
|---|
| 90 | 761 FORMAT(' Energy deposition from energy flow balance:',/,/,
|
|---|
| 91 | & 1X,'AbsNo Material',5X,'Total Edep')
|
|---|
| 92 | 762 FORMAT(I5,3X,A10,F10.3,A4)
|
|---|
| 93 | *
|
|---|
| 94 | END
|
|---|