************************************************************************
*     ------------------------
      FUNCTION FNTOTPAU(IPAR,E)
*     ------------------------
*
*     (Purpose)
*       Calc. TOTAL CROSS SECTION OF NEUTRINO
*
*     (Input)
*       IPAR   : NEUTRINO TYPE
*                  12 : NEU-E
*                 -12 : NEU-E-BAR            
*                  14 : NEU-MU
*                 -14 : NEU-MU-BAR            
*                  16 : NEU-TAU
*                 -16 : NEU-TAU-BAR
*       E      : NEUTRINO ENERGY ( GEV )
*     
*     (Output)
*       FNTOTPAU : CROSS SECTION ( 10^-38cm^2 )
*
*     (Creation Date and Author)
*       1983.11.23 ; M.Nakahata
*       1985.01.11 ; M.Nakahata FERMI MOTION AND PAULI PRINCIPLE
*       1987.08.13 ; N.Sato     NEU_TAU
*       1988.10.08 ; T.Kajita   N.C. ELASTIC INT
*       1995.05.10 ; K. KANEYUKI  FOR S.K.
*                    TOTPAU -> FNTOTPAU
*       1996.05.26 ; Y.Hayato   ADD COHERENT PION PRODUCTION      
*       1997.12.10 ; J.Kameda   ADD single eta production 
*       1997.12.10 ; J.Kameda   ADD single  K  production
*       2007.08.23 ; G.Mitsuka  add delta->gamma decay
*       2007.11.05 ; G.Mitsuka  support target nucleus besides 16O
*       2007.11.06 ; G.Mitsuka  change fnelspau to fnelspau_select
*       2007.11.10 ; T.Tanaka   add upmu mode
*       2013.02.25 ; A.Redij    added npnh mode.
*
************************************************************************
C
C    MEANING OF DATA
C    RATN   : NEUTRON RATIO IN TARGET
C    RATP   : PROTON RATIO IN TARGET
C    RATFRE : FREE PROTON RATIO IN TARGET
C     
#include "necard.h"
#include "neutmodel.h"

      REAL MOLECULE
#ifdef UPMU_RCK
      DATA RATN/0.5/
      DATA RATP/0.5/
      DATA RATFRE/0./
      MOLECULE=18.0
#else
C     NUMBNDN, NUMBNDN etc. are set in necard (2007 Nov G.Mitsuka)
      RATN  =float(NUMBNDN)/float(NUMBNDN+NUMBNDP+NUMFREP)
      RATP  =float(NUMBNDP+NUMFREP)/float(NUMBNDN+NUMBNDP+NUMFREP)
      RATFRE=float(NUMFREP)/float(NUMBNDN+NUMBNDP+NUMFREP)
      MOLECULE=float(NUMBNDN+NUMBNDP+NUMFREP)
#endif

C     --ENERGY UPPER LIMIT FOR 1PI
      IF(E.LE.1000.) THEN
         ETMP=E
      ELSE
         ETMP=999.999
      ENDIF

C     
      TOTCRS=0.
      IF (IPAR.GT.0) THEN
C     
C     -- FOR NEUTRINO
C     
#ifdef UPMU_RCK
         APICRSCC=FNAPICRS(E,IPAR,1,RATP,R1320CC)
         APICRSNC=FNAPICRS(E,IPAR,0,RATN,R1320NC)
#else
         APICRSCC=FNAPICRS(E,IPAR,1,-1.,R1320CC)
         APICRSNC=FNAPICRS(E,IPAR,0,-1.,R1320NC)
#endif
         TOTCRS=FNELSPAU_SELECT(E,IPAR)*RATN*CRSNEUT(1)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,1)*RATP*CRSNEUT(2)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,2)*RATN*CRSNEUT(3)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,3)*RATN*CRSNEUT(4)
*         TOTCRS=TOTCRS+FNAPICRS(E,IPAR,1,-1.,R1314)*CRSNEUT(5) !-- OLD
         TOTCRS=TOTCRS+APICRSCC*R1320CC*CRSNEUT(5)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,11)*RATN*CRSNEUT(6)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,12)*RATP*CRSNEUT(7)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,13)*RATN*CRSNEUT(8)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,14)*RATP*CRSNEUT(9)
