Fork me on GitHub

Changeset 574 in svn for trunk/src


Ignore:
Timestamp:
Nov 16, 2011, 3:46:45 PM (13 years ago)
Author:
cp3-support
Message:

upgrade HepMC to version 2.06.05

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/HepMCConverter.cc

    r480 r574  
    4444#include "GenParticle.h"
    4545#include "GenVertex.h"
    46 #include "IO_Ascii.h"
     46#include "IO_AsciiParticles.h"
    4747#include "IO_GenEvent.h"
    4848
     
    136136       if (index_to_particle[j]->end_vertex())
    137137        {
    138           //find # of 1. daughter
     138          // make sure first and last daughter are indeed the first and last
    139139          int first_daughter = find_in_map( particle_to_index,*(index_to_particle[j]->end_vertex()->particles_begin(HepMC::children)));
    140           //cout <<"first_daughter "<< first_daughter <<  "num_daughters " << num_daughters << endl;
     140          int last_daughter = 0;
     141
    141142          HepMC::GenVertex::particle_iterator ic;
    142           int last_daughter=0;
    143           //find # of last daughter
    144           for (ic = index_to_particle[j]->end_vertex()->particles_begin(HepMC::children);ic != index_to_particle[j]->end_vertex()->particles_end(HepMC::children); ++ic)
    145             last_daughter= find_in_map( particle_to_index,*ic);       
    146          
     143          for (ic = index_to_particle[j]->end_vertex()->particles_begin(HepMC::children);ic != index_to_particle[j]->end_vertex()->particles_end(HepMC::children); ++ic) {
     144            int current_daughter = find_in_map( particle_to_index,*ic) ;
     145            if (current_daughter < first_daughter)
     146              first_daughter = current_daughter;
     147            if (current_daughter > last_daughter)
     148              last_daughter = current_daughter;
     149          }
    147150          if (first_daughter== 0) last_daughter = 0;
    148151          da1=first_daughter;
    149152          da2=last_daughter;
     153
    150154        }
    151155      else
     
    194198      element->PID = pid;
    195199      element->Status = status;
    196       element->M1 = mo1;
    197       element->M2 = mo2;
    198       element->D1 = da1;
    199       element->D2 = da2;
     200      element->M1 = mo1 - 1; // added -1 as the numbering in the tree starts from 0
     201      element->M2 = mo2 - 1;
     202      element->D1 = da1 - 1;
     203      element->D2 = da2 - 1;
    200204
    201205      element->E = index_to_particle[n]->momentum().e();
Note: See TracChangeset for help on using the changeset viewer.