DB_Track/DB_Track.cpp

51 lines
979 B
C++

//
// DB_Track.cpp
//
//
// Created by Baranyai David on 2018. 06. 05..
//
#include <stdio.h>
#include "TApplication.h"
#include "TrackFinder.hpp"
#include "TH2D.h"
int main(int argc, char* argv[])
{
TApplication App("tapp", &argc, argv);
TH2D *twoDhisto = new TH2D("2Dhisto","2Dhisto", 100, 0, 32, 100, 0, 32);
std::vector<int> ch_id;
std::vector<int> sec;
std::vector<int> nsec;
std::vector<int> amp;
int x = 0;
int y = 0;
TrackFinder finder;
if(finder.FindTrack())
{
finder.GetTrack(ch_id, sec, nsec, amp);
for(int i = 0; i < ch_id.size(); i++)
{
x = 0;
y = 0;
if(ch_id[i] < 32)
{
x = ch_id[i];
}
else
{
y = ch_id[i] - 32;
}
twoDhisto -> Fill(x, y);
}
twoDhisto -> Draw("lego2");
}
App.Run();
return 0;
}