DB_Track/DB_Track.cpp

45 lines
956 B
C++
Raw Permalink Normal View History

2018-06-05 23:09:11 +02:00
//
// DB_Track.cpp
//
//
// Created by Baranyai David on 2018. 06. 05..
//
#include <stdio.h>
#include <iostream>
2018-06-05 23:09:11 +02:00
#include "TApplication.h"
#include "TrackFinder.hpp"
#include "TH2D.h"
#include "TCanvas.h"
#include "TSystem.h"
2018-06-05 23:09:11 +02:00
int main(int argc, char* argv[])
{
TApplication App("tapp", &argc, argv);
2018-06-06 18:02:06 +02:00
std::cout << "Press enter for the next track." << std::endl << "Press Ctrl + C to exit." << std::endl;
2018-10-16 13:05:13 +02:00
TH2D *twodhisto = new TH2D("twodhisto", "twodhisto", 100, 0, 32, 100, 0, 4);
TCanvas *canvas = new TCanvas();
2018-06-05 23:09:11 +02:00
TrackFinder finder;
while(true)
2018-06-05 23:09:11 +02:00
{
if(std::cin.get() == '\n')
2018-06-05 23:09:11 +02:00
{
2018-10-16 13:05:13 +02:00
if(finder.FindAndDrawNextTrack(twodhisto, canvas))
2018-06-05 23:09:11 +02:00
{
2018-10-16 13:05:13 +02:00
gSystem -> ProcessEvents();
}
else
{
std::cout << "Reached the end of the database" << std::endl;
2018-06-05 23:09:11 +02:00
}
}
}
2018-06-05 23:15:19 +02:00
2018-06-05 23:09:11 +02:00
App.Run();
return 0;
}