31 throw std::runtime_error(
"Invalid arguments, expect: Prefix GroupX GroupY IDX IDY");
37 std::string name(Prefix +
"_g" + GroupX +
"m" + X +
"id" + IDX +
"g" + GroupY +
"m" + Y +
"id" + IDY);
38 ptrMatrix = p->GetMatrix(name);
39 ptrMatrix->SetBins(4096, 0, 4096, 4096, 0, 4096);
44 TTreeReaderValue<std::vector<DetX>> rDetsX(R, (
"DetGroup._" + GroupX).c_str());
45 TTreeReaderValue<std::vector<DetY>> rDetsY(R, (
"DetGroup._" + GroupY).c_str());
46 while (R.Next() && !p->Done()) {
48 std::vector<DetX> vecDetsX = *rDetsX;
49 std::vector<DetY> vecDetsY = *rDetsY;
50 if (vecDetsX.size() + vecDetsY.size() < 2) {
53 for (
auto &Det1 : vecDetsX) {
54 for (
auto &Det2 : vecDetsY) {
55 if ((Det1.ID != std::stoi(IDX)) || (Det2.ID != std::stoi(IDY))) {
58 auto x = Det1.template GetCal<X>();
59 auto y = Det2.template GetCal<Y>();
63 ptrMatrix->Fill(x, y);