In the present paper, we provide an addendum to improve the efficiency of generating unweighted events within PYTHIA environment for the generator BCVEGPY2.1 [C.H. Chang, J.X. Wang, X.G. Wu, Comput. Phys. Commun. 174 (2006) 241]. This trick is helpful for experimental simulation. Moreover, the BCVEGPY output has also been improved, i.e. one Les Houches Event common block has been added so as to generate a standard Les Houches Event file that contains the information of the generated meson and the accompanying partons, which can be more conveniently used for further simulation. New version program summary: Title of program: BCVEGPY2.1a Catalogue identifier: ADTJ_v2_2 Program summary URL: http://cpc.cs.qub.ac.uk/summaries/ADTJ_v2_2.html Program obtained from: CPC Program Library, Queenʼs University, Belfast, N. Ireland Licensing provisions: Standard CPC licence, http://cpc.cs.qub.ac.uk/licence/licence.html No. of lines in distributed program, including test data, etc.: 166 133 No. of bytes in distributed program, including test data, etc.: 1 655 390 Distribution format: tar.gz Programming language used: FORTRAN 77/90 Computer: Any LINUX based on PC with FORTRAN 77 or FORTRAN 90 and GNU C compiler as well Operating systems: LINUX RAM: About 2.0 MB Classification: 11.2, 11.5 Catalogue identifier of previous version: ADTJ_v2_1 Reference in CPC: Comput. Phys. Commun. 175 (2006) 624 Does the new version supersede the old program: No Nature of physical problem: Hadronic Production of meson and its excited states Method of solution: To generate weighted and unweighted events within PYTHIA environment effectively. Restrictions on the complexity of the problem: Hadronic production of ()-quarkonium via the gluon–gluon fusion mechanism are given by the ‘complete calculation approach’. The simulation of events is done within PYTHIA environment. Reasons for new version: More and more data are accumulated at the large hadronic collider, it would be possible to make precise studies on meson properties, such as its lifetime, mass spectrum and etc. The BCVEGPY has been adopted by several experimental groups due to its high efficiency in comparison to that of PYTHIA. However, to generate unweighted events with PYTHIA inner mechanism as programmed by the previous version is still time-consuming. So it would be helpful to improve the efficiency for generating unweighted events within PYTHIA. Moreover, it would be better to use an uniform and standard output format for further detector simulation. Typical running time: Typical running time is machine and user-parameters dependent. I) To generate 106 weighted S-wave ()-quarkonium events (IDWTUP=3), it will take about 40 minutes on a 1.8 GHz Intel P4-processor machine. II) To generate unweighted S-wave ()-quarkonium events with PYTHIA inner structure (IDWTUP=1), it will take about 20 hour on a 1.8 GHz Intel P4-processor machine to generate 1000 events. III) To generate 106 unweighted S-wave ()-quarkonium events with the present trick (IDWTUP=1), it will take 17 hour on a 3.16 Hz Intel E8500 processor machine. Moreover, it can be found that the running time for the P-wave ()-quarkonium production is about two times longer than the case of S-wave production under the same conditions. Keywords: Event generator; Hadronic production; meson; Unweighted events Summary of revisions: (1) The generator BCVEGPY [1–3] has been programmed to generate events under PYTHIA environment [4], which has been frequently adopted for theoretical and experimental studies, e.g. Refs. [5–18]. It is found that each experimental group shall have its own simulation software architecture, and the users will spend a lot of time to write an interface so as to implement BCVEGPY into their own software. So it would be better to supply a standard output. The LHE format becomes a standard format [19], which is proposed to store process and event information from the matrix-element-based generators. The users can pass these parton-level information to the general event generators like PYTHIA and HERWIG [20] for further simulation. For such purpose, we add two common blocks in genevent.F. One common block is called as bcvegpy_pyupin and the other one is write_lhe. The bcvegpy_pyupin, which is similar to PYUPIN subroutine in PYTHIA, stores the initialization information in the HEPRUP common block. INTEGER MAXPUP PARAMETER (MAXPUP=100) INTEGER IDBMUP,PDFGUP,PDFSUP,IDWTUP,NPRUP,LPRUP DOUBLE PRECISION EBMUP,XSECUP,XERRUP,XMAXUP COMMON/HEPRUP/IDBMUP(2),EBMUP(2),PDFGUP(2),PDFSUP(2), &IDWTUP,NPRUP,XSECUP(MAXPUP),XERRUP(MAXPUP), &XMAXUP(MAXPUP),LPRUP(MAXPUP) The write_lhe, which is similar to PYUPEV subroutine in pythia, stores the information of each separate event in the HEPEUP common block. INTEGER MAXNUP PARAMETER (MAXNUP=500) INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP, &SPINUP COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP, &IDUP(MAXNUP),ISTUP(MAXNUP),MOTHUP(2,MAXNUP), &ICOLUP(2,MAXNUP),PUP(5,MAXNUP),VTIMUP(MAXNUP), &SPINUP(MAXNUP) The above information can be separately exported to two files ‘bcvegpy.init’ and ‘bcvegpy.evnt’. Then with the help of the PYTHIA subroutine PYLHEF, we can combine these two files into a single LHE file ‘bcvegpy.lhe’. (2) As for previous version of BCVEGPY [1–3], its main concern is to improve theoretical estimations, i.e. to obtain a precise result as fast as possible. For the purpose, the VEGAS [21] running together with IDWTUP=3 is usually appreciated. Firstly, by running VEGAS, one can obtain a sampling importance function, and then the phase-space points are generated according to the relative importance of their corresponding differential cross-sections. This sampling importance function is useful, since the integrand for the phase space integration can be regularized for obtaining a high precision total/differential cross section [21]. Secondly, by setting IDWTUP=3, all parton-level events when input to PYTHIA shall always be accepted, i.e. almost all the calculated points are effective ones and shall be evolved as final events. As a combination of these two choices, one can generate events within the so-called importance sampling approach, i.e. the parton-level events have been effectively input into PYTHIA with proper weighted phase space. This is one of the reasons why BCVEGPY runs so fast. Experimentally, it is the unweighted inputs other than the weighted inputs that are usually needed. By default BCVEGPY generates unweighted events following the same scheme of PYTHIA. For the purpose, one has to set PYTHIA parameter IDWTUP=1, then all events in a run are treated on an equal footing. And the parton-level events are uniformly generated within the whole phase space, but with a weight (XWGTUP) when input to PYTHIA, and then these events are accepted or rejected with probability XWGTUP/XMAXUP (XMAXUP is the maximum weight of the process). As most of the calculated parton-level events are rejected by this criteria, such a naive scheme is usually time-consuming. For example, by setting IDWTUP=1, it takes about 20 hours on a 1.8 GHz Intel P4-processor machine to generate 1000 events. It is too slow if one wants to simulate a large amount of events. Here, we present a new scheme to improve the efficiency of generating unweighted events within PYTHIA environment. For the purpose, we first unweight the events by using the standard hit-and-miss technique [22]. Then, we set IDWTUP=1, but we replace XMAXUP to be a reference weight that can be generated by earlier exploratory run. Each parton-level event shall result in a ratio between the weight XWGTUP to the reference weight. When such ratio is smaller than one, the event shall be retained or rejected based on whether the ratio is greater or less than the return value of random number generating function PYR(0). When the ratio is larger than one, its integral part stands for the basic number the same events to be generated. And the basic number shall be increased by one or unchanged based on whether its decimal part is greater or less than a random number PYR(0). It is found that a larger reference weight means more events to be rejected and less efficiency. So, to set a proper reference weight is a tricky problem, which requires exploratory running under oneʼs own experimental cuts and should have negligible derivation from theoretical estimations. For example, one may observe that for ATLAS transverse momentum cut and the rapidity cut , only few eventsʼ weight are larger than the value of 106 pb. So we can set this valve as the reference weight, which is reasonable for the LHC production simulation. The code for the newly suggested unweighted scheme is put in the main program ‘bcvegpy.F’. As a cross check, we present the weighted and unweighted transverse momentum -distribution and pseudo-rapidity η-distribution in Fig. 1, which are represented by solid line and dotted lines respectively. The unweighted distributions are obtained by setting IDWTUP=1 and using the new strategy described above, while the weighted distributions are obtained by setting IDWTUP=3. It can be found that the weighted and unweighted distributions coincide with each other. Since the new unweighted scheme is time-saving in comparison with that of the previous one, so it can be adopted for generating large amount of events, which may suit the needs of the newly accumulating data at LHC. Moreover, to compare and validate the result of BCVEGPY, we also use PYTHIAʼs inner mechanism to generate meson at the very beginning. For such purpose, we set MSEL=5 to generate first, and then add one filter (PDGID=541) that searches and stores every event that shall result in at least one meson. Next, we use the external decay generator EVTGEN [23], which can be running under the PYTHIA environment, to simulate the decay channel . The remaining parameters for PYTHIA are taken to be their default values. Moreover, in doing the calculation, we set the collision energy of LHC to be the present value of 7 TeV. The comparison is presented in Fig. 2, which shows that the normalized distributions for PYTHIA and BCVEGPY agree with each other well. Such an observation also agrees with the previous conclusion drawn by Ref. [12]. Display Omitted Display Omitted References: [ [1]] C.-H. Chang, C. Driouich, P. Eerola, X.-G. Wu, Comput. Phys. Commun. 159 (2004) 192. [ [2]] C.-H. Chang, J.-X. Wang, X.-G. Wu, Comput. Phys. Commun. 174 (2006) 241. [ [3]] C.-H. Chang, J.-X. Wang, X.-G. Wu, Comput. Phys. Commun. 175 (2006) 624. [ [4]] T. Sjostrand, S. Mrenna, P. Skands, JHEP 0605 (2006) 026. [ [5]] C.H. Chang, X.G. Wu, Eur. Phys. J. C 38 (2004) 267. [ [6]] C.H. Chang, J.X. Wang, X.G. Wu, Phys. Rev. D 70 (2004) 114019. [ [7]] N. Brambilla, et al., Quarkonium Working Group Collaboration, hep-ph/0412158. [ [8]] C.H. Chang, C.F. Qiao, J.X. Wang, X.G. Wu, Phys. Rev. D 71 (2005) 074012. [ [9]] C.H. Chang, C.F. Qiao, J.X. Wang, X.G. Wu, Phys. Rev. D 72 (2005) 114009. [[10]] J.W. Zhang, et al., Phys. Rev. D 79 (2009) 114012. [[11]] N. Brambilla, et al., Quarkonium Working Group Collaboration, Eur. Phys. J. C 71 (2011) 1534. [[12]] S.H. Zhang, A.A. Belkov, S. Shulga, G.M. Chen, Chin. Phys. Lett. 21 (2004) 2380. [[13]] P. Eerola, AIP Conf. Proc. 722 (2004) 242. [[14]] A. Abulencia, et al., CDF Collaboration, Phys. Rev. Lett. 96 (2006) 082002. [[15]] A. Abulencia, et al., CDF Collaboration, Phys. Rev. Lett. 97 (2006) 012002. [[16]] W.X. Meng, Chin. Phys. C 32 (2008) 83. [[17]] Y.N. Gao, et al., Chin. Phys. Lett. 27 (2010) 061302. [[18]] J. He, for the LHCb Collaboration, arXiv:1001.5370 [hep-ex]. [[19]] J. Alwall, et al., Comput. Phys. Commun. 176 (2007) 300. [[20]] G. Corcella, et al., hep-ph/0210213; M. Bahr, et al., Eur. Phys. J. C 58 (2008) 639. [[21]] G.P. Lepage, J. Comp. Phys. 27 (1978) 192. [[22]] M. Dobbs, M. Lefebvre, Phys. Rev. D 63 (2001) 053011. [[23]] A. Ryd, et al., EvtGen: A Monte Carlo Generator for B-Physics, EVTGEN-V00-11-07, 2005. [ABSTRACT FROM AUTHOR]