The technical discussion of the original proposal can be found in support #103814. The official release has only minor changes from these notes.
HepMC GenParticles contain the PDG ID and a status code. These are expected to match the conventions of the PDG numbering scheme and the HEPEVT status codes. In addition, pdf information is expected to match LHAPDF. However, HepMC does not enforce these conventions.
There has been confusion about whether f(x) or x*f(x) should be stored in PdfInfo. It is agreed that x*f(x) should be stored and the documentation (and code documentaion) will make this clear. Also, two new integer data members have been added, one for each beam, to store the unique pdf set id (which is the integer that appears in the first column of the table: PDFsets).
int pdf_id1() const;
int pdf_id2() const;
void set_pdf_id1(const int&);
void set_pdf_id2(const int&); PdfInfo( int i1, int i2, double x1, double x2, double q,
double p1, double p2, int lh1 = 0, int lh2 = 0);
When possible, it is more efficient to return complex objects by reference rather than by value (e.g., making a copy). It was noted that several methods returned a const copy instead of a reference. The code was modified to return a const reference in these cases. This change should be backwards compatible.
Affected methods:
HepMC now supports gcc compilers with arbitrary names. This was accomplished by using libtool along with autoconf and automake. Using libtool should be helpful for all GNU compilers.
Unfortunately, the use of libtool is not compatible with Visual C++. Therefore, the Windows VC build uses separate makefiles (VCMakefile). These custom makefiles are invoked automatically if you configure with CXX=cl. This also allowed us to remove extraneous warning messages caused by unsupported compiler flags. See Readme.cygwin for more info about the Windows build.
The examples had grown unwieldy and were cleaned up. The most noticeable change is that a number of separate examples are now subsets of example_MyPythia.cc.
IO_GenEvent had a constructor which took const char* filename as an argument. This constructor is supplied for historical convenience, but the argument has been changed to const std::string&, which is backwards compatible. We presume that users would prefer the stream constructors.
IO_Ascii has a similar constructor, but since this class is deprecated, the constructor was not changed. Use of IO_Ascii is strongly discouraged. IO_GenEvent will read files written by either method.
IO_ExtendedAscii, which was introduced in 1.28.00, has been removed. IO_Ascii will be removed in the 2.05.00 release, tentatively scheduled for spring of 2009.
IO_GenEvent constructors:
Historically, HepMC did not contain any information about the units of the momentum and position vectors. The user was charged with knowing what units were being used, which made it difficult to share generated events. Two data members, MomentumUnit and LengthUnit have been added to GenEvent.
The enum definitions below are encapsulated within the HepMC::Units namespace. The HepMC::Units namespace also contains a number of useful methods, including a method to return a conversion factor used by GenEvent when changing unit representations. We know of code now which uses MeV, GeV, mm, and cm and provide enums for these units.
We expect the user to convert units once, immediately after getting a new GenEvent object. This conversion would be done only if necessary. The methods are designed to encourage this use case. Although it would be possible to provide methods returning, say, the momentum in some units, that would encourage the user to convert on the fly, which is very inefficient.
No existing HepMC data has unit information. Further, the LCG experiments use different unit conventions. To allow users to specify default units which match their convention, configure now accepts --with-momentum and --with-length switches. Both momentum and length MUST be specified when configuring or the code will not compile.
enum MomentumUnit { MEV, GEV };
reference as HepMC::Units::MEV enum LengthUnits { MM, CM };
reference as HepMC::Units::MM // declare and/or change the units // momentum and/or position vectors will be scaled if either unit designation is a change evt->use_units(HepMC::Units::MEV, HepMC::Units::MM); // print a particle mass with units // HepMC::GenEvent* evt // HepMC::GenParticle* p os << "mass " << p->momentum().m() << " " << HepMC::Units::name(evt->momentum_unit()) << std::endl;
// constructor requiring units - all other arguments can be default
GenEvent( Units::MomentumUnit, Units::LengthUnit,
int signal_process_id = 0, int event_number = 0,
GenVertex* signal_vertex = 0,
const WeightContainer& weights = std::vector(),
const std::vector& randomstates = std::vector() );
// explicit constructor with units first that takes HeavyIon and PdfInfo
GenEvent( Units::MomentumUnit, Units::LengthUnit,
int signal_process_id, int event_number,
GenVertex* signal_vertex, const WeightContainer& weights,
const std::vector& randomstates,
const HeavyIon& ion, const PdfInfo& pdf );
Units::MomentumUnit momentum_unit( ) const;
Units::LengthUnit length_unit( ) const;
// declare units using enums
// if the declared unit is different than the existing unit declaration,
// the appropriate data members will be scaled
void use_units( Units::MomentumUnit, Units::LengthUnit );
// this method is for convenience
// strings must match the enum names exactly
void use_units( std::string&, std::string& );
void write_units( std::ostream & os = std::cout ) const;
GenEvent& convert_units(GenEvent & evt, Units::MomentumUnit m, Units::LengthUnit l);