Online monitoring of the center-of-mass energy from real data at BESIII

Data Quality Monitoring system (DQM) was developed to monitor data quality at BESIII experiment in real time. The stable center-of-mass energy (Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document}) is essential for the data taking. Online monitoring the Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} can help find the beam energy shift in time. The purpose is to monitor the Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} in DQM system in real time. The Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} is measured using Bhabha scattering process in DQM system, due to its large cross section and low background level. The Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} is calculated from the invariant mass of e+e-\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$e^{+}e^{-}$$\end{document}, and the correction value from radiation effect and momentum calibration. The Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} calculated with DQM system shows a good consistency with that from offline reconstruction within error. The results are validated with data taken in 2013. The overall systematic uncertainty includes 0.39 MeV/c2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$^2$$\end{document} from signal extraction and 2.54 MeV/c2\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$^2$$\end{document} from calibration and radiation correction. The Ecms\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$E_\mathrm{cms}$$\end{document} calculated from Bhabha scattering process is now available on DQM system in real time, which can be used as references for researchers to operate BESIII experiment.


Introduction
BESIII experiment is operating at the Beijing Electron Positron Collider (BEPCII) in the Institute of High Energy Physics (IHEP) of the Chinese Academy of Sciences, Beijing. With the peak luminosity of 1×10 33 cm −2 s −1 , BESIII experiment has collected many the world's largest samples of e + e − collision data at different energy points in the τ -charm energy region [1].
The BESIII detector is a magnetic spectrometer [2] located at the Beijing Electron Positron Collider (BEPCII) [3]. The cylindrical core of the BESIII detector consists of a heliumbased multilayer drift chamber (MDC), a plastic scintillator time-of-flight system (TOF), and a CsI(Tl) electromagnetic calorimeter (EMC), which are all enclosed in a superconducting solenoidal magnet providing a 1.0 T magnetic field. The solenoid is supported by an octagonal flux-return yoke with resistive plate counter muon identifier modules interleaved with steel. The acceptance of charged particles and photons is 93% over 4π solid angle. The charged-particle momentum resolution at 1 GeV/c is 0.5%, and the dE/dx resolution is 6% for the electrons from Bhabha scattering. The EMC measures photon energies with a resolution of 2.5% (5%) at 1 GeV in the barrel (end cap) region. The time resolution of the TOF barrel part is 68 ps, while that of the end cap part is 110 ps. The end cap TOF system is upgraded in 2015 with multi-gap resistive plate chamber technology, providing a time resolution of 60 ps.
To monitor the data quality with high accuracy in real time, Data Quality Monitoring system (DQM) has been developed [4,5]. After reconstructing part of real data, which is taken randomly from online data flow, the monitored results of the detector status and data quality will be available.
The stable center-of-mass energy (E cms ) is essential for the data taking. The nominal beam energy given by BEPCII is calculated from the magnetic field and the current intensity, which is affected by multiple time-dependent factors. Therefore, there is usually a difference between real E cms and the nominal beam energy, which is needed to be determined. Online measurement of the E cms helps to adjust the beam energy to certain value. The Beam Energy Measurement System (BEMS), which was installed in 2008, was designed to measure the beam energy with a relative systematic uncertainty of 2 × 10 −5 based on the Compton back-scattered photons [6]. However, it always takes a few days for the system to initiate before putting into use. Therefore, we need another methods, if it needs to obtain the E cms in short time after BESIII detector starting in operation.
In this paper, E cms is measured using Bhabha scattering process. The E cms is expressed as where M(e + e − ) is the invariant mass of e + e − , and ΔM cor is the mass correction caused by the effects including momentum calibration, multiple scattering, bremsstrahlung, and final state radiation from Bhabha scattering process. In this analysis, ΔM cor is estimated using simulations of Bhabha process with turning these effects on and off by BABAYAGA 3.5 event generator [7]. The detector geometry, material description and the tracking of the decay particles through the detector including interactions are handled by GEANT4 package [8].

