Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:24

0001 ************************************************************************
0002 *                                                                      *
0003       SUBROUTINE KI_BHG_STAT(iret)      !      by droll (18/12/04)           *
0004 *                                                                      *
0005 *                print statistical output and prepare termination      *
0006 *                                                                      *
0007 ************************************************************************
0008 
0009       IMPLICIT NONE
0010 #include "GeneratorInterface/BeamHaloGenerator/interface/bhgcons.inc"
0011 #include "GeneratorInterface/BeamHaloGenerator/interface/bhgp_info.inc"
0012 #include "GeneratorInterface/BeamHaloGenerator/interface/bhgctrl.inc"
0013       REAL RT_MUP,RT_PIP,RT_KAP,RT_PRO,RT_NEU
0014      &    ,RT_MUM,RT_PIM,RT_KAM
0015       REAL SUM_BS,RATE_S,TIME_I,F_FRAC
0016 
0017       integer iret
0018       iret = 0
0019 
0020       PRINT*,'*********************************************************'
0021       PRINT*,'*********************************************************'
0022       PRINT*,'***                                                   ***'
0023       PRINT*,'***     B E A M    H A L O    S T A T I S T I C S     ***'
0024       PRINT*,'***                                                   ***'
0025       PRINT*,'*********************************************************'
0026       PRINT*,'*********************************************************'
0027       PRINT*,' '
0028       PRINT*,'        number of generated events:',NINT(NP_GEN)
0029       IF (GENMOD.EQ.0) PRINT*,'        (no events are generated)'
0030       IF (GENMOD.EQ.1) PRINT*,'        (events are unweighted)'
0031       IF (GENMOD.EQ.2) PRINT*,'        (events are weighted)'
0032       IF (GENMOD.EQ.3) PRINT*,'        (events weighted, mars)' 
0033       IF (GENMOD.EQ.2) THEN
0034         F_FRAC = REAL(N_READ)/REAL(F1N_EV)*100.
0035         PRINT*,'        processed',F_FRAC,'% of all events'
0036         IF (NINT(N_READ).NE.F1N_EV)
0037      &  PRINT*,'        WARNING: rates and statistics are too low'
0038       ENDIF
0039       PRINT*,' '
0040       IF (LHC_B1.EQ.1) PRINT*,'        LHC beam 1 is switched ON'
0041       IF (LHC_B1.EQ.0) PRINT*,'        LHC beam 1 is switched OFF'
0042       IF (LHC_B2.EQ.1) PRINT*,'        LHC beam 2 is switched ON'
0043       IF (LHC_B2.EQ.0) PRINT*,'        LHC beam 2 is switched OFF'
0044       PRINT*,' '
0045       PRINT*,'        minimal energy generated:',EG_MIN,' GeV'
0046       PRINT*,'        maximal energy generated:',EG_MAX,' GeV'
0047       PRINT*,' '
0048       SUM_BS = REAL(LHC_B1+LHC_B2) ! sum of beams
0049       if( genmod .eq. 3 ) sum_bs = sum_bs/nprime
0050       RT_MUP = REAL(R_MU_P)*SUM_BS ! mu+ rate [Hz]
0051       PRINT*,'        rate of generated mu+:',RT_MUP,' Hz'
0052       RT_MUM = REAL(R_MU_M)*SUM_BS ! mu- rate [Hz]
0053       PRINT*,'        rate of generated mu-:',RT_MUM,' Hz'
0054       RT_PIP = REAL(R_PI_P)*SUM_BS ! pi+ rate [Hz]
0055       PRINT*,'        rate of generated pi+:',RT_PIP,' Hz'
0056       RT_PIM = REAL(R_PI_M)*SUM_BS ! pi- rate [Hz]
0057       PRINT*,'        rate of generated pi-:',RT_PIM,' Hz'
0058       RT_KAP = REAL(R_KA_P)*SUM_BS ! K+ rate [Hz]
0059       PRINT*,'        rate of generated  K+:',RT_KAP,' Hz'
0060       RT_KAM = REAL(R_KA_M)*SUM_BS ! K- rate [Hz]
0061       PRINT*,'        rate of generated  K-:',RT_KAM,' Hz'
0062       RT_PRO = REAL(R_PROT)*SUM_BS ! p+ rate [Hz]
0063       PRINT*,'        rate of generated  p+:',RT_PRO,' Hz'
0064       RT_NEU = REAL(R_NEUT)*SUM_BS ! n0 rate [Hz]
0065       PRINT*,'        rate of generated  n0:',RT_NEU,' Hz'
0066       RATE_S = RT_MUP+RT_PIP+RT_KAP+RT_PRO+RT_NEU
0067      &       + RT_MUM+RT_PIM+RT_KAM ! particle rate [Hz]
0068       TIME_I = REAL(NP_GEN)/RATE_S  ! time interval for all particles in ntuple
0069       PRINT*,'        -> rate:',RATE_S,' particles per second'
0070       IF (GENMOD.EQ.1) THEN
0071         PRINT*,'        -> # of events in your ntuple corresponds'
0072         PRINT*,'           to a time interval of',TIME_I,' s'
0073       ENDIF
0074       PRINT*,' '
0075       PRINT*,'*********************************************************'
0076       PRINT*,'*********************************************************'
0077 
0078       IF (GENMOD.EQ.2) CLOSE(22)
0079       IF (GENMOD.EQ.3) CLOSE(22)
0080       RETURN
0081       
0082       END
0083