2022-07-05 19:02:59 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifndef file_handler_h
|
|
|
|
#define file_handler_h
|
|
|
|
|
2022-07-06 23:47:50 +08:00
|
|
|
#include "utils.h"
|
2022-07-05 19:02:59 +08:00
|
|
|
|
|
|
|
using std::string;
|
|
|
|
using std::to_string;
|
|
|
|
|
|
|
|
class FileHandler {
|
|
|
|
public:
|
2022-07-06 23:47:50 +08:00
|
|
|
FileHandler() {};
|
2022-07-06 23:33:12 +08:00
|
|
|
FileHandler(string, int n_ = 6, int thMin_ = 800, int thMax_ = 4000);
|
2022-07-06 23:47:50 +08:00
|
|
|
~FileHandler() {};
|
2022-07-05 19:02:59 +08:00
|
|
|
|
|
|
|
public:
|
2022-07-06 23:33:12 +08:00
|
|
|
int n = 6, m = 8;
|
|
|
|
int thMin, thMax, pX;
|
2022-07-05 19:02:59 +08:00
|
|
|
string file;
|
2022-07-06 23:42:52 +08:00
|
|
|
std::vector<int> adcValue[6][8][2];
|
2022-07-05 19:02:59 +08:00
|
|
|
|
|
|
|
public:
|
2022-07-06 23:42:52 +08:00
|
|
|
void readData();
|
2022-07-05 19:02:59 +08:00
|
|
|
};
|
|
|
|
|
2022-07-06 23:33:12 +08:00
|
|
|
FileHandler::FileHandler(string file_, int n_, int thMin_, int thMax_) {
|
2022-07-05 19:02:59 +08:00
|
|
|
file = file_;
|
|
|
|
n = n_;
|
2022-07-06 23:33:12 +08:00
|
|
|
thMin = thMin_;
|
|
|
|
thMax = thMax_;
|
2022-07-05 19:02:59 +08:00
|
|
|
}
|
|
|
|
|
2022-07-06 23:42:52 +08:00
|
|
|
void FileHandler::readData() { readROOTData(file.c_str(), adcValue, n, m, thMin, thMax); }
|
2022-07-05 19:02:59 +08:00
|
|
|
|
|
|
|
#endif
|