change: output to python
This commit is contained in:
parent
d7b2f6cf1e
commit
b66e839b32
|
@ -3,8 +3,12 @@
|
|||
*.log
|
||||
*.csv
|
||||
*.json
|
||||
*.txt
|
||||
2016Q3D/
|
||||
|
||||
# env
|
||||
venv/
|
||||
|
||||
# build cache
|
||||
build/
|
||||
|
||||
|
|
32
main.cpp
32
main.cpp
|
@ -8,28 +8,40 @@
|
|||
using namespace std;
|
||||
|
||||
int main() {
|
||||
int n;
|
||||
int n, id, E;
|
||||
string run;
|
||||
FileHandler *FH;
|
||||
BlockHandler *BH;
|
||||
CsvReader cR("config2.csv");
|
||||
CsvReader CR("config1.csv");
|
||||
|
||||
CR.readData();
|
||||
n = CR.rows();
|
||||
E = stoi(CR(0, 3));
|
||||
|
||||
cR.readData();
|
||||
n = cR.rows();
|
||||
FH = new FileHandler[n - 1];
|
||||
BH = new BlockHandler[5];
|
||||
for (int i = 0; i < 5; i++) BH[i] = BlockHandler(i);
|
||||
|
||||
for (int i = 1; i < n; i++) {
|
||||
run = cR(i, 0);
|
||||
run = CR(i, 0);
|
||||
FH[i - 1] = FileHandler("2016Q3D/root/raw/201609Q3D" + run + ".root", 5);
|
||||
FH[i - 1].pX = stoi(cR(i, 5));
|
||||
FH[i - 1].pX = stoi(CR(i, 2));
|
||||
FH[i - 1].readData();
|
||||
BH[stoi(CR(i, 1))].addData(FH[i - 1]);
|
||||
}
|
||||
|
||||
BH = new BlockHandler[5];
|
||||
for (int i = 0; i < 5; i++) BH[i].splitData();
|
||||
|
||||
string s;
|
||||
for (int i = 0; i < 5; i++) {
|
||||
BH[i] = BlockHandler(4 - i);
|
||||
for (int j = i * 7; j < i * 7 + 7; j++) BH[i].addData(FH[j]);
|
||||
BH[i].splitData();
|
||||
for (int j = 0; j < 8; j++) {
|
||||
s = "result/bind/" + to_string(E) + "-" + to_string(i) + "-" + to_string(j) + ".txt";
|
||||
std::ofstream ofs(s);
|
||||
for (int k = 0; k < BH[i].bind[j].data.size(); k++) {
|
||||
auto p = BH[i].bind[j].data.at(k);
|
||||
ofs << p(0) << " " << p(1) << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue