APFEL Web: a Web-based application for the graphical visualization of parton distribution functions

APFEL Web: a Web-based application for the graphical visualization of parton distribution functions

Stefano Carrazza111Corresponding author: stefano.carrazza@mi.infn.it, Alfio Ferrara, Daniele Palazzo
and Juan Rojo
Dipartimento di Fisica, Università degli Studi di Milano & INFN, Sezione di Milano, Via Celoria 16, Milano, Italy PH Department, TH Unit, CERN, CH-1211 Geneva 23, Switzerland Dipartimento di Informatica, Università degli Studi di Milano, Via Comelico 39, Milano, Italy University of Oxford, 1 Keble Road, Oxford OX1 3NP, United Kingdom stefano.carrazza@mi.infn.it
Received: date / Revised version: date

We present APFEL Web, a Web-based application designed to provide a flexible user-friendly tool for the graphical visualization of parton distribution functions (PDFs). In this note we describe the technical design of the APFEL Web application, motivating the choices and the framework used for the development of this project. We document the basic usage of APFEL Web and show how it can be used to provide useful input for a variety of collider phenomenological studies. Finally we provide some examples showing the output generated by the application.


Keywords: Parton distribution functions, LHC phenomenology, graphical visualization

1 Introduction

The requirements of precision physics at CERN’s Large Hadron Collider (LHC) have lead to the development of a variety of computer programs that can be used to analyze LHC data and to provide predictions for phenomenologically relevant processes. The APFEL library, presented in Ref. [1], is an example of such a program. APFEL is a parton distribution function (PDF) evolution library [2, 3, 4, 5, 6] which specialises in the solution of the DGLAP evolution equations with QED corrections. The library also provides a native graphical user interface (APFEL GUI) with plotting tools for PDF comparison, luminosities, deep-inelastic scattering (DIS) observables and theoretical prediction computed through the APPLgrid interface [7]. The APFEL GUI reads PDF data stored and interfaced by the LHAPDF library [8, 9] and plots are produced with ROOT [10].

After releasing the native version of the GUI we have observed that users had difficulties in maintaining the version of the PDF grids available from the LHAPDF library. Additionally the APFEL GUI installation procedure required dependencies which are constantly under development, e.g. the Qt toolkit222http://www.qt.io/, LHAPDF and ROOT. Therefore, in order to reduce the drawbacks of a native application we have ported the code to an online centralized server system that we called APFEL Web. This service is designed with the objective to provide a fast and complete interface to APFEL GUI with an user-friendly Web-application interface. In this respect, APFEL Web provides also a timely replacement to the HepData online PDF plotter333http://hepdata.cedar.ac.uk/pdf/pdf3.html.

APFEL Web is a Web-based application attached to a computer cluster, available online at:


It contains PDF grids from LHAPDF5 and LHAPDF6 libraries and it allows users to evolve PDFs using custom configurations provided by the APFEL library. Computational results are presented in the format of plots which are produced by the ROOT framework.

This article is organized as follows. In Sect. 2 we document the application design and we explain the model scheme developed for this project. In Sect. 3 we discuss how to use the Web-application and obtain results. Finally, in Sect. 4 we present our conclusion and directions for future work.

2 Application design

The APFEL Web project is divided into two parts: the server-side and the cluster-side. The separation is a real requirement because the service needs to interact with multiple users and computational jobs at the same time. In the following we start from the description of the Web framework developed for the server-side and then we show how the combination is performed.

2.1 The Web framework and interface

Figure 1: A static design scheme of the APFEL Web application model. The boxes represent a simplified view of the main components of this Web-application. Solid lines with 1/N labels represent the one/many relationships for each component of the application. Labels inside the boxes are examples of the database entry keys associated to the model.

For the development of the Web interface we have used the Django Web framework444https://www.djangoproject.com/. Django is a high-level Python Web framework which provides a high-performing solution for custom and flexible Web-applications. Moreover the choice of Python as programming language instead of PHP or Java, is motivated by the need of a simple interface to interact with the server system, by simplifying the implementation of the communication between server and cluster sides.

Following the Django data model we have chosen to stored data in a PostgreSQL555http://www.postgresql.org database which should provide a good performance for our query requirements. We use the authentication system provided by the Django framework in order to create a personal user Web-space, so users can save privately personal configurations and start long jobs without need to be connected over the whole calculation time.

In Figure 1 we show a schematic view of the Web-application model used in APFEL Web. Starting from the top-left element, users have access to PDF objects which store in the database the information about the PDF: e.g. the set name, the PDF uncertainty treatment and the library for the treatment of PDF evolution. Users have the option to choose PDF sets from the LHAPDF library or, if preferred, upload their own private grid using the LHAPDF5 LHgrid and LHAPDF6 formats. Users are able to run jobs after setting up the PDF grid objects: there are seven job types which are classified in the image as plotting tools and will be described in detail in Sect. 3. For each plotting tool there are customized input Web-forms, implemented with the Django models framework, which collect information and store it in the database before the job submission. When a job finalizes, it stores images and ROOT files to the server disk, which are then downloaded by the user. General configuration information such as the path of the PDF grids and libraries are stored directly into the Django settings.

Concerning Web-security in APFEL Web, the user’s account and its information are protected by the Django Middleware framework. Undesirable users, such as spambots, are filtered by a security question during the registration form. Finally, all users have a limited disk quota which disable job submissions when exceeded.

2.2 Computation engine and server deployment

Figure 2: Deployment layout of APFEL Web.

In parallel to the Web development, the most important component of APFEL Web is the computational engine that we called apfeldaemon. The program is a generalization of the open source APFEL GUI code in C++ with the inclusion of the database I/O procedures. The job configuration and the PDF grids are read from the database, and the computation is performed upon request by the user. In order to solve the problem correlated with the usage of two different interfaces to PDF grids, i.e. LHAPDF5 and LHAPDF6, the apfeldaemon is composed by two binaries which are linked to the respective libraries: the Web-application checks the PDF grid version and it starts the computation procedure with the correct daemon.

In Figure 2 we show the scheme of the Web-application structure. Users from Web browsers send requests to a Python server which in our case is implemented by gunicorn and nginx666http://gunicorn.org and http://nginx.org/. The Python server performs the request using the Django framework, at this level PDF objects and jobs are prepared and saved in the database, additionally eventual job results are collected in a dedicated view. From the computational point of view the layout is very simple and clearly illustrated by the left side of Fig. 2. We have set up a Portable Batch System (PBS)777An example of PBS open source implementation: http://www.adaptivecomputing.com/ for the multi-core server which receives job submissions and is able to automatically handle the job queue, avoiding the unpleasant situation of server overloading. Jobs are submitted by the Django application which passes the job identification number, this value is read by the apfeldaemon and it performs a query at the corresponding database entry, then it collects the relevant information to start the correct job. When the job finalizes the apfeldaemon modifies the job status in the database, so the Web interface notifies the user of the job status.

The apfeldaemon program was designed and compiled with performance as priority, in fact there are relevant computational speed improvements when comparing to the previous APFEL GUI program almost due to the clear separation between the GUI and the calculation engine. In order to provide to the reader an idea of the typical processing time per job, we estimate that one job requires two seconds to process a single PDF set when producing a PDF comparison plots, meanwhile for luminosity and observables jobs, the system takes up to one minute per PDF set when including the uncertainty treatment.

3 Results

Figure 3: Examples of output generated with APFEL Web. Plots are presented in the following order, clockwise from top-left: member plot, all flavors plot, PDF comparison and -channel luminosity.

While the use of the Web-interface should be self-explanatory, here we describe and show examples of job results that a user is able to obtain from APFEL Web.

