import hep.analysis.*;
import hep.lcd.event.*;
import hep.lcd.util.driver.*;
import hep.physics.*;
import hep.physics.jets.*;
import hep.physics.predicate.*;
import java.util.*;

final public class ShapeAnalysis extends Driver
{
   // Create an instance of the EventShape utility
   EventShape es = new EventShape();
   // Create a Predicate that accepts final state charged particles 
   Predicate predicate = new Predicate()
   {
      public boolean accept(Object in)
      {
         Particle p = (Particle) in;
         if (p.getStatusCode() != Particle.FINALSTATE) return false;
         if (p.getType().getCharge() == 0) return false;
         return true;
      }
   };
   public void process(LCDEvent event)
   {
      // We will use the MC truth in this example
      ParticleVector pv = event.getMCParticles();
      es.setEvent(pv.particles(),predicate);
      histogram("Thrust").fill(es.thrust().x());
      histogram("Oblateness").fill(es.oblateness());
   }
}