Measuring E cms using dimu and Bhabha processes
The E cms is usually measured using dimu process in the offline environment [9] with fully reconstructed data set. The reason of using dimu process rather than Bhabha process in the offline environment is the radiation effect of Bhabha process is more complex. DQM system also provides the E cms measurements using dimu process. The E cms was obtained from the fitting of the invariant mass of μ + μ − , M(μ + μ − ) run by run. The period of time of a typical run is about 1 hour in the previous BESIII detector running.
The fitted E cms in DQM system for several runs is shown in Fig. 1. The distribution of M(μ + μ − ) is fitted with Gaussian function. The average value of these runs is 3872.90 ± 0.19 MeV/c 2 . While the statistical uncertainty of each run is about 1-2 MeV/c 2 , which could not meet the accuracy requirement of online monitoring. Because of the low cross section of dimu process and the partially reconstruction mechanism on DQM[4] [5], only hundreds of events are successfully reconstructed for a typical run, which leads to the high statistical uncertainty of the E cms fitting result.
To get a more accurate result in the limited time, Bhabha scattering process is another choice. The cross section of Bhabha process is almost hundreds of times larger than that of dimu process, which could obtain much more events in the same time interval, and hence much less statistical uncertainty. Bhabha event candidates are required to two charged tracks reconstructed in MDC with opposite charge. Each charged track is required to pass the interaction point within ±10 cm in the beam direction and within ±1 cm in the perpendicular plane. Polar angle of each charged tracks should satisfy |cosθ | < 0.83 to ensure the good consistency between data and MC. The energy deposited in the EMC of each track is required to be greater than 0.65× E beam , where E beam is the beam energy. To select back-to-back tracks in MDC, |Δθ | ≤ 6 • and |Δφ| ≤ 6 • are required, where Δθ and Δφ are the polar angle and azimuthal angle of two tracks.
The background level is about 10 −5 using MC samples of e + e − → (γ )μ + μ − , e + e − → γ γ , and e + e − → qq processes with the event selection criteria, which is negligibly small.
The result of M(e + e − ) is shown in Fig. 2. Signal shape is described by the sum of Gaussian and Crystal Ball function [10] with common mean and sigma. Background is described by 1 st Chebyshev polynomials. The average value To calculate the E cms with flexibility, it is necessary to weigh the time interval between two measurements and the number of events obtained in the interval. The system would collect small number of events in a short time interval, which leads to high statistical uncertainty of the measurement. We checked the statistical uncertainty of each measurement under different number of events. Figure 3 shows the fitting result of each measurement with 5000, 20,000 and 50,000 events, respectively. The corresponding statistical uncertainty is about 0.8 MeV/c 2 , 0.4 MeV/c 2 , 0.2 MeV/c 2 ; therefore, 20000 events for each measurement are sufficient. In the current setting of DQM system, this would take about 15 minutes under regular data taking period. Although the statistical uncertainty of low statistical measurement is large, the error of average measurements in a certain time period, e.g., 1 day, is stable. This would allow operators to change the measurement frequency without worrying about losing the measurement accuracy in a long time period.

Radiation correction
The E cms in DQM system is measured using Bhabha process. The ISR/FSR effects and momentum calibration contribute to the mass shift of invariant mass using Bhabha process or dimu process respectively. In additional to those effects, the multiple scattering and bremsstrahlung effects also con- tribute to the measurement of E cms since the mass of electron is less than that of muon for Bhabha process. In this analysis, these effects are estimated with MC simulation using BABAYAGA 3.5 [7].
To estimate the radiation effects (including the multiple scattering, bremsstrahlung effect) from Bhabha process, MC samples with radiation effects turning on and off are generated. The M(e + e − ) with no radiation effects are fitted with Gaussian function, while those with radiation effects are fitted with the sum of Gaussian and Crystal Ball function with common mean and sigma for signal, and 1 st Chebyshev polynomials for background. The fit results are shown in Fig. 4a, b. The difference between the mean value is taken as ΔM Rad in the calculation of E cms .
To validate the results of Bhabha events with no radiation effects, dimu events with ISR/FSR turning off under the same E cms are also generated, and the M(μ + μ − ) is fitted with Gaussian function. The result is shown in Fig. 4c. The difference between the mean value in Fig. 4b, c is less than 0.1 MeV/c 2 and within error, which indicates that the method to obtain ΔM Rad from Bhabha events is reasonable.
The dependence of ΔM Rad on the center-of-mass energy is shown in Fig. 5 using the MC samples generated at a series CMS Energy(GeV) The resulting E cms -dependent ΔM Rad will be used to correct the measured M(e + e − ).