The first step consists in the creation of custom “PDF objects” in the user’s workspace. The following points explain how to create such objects:

  1. select a PDF grid from the LHAPDF5 and/or LHAPDF6 libraries and determine the treatment of the PDF uncertainty among: no error, Monte Carlo approach, Hessian eigenvectors (68 and 90% c.l.) and symmetric eigenvectors. When selecting a PDF set the system proposes automatically an uncertainty type based on the PDF collaboration name.

  2. import a new LHAPDF grid file, with the only requirement that it is provided either in the LHAPDF5 LHgrid or in the LHAPDF6 format. The main target for this feature are the members of the PDF collaborations which can perform comparisons with preliminary sets of PDFs before the publication in LHAPDF.

  3. set the evolution library by choosing between the LHAPDF interpolation routines or the APFEL custom evolution.

We provide the following computational functions, which are illustrated in Figures 3 and 4:

  • Plot PDF Members”: it plots for projections in all the members of a PDF set for a single parton flavor at a given energy scale . See the top-left image in Fig. 3 where we show the replicas of NNPDF2.3 NLO [4] together with its central value and Monte Carlo uncertainty band, these last features are options which can be disabled by the user. This plotting tool accepts only a single PDF set at each time in order to avoid too many information in a single plot. We provide the possibility to choose between the usual parton flavors, i.e. with , and the combination of them: ([11], the so called evolution basis.

  • Plot all PDF flavors”: each PDF flavor is plotted together in the same canvas at a fixed energy scale. We also provide the possibility to scale PDF flavors by a predetermined numeric factor in order to produce plots similar to the PDG [12]. An example of PDF flavor plot is presented in the top-right of Fig. 3 where the gluon PDF is scaled by a factor 10.

  • Plot Multiple PDFs (x)”: this tool compares the same flavor of multiple PDF sets and the respective uncertainties at a given energy scale for projections in . We provide the possibility to compute the absolute value or the just the ratio respect to a reference PDF set. The bottom-left image of Fig. 3 shows the comparison between NNPDF2.3 NLO [4], CT10 NLO [13] and MSTW2008 NLO [14] sets at GeV.

  • Plot Multiple PDFs (Q)”: this tool compares the same flavor of multiple PDF sets and the respective uncertainties at a fixed -value as a function of the energy scale .

  • Compute Luminosity”: it performs the computation of parton luminosities [15] normalized to a reference PDF set at a given center of mass energy. There are several channels available: , , , , , , , , , , etc. In the bottom-right plot of Fig. 3 we show an example of -luminosity at TeV using the PDF sets presented above with CT10 NLO as reference PDF set.

  • Compute DIS(x)/DIS(Q)”: it computes DIS observables as functions of or for different heavy quark schemes and perturbative orders, including the Fixed Flavor Number scheme (FFNS), the Zero Mass Variable Number scheme (ZMVN), and the FONLL scheme [16] where the choice of a NLO prediction implies using the FONLL-A scheme, while choosing NNLO leads to using the FONLL-C scheme. A detailed explanation of all possible configurations is presented in Sect. 4.3 of Ref. [1]. An example of such tool is presented in the left plot of Fig. 4.

  • APPLgrid observables”: this tool provides a simple a fast interface to theoretical predictions through the APPLgrid library [7]. The system already provides several grids that are available from the APPLgrid website888http://applgrid.hepforge.org/ but also from the NNPDF collaboration [5] and aMCfast [17]. This function allows users to compute the central value and the respective uncertainties for multiple PDF sets. On the right plot of Fig. 4 we show the output of this tool for the predictions of ATLAS 2010 inclusive jets at TeV [18].

Figure 4: On the left, an example of DIS observable computed by APFEL Web: . On the right, another example about the APPLgrid observables tool used for the computation of predictions for ATLAS 2010 inclusive jets at TeV [18].

For all the tools presented above, the Web interface provides options for customizing the graphics, like setting the plot title, axis ranges, axis titles and curve colors. APFEL Web also provides the possibility to save plots and the associated data in multiple formats, including: PNG, EPS, PDF, .C (ROOT) and .root (ROOT).

Finally, it is important to highlight that the results produced by APFEL Web for PDF comparison and parton luminosities from different PDF sets have been verified against the PDF benchmarking exercise of Ref. [2].

4 Summary and outlook

APFEL Web is a new Web-based application that provides a user-friendly graphical user interface for the visualization of PDFs with a wide range of formats: absolute plots, ratio plots, compare PDFs from different groups, compare error PDF from a single set, plot all PDF flavor combinations at the same time, compute parton luminosities and finally compute also DIS structure functions and APPLgrid observables. All these functionalities are accessed via a centralized Web server.

APFEL Web is available online for PC and mobile devices at:


The current framework provides a stable starting point to an future expansion of the functions already implemented in APFEL Web, the design of the PDF objects is flexible enough to perform convolution of PDFs in multiple external codes, suggesting the possibility to include in future releases other software tools from HEP, enlarging the functions of this Web-application.

The APFEL Web application was released on October 7, 2014. Four months after the release we already have registered 76 users from 10 countries, with an average of 200 visits each month. Currently, the server has successfully completed more than 900 jobs. Thanks to its flexibility and user-friendliness, we believe that in the coming months and years APFEL Web has the potential to become a widely used tool in the LHC community.


We thank Stefano Forte and Valerio Bertone for intensive discussions and feedback during the construction of this application. SC acknowledges support by an Italian PRIN2010 grant and by an European Investment Bank EIBURS grant.



  • [1] Bertone V, Carrazza S and Rojo J 2014 Comput.Phys.Commun. 185 1647 1310.1394
  • [2] Ball R D, Carrazza S, Del Debbio L et al. 2013 JHEP 1304 125 1211.5142
  • [3] Ball R D et al. (NNPDF) 2013 Nucl.Phys. B877 290 1308.0598
  • [4] Ball R D, Bertone V, Carrazza S et al. 2013 Nucl.Phys. B867 244 1207.1303
  • [5] Ball R D et al. (The NNPDF Collaboration) 2014 1410.8849
  • [6] Harland-Lang L, Martin A, Motylinski P et al. 2014 1412.3989
  • [7] Carli T, Clements D, Cooper-Sarkar A et al. 2010 Eur.Phys.J. C66 503 0911.2985
  • [8] Buckley A, Ferrando J, Lloyd S et al. 2014 1412.7420
  • [9] Butterworth J, Dissertori G, Dittmaier S et al. 2014 1405.1067
  • [10] Brun R and Rademakers F 1997 Nucl.Instrum.Meth. A389 81
  • [11] Ball R D et al. (NNPDF Collaboration) 2012 Nucl.Phys. B855 153 1107.2652
  • [12] Olive K et al. (Particle Data Group) 2014 Chin.Phys. C38 090001
  • [13] Lai H L, Guzzi M, Huston J et al. 2010 Phys.Rev. D82 074024 1007.2241
  • [14] Martin A, Stirling W, Thorne R et al. 2009 Eur.Phys.J. C63 189 0901.0002
  • [15] Ball R D et al. (The NNPDF collaboration) 2010 Nucl. Phys. B838 136 1002.4407
  • [16] Forte S, Laenen E, Nason P et al. 2010 Nucl.Phys. B834 116 1001.2312
  • [17] Bertone V, Frederix R, Frixione S et al. 2014 JHEP 1408 166 1406.7693
  • [18] Aad G et al. (ATLAS Collaboration) 2012 Phys.Rev. D86 014022 1112.6297
Comments 0
Request Comment
You are adding the first comment!
How to quickly get a good reply:
  • Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
  • Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
  • Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters
Add comment
Loading ...
This is a comment super asjknd jkasnjk adsnkj
The feedback must be of minumum 40 characters
The feedback must be of minumum 40 characters

You are asking your first question!
How to quickly get a good answer:
  • Keep your question short and to the point
  • Check for grammar or spelling errors.
  • Phrase it like a question
Test description