*  Namelist to control input data
*

&InFiles
  ! Number of intput files
    NInputFiles = 7
 
  ! Input files:

    InputFileNames(1) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_NCep_920.dat'
    InputFileNames(2) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_NCep_820.dat'
    InputFileNames(3) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_NCep_575.dat'
    InputFileNames(4) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_NCep_460.dat'
    InputFileNames(5) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_NCem.dat'
    InputFileNames(6) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_CCep.dat'
    InputFileNames(7) = 'datafiles/hera/h1zeusCombined/inclusiveDis/1506.06042/HERA1+2_CCem.dat'


&End

&InCorr
  ! Number of correlation (statistical, systematical or full) files
    NCorrFiles = 0
 
  ! Correlation files:
  !  CorrFileNames(1) = 'datafiles/hera/h1/jets/0904.3870/H1_NormInclJets_HighQ2_99-07___H1_NormInclJets_HighQ2_99-07.corr'
&End

&CovarToNuisance
   ! Global switch for using nuisance param representation for covariance mat.
  LConvertCovToNui = .false.

   ! Tolerance -- zero means exact transformation
  Tolerance = 0.0

   ! (Optional) -- try to subtract diagonal stat. uncertainties from total covariance when determining uncorrelated uncertainites
  LSubtractStat = .false.

   ! The following lines allow to adjust error scaling properties (default: :M)
  DataName     = 'CMS electon Asymmetry rapidity', 'CMS W muon asymmetry'
  DataSystType = ':A', ':A'
&End

&QCDNUM
   ! do not re-compute QCDNUM tables if they are present and match grid definition
  Read_QCDNUM_Tables = .true.
&End 


&OutDir
  ! Name of the directory where output will be stored (max 255 characters)
    OutDirName = 'output'
&End
*
* (Optional) Modify renormalisation/factorisation scales, dataset
* dependently. The numbering follows sequential numbering of input files
*
&Scales 
    DataSetMuR  = 7*1.0     ! Set muR scale to 1 for all 4 datasets
    DataSetMuF  = 7*1.0     ! Set muF scale to 1 for all 4 datasets
 !   DataSetTheoryOrder = 7*'NNLO',"NLO",'NNLO'
 !   DataSetMaxNF(2) = 4    ! Enable the H-VFNS (requires APFEL)
 !   DataSetMaxNF = 9*5
&End

*
* (Optional) List systematic sources, modify their scaling properties:
*
&Systematics
 !C      List sources, Results.txt file would list them first. Use the usual :A, :P, 
 !C      qualifiers to change the scalling properties
 !  ListOfSources = 'ATLAS_lumi2010', 'ATL_WZ2010_Source_13:A'
 !C      Modify the prior in chi2 definition (1.0 is default):
 !  PriorScaleName = 'ATLAS_lumi2010', 'ATL_WZ2010_Source_13'
 !  PriorScaleFactor = 0.0, 0.0 
&End


