package hep.physics.stdhep.convert;

import hep.io.stdhep.*;
import hep.physics.event.generator.GeneratorFactory;
import hep.physics.event.generator.MCEvent;
import hep.physics.particle.BasicParticle;
import hep.physics.particle.Particle;
import hep.physics.particle.properties.ParticlePropertyManager;
import hep.physics.particle.properties.ParticlePropertyProvider;
import hep.physics.particle.properties.ParticleType;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.BasicHepLorentzVector;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.HepLorentzVector;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 * A class that converts MCEvent<-->StdhepEvent
 * @author Tony Johnson (tonyj@slac.stanford.edu)
 * @version $Id: StdhepConverter.java 8584 2006-08-10 23:06:37Z duns $
 */
public class StdhepConverter
{
   private ParticlePropertyProvider ppp; 
   private GeneratorFactory factory;
   
   public StdhepConverter()
   {
      this(ParticlePropertyManager.getParticlePropertyProvider());
   }
   public StdhepConverter(ParticlePropertyProvider ppp)
   {
      this(ppp, new GeneratorFactory());
   }
   public StdhepConverter(ParticlePropertyProvider ppp, GeneratorFactory factory)
   {
      this.ppp = ppp;
      this.factory = factory;
   }
   /**
    * Convert from a StdhepEvent to an MCEvent.
    * Useful when reading stdhep files.
    */
   public MCEvent convert(StdhepEvent hepevt)
   {
      MCEvent event = factory.createEvent(0,hepevt.getNEVHEP());
      
      int n = hepevt.getNHEP();
      BasicParticle[] particle = new BasicParticle[n];
      for (int i=0; i 

Ads help maintain this website.