#include <iostream>
#include <stdio.h>

#include "Event.h"

void dump( const Event& ev ) {
  int n = ev.nParticles();
  std::cout << " ********* event: " << ev.eventNumber()
            << " *********" << std::endl;
  std::cout << n << " particles" << std::endl;
  int i;
  char line[1000];
  const Event::part_ptr* particles = ev.particles();
  for ( i = 0; i < n; ++i ) {
    Event::part_ptr p = particles[i];
/*
    // C++-style output
    std::cout <<   "pt: " << p->pt
              << " eta: " << p->eta
              << " phi: " << p->phi
              << "    charge: ";
*/
    // C-style formatting style
    sprintf( line, "pt: %10.4f  eta: %8.4f phi: %8.4f",
             p->pt, p->eta, p->phi );
    std::cout << line << "    charge: ";

    std::cout << ( p->charge > 0 ? '+' : '-' );
    std::cout << "    type: ";
    std::cout << ( p->muonId     ? "muon" : "hadron" );
    std::cout << std::endl;
  }
  return;
}

