2018-06-07 17:54:56 +02:00
|
|
|
//
|
|
|
|
// TrackFinder.hpp
|
|
|
|
// TrackReconstruction
|
|
|
|
//
|
|
|
|
// Created by Baranyai David on 2018. 06. 07..
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef TrackFinder_hpp
|
|
|
|
#define TrackFinder_hpp
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <fstream>
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
#include <sstream>
|
2018-06-27 12:43:37 +02:00
|
|
|
#include <algorithm>
|
2018-06-07 17:54:56 +02:00
|
|
|
|
|
|
|
struct Hit
|
|
|
|
{
|
|
|
|
unsigned int ch_id;
|
|
|
|
unsigned int fine_ts;
|
|
|
|
unsigned int coarse_ts;
|
|
|
|
unsigned long ts;
|
|
|
|
unsigned int width;
|
|
|
|
unsigned int which_chamber;
|
|
|
|
std::string direction;
|
|
|
|
};
|
|
|
|
|
|
|
|
class TrackFinder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
TrackFinder();
|
|
|
|
~TrackFinder();
|
|
|
|
bool FindTrack();
|
|
|
|
void GetTrack(std::vector<Hit>&);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void SortFile();
|
|
|
|
|
|
|
|
std::ifstream file;
|
|
|
|
std::string line;
|
|
|
|
|
|
|
|
int interval = 2000;
|
|
|
|
unsigned int iterator = 0;
|
|
|
|
|
|
|
|
bool istrackavailable = false;
|
|
|
|
|
|
|
|
Hit h;
|
|
|
|
|
|
|
|
std::vector<Hit> hits;
|
|
|
|
std::vector<Hit> track;
|
|
|
|
};
|
|
|
|
|
2018-06-11 00:15:36 +02:00
|
|
|
std::ostream& operator << (std::ostream&, const Hit&);
|
|
|
|
|
2018-06-07 17:54:56 +02:00
|
|
|
#endif /* TrackFinder_hpp */
|