hepmc

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/trunk @ 388  →  /trunk @ 389
/trunk/ChangeLog
@@ -4,6 +4,14 @@
* HepMC/SimpleVector: remove FourVector::mag() and ThreeVector::mag()
Change test/testSimpleVector.cc and test/testMass.cc to reflect this.
 
* HepMC/HepMCDefs.h: New header containing HEPMC_HAS_UNITS and
similar macros so users can check for various code features.
HepMC/GenEvent.h includes HepMCDefs.h.
* HepMC/Version.h: Use new HEPMC_VERSION macro.
* HepMC/GenParticle: add is_undecayed(), has_decayed(), and is_beam_particle()
convenience methods. Test these methods in test/testHepMC.
 
2009-01-28 Lynn Garren
 
* remove HepMC/IO_Ascii.h and test/testDeprecated
New file
/trunk/HepMC/HepMCDefs.h
@@ -0,0 +1,53 @@
#ifndef HEPMC_DEFS_H
#define HEPMC_DEFS_H
// ----------------------------------------------------------------------
//
// HepMCDefs.h
// Author: Lynn Garren
//
// Define various useful macros
// Most allow users to check for various code features
//
// ----------------------------------------------------------------------
 
// the HeavyIon class is available in HepMC
#ifndef HEPMC_HAS_HEAVY_ION
#define HEPMC_HAS_HEAVY_ION
#endif
 
// the IO_Ascii class is NOT available in HepMC
#ifndef HEPMC_IO_ASCII_REMOVED
#define HEPMC_IO_ASCII_REMOVED
#endif
 
// the IO_GenEvent class is available in HepMC
#ifndef HEPMC_HAS_IO_GENEVENT
#define HEPMC_HAS_IO_GENEVENT
#endif
 
// the PdfInfo class is available in HepMC
#ifndef HEPMC_HAS_PDF_INFO
#define HEPMC_HAS_PDF_INFO
#endif
 
// HepMC uses SimpleVector (FourVector) to store momentum and position
#ifndef HEPMC_HAS_SIMPLE_VECTOR
#define HEPMC_HAS_SIMPLE_VECTOR
#endif
 
// units are defined in HepMC
#ifndef HEPMC_HAS_UNITS
#define HEPMC_HAS_UNITS
#endif
 
// the GenCrossSection class is available in HepMC
#ifndef HEPMC_HAS_CROSS_SECTION
#define HEPMC_HAS_CROSS_SECTION
#endif
 
// define the version of HepMC.
#ifndef HEPMC_VERSION
#define HEPMC_VERSION "2.04.01"
#endif
 
#endif // HEPMC_DEFS_H
/trunk/HepMC/GenEvent.h
@@ -126,6 +126,7 @@
#include "HepMC/HeavyIon.h"
#include "HepMC/PdfInfo.h"
#include "HepMC/Units.h"
#include "HepMC/HepMCDefs.h"
#include <map>
#include <string>
#include <vector>
/trunk/HepMC/Version.h
@@ -11,6 +11,7 @@
 
#include <string>
#include <iostream>
#include "HepMC/HepMCDefs.h"
 
namespace HepMC {
 
@@ -20,7 +21,7 @@
 
inline std::string versionName( )
{
return "2.04.01";
return HEPMC_VERSION;
}
 
inline void version( )
/trunk/HepMC/GenParticle.h
@@ -121,6 +121,15 @@
/// event has a unique barcode. Particle barcodes are positive numbers,
/// vertex barcodes are negative numbers.
int barcode() const; //!< particle barcode
/// Convenience method. Returns true if status==1
bool is_undecayed() const;
/// Convenience method. Returns true if status==2
bool has_decayed() const;
/// Convenience method. Returns true if status==4
/// Note that using status 4 for beam particles is a new convention which
/// may not have been implemented by the code originating this GenEvent.
bool is_beam() const;
 
/////////////////////
// mutator methods //
@@ -224,6 +233,16 @@
 
inline void GenParticle::set_barcode_( int bc ) { m_barcode = bc; }
 
inline bool GenParticle::is_undecayed() const {
return ( m_status==1 ) ? true : false;
}
inline bool GenParticle::has_decayed() const {
return ( m_status==2 ) ? true : false;
}
inline bool GenParticle::is_beam() const {
return ( m_status==4 ) ? true : false;
}
 
} // HepMC
 
#endif // HEPMC_GEN_PARTICLE_H
/trunk/HepMC/Makefile.am
@@ -39,4 +39,4 @@
TempParticleMap.h \
Units.h \
Version.h \
defs.h
HepMCDefs.h
/trunk/HepMC/VCMakefile.in
@@ -71,7 +71,7 @@
TempParticleMap.h \
Units.h \
Version.h \
defs.h
HepMCDefs.h
 
all: defs.h
$(MAKE) $(AM_MAKEFLAGS) all-am