*
* Main steering cards
*
&xFitter 
  RunningMode = 'Fit'  
                ! 'Fit'             -- standard MINUIT-minimization of PDF and other parameters
                ! 'LHAPDF Analysis' -- Evalutate input LHAPDF set uncertaitnies, chi2, profiling or reweighting
                !                      Requires &LHAPDF namelist to specify the set name. If PDFSTYLE is not
                !                      set to LHAPDFQ0, LHAPDF or LHAPDFNATIVE, sets it to LHAPDF
                ! 'PDF Rotate'      -- performs PDF re-diagonalization. Requires theo.in files to operate properly  

  TheoryType = 'DGLAP' ! 'DGLAP'  -- colinear evolution
                       ! 'DGLAP_APFEL'      -- collinear evolution with APFEL
                       ! 'DGLAP_QEDEVOL'    -- collinear evolution with QEDEVOL
                       ! 'DGLAP_APFEL_QED'  -- collinear evolution with APFEL with QED corrections
                       ! 'DIPOLE' -- dipole model 
                       ! 'uPDF'   -- un-integrated PDFs
                                !uPDF1 fit with kernel ccfm-grid.dat file
                                !uPDF2 fit evolved uPDF, fit just normalisation
                                !uPDF3 fit using precalculated grid of sigma_hat
                                !uPDF4 fit calculating kernel on fly, grid of sigma_hat


  Order  = 'NNLO'       ! 'LO', 'NLO' or 'NNLO', used for DGLAP evolution.

  Q02     = 1.9 ! Evolution starting scale

 ! --- Scheme for heavy flavors 
 ! ---  HF_SCHEME = 'ZMVFNS'           : ZM-VFNS (massless) from QCDNUM,
 ! ---  HF_SCHEME = 'ZMVFNS MELA'      : ZM-VFNS (massless) from MELA (N-space),
 ! ---  HF_SCHEME = 'RT'               : Thorne-Roberts VFNS (massive)
 ! ---  HF_SCHEME = 'RT FAST'          : Fast approximate TR VFNS scheme, usign k-factor
 ! ---  HF_SCHEME = 'RT OPT'           : Thorne-Roberts VFNS (massive)
 ! ---  HF_SCHEME = 'RT OPT FAST'      : Fast approximate TR VFNS scheme, usign k-factor
 ! ---  HF_SCHEME = 'ACOT Full'        : ACOT - F.Olness Version (massive), using k-factors  
 ! ---  HF_SCHEME = 'ACOT Full +N2LO'  : ACOT - F.Olness Version (massive) adding N2LO approx, using k-factors  
 ! ---  HF_SCHEME = 'ACOT Full +N3LO'  : ACOT - F.Olness Version (massive) adding N3LO approx, using k-factors  
 ! ---  HF_SCHEME = 'ACOT Chi'         : ACOT - F.Olness Version (massive), using k-factors  
 ! ---  HF_SCHEME = 'ACOT Chi +N2LO'   : ACOT - F.Olness Version (massive) adding N2LO approx, using k-factors  
 ! ---  HF_SCHEME = 'ACOT Chi +N3LO'   : ACOT - F.Olness Version (massive) adding N3LO approx, using k-factors  
 ! ---  HF_SCHEME = 'ACOT ZM'          : ACOT - F.Olness Version (massless), using k-factors  
 ! ---  HF_SCHEME = 'ACOT ZM +N2LO'    : ACOT - F.Olness Version (massless), using k-factors  
 ! ---  HF_SCHEME = 'ACOT ZM +N3LO'    : ACOT - F.Olness Version (massless), using k-factors  
 ! ---  HF_SCHEME = 'S-ACOT Chi RC'    : S-ACOT-chi scheme - CTEQ-TEA Version, using reduced cross section
 ! ---  HF_SCHEME = 'FF'               : Fixed Flavour Number Scheme (qcdnum)
 ! ---  HF_SCHEME = 'FF ABM'           : Fixed Flavour Number Scheme (ABM)
 ! ---  HF_SCHEME = 'FF ABM RUNM'      : Fixed Flavour Number Scheme (ABM) using run mass def
 ! ---  HF_SCHEME = 'FONLL-A'          : FONLL-A mass scheme provided by APFEL with pole masses (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-A RUNM OFF' : FONLL-A mass scheme provided by APFEL with MSbar masses running OFF (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-A RUNM ON'  : FONLL-A mass scheme provided by APFEL with MSbar masses running ON (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-B'          : FONLL-B mass scheme provided by APFEL with pole masses (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-B RUNM OFF' : FONLL-B mass scheme provided by APFEL with MSbar masses running OFF (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-B RUNM ON'  : FONLL-B mass scheme provided by APFEL with MSbar masses running ON (available at NLO)
 ! ---  HF_SCHEME = 'FONLL-C'          : FONLL-C mass scheme provided by APFEL with pole masses (available only at NNLO)
 ! ---  HF_SCHEME = 'FONLL-C RUNM OFF' : FONLL-C mass scheme provided by APFEL with MSbar masses running OFF (available only at NNLO)
 ! ---  HF_SCHEME = 'FONLL-C RUNM ON'  : FONLL-C mass scheme provided by APFEL with MSbar masses running ON (available only at NNLO)
                                       ! (Any of the FONLL schemes at LO is equivalent to the ZM-VFNS)
  HF_SCHEME = 'RT OPT'

 ! PDF type. Possible types are currently available:
 ! 'proton'  -- default (fitting proton data)
 ! 'lead'    -- fitting ONLY lead data (can't be used in combination with proton data)

 PDFType = 'proton'

 ! PDF parameterisation style. Possible styles are currently available:
 !  'HERAPDF' -- HERAPDF-like with uval, dval, Ubar, Dbar, glu evolved pdfs
 !  'CTEQ'        -- CTEQ-like parameterisation
 !  'CTEQHERA'    -- Hybrid: valence like CTEQ, rest like HERAPDF
 !  'CHEB'        -- CHEBYSHEV parameterisation based on glu,sea, uval,dval evolved pdfs
 !  'LHAPDFQ0'    -- use lhapdf library to define pdfs at starting scale and evolve with local qcdnum parameters
 !  'LHAPDF'      -- use lhapdf library to define pdfs at all scales
 !  'LHAPDFNATIVE'-- use lhapdf library to access pdfs and alphas
 !  'DDIS'        -- use Diffractive DIS 
 !  'BiLog'       -- bi-lognormal parametrisation 

  PDFStyle = 'HERAPDF'

 ! XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 !
 ! Chi2 definition. Following options are supported:
 !  
 ! -- Bias corrections for uncertainties --
 ! 'StatScale'    :  'Poisson',  'NoRescale' ( see also 'ExtraSystRescale' below )
 ! 'UncorSysScale':  'Poisson',  'Linear',  'NoRescale'
 ! 'CorSysScale'  :  'Linear',   'NoRescale'
 ! 
 ! -- Treatment of systematics in chi2 ---
 ! 'UncorChi2Type':  'Diagonal'  
 ! 'CorChi2Type'  :  'Hessian', 'Matrix', 'Offset'
 !
 ! -- Extra corrections ---
 !   are given as comma separated list for Chi2ExtraParam, they are off by default.
 !  'PoissonCorr'            : extra log correction accounting for changing uncertainties 
 !  'FirstIterationRescale' : re-scale uncertainties at the first iteration only 
 !  'ExtraSystRescale'      : additional re-scaling of stat. uncertainty to account for syst. shifts.

   CHI2SettingsName = 'StatScale', 'UncorSysScale', 'CorSysScale', 'UncorChi2Type', 'CorChi2Type'
   Chi2Settings     = 'Poisson'  , 'Linear',        'Linear'     , 'Diagonal'     , 'Hessian'
   Chi2ExtraParam = 'PoissonCorr'

 ! Flag to define if native APPLgrid CKM values should be kept.
 LUseAPPLgridCKM = True

 ! Debug flag
  LDEBUG     = False

 ! Quadratic approximation for asymmetric uncertainties
 ! AsymErrorsIterations = 10
&End



*
* Add extra to minuit parameters. These MUST include alpha_S and fs
*
&ExtraMinimisationParameters
   name  = 'alphas',   'fs',   'fcharm'
   value =  0.118 ,   0.4,      0.
   step  =  0.0    ,   0.0 ,      0.     ! set to 0 to avoid minimisation 
&End


*
* Output steering cards
*
&Output 
  ! -- Error bands on parton distributions
  DoBands = False        ! asymmetric bands (J. Pumplin)
  DoBandsSym = False     ! symmetric bands ( HESSE )

  ! -- Q2 values at which the pdfs & errors are done (up to 20)
  Q2VAL = 1.9, 3.0, 4.0, 5., 10., 100., 6464, 8317 
!  Q2VAL = 1.9, 4., 10., 100., 6464, 8317 

  ! How many x points to write (standard = 101)
  OUTNX = 101

  ! x-range of output (standard = 1E-4 1.0)
  OUTXRANGE = 1E-4, 0.9999

  ! Do not write out LHAPDF6 output
  ! WriteLHAPDF6 = false

  ! Write out LHAPDF5 output
  ! WriteLHAPDF5 = false
&End



*
* Process dependent cuts
*
&Cuts

  !--------------------- NC ep  --------------------------

  ! Rule #1: Q2 cuts
   ProcessName(1)     = 'NC e+-p'
   Variable(1)        = 'Q2'
   CutValueMin(1)     = 3.5
   CutValueMax(1)     = 1000000.0

  ! Rule #2: x cuts
   ProcessName(2)     = 'NC e+-p'
   Variable(2)        = 'x'
   CutValueMin(2)     = 0.000001 
   CutValueMax(2)     = 1.0

  !---------------------  CC ep  ------------------

   ProcessName(3)     = 'CC e+-p'
   Variable(3)        = 'Q2'
   CutValueMin(3)     = 3.5
   CutValueMax(3)     = 1000000.0

   ProcessName(4)     = 'CC e+-p'
   Variable(4)        = 'x'
   CutValueMin(4)     = 0.000001 
   CutValueMax(4)     = 1.0

  !-------------------- DY pp  ----------------------

   ProcessName(5)     = 'CC pp'
   Variable(5)        = 'eta1'
   CutValueMin(5)     = -1.
   CutValueMax(5)     = 100.

  !------------------- Jets ---------------------------
   
   ProcessName(6)     = 'pp jets APPLGRID'
   Variable(6)        = 'pt1'
   CutValueMin(6)     = 20.
   CutValueMax(6)     = 1000000.

  !--------------------- Fixed target --------------------------

  ! Rule #7: Whad2 cut
   ProcessName(7)     = 'muon p'
   Variable(7)        = 'Whad2'
   CutValueMin(7)     = 15.   

  !--------------------- Fastnlo jets ----------------------

   ProcessName(8)     = 'FastNLO ep jets'
   Variable(8)        = 'kfac'
   CutValueMin(8)     = 0.0
   CutValueMax(8)     = 2.5

  !--------------------- NC ep charm ----------------

   ProcessName(9)     = 'NC e+-p charm'
   Variable(9)        = 'Q2'
   CutValueMin(9)     = 3.5 
   CutValueMax(9)     = 10000.0

   ProcessName(10)     = 'NC e+-p charm'
   Variable(10)        = 'x'
   CutValueMin(10)     = 0.000001 
   CutValueMax(10)     = 1.0

   
&End

*
* (Optional) MC errors steering cards
*
&MCErrors
  ! Activate MC method for error estimation if lRand = True
  lRAND   = False
  
  ! Use data (true, default) or theory (false) for the central values of the MC replica
  lRANDDATA = True

  ! MC method Seed
  ISeedMC = 123456 

  ! --- Choose what distribution for the random number generator 
  ! STATYPE (SYS_TYPE)  =   1  gauss
  ! STATYPE (SYS_TYPE)  =   2  uniform
  ! STATYPE (SYS_TYPE)  =   3  lognormal
  ! STATYPE (SYS_TYPE)  =   4  poisson (only for lRANDDATA = False !)
  STATYPE =  1
  SYSTYPE =  1
&End

*
* (Optional) Chebyshev study namelist
*
&Cheb
  ! Set following > 0 to turn on:
   NCHEBGLU = 0   ! number of parameters for the gluon (max 15)
   NCHEBSEA = 0   ! number of parameters for the sea   (max 15)

  ! Cheb. polynomial type: multiply by (1-x) (1) or not (0)  
   ichebtypeGlu = 1 
   ichebtypeSea = 1 

  ! Starting point in x:
   chebxmin = 1.E-5

   ILENPDF  = 0   ! use pdf length constraint

  ! PDF length constraint strength for different PDFs:
   PDFLenWeight = 1., 1., 1., 1., 1.     

  ! Range in W where length constraint is applied:
   WMNLen =  20.
   WMXLen = 320.

&End

*
* (Optional) pure polynomial parameterisation for valence quarks
*
&Poly
  ! Set to > zero to activate
  NPolyVal = 0 
  IZPOPOLY = 1  ! ( times (1-x) for 0 and (1-x)^2 for 1) 
  IPOLYSQR = 0  ! ( ensure positivity of PDFs by squaring them )
&End

*
* (Optional) choose the factorisation scale for HQs
* tuned via parameters:    mu_f^2 = scalea1 * Q^2 + scaleb1 * 4*m_h^2
* Available for 'FF', 'FF ABM' options (heavy quarks scale)
* Also defines scale for 'ZMVFNS'.'ACOT Full' and 'ACOT Chi' options ( for these options scale is being set for heavy quarks and light quarks).  
&HQScale
   scalea1    =  1. 
   scaleb1    =  0.  
   MassHQ = 'mc' ! (available: mc, mb), relevant for 'FF', 'ZMVFNS', 'ACOT Full' and  'ACOT chi'
&End

*
* (Optional) LHAPDF sttering card
*
&lhapdf
  LHAPDFSET  = 'CT10nlo'               ! LHAPDF grid file 
  ILHAPDFSET = 0                       ! Set a PDF member of the PDF set (use together with LHAPDFPROFILE = False)
  ! LHAPDFVARSET = 'HERAPDF20_NLO_VAR' ! Add a PDF set with model and parametrisation uncertainties
  ! NPARVAR = 3                        ! Number of parametrisation uncertainties in the LHAPDFVARSET set
  ! LHAPDFPROFILE = False              ! run only on the set specified by ILHAPDFSET
  ! LHASCALEPROFILE = True             ! Add QCD scale variations as nuisance parameters
  ! SCALE68 = false                    ! Scale PDF uncertainties by a factor 1/1.645
  ! WriteAlphaSToMemberPDF = false
  ! NREMOVEPRIORS = 0                  ! Remove prior from the last n PDF nuisance parameters
  ! DataToTheo = True                  ! reset data to predictions corresponding to member 0, for sensitivity studies
&End
