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

#include "Event.h"

using namespace std;

void dump( const Event& ev ) {
  int n = ev.nParticles();
  cout << " ********* event: " << ev.eventNumber()
       << " *********"         << endl;
  cout << n << " particles"    << endl;
  int i;
  char line[1000];
  const vector<Event::part_ptr> particles = ev.particles();
  for ( i = 0; i < n; ++i ) {
    Event::part_ptr p = particles[i];
/*
    // C++-style output
    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 );
    cout << line << "    charge: ";

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

