4 ! LHAGLUE Interface to LHAPDF library of modern parton
5 ! density functions (PDF) with uncertainties
7 ! Authors for v4: Dimitri Bourilkov, Craig Group, Mike Whalley
9 ! Authors for v3: Dimitri Bourilkov, Craig Group, Mike Whalley
11 ! Author for v1 and v2: Dimitri Bourilkov bourilkov@mailaps.org
12 ! University of Florida
14 ! HERWIG interface by Dimitri Bourilkov and Craig Group
16 ! New numbering scheme and upgrade for LHAPDF v2.1
17 ! by Dimitri Bourilkov and Mike Whalley
19 ! For more information, or when you cite this interface, currently
20 ! the official reference is:
21 ! D.Bourilkov, "Study of Parton Density Function Uncertainties with
22 ! LHAPDF and PYTHIA at LHC", hep-ph/0305126.
24 ! The official LHAPDF page is:
26 ! http://durpdg.dur.ac.uk/lhapdf/index.html
28 ! The interface contains four subroutines (similar to PDFLIB).
29 ! It can be used seamlessly by Monte Carlo generators
30 ! interfaced to PDFLIB or in stand-alone mode.
32 ! For initialization (called once)
36 ! For the proton/pion structure functions
38 ! STRUCTM(X,Q,UPV,DNV,USEA,DSEA,STR,CHM,BOT,TOP,GLU)
40 ! For the photon structure functions
42 ! STRUCTP(X,Q2,P2,IP2,UPV,DNV,USEA,DSEA,STR,CHM,BOT,TOP,GLU)
44 ! For statistics ON structure functions (under/over-flows)
48 ! This interface can be invoked in 3 ways depending
49 ! on the value of PARM(1) provided by the user when
50 ! calling PDFSET(PARM,VALUE):
52 ! For PYTHIA: PARM(1).EQ.'NPTYPE'
53 ! (this is set automatically by PYTHIA)
55 ! For HERWIG: PARM(1).EQ.'HWLHAPDF'
56 ! (set by the USER e.g. in the main program like this:
57 ! AUTPDF(1) = 'HWLHAPDF'
58 ! AUTPDF(2) = 'HWLHAPDF' )
60 ! For Stand-alone: PARM(1).EQ.'DEFAULT'
61 ! (can be used for PDF studies or when interfacing
64 ! The LHAPDF set/member is selected depending on the value of:
66 ! PYTHIA: ABS(MSTP(51)) - proton
67 ! ABS(MSTP(53)) - pion
68 ! ABS(MSTP(55)) - photon
70 ! HERWIG: ABS(INT(VALUE(1)))
72 ! STAND-ALONE: ABS(INT(VALUE(1)))
78 ! THE LOCATION OF THE LHAPDF LIBRARY HAS TO BE SPECIFIED
79 ! AS DESCRIBED BELOW (the rest is optional)
81 ! if the user does nothing, sensible defaults
82 ! are active; to change the behaviour, the corresponding
83 ! values of LHAPARM() should be set to the values given below
85 ! Location of the LHAPDF library of PDFs (pathname):
86 ! uses common block /LHAPDFC/
88 ! If the user does nothing => default = subdir PDFsets of the
89 ! current directory (can be real subdir
90 ! OR a soft link to the real location)
91 ! If the user sets LHAPATH => supplied by the USER who defines the
92 ! path in common block COMMON/LHAPDFC/LHAPATH
93 ! BEFORE calling PDFSET
97 ! use common block /LHACONTROL/
99 ! Collect statistics on under/over-flow requests for PDFs
100 ! outside their validity ranges in X and Q**2
101 ! (call PDFSTA at end of run to print it out)
103 ! LHAPARM(16).EQ.'NOSTAT' => No statistics (faster)
104 ! LHAPARM(16).NE.'NOSTAT' => Default: collect statistics
106 ! Option to use the values for the strong coupling alpha_s
107 ! as computed in LHAPDF in the MC generator
108 ! (to ensure uniformity between the MC generator and the PDF set)
109 ! WARNING: implemented ONLY for PYTHIA in LHAPDFv4
111 ! LHAPARM(17).EQ.'LHAPDF' => Use alpha_s from LHAPDF
112 ! LHAPARM(17).NE.'LHAPDF' => Default (same as LHAPDF v1/v3)
114 ! Extrapolation of PDFs outside LHAPDF validity range given by
115 ! [Xmin,Xmax] and [Q2min,Q2max]; DEFAULT => PDFs "frozen" at the
118 ! LHAPARM(18).EQ.'EXTRAPOLATE' => Extrapolate PDFs on OWN RISK
119 ! WARNING: Crazy values can be returned
121 ! Printout of initialization information in PDFSET (by default)
123 ! LHAPARM(19).EQ.'SILENT' => No printout (silent mode)
124 ! LHAPARM(19).EQ.'LOWKEY' => Print 5 times (almost silent mode)
127 !*********************************************************************
129 ! $Id: lhaglue.f 356 2008-08-28 15:58:02Z buckley $
132 ! Revision 1.7 2005/12/02 14:50:54 whalley
133 ! Changes for new CTEQ code/AB sets
135 ! Revision 1.6 2005/10/18 15:35:48 whalley
136 ! fix to allow LHAPATH to be user defined as well as lhapdf-config
138 ! Revision 1.5 2005/10/18 11:47:48 whalley
139 ! Change to only set LHAPATH once per run
141 ! Revision 1.1.1.2 1996/10/30 08:29:06 cernlib
144 ! Revision 1.1.1.1 1996/04/12 15:29:26 plothow
147 ! v5.0 06-Oct-2005 Major change to allow multiset-initializations
148 ! v4.0 28-Apr-2005 PDFSTA routine; option to use Alfa_s from LHAPDF
149 ! v4.0 21-Mar-2005 Photon/pion/new p PDFs, updated for LHAPDF v4
150 ! v3.1 26-Apr-2004 New numbering scheme, updated for LHAPDF v2/v3
151 ! v3.0 23-Jan-2004 HERWIG interface added
152 ! v2.0 20-Sep-2003 PDFLIB style adopted
153 ! v1.0 05-Mar-2003 First working version from PYTHIA to LHAPDF v1
155 ! interface to LHAPDF library
156 !*********************************************************************
160 ! Initialization for use of parton distributions
161 ! according to the LHAPDF interface.
163 ! v4.0 28-Apr-2005 Option to use Alfa_s from LHAPDF
164 ! v4.0 21-Mar-2005 Photon/pion/new p PDFs, updated for LHAPDF v4
165 ! v3.1 26-Apr-2004 New numbering scheme
166 ! v3.0 23-Jan-2004 HERWIG interface added
168 ! Interface to LHAPDF library
169 subroutine pdfset(parm,value, mstu11, mstp51, mstp53, mstp55, qcdl4, qcdl5, axmin, axmax, aq2min, aq2max)
170 entry pdfset_herwig(parm, value)
171 ! Double precision and integer declarations.
172 implicit double precision(a-h, o-z)
173 implicit integer(i-n)
175 include 'commonlhapdf.inc'
176 include 'commonlhasets.inc'
177 include 'commonlhapdfc.inc'
178 include 'commonlhacontrol.inc'
179 include 'commonlhaglsta.inc'
180 ! additions for multiset use
181 double precision xxmin(nmxset),xxmax(nmxset),qq2min(nmxset),qq2max(nmxset)
182 save xxmin,xxmax,qq2min,qq2max
183 ! Interface to LHAPDFLIB.
184 double precision qcdlha4, qcdlha5
186 common/lhapdfr/qcdlha4, qcdlha5, nfllha
189 common/lhapdfe/lhaextrp
192 common/lhasilent/lhasilent
194 ! Interface to PDFLIB.
195 common/w50511/ nptypepdfl,ngrouppdfl,nsetpdfl,modepdfl,nflpdfl,lopdfl,tmaspdfl
197 double precision tmaspdfl
198 double precision qcdl4,qcdl5
199 double precision axmin, axmax, aq2min, aq2max
200 ! Interface to PDFLIB.
201 common/w50513/xmin,xmax,q2min,q2max
203 double precision xmin,xmax,q2min,q2max
204 ! Local arrays and character variables (NOT USED here DB)
205 character*20 parm(20)
206 double precision value(20)
208 integer :: lhainput = 1
219 character*512 dirpath
221 character*1000 chroot
223 ! Initialise common blocks
227 ! call getdirpath(dirpath)
230 if(first .AND. (LHAPARM(20).NE.'LHAPATH')) then
231 !...overide the default PDFsets path
232 ! ... check first if the environmental variable LHAPATH is set
233 call getenv('LHAPATH',lhapath)
234 if(lhapath.eq.'') then
235 ! The environment variable LHAPATH is not set.
236 ! Take the data from $ALICE_ROOT/LHAPDF/PDFsets
237 CALL GETENV('ALICE_ROOT',CHROOT)
238 LNROOT = LNBLNK(CHROOT)
240 LHAPATH='PDFsets' ! Default value
242 LHAPATH=CHROOT(1:LNROOT)//'/LHAPDF/PDFsets'
251 if(lhaparm(18).EQ.'EXTRAPOLATE') then ! Extrapolate PDFs on own risk
255 if (lhaparm(19).EQ.'SILENT') then ! No printout (silent MODE)
257 elseif (lhaparm(19).EQ.'LOWKEY') then ! print 5 times (lowkey mode)
258 if (lhafive .lt. 6) then
259 lhafive = lhafive + 1
264 if (parm(1).EQ.'NPTYPE') then ! pythia
266 if(value(1) .eq. 1) then ! nucleon
267 lhainput = abs(mstp51)
268 elseif(value(1) .eq. 2) then ! pion
269 lhainput = abs(mstp53)
270 elseif(value(1) .eq. 3) then ! photon
271 lhainput = abs(mstp55)
273 if (lhasilent .ne. 1) print *,'==== PYTHIA WILL USE LHAPDF ===='
274 elseif(parm(1).EQ.'HWLHAPDF') then ! herwig
275 lhainput = abs(int(value(1)))
276 if(lhaonce.eq.lhainput) return
277 if(lhasilent .ne. 1) print *,'==== HERWIG WILL USE LHAPDF ===='
280 elseif(parm(1).EQ.'DEFAULT') then ! stand-alone
281 lhainput = abs(int(value(1)))
282 if(lhaonce.eq.lhainput) return
283 if(lhasilent .ne. 1) print *,'==== STAND-ALONE LHAGLUE MODE TO USE LHAPDF ===='
287 print *,'== UNKNOWN LHAPDF INTERFACE CALL! STOP EXECUTION! =='
290 ! Initialize parton distributions: LHAPDFLIB.
291 lhapathlen=index(lhapath,' ') - 1
293 xmin = 1.0D-6 ! X_min for current PDF set
294 xmax = 1.0D0 ! X_max for current PDF set
295 q2min = 1.0D0**2 ! Q**2_min scale for current PDF set [GeV]
296 q2max = 1.0D5**2 ! Q**2_max scale for current PDF set [GeV]
301 if ((lhainput .ge. 10000) .and. (lhainput .le. 19999)) then
303 if ((lhainput .ge. 10000) .and. (lhainput .le. 10040)) then
305 lhaname=lhapath(1:lhapathlen)//'/cteq6.LHpdf'
307 elseif((lhainput .ge. 10041) .and. (lhainput .le. 10041)) then
309 lhaname=lhapath(1:lhapathlen)//'/cteq6l.LHpdf'
311 elseif((lhainput .ge. 10042) .and. (lhainput .le. 10042)) then
313 lhaname=lhapath(1:lhapathlen)//'/cteq6ll.LHpdf'
315 elseif((lhainput .ge. 10050) .and. (lhainput .le. 10090)) then
317 lhaname=lhapath(1:lhapathlen)//'/cteq6mE.LHgrid'
319 elseif((lhainput .ge. 10100) .and. (lhainput .le. 10140)) then
321 lhaname=lhapath(1:lhapathlen)//'/cteq61.LHpdf'
323 elseif((lhainput .ge. 10150) .and. (lhainput .le. 10190)) then
325 lhaname=lhapath(1:lhapathlen)//'/cteq61.LHgrid'
327 elseif((lhainput .ge. 10250) .and. (lhainput .le. 10269)) then
329 lhaname=lhapath(1:lhapathlen)//'/cteq6AB.LHgrid'
331 elseif((lhainput .ge. 10350) .and. (lhainput .le. 10390)) then
333 lhaname=lhapath(1:lhapathlen)//'/cteq65.LHgrid'
337 elseif((lhainput .ge. 10450) .and. (lhainput .le. 10456)) then
339 lhaname=lhapath(1:lhapathlen)//'/cteq65c.LHgrid'
343 elseif((lhainput .ge. 10460) .and. (lhainput .le. 10467)) then
345 lhaname=lhapath(1:lhapathlen)//'/cteq65s.LHgrid'
349 elseif((lhainput .ge. 10550) .and. (lhainput .le. 10594)) then
351 lhaname=lhapath(1:lhapathlen)//'/cteq66.LHgrid'
355 elseif((lhainput .ge. 10650) .and. (lhainput .le. 10653)) then
357 lhaname=lhapath(1:lhapathlen)//'/cteq66c.LHgrid'
361 elseif((lhainput .ge. 10660) .and. (lhainput .le. 10663)) then
363 lhaname=lhapath(1:lhapathlen)//'/cteq66a.LHgrid'
367 elseif((lhainput .ge. 10670) .and. (lhainput .le. 10677)) then
369 lhaname=lhapath(1:lhapathlen)//'/cteq6lg.LHgrid'
371 elseif((lhainput .ge. 19050) .and. (lhainput .le. 19050)) then
373 lhaname=lhapath(1:lhapathlen)//'/cteq5m.LHgrid'
375 elseif((lhainput .ge. 19051) .and. (lhainput .le. 19051)) then
377 lhaname=lhapath(1:lhapathlen)//'/cteq5m1.LHgrid'
379 elseif((lhainput .ge. 19053) .and. (lhainput .le. 19053)) then
381 lhaname=lhapath(1:lhapathlen)//'/cteq5f3.LHgrid'
383 elseif((lhainput .ge. 19054) .and. (lhainput .le. 19054)) then
385 lhaname=lhapath(1:lhapathlen)//'/cteq5f4.LHgrid'
387 elseif((lhainput .ge. 19060) .and. (lhainput .le. 19060)) then
389 lhaname=lhapath(1:lhapathlen)//'/cteq5d.LHgrid'
391 elseif((lhainput .ge. 19070) .and. (lhainput .le. 19070)) then
393 lhaname=lhapath(1:lhapathlen)//'/cteq5l.LHgrid'
395 elseif((lhainput .ge. 19150) .and. (lhainput .le. 19150)) then
397 lhaname=lhapath(1:lhapathlen)//'/cteq4m.LHgrid'
400 elseif((lhainput .ge. 19160) .and. (lhainput .le. 19160)) then
402 lhaname=lhapath(1:lhapathlen)//'/cteq4d.LHgrid'
405 elseif((lhainput .ge. 19170) .and. (lhainput .le. 19170)) then
407 lhaname=lhapath(1:lhapathlen)//'/cteq4l.LHgrid'
411 write(lhaprint,5150) lhaset
415 elseif((lhainput .ge. 20000) .and. (lhainput .le. 29999)) then
419 if((lhainput .ge. 20000) .and. (lhainput .le. 20004)) then
421 lhaname=lhapath(1:lhapathlen)//'/MRST2001nlo.LHpdf'
422 elseif((lhainput .ge. 20050) .and. (lhainput .le. 20054)) then
424 lhaname=lhapath(1:lhapathlen)//'/MRST2001nlo.LHgrid'
425 elseif((lhainput .ge. 20060) .and. (lhainput .le. 20061)) then
427 lhaname=lhapath(1:lhapathlen)//'/MRST2001lo.LHgrid'
428 elseif((lhainput .ge. 20070) .and. (lhainput .le. 20074)) then
430 lhaname=lhapath(1:lhapathlen)//'/MRST2001nnlo.LHgrid'
431 elseif((lhainput .ge. 20100) .and. (lhainput .le. 20130)) then
433 lhaname=lhapath(1:lhapathlen)//'/MRST2001E.LHpdf'
434 elseif((lhainput .ge. 20150) .and. (lhainput .le. 20180)) then
436 lhaname=lhapath(1:lhapathlen)//'/MRST2001E.LHgrid'
437 elseif((lhainput .ge. 20200) .and. (lhainput .le. 20201)) then
439 lhaname=lhapath(1:lhapathlen)//'/MRST2002nlo.LHpdf'
440 elseif((lhainput .ge. 20250) .and. (lhainput .le. 20251)) then
442 lhaname=lhapath(1:lhapathlen)//'/MRST2002nlo.LHgrid'
443 elseif((lhainput .ge. 20270) .and. (lhainput .le. 20271)) then
445 lhaname=lhapath(1:lhapathlen)//'/MRST2002nnlo.LHgrid'
446 elseif((lhainput .ge. 20300) .and. (lhainput .le. 20301)) then
448 lhaname=lhapath(1:lhapathlen)//'/MRST2003cnlo.LHpdf'
451 elseif((lhainput .ge. 20350) .and. (lhainput .le. 20351)) then
453 lhaname=lhapath(1:lhapathlen)//'/MRST2003cnlo.LHgrid'
456 elseif((lhainput .ge. 20370) .and. (lhainput .le. 20371)) then
458 lhaname=lhapath(1:lhapathlen)//'/MRST2003cnnlo.LHgrid'
461 elseif((lhainput .ge. 20400) .and. (lhainput .le. 20401)) then
463 lhaname=lhapath(1:lhapathlen)//'/MRST2004nlo.LHpdf'
464 elseif((lhainput .ge. 20406) .and. (lhainput .le. 20407)) then
466 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF3nlo.LHpdf'
467 elseif((lhainput .ge. 20408) .and. (lhainput .le. 20409)) then
469 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF4nlo.LHpdf'
470 elseif((lhainput .ge. 20450) .and. (lhainput .le. 20451)) then
472 lhaname=lhapath(1:lhapathlen)//'/MRST2004nlo.LHgrid'
473 elseif((lhainput .ge. 20452) .and. (lhainput .le. 20453)) then
475 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF3lo.LHgrid'
476 elseif((lhainput .ge. 20454) .and. (lhainput .le. 20455)) then
478 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF4lo.LHgrid'
479 elseif((lhainput .ge. 20456) .and. (lhainput .le. 20457)) then
481 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF3nlo.LHgrid'
482 elseif((lhainput .ge. 20458) .and. (lhainput .le. 20459)) then
484 lhaname=lhapath(1:lhapathlen)//'/MRST2004FF4nlo.LHgrid'
485 elseif((lhainput .ge. 20460) .and. (lhainput .le. 20462)) then
487 lhaname=lhapath(1:lhapathlen)//'/MRST2004qed.LHgrid'
488 elseif((lhainput .ge. 20470) .and. (lhainput .le. 20471)) then
490 lhaname=lhapath(1:lhapathlen)//'/MRST2004nnlo.LHgrid'
491 elseif((lhainput .ge. 20550) .and. (lhainput .le. 20580)) then
493 lhaname=lhapath(1:lhapathlen)//'/MRST2006nnlo.LHgrid'
497 elseif((lhainput .ge. 20650) .and. (lhainput .le. 20650)) then
499 lhaname=lhapath(1:lhapathlen)//'/MRST2007lomod.LHgrid'
500 elseif((lhainput .ge. 20651) .and. (lhainput .le. 20651)) then
502 lhaname=lhapath(1:lhapathlen)//'/MRSTMCal.LHgrid'
503 elseif((lhainput .ge. 29000) .and. (lhainput .le. 29003)) then
505 lhaname=lhapath(1:lhapathlen)//'/MRST98.LHpdf'
506 elseif((lhainput .ge. 29040) .and. (lhainput .le. 29045)) then
508 lhaname=lhapath(1:lhapathlen)//'/MRST98lo.LHgrid'
509 elseif((lhainput .ge. 29050) .and. (lhainput .le. 29055)) then
511 lhaname=lhapath(1:lhapathlen)//'/MRST98nlo.LHgrid'
512 elseif((lhainput .ge. 29060) .and. (lhainput .le. 29065)) then
514 lhaname=lhapath(1:lhapathlen)//'/MRST98dis.LHgrid'
515 elseif((lhainput .ge. 29070) .and. (lhainput .le. 29071)) then
517 lhaname=lhapath(1:lhapathlen)//'/MRST98ht.LHgrid'
519 write(lhaprint,5150) lhaset
523 elseif((lhainput .ge. 30000) .and. (lhainput .le. 39999)) then
524 if((lhainput .ge. 30100) .and. (lhainput .le. 30200)) then
526 lhaname=lhapath(1:lhapathlen)//'/Fermi2002_100.LHpdf'
527 elseif((lhainput .ge. 31000) .and. (lhainput .le. 32000)) then
529 lhaname=lhapath(1:lhapathlen)//'/Fermi2002_1000.LHpdf'
531 write(lhaprint,5150) lhaset
535 elseif((lhainput .ge. 40000) .and. (lhainput .le. 49999)) then
536 if((lhainput .ge. 40100) .and. (lhainput .le. 40200)) then
538 lhaname=lhapath(1:lhapathlen)//'/Alekhin_100.LHpdf'
539 elseif((lhainput .ge. 41000) .and. (lhainput .le. 41999)) then
541 lhaname=lhapath(1:lhapathlen)//'/Alekhin_1000.LHpdf'
542 elseif((lhainput .ge. 40350) .and. (lhainput .le. 40367)) then
544 lhaname=lhapath(1:lhapathlen)//'/a02m_lo.LHgrid'
548 elseif((lhainput .ge. 40450) .and. (lhainput .le. 40467)) then
550 lhaname=lhapath(1:lhapathlen)//'/a02m_nlo.LHgrid'
554 elseif((lhainput .ge. 40550) .and. (lhainput .le. 40567)) then
556 lhaname=lhapath(1:lhapathlen)//'/a02m_nnlo.LHgrid'
561 write(lhaprint,5150) lhaset
565 elseif((lhainput .ge. 50000) .and. (lhainput .le. 59999)) then
566 if((lhainput .ge. 50100) .and. (lhainput .le. 50200)) then
568 lhaname=lhapath(1:lhapathlen)//'/Botje_100.LHpdf'
569 elseif((lhainput .ge. 51000) .and. (lhainput .le. 51999)) then
571 lhaname=lhapath(1:lhapathlen)//'/Botje_1000.LHpdf'
573 write(lhaprint,5150) lhaset
577 elseif((lhainput .ge. 60000) .and. (lhainput .le. 69999)) then
580 if((lhainput .ge. 60000) .and. (lhainput .le. 60022)) then
582 lhaname=lhapath(1:lhapathlen)//'/ZEUS2002_TR.LHpdf'
583 elseif((lhainput .ge. 60100) .and. (lhainput .le. 60122)) then
585 lhaname=lhapath(1:lhapathlen)//'/ZEUS2002_ZM.LHpdf'
586 elseif((lhainput .ge. 60200) .and. (lhainput .le. 60222)) then
588 lhaname=lhapath(1:lhapathlen)//'/ZEUS2002_FF.LHpdf'
589 elseif((lhainput .ge. 60300) .and. (lhainput .le. 60322)) then
591 lhaname=lhapath(1:lhapathlen)//'/ZEUS2005_ZJ.LHpdf'
593 write(lhaprint,5150) lhaset
597 elseif((lhainput .ge. 70000) .and. (lhainput .le. 79999)) then
601 if((lhainput .ge. 70050) .and. (lhainput .le. 70050)) then
603 lhaname=lhapath(1:lhapathlen)//'/H12000ms.LHgrid'
604 elseif((lhainput .ge. 70051) .and. (lhainput .le. 70070)) then
606 lhaname=lhapath(1:lhapathlen)//'/H12000msE.LHgrid'
607 elseif((lhainput .ge. 70150) .and. (lhainput .le. 70150)) then
609 lhaname=lhapath(1:lhapathlen)//'/H12000dis.LHgrid'
610 elseif((lhainput .ge. 70151) .and. (lhainput .le. 70170)) then
612 lhaname=lhapath(1:lhapathlen)//'/H12000disE.LHgrid'
613 elseif((lhainput .ge. 70250) .and. (lhainput .le. 70250)) then
615 lhaname=lhapath(1:lhapathlen)//'/H12000lo.LHgrid'
616 elseif((lhainput .ge. 70251) .and. (lhainput .le. 70270)) then
618 lhaname=lhapath(1:lhapathlen)//'/H12000loE.LHgrid'
619 ! Temporarily removed on returning to original H12000 files
620 ! elseif((lhainput .ge. 70350) .and. (lhainput .le. 70350)) then
622 ! lhaname=lhapath(1:lhapathlen)//'/H12000lo2.LHgrid'
623 ! elseif((lhainput .ge. 70351) .and. (lhainput .le. 70370)) then
625 ! lhaname=lhapath(1:lhapathlen)//'/H12000lo2E.LHgrid'
627 write(lhaprint,5150) lhaset
631 elseif((lhainput .ge. 80000) .and. (lhainput .le. 89999)) then
635 if((lhainput .ge. 80050) .and. (lhainput .le. 80051)) then
637 lhaname=lhapath(1:lhapathlen)//'/GRV98nlo.LHgrid'
638 elseif((lhainput .ge. 80060) .and. (lhainput .le. 80060)) then
640 lhaname=lhapath(1:lhapathlen)//'/GRV98lo.LHgrid'
642 write(lhaprint,5150) lhaset
649 elseif((lhainput .ge. 210) .and. (lhainput .le. 212)) then
654 if((lhainput .ge. 210) .and. (lhainput .le. 212)) then
656 lhaname=lhapath(1:lhapathlen)//'/OWPI.LHgrid'
658 write(lhaprint,5150) lhaset
662 elseif((lhainput .ge. 230) .and. (lhainput .le. 233)) then
667 if((lhainput .ge. 230) .and. (lhainput .le. 233)) then
669 lhaname=lhapath(1:lhapathlen)//'/SMRSPI.LHgrid'
671 write(lhaprint,5150) lhaset
675 elseif((lhainput .ge. 250) .and. (lhainput .le. 252)) then
679 if((lhainput .ge. 250) .and. (lhainput .le. 251)) then
682 lhaname=lhapath(1:lhapathlen)//'/GRVPI1.LHgrid'
683 elseif((lhainput .ge. 252) .and. (lhainput .le. 252)) then
686 lhaname=lhapath(1:lhapathlen)//'/GRVPI0.LHgrid'
688 write(lhaprint,5150) lhaset
692 elseif((lhainput .ge. 260) .and. (lhainput .le. 263)) then
697 if((lhainput .ge. 260) .and. (lhainput .le. 263)) then
699 lhaname=lhapath(1:lhapathlen)//'/ABFKWPI.LHgrid'
701 write(lhaprint,5150) lhaset
708 elseif((lhainput .ge. 310) .and. (lhainput .le. 312)) then
713 if((lhainput .ge. 310) .and. (lhainput .le. 311)) then
715 lhaname=lhapath(1:lhapathlen)//'/DOG0.LHgrid'
716 elseif((lhainput .ge. 312) .and. (lhainput .le. 312)) then
718 lhaname=lhapath(1:lhapathlen)//'/DOG1.LHgrid'
720 write(lhaprint,5150) lhaset
724 elseif((lhainput .ge. 320) .and. (lhainput .le. 324)) then
728 if((lhainput .ge. 320) .and. (lhainput .le. 321)) then
732 lhaname=lhapath(1:lhapathlen)//'/DGG.LHgrid'
733 elseif((lhainput .ge. 322) .and. (lhainput .le. 322)) then
737 lhaname=lhapath(1:lhapathlen)//'/DGG.LHgrid'
738 elseif((lhainput .ge. 323) .and. (lhainput .le. 323)) then
742 lhaname=lhapath(1:lhapathlen)//'/DGG.LHgrid'
743 elseif((lhainput .ge. 324) .and. (lhainput .le. 324)) then
747 lhaname=lhapath(1:lhapathlen)//'/DGG.LHgrid'
749 write(lhaprint,5150) lhaset
753 elseif((lhainput .ge. 330) .and. (lhainput .le. 334)) then
759 if((lhainput .ge. 330) .and. (lhainput .le. 332)) then
761 lhaname=lhapath(1:lhapathlen)//'/LACG.LHgrid'
762 elseif((lhainput .ge. 333) .and. (lhainput .le. 333)) then
765 lhaname=lhapath(1:lhapathlen)//'/LACG.LHgrid'
766 elseif((lhainput .ge. 334) .and. (lhainput .le. 334)) then
769 lhaname=lhapath(1:lhapathlen)//'/LACG.LHgrid'
771 write(lhaprint,5150) lhaset
775 elseif((lhainput .ge. 340) .and. (lhainput .le. 345)) then
780 if((lhainput .ge. 340) .and. (lhainput .le. 341)) then
782 lhaname=lhapath(1:lhapathlen)//'/GSG1.LHgrid'
783 elseif((lhainput .ge. 342) .and. (lhainput .le. 343)) then
785 lhaname=lhapath(1:lhapathlen)//'/GSG0.LHgrid'
786 elseif((lhainput .ge. 344) .and. (lhainput .le. 344)) then
788 lhaname=lhapath(1:lhapathlen)//'/GSG961.LHgrid'
789 elseif((lhainput .ge. 345) .and. (lhainput .le. 345)) then
791 lhaname=lhapath(1:lhapathlen)//'/GSG960.LHgrid'
793 write(lhaprint,5150) lhaset
797 elseif((lhainput .ge. 350) .and. (lhainput .le. 354)) then
802 if((lhainput .ge. 350) .and. (lhainput .le. 352)) then
804 lhaname=lhapath(1:lhapathlen)//'/GRVG1.LHgrid'
805 elseif((lhainput .ge. 353) .and. (lhainput .le. 353)) then
808 lhaname=lhapath(1:lhapathlen)//'/GRVG0.LHgrid'
809 elseif((lhainput .ge. 354) .and. (lhainput .le. 354)) then
813 lhaname=lhapath(1:lhapathlen)//'/GRVG0.LHgrid'
815 write(lhaprint,5150) lhaset
819 elseif((lhainput .ge. 360) .and. (lhainput .le. 363)) then
824 if((lhainput .ge. 360) .and. (lhainput .le. 363)) then
826 lhaname=lhapath(1:lhapathlen)//'/ACFGPG.LHgrid'
828 write(lhaprint,5150) lhaset
832 elseif((lhainput .ge. 380) .and. (lhainput .le. 386)) then
837 if((lhainput .ge. 380) .and. (lhainput .le. 386)) then
839 lhaname=lhapath(1:lhapathlen)//'/WHITG.LHgrid'
841 write(lhaprint,5150) lhaset
845 elseif ((lhainput .ge. 390) .and. (lhainput .le. 398)) then
850 if ((lhainput .ge. 390) .and. (lhainput .le. 392)) then
853 lhaname=lhapath(1:lhapathlen)//'/SASG.LHgrid'
854 elseif((lhainput .ge. 393) .and. (lhainput .le. 394)) then
857 lhaname=lhapath(1:lhapathlen)//'/SASG.LHgrid'
858 elseif((lhainput .ge. 395) .and. (lhainput .le. 396)) then
861 lhaname=lhapath(1:lhapathlen)//'/SASG.LHgrid'
862 elseif((lhainput .ge. 397) .and. (lhainput .le. 398)) then
865 lhaname=lhapath(1:lhapathlen)//'/SASG.LHgrid'
867 write(lhaprint,5150) lhaset
870 ! Unknown Family ?! Giving up
872 write(lhaprint,5150) lhaset
876 lhamemb=lhainput-lhaset
877 ! Now work out if we have already called this set/member
880 if (lhaname.eq.lhanames(j).and. &
881 lhamemb.eq.lhamembers(j)) then
887 if (nsets.gt.nmxset) then
888 if (LHASILENT.ne.1) then
889 print *, "WARNING: too many sets initialised"
890 print *,"overwriting from set 1 again"
896 lhanames(iset)=lhaname
897 lhanumbers(iset)=lhainput
898 lhamembers(iset)=lhamemb
903 call initpdfsetm(iset,lhaname)
904 call numberpdfm(iset,lhaallmem)
905 if(lhasilent .ne. 1) then
907 write(lhaprint,5152) lhaname
908 write(lhaprint,5153) lhaallmem
911 if ((lhamemb.lt.0) .or. (lhamemb.gt.lhaallmem)) then
912 write(lhaprint,5155) lhamemb
913 write(lhaprint,5156) lhaallmem
917 ! print *,'calling initpdf',lhamemb
918 ! print *,'calling initpdfm ',iset,lhaname,lhamemb
919 ! print *,'LHAGLUE .... initializing set,member ',iset,lhamemb
920 call initpdfm(iset,lhamemb)
922 ! the rest is done every time pdfset is called
923 !print *,'setting nset to:',iset
925 call setnmem(iset,lhamemb)
930 call GetLam4M(iset,LHAMEMB,qcdlha4)
931 call GetLam5M(iset,LHAMEMB,qcdlha5)
934 alphasLHA = alphasPDFM(iset,QMZ)
935 if(lhasilent .ne. 1) write(lhaprint,5158) alphasLHA
937 if(lhaparm(17).EQ.'LHAPDF') then
938 nptypepdfl = 1 ! Proton PDFs
942 if (LHASILENT .NE. 1) write(lhaprint,5159) qcdl4, qcdl5
944 nptypepdfl = 1 ! Proton PDFs
949 if (parm(1).EQ.'NPTYPE') then ! PYTHIA
955 if(parm(1).EQ.'NPTYPE') then ! herwig
961 ! Formats for initialization information.
962 5150 format(1X,'WRONG LHAPDF set number =',I12,' given! STOP EXE!')
963 5151 format(1X,'==============================================')
964 5152 format(1X,'PDFset name ',A80)
965 5153 format(1X,'with ',I10,' members')
966 5154 format(1X,'==== initialized. ===========================')
967 5155 format(1X,'LHAPDF problem => YOU asked for member = ',I10)
968 5156 format(1X,'Valid range is: 0 - ',I10,' Execution stopped.')
969 !5157 format(1X,'Number of flavors for PDF is:',I4)
970 5158 format(1X,'Strong coupling at Mz for PDF is:',F9.5)
971 5159 format(1X,'Will use for PYTHIA QCDL4, QCDL5:',2F9.5)
974 end subroutine pdfset
977 !********************************************************************
979 ! -- copy of PDFLIB to use the eks98 nuclear correction factors
981 subroutine structa(x,q,a,upv,dnv,usea,dsea,str,chm,bot,top,glu)
982 implicit double precision (a-h,o-z)
984 call getlhaparm(15,lparm)
986 if(lparm.eq.'EPS08') then
987 call eps08(x,q,a,ruv,rdv,ru,rd,rs,rc,rb,rt,rg)
988 else if (lparm.eq.'EPS09LO') then
989 call eps09(1, 1, a, x, q, ruv, rdv, ru, rd, rs, rc, rb, rt, rg)
990 else if (lparm.eq.'EPS09NLO') then
991 call eps09(2, 1, a, x, q, ruv, rdv, ru, rd, rs, rc, rb, rt, rg)
993 call eks98(x,q,a,ruv,rdv,ru,rd,rs,rc,rb,rt,rg)
995 call structm(x,q,upv,dnv,usea,dsea,str,chm,bot,top,glu)
1006 end subroutine structa
1009 !*********************************************************************
1011 ! Gives parton distributions according to the LHAPDF interface.
1012 ! Two evolution codes used:
1013 ! EVLCTEQ for CTEQ PDF sets
1014 ! QCDNUM for Other PDF sets
1016 ! Author: Dimitri Bourilkov bourilkov@mailaps.org
1018 ! v4.0 21-Mar-2005 Photon/pion/new p PDFs, updated for LHAPDF v4
1021 ! interface to LHAPDF library
1022 subroutine structm(dx,dq,upv,dnv,usea,dsea,str,chm,bot,top,glu)
1023 ! double precision and integer declarations.
1024 implicit double precision(a-h, o-z)
1025 implicit integer(i-n)
1027 include 'commonlhapdf.inc'
1028 include 'commonlhasets.inc'
1029 include 'commonlhacontrol.inc'
1030 include 'commonlhaglsta.inc'
1031 ! interface to lhapdflib.
1032 double precision qcdlha4, qcdlha5
1034 common/lhapdfr/qcdlha4, qcdlha5, nfllha
1037 common/lhapdfe/lhaextrp
1039 ! interface to pdflib.
1040 common/w50513/xmin,xmax,q2min,q2max
1042 double precision xmin,xmax,q2min,q2max
1044 double precision upv,dnv,usea,dsea,str,chm,bot,top,glu
1045 double precision dx,dq,x,q,f(-6:6),photon,gluino
1051 if(lhaparm(16).ne.'NOSTAT') then
1052 totnum = totnum+1.d0
1053 if(x .lt. xmin) xminnum = xminnum+1.d0
1054 if(x .gt. xmax) xmaxnum = xmaxnum+1.d0
1055 if(q2 .lt. q2min) q2minnum = q2minnum+1.d0
1056 if(q2 .gt. q2max) q2maxnum = q2maxnum+1.d0
1059 ! range of validity e.g. 10^-6 < x < 1, q2min < q^2 extended by
1060 ! freezing x*f(x,q2) at borders.
1061 if(lhaextrp .ne. 1) then ! safe mode == "freeze"
1062 xin=max(xmin,min(xmax,x))
1063 q=sqrt(max(0d0,q2min,min(q2max,q2)))
1064 else ! adventurous mode == own risk !
1069 !print *,'calling evolvepdfm:',iset
1071 ! fix to allow STRUCTM to work for photon PDFs (Herwig does this)
1072 ! set P2 = 0.0d0 and IP2 = 0
1073 if(lhanumbers(iset).ge.300.and.lhanumbers(iset).le.399) then
1076 call evolvepdfpm(iset,xin,q,p2,ip2,f)
1077 else if (lhanumbers(iset).ge.20460.and.lhanumbers(iset).le.20462) then
1078 call evolvepdfphotonm(iset,xin,q,f,photon)
1079 else if (lhanumbers(iset).ge.20670.and.lhanumbers(iset).le.20677) then
1080 call evolvepdfgluinom(iset,xin,q,f,gluino)
1082 call evolvepdfm(iset,xin,q,f)
1095 end subroutine structm
1098 !*********************************************************************
1100 ! Gives parton distributions according to the LHAPDF interface.
1103 ! v4.0 21-Mar-2005 Photon/pion/new p PDFs, updated for LHAPDF v4
1105 ! Interface to LHAPDF library
1106 subroutine structp(dx,dq2,p2,ip2,upv,dnv,usea,dsea,str,chm,bot,top,glu)
1107 ! Double precision and integer declarations.
1108 implicit double precision(a-h, o-z)
1109 implicit integer(i-n)
1111 include 'parmsetup.inc'
1112 include 'commonlhapdf.inc'
1113 include 'commonlhacontrol.inc'
1114 include 'commonlhaglsta.inc'
1115 ! Interface to LHAPDFLIB.
1116 double precision qcdlha4, qcdlha5
1118 common/lhapdfr/qcdlha4, qcdlha5, nfllha
1121 common/lhapdfe/lhaextrp
1123 ! Interface to PDFLIB.
1124 common/w50513/xmin,xmax,q2min,q2max
1126 double precision xmin,xmax,q2min,q2max
1128 double precision upv,dnv,usea,dsea,str,chm,bot,top,glu
1129 double precision dx,dq2,q2,x,q,f(-6:6)
1134 if(lhaparm(16).ne.'NOSTAT') then
1135 totnup = totnup+1.d0
1136 if(x .lt. xmin) xminnup = xminnup+1.d0
1137 if(x .gt. xmax) xmaxnup = xmaxnup+1.d0
1138 if(q2 .lt. q2min) q2minnup = q2minnup+1.d0
1139 if(q2 .gt. q2max) q2maxnup = q2maxnup+1.d0
1142 ! Range of validity e.g. 10^-6 < x < 1, Q2MIN < Q^2 extended by
1143 ! freezing x*f(x,Q2) at borders.
1145 if(lhaextrp .ne. 1) then ! safe mode == "freeze"
1146 xin=max(xmin,min(xmax,x))
1147 q=sqrt(max(0d0,q2min,min(q2max,q2)))
1148 else ! adventurous mode == OWN RISK !
1152 call evolvepdfpm(iset,xin,q,p2,ip2,f)
1163 end subroutine structp
1166 !*********************************************************************
1168 ! For statistics ON structure functions (under/over-flows)
1170 ! Author: Dimitri Bourilkov bourilkov@mailaps.org
1173 ! first introduced in v4.0 28-Apr-2005
1176 ! Double precision and integer declarations.
1177 implicit double precision(a-h, o-z)
1178 implicit integer(i-n)
1180 include 'commonlhaglsta.inc'
1181 ! Interface to LHAPDFLIB.
1184 print *,'===== PDFSTA statistics for PDF under/over-flows ===='
1186 print *,'====== STRUCTM statistics for nucleon/pion PDFs ====='
1188 print *,' total # of calls ',TOTNUM
1189 if(totnum .gt. 0.d0) then
1190 percbelow = 100.d0*xminnum/totnum
1191 percabove = 100.d0*xmaxnum/totnum
1192 print *,' X below PDF min ',xminnum,' or ',percbelow, ' %'
1193 print *,' X above PDF max ',xmaxnum,' or ',percabove, ' %'
1194 percbelow = 100.d0*q2minnum/totnum
1195 percabove = 100.d0*q2maxnum/totnum
1196 print *,' Q2 below PDF min ',q2minnum,' or ',percbelow, ' %'
1197 print *,' Q2 above PDF max ',q2maxnum,' or ',percabove, ' %'
1200 print *,'========= STRUCTP statistics for photon PDFs ========'
1202 print *,' total # of calls ',totnup
1203 if(totnup .gt. 0.d0) then
1204 percbelow = 100.d0*xminnup/totnup
1205 percabove = 100.d0*xmaxnup/totnup
1206 print *,' X below PDF min ',xminnup,' or ',percbelow, ' %'
1207 print *,' X above PDF max ',xmaxnup,' or ',percabove, ' %'
1208 percbelow = 100.d0*q2minnup/totnup
1209 percabove = 100.d0*q2maxnup/totnup
1210 print *,' Q2 below PDF min ',q2minnup,' or ',percbelow, ' %'
1211 print *,' Q2 above PDF max ',q2maxnup,' or ',percabove, ' %'
1215 end subroutine pdfsta
1218 subroutine pftopdg(dx,dscale,dxpdf)
1219 !include "pdf/expdp.inc"
1220 double precision dx,dscale,dupv,ddnv,dusea,ddsea,dstr,dchm,dbot,dtop,dgl,dxpdf(-6:6)
1221 ! Call STRUCTM in PDFLIB to get flavour content
1222 call structm(dx,dscale,dupv,ddnv,dusea,ddsea,dstr,dchm,dbot,dtop,dgl)
1223 ! Convert flavour convention of PDFLIB to PDG convention
1225 dxpdf(1) = ddnv + ddsea
1226 dxpdf(2) = dupv + dusea
1238 end subroutine pftopdg