using namespace std;
#include <iostream>
#include <fstream>
#include <string>

#include "TH1.h"
#include "TApplication.h"

int main( int argc, char* argv[] ) {

  // input file
  string name_i( argv[1] );
  ifstream file_i( name_i.c_str() );

  // create histogram
  TH1F h( "hits", "hits", 21, 0.0, 2.1 );
  h.SetMinimum( 0.0 );

  // read file and fill histogram
  float x;
  while ( file_i >> x ) h.Fill( x );

  // plot histogram
  TApplication app( "tkplot", &argc, argv );
  h.Draw( "e" );
  app.Run( kTRUE );

  return 0;

}