Momentum calibration
To measure the E cms more precisely, the momentum of electron needs to be validated. DQM system works in the online environment, and the measurements of momentum of charged tracks are performed with rough MDC calibration constants and with misalignment effect. A fine calibration and alignment study of MDC require an accumulation of events with high statistic which could not be satisfied in the online environment. The calibration constants used in DQM are often obtained from recent data and may not be good enough for the current data. The difference of the E cms due to the calibration constants will be treated as systematic uncertainty and will be discussed in chapter 7.
According to the Ref. [9], the muon momentum is validated with e + e − → γ ISR J /ψ and J /ψ → μ + μ − . Since muon and electron are both light lepton and have similar momentum in detector, the result of muon momentum validation can be applied on electron. The validation method is introduced below.
To get the momentum calibration correction value for a run interval, e.g., run 47543 to 48170, in which the CMS energy is 4190 MeV, MC sample from these run numbers with a series of input energy is produced. Figure 6 from Ref. [11] shows the difference of the fitting result of M(μ + μ − ) and the input energy. The red line is fitting result: y = (5.44 × 10 −4 ± 3.31 × 10 −5 )x − (0.11 ± 0.12)(MeV).
On the other hand, the mean value of M obs (μ + μ − ) for the processes: e + e − → γ ISR J /ψ and J /ψ → μ + μ − γ FSR can be obtained from real data samples. Due to the FSR effect, the measured M obs (μ + μ − ) is slightly lower than the nominal J /ψ mass. The mass shift ΔM FSR is estimated by MC simulation from the process e + e − → γ ISR J /ψ with FSR turning on and off. Thus the measured J /ψ mass from real data samples can be calculated as: Afterward, the difference between M obs (J /ψ) and the value of J /ψ mass from PDG can be obtained: ΔM = M obs (J /ψ) − M PDG (J /ψ). Then the momentum calibration correction value can be calculated from the function: where k is the slope of the fitting result in Fig. 6  where M(e + e − ) from offline data is shown in Fig. 7 [13], which is consistent with the calculation from Bhabha process.
To verify the method, MC with different input energy of Bhabha process is generated. The difference of E cms calculated from Eq. 5 and the input energy is shown in Fig. 8. The result shows the E cms is consistent with input energy within error, that means the method to calculate E cms is reliable.
To ensure the accuracy of the method, cross-check with data is performed. Figure 9 shows the corresponding fitting Input Energy(GeV) , and E cms from dimu process [9] and Bhabha process is listed in Table. 1. The momenta of muon and electron do not need to be corrected. The result indicates that E cms from both dimu and Bhabha processes is consistent within error, that means the method to obtain E cms from Bhabha events is reasonable and unbiased.

Algorithm deployment
The algorithm to obtain E cms from Bhabha events is deployed on the DQM system. DQM system invokes user-defined histogram-filling algorithm to fill histogram, including the histogram of invariant mass distribution of e + e − . The histograms are generated during data taking and stored in ROOT file after each run ends [4] [5][14]. Once a new root file is generated, E cms will be calculated and the result will be stored in the DQM databases for further studied. Figure 10 shows the E cms in DQM system from several runs. Since the momentum validation cannot be done on DQM system, the correction value is estimated from most recent result or during data taken. Here 2.5 MeV is taken as the correction value of momentum calibration for data obtained in 2018-2019. As shown in Fig. 13, the E cms calculated from DQM system and offline environment is around nominal J /ψ mass with 2.5 MeV as momentum correction value.

Systematic uncertainty
The systematic uncertainty of this analysis is contributed from the calculation of radiation correction, the fitting procedure of each measurement and the difference of momentum calibration constants.
The radiation correction of Bhabha event is E cms dependent and is calculated from MC samples. The standard deviation of the radiation correction value is given by where the ΔM Rad is the radiation correction value measured from MC simulation in Fig. 5 and ΔM Rad is the radiation correction value from fitting in Fig. 5. The uncertainty from signal extraction procedure is estimated by changing the fitting range and background shape. The uncertainty due to the fitting range is estimated by varying M(e + e − ) by 20 MeV/c 2 . The difference of mean value of M(e + e − ) in J /ψ data is about 0.32 MeV/c 2 and is shown in Fig. 11. The uncertainty due to the background shape is estimated by changing the order of Chebyshev polynomials from 1 st to 2 nd . The difference of mean value of M(e + e − ) in J /ψ data is about 0.23 MeV/c 2 and is shown in Fig. 12.
The uncertainty due to the calibration constants can be divided into two parts. The first one is the difference of E cms between DQM system and the offline environment, which is estimated by comparing the fitting result of the M(e + e − ) versus run number from J /ψ data sample taken in 2018 and 2019. The difference is about 0.75 MeV/c 2 , which is shown in Fig. 13. The second one is the difference of the momentum calibration correction value between different data samples. The momentum calibration correction value  The systematic uncertainties from signal extraction procedure affect each measurement of the E cms , while that from the difference of momentum calibration constants and radiation correction only has an effect when the calibration constants or E cms changes. For the data obtained at the same calibration constants and E cms , the systematic uncertainty is only coming from the first term. Table 2 lists all the systematic uncertainties that contribute to the E cms measurement, and the total systematic uncertainty is obtained by adding the individual contributions in quadrature. Because the effects of signal extraction procedure, radiation correction and calibration constants on the measurements are different, the total systematic uncertainty is calculated separately.    Since the value of calibration constants and hence the momentum correction value changes with different time period of data sample, the uncertainty can hardly be estimated clearly and their value is just roughly given in Table 2.

Summary
The center-of-mass energy can be measured in real time during data taking using Bhabha process from DQM system. The statistical uncertainty is much lower than that used to be done on dimu process, and the overall systematic uncertainty is about 0.39 MeV/c 2 from signal extraction and 2.54 MeV/c 2 from calibration and radiation correction, which is good enough for monitoring during data taking. The method is validated by dimu process from the data reconstructed in the offline environment. The algorithm has already been deployed on DQM system and achieved satisfied result, which is essential for monitoring the center-of-mass energy in BESIII in realtime.