14 #include <b2bii/modules/B2BIIMdstInput/B2BIIFixMdstModule.h>
15 #include "belle_legacy/panther/panther.h"
16 #include "belle_legacy/tables/brecon.h"
17 #include "belle_legacy/tables/mdst.h"
18 #include "belle_legacy/tables/belletdf.h"
31 Belle::Brecon_Manager& breconmgr = Belle::Brecon_Manager::get_manager();
32 if (!breconmgr.count())
return;
33 Belle::Mdst_pi0_Manager& pi0mgr = Belle::Mdst_pi0_Manager::get_manager();
35 for (std::vector<Belle::Brecon>::iterator it = breconmgr.begin();
36 it != breconmgr.end(); ++it) {
39 if (std::abs((*it).pcode()) != 111)
continue;
40 const int da_first((*it).daFirst());
41 const int da_last((*it).daLast());
42 if (da_first < 1 || da_last < 1)
continue;
43 if (da_last - da_first != 1)
continue;
44 const Belle::Brecon& gamma1(breconmgr[da_first - 1]);
45 const Belle::Brecon& gamma2(breconmgr[da_last - 1]);
46 if (gamma1.stable() != 2 || gamma2.stable() != 2)
continue;
50 const Belle::Panther_ID g1(gamma1.idmdst());
51 const Belle::Panther_ID g2(gamma2.idmdst());
52 for (std::vector<Belle::Mdst_pi0>::const_iterator it2 = pi0mgr.begin();
53 it2 != pi0mgr.end(); ++it2) {
54 const Belle::Panther_ID da1((*it2).gamma_ID(0));
55 const Belle::Panther_ID da2((*it2).gamma_ID(1));
56 if ((g1 == da1 && g2 == da2) || (g1 == da2 && g2 == da1)) {
57 pi0_ID = (int)(*it2).get_ID();