change: output to python

This commit is contained in:
liuyihui 2022-07-07 02:09:19 +08:00
parent d7b2f6cf1e
commit b66e839b32
2 changed files with 26 additions and 10 deletions

4
.gitignore vendored
View File

@ -3,8 +3,12 @@
*.log *.log
*.csv *.csv
*.json *.json
*.txt
2016Q3D/ 2016Q3D/
# env
venv/
# build cache # build cache
build/ build/

View File

@ -8,28 +8,40 @@
using namespace std; using namespace std;
int main() { int main() {
int n; int n, id, E;
string run; string run;
FileHandler *FH; FileHandler *FH;
BlockHandler *BH; 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]; 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++) { 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] = 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(); 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++) { for (int i = 0; i < 5; i++) {
BH[i] = BlockHandler(4 - i); for (int j = 0; j < 8; j++) {
for (int j = i * 7; j < i * 7 + 7; j++) BH[i].addData(FH[j]); s = "result/bind/" + to_string(E) + "-" + to_string(i) + "-" + to_string(j) + ".txt";
BH[i].splitData(); 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; return 0;