Commit ad2bd1a8 authored by Lynn Garren's avatar Lynn Garren
Browse files

begin integrating HepMC 1.24

parent 05f42758
......@@ -235,8 +235,7 @@ namespace HepMC {
inline void GenParticle::set_momentum( const CLHEP::HepLorentzVector& vec4 )
{ m_momentum = vec4; }
inline void GenParticle::set_pdg_id( int id )
{ m_pdg_id = id; }
inline void GenParticle::set_pdg_id( int id ) { m_pdg_id = id; }
inline void GenParticle::set_status( int status ) { m_status = status; }
......
......@@ -5,6 +5,8 @@ pkgincludedir = $(prefix)/include/CLHEP/@PACKAGE@
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(pkgincludedir)/include
$(INSTALL_DATA) $(srcdir)/HerwigWrapper.h $(DESTDIR)$(pkgincludedir)/include/HerwigWrapper.h
$(INSTALL_DATA) $(srcdir)/HerwigWrapper6_4.h $(DESTDIR)$(pkgincludedir)/include/HerwigWrapper6_4.h
$(INSTALL_DATA) $(srcdir)/PythiaWrapper.h $(DESTDIR)$(pkgincludedir)/include/PythiaWrapper.h
$(INSTALL_DATA) $(srcdir)/PythiaWrapper5_720.h $(DESTDIR)$(pkgincludedir)/include/PythiaWrapper5_720.h
$(INSTALL_DATA) $(srcdir)/PythiaWrapper6_152.h $(DESTDIR)$(pkgincludedir)/include/PythiaWrapper6_152.h
......
......@@ -9,10 +9,10 @@
// with MS Visual C++, which interfaces to fortran in a different manner.
// For it to work you need to define the _WIN32 variable when compiling.
#ifdef _WIN32 // Platform: Windows MS Visual C++
#include "PythiaWrapper6_152_WIN32.h"
#include "CLHEP/HepMC/include/PythiaWrapper6_152_WIN32.h"
#else // Generic version, tested on Linux ecgs/gcc
#include "PythiaWrapper6_152.h"
#include "CLHEP/HepMC/include/PythiaWrapper6_152.h"
#endif // Platform
......
......@@ -140,7 +140,7 @@ extern "C" {
// A simple example of calling Pythia from C++ using this header file:
// (compiling instructions are given after the example)
//--------------------------------------------------------------------------
// #include "PythiaWrapper5_720.h"
// #include "CLHEP/HepMC/include/PythiaWrapper5_720.h"
// main() {
// // init the PYDATA block data as external by calling
// initpydata();
......
-------------------- CLHEP_1_900 --------------------
2003-09-24 Lynn Garren <garren@fnal.gov>
integrating changes from HepMC 1.24 into CLHEP/HepMC
-------------------- HepMC-01-02-14 ----(gcc 3.2 compatible)---------
2003-04-21 Matt Dobbs <Matt.Dobbs@Cern.CH>
* src/IO_HERWIG.cxx:
minor changes to handling of herwig event record
-------------------- HepMC-01-02-11 ----(gcc 3.2 compatible)---------
2003-03-10 Matt Dobbs <Matt.Dobbs@Cern.CH>
* HepMC/IO_BaseClass.h:
Fixed bug reported by Peter Loch, wherein the virtual destructor
for IO_BaseClass was missing.
-------------------- HepMC-01-02-10 ----(gcc 3.2 compatible)---------
2003-03-03 Matt Dobbs <Matt.Dobbs@Cern.CH>
* HepMC/GenVertex.h: added extra ifdef statement to allow
compilation on gcc 3.2. (forward_iterator and open_mode problems).
* HepMC/IO_Ascii.h: as above.
* src/IO_Ascii.cxx (HepMC): as above.
2003-01-17 Matt Dobbs <Matt.Dobbs@Cern.CH>
* src/IO_PDG_ParticleDataTable.cxx (HepMC): if the PDG table does
not exist, we abort, rather than just returning false.
-------------------- HepMC-01-02-04 ----(5.0.0)------------
2002-11-04 Matt Dobbs <Matt.Dobbs@Cern.CH>
* src/GenEvent.cxx (HepMC): set_barcode(particle, barcode),
set_barcode(vertex, barcode) Fixed a bug reported by Giorgos S.
For this bug, a user suggests a barcode for a vertex that is
already part of an event... the vertex is inserted in the vertex
map with the new barcode, but HepMC forgets to erase the old
entry... such that the vertex now appears twice in the map. This
is fixed, and the corresponding error for particles is also fixed.
2002-10-31 Matt Dobbs <Matt.Dobbs@Cern.CH>
* HepMC/IO_HERWIG.h: modified IO_HERWIG to include a switch
(default m_no_gaps_in_barcodes=on) which removes null entries from
Herwig HEPEVT and reshuffles the common block
2002-10-22 Matt Dobbs <Matt.Dobbs@Cern.CH>
* HepMC/HerwigWrapper6_4.h, HepMC/HerwigWrapper.h: new interface
to HERWIG Version 6.4 is added. There is an example for using it
at examples/example_MyHerwig.cxx. To use this example you will
have to download HERWIG version 6.4 and modify the Makefile to
link it.
* HepMC/IO_HERWIG.h: New class for reading the Herwig version of
the HEPEVT common block is added. READ THE COMMENTS IN THE .h file
carefully before using it!
2002-07-29 Matt Dobbs <Matt.Dobbs@Cern.CH>
-------------------- HepMC-01-02-03 ----(4.0.2)------------
* src/GenVertex.cxx (HepMC): remove_particle()
* HepMC/GenVertex.h:
removed confusing comment about the use of GenVertex::remove_particle()
in .h file, and clarified the comment in .cxx file.
* src/GenEvent.cxx (HepMC): operator=
bug discovered by <Malte.Muller@cern.ch>.
Formerly, the GenEvent::operator= method relied on the particles
attached to each vertex to always be in the same order. However,
since the particles are stored in set<>, this is not always true
-- making the results of the operator= method unreliable.
This is fixed by mapping the vertices explicitly.
* src/IO_PDG_ParticleDataTable.cxx (HepMC):
added a line in read_entry that ignores empty lines (previously
empty lines in the pdg data table generated a cerr message).
This change was requested by Davida Costanzo.
2002-03-02 Matt Dobbs <Matt.Dobbs@Cern.CH>
-------------------- HepMC-01-02-02 ----(3.0.1)------------
* src/GenVertex.cxx (HepMC):
GenVertex::edge_iterator::edge_iterator( .. )
Extra error protection added in the constructor.
Sometimes the edge_iterator fails when we have a vertex with no
in_particles. This never happens in standalone mode, but when ran
with the ATLAS framework, it does happen. New code identifies the
scenario explicitly, and catches the error, which has to do with
the past-the-end value of the edge_iterator.
* test/test_iterators.cxx: new test program added for iterators,
to test for the above problems.
2002-02-19 Matt Dobbs <Matt.Dobbs@Cern.CH>
CHANGES TO ALLOW HEPMC TO COMPILE WITH SOLARIS CC 5.2
* cmt/requirements: added the line
macro_append cppflags "" Solaris " -D__SUNPRO_CC "
to handle Solaris CC 5.2 features.
* HepMC/ParticleDataTable.h:
turns on MISSING_FORWARD_ITERATOR when __SUNPRO_CC is defined.
This defines forward_iterator as iterator
* HepMC/GenVertex.h:
same as ParticleDataTable.h, but also turns on
NEED_SOLARIS_FRIEND_FEATURE when __SUNPRO_CC is defined.
* src/Polarization.cxx (HepMC):
replaced abs() with theta = ( theta>0 ? theta : -theta );
for compatibility with Solaris.
2002-02-15 Matt Dobbs <Matt.Dobbs@Cern.CH>
-------------------- HepMC-01-02-01 ----(3.0.0)------------
* HepMC/GenEvent.h: bug discovered by <srinir@bnl.gov> with help
from Paolo and Hong.
The GenEvent::particle_iterator, const_particle_iterator,
vertex_iterator, const_vertex_iterator
had methods like:
bool operator !=(const particle_iterator& a) const
{ return !(**this == *a); }
which doesn't work because you are not allowed to de-reference
the end() iterator [the above coding is a relic of the old
walking iterators which did not inherit from
forward_iterstor, and for which *end() was well
defined.]
The correct usage is:
{ return m_map_iterator == a.m_map_iterator; }
Note: this does NOT affect the GenVertex::***_iterator's, since
for those iterators *end() is well defined.
2002-06-01 Lynn Garren <garren@fnal.gov>
-------------------- CLHEP_1_800 --------------------
......
This diff is collapsed.
......@@ -55,10 +55,15 @@ namespace HepMC {
// 2. create a NEW copy of all vertices from inevent
// taking care to map new vertices onto the vertices being copied
// and add these new vertices to this event.
// We do not use GenVertex::operator= because that would copy
// the attached particles as well.
std::map<const GenVertex*,GenVertex*> map_in_to_new;
for ( GenEvent::vertex_const_iterator v = inevent.vertices_begin();
v != inevent.vertices_end(); v++ ) {
GenVertex* newvertex = new GenVertex(**v);
//GenVertex* newvertex = new GenVertex(**v);
GenVertex* newvertex = new GenVertex(
(*v)->position(), (*v)->id(), (*v)->weights() );
newvertex->suggest_barcode( (*v)->barcode() );
map_in_to_new[*v] = newvertex;
add_vertex( newvertex );
}
......@@ -68,24 +73,24 @@ namespace HepMC {
map_in_to_new[inevent.signal_process_vertex()] );
} else set_signal_process_vertex( 0 );
//
// 3. for each outgoing particle in each vtx that had a decay vertex
// in the old list, set the outparticle.decayvertex pointers to
// the right place in the new list ...
for ( std::map<const GenVertex*,GenVertex*>::const_iterator m =
map_in_to_new.begin();
m != map_in_to_new.end(); m++ ) {
for ( GenVertex::particles_out_const_iterator
pold = ((*m).first)->particles_out_const_begin(),
pnew = ((*m).second)->particles_out_const_begin();
pold != ((*m).first)->particles_out_const_end();
++pold, ++pnew ) {
if ( (*pold)->end_vertex() ) {
map_in_to_new[(*pold)->end_vertex()]->
add_particle_in(*pnew);
}
}
}
//
// 3. create a NEW copy of all particles from inevent
// taking care to attach them to the appropriate
// place in the new list ...
for ( GenEvent::particle_const_iterator p = inevent.particles_begin();
p != inevent.particles_end(); p++ )
{
GenParticle* oldparticle = *p;
GenParticle* newparticle = new GenParticle(*oldparticle);
if ( oldparticle->end_vertex() ) {
map_in_to_new[ oldparticle->end_vertex() ]->
add_particle_in(newparticle);
}
if ( oldparticle->production_vertex() ) {
map_in_to_new[ oldparticle->production_vertex() ]->
add_particle_out(newparticle);
}
}
// 4. now that vtx/particles are copied, do everything else
set_signal_process_id( inevent.signal_process_id() );
set_event_number( inevent.event_number() );
......@@ -218,6 +223,19 @@ namespace HepMC {
return false;
}
//
// M.Dobbs Nov 4, 2002
// First we must check to see if the particle already has a
// barcode which is different from the suggestion. If yes, we
// remove it from the particle map.
if ( p->barcode() != 0 && p->barcode() != suggested_barcode ) {
if ( m_particle_barcodes.count(p->barcode()) &&
m_particle_barcodes[p->barcode()] == p ) {
m_particle_barcodes.erase( p->barcode() );
}
// At this point either the particle is NOT in
// m_particle_barcodes, or else it is in the map, but
// already with the suggested barcode.
}
// First case --- a valid barcode has been suggested
// (valid barcodes are numbers greater than zero)
bool insert_success = true;
......@@ -275,6 +293,20 @@ namespace HepMC {
<< std::endl;
return false;
}
// M.Dobbs Nov 4, 2002
// First we must check to see if the vertex already has a
// barcode which is different from the suggestion. If yes, we
// remove it from the vertex map.
if ( v->barcode() != 0 && v->barcode() != suggested_barcode ) {
if ( m_vertex_barcodes.count(v->barcode()) &&
m_vertex_barcodes[v->barcode()] == v ) {
m_vertex_barcodes.erase( v->barcode() );
}
// At this point either the vertex is NOT in
// m_vertex_barcodes, or else it is in the map, but
// already with the suggested barcode.
}
//
// First case --- a valid barcode has been suggested
// (valid barcodes are numbers greater than zero)
......
......@@ -237,6 +237,9 @@ namespace HepMC {
// delete vtx->remove_particle( particle );
// or if the particle has an end vertex, you could:
// delete vtx->remove_particle( particle )->end_vertex();
// which would delete the particle's end vertex, and thus would
// also delete the particle, since the particle would be
// owned by the end vertex.
if ( !particle ) return 0;
if ( particle->end_vertex() == this ) {
particle->set_end_vertex_( 0 );
......@@ -386,30 +389,39 @@ namespace HepMC {
// events were processed and only when I called the delete
// function on past events. I believe it had something to do with
// the past the end values, which are now robustly coded in this
// version as boolean members. I expect this new version is
// slower but 3 days debugging the old version can be considered
// slow too!
// version as boolean members.
//
// default range is family, only other choices are children/parents
// descendants/ancestors not allowed & recasted ot children/parents
if ( range == descendants || range == children ) m_range = children;
if ( range == ancestors || range == parents ) m_range = parents;
// check to be sure the inherited interator points to the right place
if ( m_vertex->m_particles_in.empty() &&
m_vertex->m_particles_out.empty() ) {
// Case: particles_in and particles_out is empty.
m_is_inparticle_iter = 0;
m_is_past_end = 1;
} else if ( m_range == parents && m_vertex->m_particles_in.empty() ){
// Case: particles in is empty and parents is requested.
m_is_inparticle_iter = 1;
m_is_past_end = 1;
} else if ( m_range == children && m_vertex->m_particles_out.empty() ){
// Matt added this 2001-02-28 to handle the case when
// a vertex has incoming particles, but none outgoing and user
// requests children
// Case: particles out is empty and children is requested.
m_is_inparticle_iter = 0;
m_is_past_end = 1;
} else if ( m_range == children ||
(m_vertex->m_particles_in.empty() && m_range == family) ) {
} else if ( m_range == children ) {
// Case: particles out is NOT empty, and children is requested
m_set_iter = m_vertex->m_particles_out.begin();
m_is_inparticle_iter = 0;
m_is_past_end = 0;
} else if ( m_range == family && m_vertex->m_particles_in.empty() ) {
// Case: particles in is empty, particles out is NOT empty,
// and family is requested. Then skip ahead to partilces out.
m_set_iter = m_vertex->m_particles_out.begin();
m_is_inparticle_iter = 0;
m_is_past_end = 0;
} else {
// Normal scenario: start with the first incoming particle
m_set_iter = m_vertex->m_particles_in.begin();
m_is_inparticle_iter = 1;
m_is_past_end = 0;
......@@ -802,9 +814,3 @@ namespace HepMC {
}
} // HepMC
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment