HepMC GenParticles contain the PDG ID and a status code. These are expected to match the conventions of the PDG numbering scheme, HEPEVT status codes, and 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 will be 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 has been noted that several methods return a const copy instead of a reference. The code will be modified to return a const references in these cases. This change should be backwards compatible.
Affected methods:
It has been agreed that HepMC should support gcc compilers with arbitrary names. Providing this support appears to require using libtool along with autoconf and automake. How this impacts support for Windows VC is still undetermined. One way or another, HepMC will build both with arbitrary "gcc" compilers and on Windows with Visual C++.
The examples have grown unwieldy and need to be cleaned up. This is a low priority problem and may be deferred to the 2.05 release.
IO_GenEvent (and also the deprecated IO_Ascii and IO_ExtendedAscii) has a constructor which takes const char* filename as an argument. This constructor is supplied for historical convenience, but we will change the argument to const std::string&, which is backwards compatible. We presume that users would prefer the stream constructors. Since IO_Ascii and IO_ExtendedAscii are deprecated, they will not be changed. Use of IO_Ascii and IO_ExtendedAscii is strongly discouraged. IO_GenEvent will read files written by either method.
IO_GenEvent constructors:
At present, HepMC does not contain any information about the units of the momentum and position vectors. The user is charged with knowing what units are being used. This makes it difficult to share generated events. We propose adding two data members, MomentumUnits and PositionUnits, to GenEvent.
The enum definitions below are encapsulated within the MomentumUnits and PositionUnits classes. The classes also provide a number of useful methods, including a method to return a conversion factor to be used by GenEvent when changing unit representations. Which units would be most useful is a matter for discussion. We know of code now which uses MeV, GeV, mm, and cm. However, it would be unwise to limit the code to just 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. If there is no unit information in the persistent GenEvent object, then the units are "unknown" and must be set by the user. Also, by default, units are "unknown" if not explicitly specified. This is because different experiments use different default units.
enum HepMCmomentumUnits { unknown = 0, ev, keV, MeV, GeV, TeV }; enum HepMCpositionUnits { unknown = 0, mm, cm, meter }; // reading input from old data files which do not specify the units
// here we specify the units
if( evt->set_momentum_units(HepMC::MomentumUnits::MeV) ) { ... }
if( evt->set_position_units(HepMC::PositionUnits::mm) ) { ... }
// units are known, but we want different units
if( evt->convert_momentum_units( HepMC::MomentumUnits::MeV ) ) { ... }
if( evt->convert_position_units( HepMC::MomentumUnits::cm ) ) { ... }
// print a particle mass with units
// HepMC::GenEvent* evt
// HepMC::GenParticle* p
os << "mass " << p->momentum().m() << " " << evt->momentum_units().name() << std::endl;
const MomentumUnits& momentum_units( ) const; const PositionUnits& position_units( ) const; void write_units( std::ostream & os = std::cout ) const; // The following set units methods are designed to be used if // and only if the units have not already been declared. // To change an existing unit designation, and perform the desired // conversion, call the appropriate convert units method. // set_xxx_units will fail if the units are already defined // units default to "unknown" if not defined bool set_momentum_units( MomentumUnits::HepMCmomentumUnits ); bool set_position_units( PositionUnits::HepMCpositionUnits ); // declare both position and momentum units with one call // set_units will fail if the either set of units has already been declared bool set_units( MomentumUnits::HepMCmomentumUnits, PositionUnits::HepMCpositionUnits ); // these methods are for convenience // strings must match the enum names exactly bool set_momentum_units( std::string& ); bool set_position_units( std::string& ); // convert_xx_units will fail if the units are "unknown" // convert_xx_units will succeed, but take no action if you are converting // to the same units as presently declared // otherwise, convert_xx_units will perform the conversion and // also change the unit designation // this is meant to be a one time operation bool convert_momentum_units( MomentumUnits::HepMCmomentumUnits ); bool convert_position_units( PositionUnits::HepMCpositionUnits );