{'fraction_non_alphanumeric': 0.03166928562794633, 'fraction_numerical': 0.00817921753495306, 'mean_word_length': 4.5775280898876405, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
The FMNRxPYTHIA interface for Heavy Quark production at HERA

A method to calculate heavy flavor visible-level cross sections at Next-to-Leading Order (NLO) in Quantum Chromodynamics (QCD), based on an interface of the FMNR program to PYTHIA, is described. It uses the NLO prediction at quark level provided by FMNR, with a statistical reduction procedure (REDSTAT) that allows a link to PYTHIA 6.2 to be made, from where the description of the full hadron fragmentation and decay chain is obtained. The method is applied to ep ->b bbar X ->D* mu X and mu+ mu- X final states at HERA. Comparisons of the data and NLO cross sections at visible and b-quark level were found to be consistent.


Introduction
Heavy flavor (beauty and charm) production in ep collisions at HERA allows QCD to be probed and understood in detail. Several heavy flavor production channels have been studied by the H1 [2] and ZEUS [1] experiments and compared to NLO QCD predictions based on the FMNR [3] massive fixed order calculations. These calculations are currently the only ones available at NLO which include a fully differential description of the parton-level final states, and therefore a non-trivial propagation of cuts at the visible level (i.e. on variables measured directly in the detector). In order to achieve this, the partons need to be fragmented and decayed to measurable hadron or lepton final states. For relatively simple cases, this can be implemented through a numerical or analytical parametrization of the parton-hadron level relation, obtained from separate MC simulations or direct measurements, which are then directly appended to the FMNR prediction. For final states with correlated cuts on several final particles, such as in [4,5], this is not easily possible, although it has been attempted [6]. Nevertheless, NLO predictions for such final states are needed.
One solution to this problem is the MC@NLO approach [7] -already implemented for the LHC and Tevatron -which is not yet available for HERA. In this approach NLO QCD predictions are matched to parton showers in heavy flavor production, combining a Monte Carlo event generator (HERWIG [8]) with NLO calculations of rates for QCD processes.
The alternative proposed here is an interface of the FMNR program to Pythia [9]. The application of the REDSTAT option [10] to the NLO description at quark level provided by FMNR, transforms FMNR into an effective Monte Carlo-like event generator. The parton-level events are then read back through the "Les Houches accord" [11] interface into Pythia 6.2, where the description of the hadron fragmentation and full decay chain is implemented.
No attempt is made to include additional parton showering. This will be achieved later by MC@NLO for HERA, when it will become available [12]. 2 The FMNR program FMNR makes cross-section calculations at NLO in QCD for heavy quark production in ep and γp collisions. It is designed to give predictions in the photoproduction regime (photon virtuality Q 2 1 GeV 2 ). It contains point-like and hadronic photon coupling to the heavy quarks (see Fig. 1) in the massive fixed-order approach. In this scheme, the quarks are produced dynamically (i.e. they are not included in the structure functions) and the relevant scale is the mass of the heavy quarks (m Q , Q = c, b), neglecting terms like [α s ln µ 2 /m 2 Q ] n that are resummed in other approaches. This makes this approach particularly valid for processes in which the hard scale µ 2 ∼ m 2 Q . In addition to quark-level predictions, the FMNR program provides a framework to fragment e.g. b quarks into B hadrons, and simulate the decay of these hadrons by interfacing them to appropriately chosen decay spectra. However, decays to complex final states, like D * + µ from the decay of the same B hadron with cuts on both particles, cannot be easily implemented in this scheme.
A straightforward interface of the parton-level events produced by FMNR to a Monte Carlo-like fragmentation and simulation chain is not practical since weights (either positive or negative) are assigned to the output events. These weights range over more than 8 orders of magnitude as is shown in Figure 2. FMNR also differs from a true Monte Carlo generator because the events are not created randomly, but rather in a systematic order, and thus the complete data set must be considered in order to get meaningful results. This makes such an approach extremely inefficient because high statistics needs to be generated in order to keep statistical fluctuations low.
As seen in Figure 2, in most cases the weights assigned to the events are within four orders of magnitude. However, there are also cases in which a pair of similar events are created with relatively large (but oppositely signed) weights. This is due to the fact that in the phase-space region where FMNR performs the calculations, collinear and infrared divergences are present [13]. Physically, these paired events correspond to two distinct but similar processes: In the first case, a quarkantiquark pair and a gluon are produced in the collision, and the gluon is such that it remains near one of the heavy quarks. In the second case, the gluon not only remains near the heavy quark but also at some later time is reabsorbed (see Figure 3).  For the cross-section calculation this means in practice that the process with e.g. the collinear gluon has positive weight, but gives a divergent contribution, and the interference term between the LO process and the process with a virtual gluon has a negative weight and gives a divergent contribution as well. FMNR overcome the problem of the soft and collinear divergences by generating sequences of topologically correlated events in such a way that the cancellation is performed by the integration over that phase-space region. The output of FMNR is hence, weighted partonic events with a heavy quark-antiquark pair, and events with the pair plus an extra parton (a gluon or a light quark or anti-quark).
However, problems do occasionally arise because the histograms used to plot the output are discretely binned, and it can happen that one of the two paired events will end up in one histogram bin, while the other event with only very slightly different topology ends up in the adjacent one. When this happens the two events can not cancel one another, and so the two adjacent bins are left with relatively large weighted events. It is then necessary to produce many more events with smaller weights for the histogram to smooth out. Although the contributions to the cross section are finite at this point, the values of the weights for the generated events span over many orders of magnitude (Fig. 2).
A solution to this problem is to find all paired events and suitably average them before they are output into the histogram. This is what the reduced statistics (REDSTAT) option does, as will be explained in detail in the following section.

REDSTAT
The group of subroutines REDSTAT is implemented as an extension to the FMNR program. It is designed to: • reduce the range of weights for the generated events, such that an interface to fragmentation and simulation packages like Pythia becomes realistic; • reduce the necessary statistics without losing NLO accuracy; • improve run-time efficiency.
The method is as follows: REDSTAT monitors all the parton level events as they are generated by FMNR, and searches for events with weights above a given threshold. Two or more events with large but opposite sign weights and similar kinematics are then combined into a new single event by averaging the four-momentum of the partons and assigning the sum of the weights as the new weight. For events with weights below the threshold, REDSTAT makes a random decision to keep the event with a probability proportional to its weight (sampling approach). These events then acquire the weight of the threshold.
The threshold is chosen such that the number of events with positive weights is almost equal to the number of events with negative weights above that threshold. Events are considered to have similar kinematics when the difference in transverse momentum (p T ), rapidity (ζ) and azimuthal angle (φ) of the quark-antiquark pair are less than user cut values that should reflect the experimental detector resolution.
After this procedure, as can be seen in Figure 4, the range of weights is reduced to about two orders of magnitude, and the number of generated events is also reduced, therefore improving the run-time efficiency of subsequent applications using these events as input. This method preserves the NLO accuracy for the relevant spectra (e.g. b-quark p T and angular distributions) and cross sections at parton level, as long as the chosen binning is not smaller than the assumed resolution, as will be explained in the next section.
Some caveats of this method are related to technical details of the REDSTAT implementation: the optimal threshold used to decide whether events will or will not be combined does not have a universal value. It must be chosen looking at the weight distributions, and these change depending on the generated process (charm or beauty) and according to the number of generated events (for example, it moves to the left when more statistics is generated). The default cut-off values of p T , ζ and φ are tuned to the ZEUS detector resolution and have to be appropriately retuned for other applications. Therefore, we recommend to contact the authors for advice before using REDSTAT.
Finally, an optional output file for the interface to other packages is created. This is an ASCII file containing the information of the generated parton level events. For each event, this includes e.g. the assigned weight and the four-momenta of the two or three final state partons.

Examples of REDSTAT results
• Cross-section prediction at b-quark level for the process γp → b(b)X This was calculated using the original FMNR program and compared to the FMNR version which includes REDSTAT. The kinematic region was Q 2 < 1 GeV 2 and inelasticity 0.05 < y < 0.85.
The parameters used in both calculations were: the mass of the b-quark m b = 4.75 GeV; the renormalization and factorization scales, is the average of the squared transverse momentum of the two emerging b quarks; the structure functions CTEQ5M [14] for the proton and GRV-G-HO [15] for the photon.
For the evaluation of the theoretical uncertainty (relevant for section 5), the scales were varied by a factor 2, and the mass of the beauty quark was varied between 4.5 and 5 GeV. The variations were done simultaneously such that the spread was maximized. The uncertainty of the structure functions turned out to be small in comparison, and is neglected.
Additional REDSTAT parameters were: weight threshold: 10 −5 ; maximal difference in transverse momentum between the partons of the events to be combined, ∆p T = 1.0 GeV; similarly, maximal difference in rapidity: ∆ζ = 0.20; maximal difference in the angle between the quarks: ∆φ = 0.3 rad.
These cuts were applied to the two heavy (anti)quarks only. The number of events generated in each sample are displayed in Table 1.  Table 2: Comparison of NLO cross-section predictions using FMNR without/with the REDSTAT option, for rapidity of the b-quark or antiquark |ζ| < 1.
• Comparison of the transverse momentum distribution of the b(b)-quark As it is shown in Figure 5, the REDSTAT option yields a good description of the b-quark p T . The small differences in the shapes of the distributions are due to statistical fluctuations of such a typical FMNR run. This is illustrated further in the Figure 6; in which in order to estimate the statistical fluctuations, 10 samples of standard FMNR runs where generated using the same statistics changing only the seed of the random number generator. Obtaining a distribution as the mean value of the 10 samples, the error of which has a variance V (x) = σ 2 /N . This mean distribution (called standard in the Figure) is compared to a run using 10 times more statistics and to the version using REDSTAT. After RED-STAT, the fluctuations are expected to be smaller than in the original FMNR, since the probability to split a correlated pair of events at the bin boundary is reduced.

The FMNR⊗Pythia Interface
The implementation of the interface of the FMNR parton-level predictions to the fragmentation and decay chain from Pythia/Jetset is a two-step process. The first step of this FMNR⊗Pythia interface consists in the application of the REDSTAT extension to the FMNR program (described in Section 3). RED-STAT is used to transform FMNR into an effective Monte Carlo-like parton-level event generator, through the combination of events with similar kinematics and a sampling approach.
The events obtained this way are written to an output file. In the second step, these events are read back into the Pythia 6.2 program through the "Les Houches accord" user interface.
The interface routine UPEVNT then sequentially reads one event from the input ASCII file and fills it into the "Les Houches" interface variables to be used as input by Pythia. At this stage, a "reasonable" (i.e. physically possible) colour flow is assigned to each FMNR parton level process. FMNR does not provide this information, which is needed in the case of string fragmentation. The difference due to different possible colour flow assignments should be included in the systematic error if this is critical for the application.
Since the first comparisons with data were made to measured beauty production cross sections [], the following sections are written for the specific case of beauty production. All arguments hold in an analog way for charm production.
The initial state partons are allowed to have an intrinsic k T (typically ∼ 300 MeV) as implemented in Pythia. This has a negligible effect on the resulting cross sections (∼ 1%).
Parton showering is not allowed in order to avoid double counting of higher order contributions.
Fragmentation of b-quarks close to production threshold turned out to be a non trivial issue. Since the details of the threshold treatment were found to be much more important than the choice of a particular fragmentation function, the Peterson formula with ǫ = 0.0035 is used for convenience. Three approaches have been considered: • Independent fragmentation in the Pythia model, within FMNR⊗Pythia. This is used because FMNR does not provide color connections on an event-to-event basis, and color connections are not required in this model.
• Fragmentation in the Lund string model, within FMNR⊗Pythia. For this, reasonable color connections have to be associated to each FMNR event.
• Independent fragmentation scheme as provided in the context of the original FMNR. This implies setting the B-hadron momentum equal to the b-quark momentum before reducing it according to the Peterson formula. This neglects threshold corrections due to the need of simultaneous conservation of energy and momentum.
In the first two cases, the fragmentation, decay tables and kinematics as implemented in Pythia 6.2/Jetset are used to obtain a hadron-level event. Therefore, non-dominant arbitrarily complicated decays, such as B → D * D followed by a D → µX, or muons through intermediate J/Ψ or τ states, are automatically included.
The branching ratios were empirically corrected at analysis level to correspond to those obtained from the Particle Data Group (PDG) [16]. Unless otherwise stated, the 2 nd approach is used for the central prediction, while the first enters the systematic uncertainty.
The third case could be used only for relatively simple final states (e.g. independent production of a muon from each heavy quark), and the resulting differences with respect to the first two cases were extrapolated to the more complicated ones (e.g. correlated production of two muons from the same b quark), and used as a systematic check.

Examples of the use of the FMNR⊗Pythia interface.
Double tagging techniques like µ + µ − or D * µ [4][5][6] benefit from the increasing amount of data provided by HERA. At the ZEUS experiment, a beauty enriched data sample is obtained in these channels taking advantage of the significantly reduced background. This allows softer kinematic cuts which, in combination with the wide rapidity coverage of the ZEUS muon detectors, results in an enhanced sensitivity to B hadrons produced at low transverse momenta, where the bulk of the b cross section is concentrated. Under these conditions a direct measurement of the total bb cross section becomes possible without the use of large model-dependent extrapolation factors.
Tagging muons or D * from different b quarks allows bb correlations to be explicitly measured, while tagging two muons or a muon and D * from the same b quark yields measurements which are almost insensitive to such correlations. However, the complexity of the decays of these channels and the different cuts applied to the final state particles makes a calculation of the NLO prediction using the original FMNR approach very difficult.
In this section our new method will be applied to obtain NLO beauty cross-section predictions for the final state channels D * µ and µ + µ − .

The ep → bbX → D * µX ′ channel
In the case of D * + µ [4] an unlike-sign combination of both particles is observed in the same detector hemisphere if they come from the same b quark, (mainly via B 0 → D * µν µ ) yielding a pure b sample. If they originate from different b quarks then the µ and D * are emitted into different hemispheres. Both like and unlike sign charge combinations are allowed. In the unlike sign case only, the signature is similar to the one given by charm from different c quarks. These differences can be used to extract the beauty signal. More details are given in [17].
The cross section for inclusive beauty production ep → bbX → D * µX ′ in the kinematic range p D * T > 1.9 GeV, −1.5 < η D * < 1.5, p µ T > 1.4 GeV and −1.75 < η µ < 1.3 was measured to be: This is larger than, but still compatible with, the corresponding FMNR⊗Pythia NLO prediction of where the first error refers to the uncertainties of the FMNR parton level calculation, and the second error refers to the uncertainties related to fragmentation and decay.
Strictly speaking, the FMNR predictions are only valid for the photoproduction regime. Here, the Weizsäcker-Williams (WW) approximation with an effective Q 2 max < 25 GeV 2 cutoff [18][19][20] was used to include the ∼ 15% DIS contribution for a combined cross section. This NLO QCD prediction is also listed in Table 3.
A cross section for the same kinematic range, but adding a photoproduction requirement (Q 2 < 1 GeV 2 , 0.05 < y < 0.085) was also obtained. The result, as well as the corresponding FMNR⊗Pythia prediction, are shown in Table 3. As in the inclusive case, the prediction underestimates the measured cross section, but is compatible with the measurement within the large errors.
Finally, these measured visible-level cross sections were extrapolated to b-quark level using Pythia. The NLO QCD prediction can then be obtained at parton level directly from the original FMNR calculation. From the comparison of the ratios at visible and b-quark level in Table 3, one can conclude that the Pythia extrapolation, which was the only way to compare the cross sections before Eq. (2) could be calculated [17], was reliable.

Comparison ZEUS -H1
The H1 Collaboration has measured a cross section similar to the ZEUS photoproduction cross section, in a slightly different kinematic region [6]: p D * T > 1.5 GeV, −1.5 < η D * < 1.5, p µ > 2.0 GeV, −1.735 < η D * < 1.735, Q 2 < 1 GeV 2 and 0.05 < y < 0.75. Its value is shown in Table 4. Using the FMNR⊗Pythia interface, the ZEUS cross section can be extrapolated to the H1 kinematic region [4]. A direct comparison of the two results is shown in Table 4. Reasonable agreement is found. The data to NLO ratio is again consistent with the ones quoted in Table 3.
The NLO prediction is somewhat larger than the one evaluated in [6] due to the inclusion of the hadronlike photon contribution, the inclusion of secondarymuon branching fractions for D * and µ from the same b quark (e.g. B → D * D → D * µX), which are difficult to handle outside the FMNR⊗Pythia framework, and a detailed simulation of the kinematics of the b → B → D * chain rather than direct collinear fragmentation of b quarks into D * mesons. This reduces the discrepancy claimed in [6] and is an example for the importance of a detailed treatment of complicated final states.

5.3
The The signature of the dimuon channel is very similar to the D * µ channel and detailed information can be found in [5]. Again, this is a very complicated final state, for which the cross section measurements are being finalized by ZEUS. The purpose of this section is to provide cross section predictions to which the ZEUS results can be compared.

Visible beauty cross-sections prediction for
The measured visible cross-section compared to the NLO prediction from FMNR⊗Pythia is shown in Table 5. The extrapolation to b-quark level was done using Pythia and is compared to the NLO prediction, obtained by adding up the (original) FMNR and HVQDIS [21] predictions, for the photoproduction and DIS regions respectively.
Here, as in the case of the D * µ channel, the crosssection comparisons at visible and b-quark level are consistent.

Differential cross sections
Differential cross-sections were also obtained and shown in Figure 8. One can observe the general trend of NLO to lie below the data, but consistent between errors. The shape of the distributions is well reproduced by the NLO prediction.
For the correlations between the two b-quarks, the reconstructed dimuon mass range was restricted to Figure 8: Differential cross-sections dσ/dp T (left) and dσ/dη (right) for muons.
The data points are compared to the scaled LO prediction from Pythia + Rapgap, and to the NLO prediction from FMNR⊗Pythia.  25 GeV. This additional cut reduces the probability that both quarks come from the same B-hadron. The corresponding differential cross-section is shown in Figure 9. The distribution is reasonably described by the FMNR⊗Pythia NLO prediction within the large errors. The leading order contribution alone, which is also shown, reproduces the measured less well. Although the difference in shape is not dramatic, this could confirm the importance of the contributions from higher order processes.

Other applications
In principle, the FMNR⊗Pythia interface can be used to generate events which can be propagated through the full simulation and reconstruction chain of any experiment measuring ep or γp heavy flavor final states (if the chain allows the handling of negative weights). This opens up additional applications, such as cross sections for hadron-level heavy flavor jets, with hadron to parton-level corrections fully consistent with the NLO approach. So far, LO+PS Monte Carlos needed to be used for this purpose.
Examples for potential applications in the near future include • evaluation of parton to hadron-level corrections for measurements of the charm fragmentation function at HERA [22,23]; • evaluation of NLO cross sections for measured µµjet-jet and µe-jet-jet final states from both charm and beauty [24,25], for which no NLO predictions exist so far; • reevaluation and verification of NLO predictions for essentially all earlier HERA heavy flavor results [1,2] at visible level.
These applications will not obliviate the need for calculations using the MC@NLO approach, which will be able to handle final state parton showering in addition. However, they have the virtue of being available immediately.

Conclusions
Cross sections for heavy quark production in ep collisions at HERA are being measured with high precision. This includes channels with complex final states for which NLO QCD predictions are not easily obtained from simple extensions to parton level calculations. The FMNR⊗Pythia interface allows such predictions to be obtained for the photoproduction regime.
In the ep → bbX → D * µX ′ channel, both at visible and quark level, the measured data at ZEUS exceed the FMNR⊗Pythia NLO prediction, but are compatible within the errors. It was also found that the H1 and ZEUS visible cross sections are consistent.
The almost constant data to NLO ratio obtained from the cross sections shows that the extrapolation from visible to quark level, or vice versa, is meaningful and reliable. Inclusive and differential cross sections in the ep → bbX → µ + µ − X ′ channel are evaluated, which can be compared to ZEUS measurements, currently being finalized. Other potential applications to both charm and beauty measurements in ep and γp interactions have been outlined.