*         TOTCRS=TOTCRS+FNAPICRS(E,IPAR,0,-1.,R1314)*CRSNEUT(10)
         TOTCRS=TOTCRS+APICRSNC*R1320NC*CRSNEUT(10)
         TOTCRS=TOTCRS+FNELSCRN(E,IPAR,2212)*RATFRE*CRSNEUT(11)
         TOTCRS=TOTCRS+FNELSPAN(E,IPAR,2212)*(RATP-RATFRE)
     $        *CRSNEUT(12)
         TOTCRS=TOTCRS+FNELSPAN(E,IPAR,2112)*RATN*CRSNEUT(13)

         TOTCRS=TOTCRS+COHCRSNE(E,IPAR,1) /MOLECULE*CRSNEUT(14)
         TOTCRS=TOTCRS+COHCRSNE(E,IPAR,0) /MOLECULE*CRSNEUT(15)

         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,1)*RATN*CRSNEUT(16)
         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,11)*RATN*CRSNEUT(17)
         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,12)*RATP*CRSNEUT(18)

         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,1)*RATN*CRSNEUT(19)
         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,11)*RATN*CRSNEUT(20)
         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,12)*RATP*CRSNEUT(21)
         TOTCRS=TOTCRS+APICRSCC*(1.-R1320CC)*CRSNEUT(23)
         TOTCRS=TOTCRS+APICRSNC*(1.-R1320NC)*CRSNEUT(24)

         TOTCRS=TOTCRS+RSSGCRS(E,IPAR, 1)*RATN*CRSNEUT(25)
         TOTCRS=TOTCRS+RSSGCRS(E,IPAR,11)*RATN*CRSNEUT(26)
         TOTCRS=TOTCRS+RSSGCRS(E,IPAR,12)*RATP*CRSNEUT(27)
         TOTCRS=TOTCRS+FNMEC_SELECT(E,IPAR)*CRSNEUT(28) 
         FNTOTPAU=TOTCRS

      ELSE
C     
C     -- FOR ANTI NEUTRINO
C     
#ifdef UPMU_RCK
         APICRSCC=FNAPICRS(E,IPAR,1,RATP,R1320CC)
         APICRSNC=FNAPICRS(E,IPAR,0,RATN,R1320NC)
#else
         APICRSCC=FNAPICRS(E,IPAR,1,-1.,R1320CC)
         APICRSNC=FNAPICRS(E,IPAR,0,-1.,R1320NC)
#endif
         TOTCRS=FNELSCRS(E,IPAR)*RATFRE*CRSNEUTB(1)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,4)*RATN*CRSNEUTB(2)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,5)*RATP*CRSNEUTB(3)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,6)*RATP*CRSNEUTB(4)
*         TOTCRS=TOTCRS+FNAPICRS(E,IPAR,1,-1.,R1314)*CRSNEUTB(5)
         TOTCRS=TOTCRS+APICRSCC*R1320CC*CRSNEUTB(5)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,15)*RATN*CRSNEUTB(6)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,16)*RATP*CRSNEUTB(7)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,17)*RATN*CRSNEUTB(8)
         TOTCRS=TOTCRS+RSSPICRS(ETMP,IPAR,18)*RATP*CRSNEUTB(9)
*         TOTCRS=TOTCRS+FNAPICRS(E,IPAR,0,-1.,R1314)*CRSNEUTB(10)
         TOTCRS=TOTCRS+APICRSNC*R1320NC*CRSNEUTB(10)
         TOTCRS=TOTCRS+FNELSPAU_SELECT(E,IPAR)*(RATP-RATFRE)*CRSNEUTB(11)
         TOTCRS=TOTCRS+FNELSCRN(E,IPAR,2212)*RATFRE*CRSNEUTB(12)
         TOTCRS=TOTCRS+FNELSPAN(E,IPAR,2212)*(RATP-RATFRE)
     $        *CRSNEUTB(13)
         TOTCRS=TOTCRS+FNELSPAN(E,IPAR,2112)*RATN*CRSNEUTB(14)

         TOTCRS=TOTCRS+COHCRSNE(E,IPAR,1) /MOLECULE*CRSNEUTB(15)
         TOTCRS=TOTCRS+COHCRSNE(E,IPAR,0) /MOLECULE*CRSNEUTB(16)

         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,2)*RATP*CRSNEUTB(17)
         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,13)*RATN*CRSNEUTB(18)
         TOTCRS=TOTCRS+RSSETCRS(ETMP,IPAR,14)*RATP*CRSNEUTB(19)

         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,2)*RATP*CRSNEUTB(20)
         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,13)*RATN*CRSNEUTB(21)
         TOTCRS=TOTCRS+RSSKCRS(ETMP,IPAR,14)*RATP*CRSNEUTB(22)
         TOTCRS=TOTCRS+APICRSCC*(1.-R1320CC)*CRSNEUTB(23)
         TOTCRS=TOTCRS+APICRSNC*(1.-R1320NC)*CRSNEUTB(24)

         TOTCRS=TOTCRS+RSSGCRS(E,IPAR, 2)*RATP*CRSNEUTB(25)
         TOTCRS=TOTCRS+RSSGCRS(E,IPAR,13)*RATN*CRSNEUTB(26)
         TOTCRS=TOTCRS+RSSGCRS(E,IPAR,14)*RATP*CRSNEUTB(27)
         TOTCRS=TOTCRS+FNMEC_SELECT(E,IPAR)*CRSNEUTB(28)
         FNTOTPAU=TOTCRS

      ENDIF
      RETURN
      END
