|
49 | 49 | #include <array> |
50 | 50 | #include <cmath> |
51 | 51 | #include <cstdint> |
| 52 | +#include <deque> |
52 | 53 | #include <map> |
53 | 54 | #include <random> |
54 | 55 | #include <string> |
@@ -1572,23 +1573,30 @@ struct Photonhbt { |
1572 | 1573 | obs.deta, obs.dphi, obs.kt); |
1573 | 1574 | auto addToPool = [&](auto const& g) { |
1574 | 1575 | if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { |
1575 | | - EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); |
1576 | | - emh1->AddTrackToEventPool(keyDFCollision,gtmp); |
1577 | | - } }; |
| 1576 | + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); |
| 1577 | + gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); |
| 1578 | + emh1->AddTrackToEventPool(keyDFCollision, gtmp); |
| 1579 | + } |
| 1580 | + }; |
1578 | 1581 | addToPool(g1); |
1579 | 1582 | addToPool(g2); |
1580 | 1583 | } |
1581 | | - if (qaflags.doSinglePhotonQa) |
1582 | | - for (const auto& g : photons1Coll) |
| 1584 | + if (qaflags.doSinglePhotonQa) { |
| 1585 | + for (const auto& g : photons1Coll) { |
1583 | 1586 | if (cut1.template IsSelected<decltype(g), TSubInfos1>(g)) { |
1584 | 1587 | const int gid = g.globalIndex(); |
1585 | | - if (idsAfterDR.count(gid)) |
| 1588 | + if (idsAfterDR.count(gid)) { |
1586 | 1589 | fillSinglePhotonQAStep<1>(g); |
1587 | | - if (idsAfterRZ.count(gid)) |
| 1590 | + } |
| 1591 | + if (idsAfterRZ.count(gid)) { |
1588 | 1592 | fillSinglePhotonQAStep<2>(g); |
1589 | | - if (idsAfterEllipse.count(gid)) |
| 1593 | + } |
| 1594 | + if (idsAfterEllipse.count(gid)) { |
1590 | 1595 | fillSinglePhotonQAStep<3>(g); |
| 1596 | + } |
1591 | 1597 | } |
| 1598 | + } |
| 1599 | + } |
1592 | 1600 | usedPhotonIdsPerCol.clear(); |
1593 | 1601 | if (!mixing.cfgDoMix || ndiphoton == 0) |
1594 | 1602 | continue; |
@@ -1788,23 +1796,30 @@ struct Photonhbt { |
1788 | 1796 |
|
1789 | 1797 | auto addToPool = [&](auto const& g) { |
1790 | 1798 | if (usedPhotonIdsPerCol.insert(g.globalIndex()).second) { |
1791 | | - EMPair gtmp(g.pt(),g.eta(),g.phi(),0.f); gtmp.setConversionPointXYZ(g.vx(),g.vy(),g.vz()); |
1792 | | - emh1->AddTrackToEventPool(keyDFCollision,gtmp); |
1793 | | - } }; |
| 1799 | + EMPair gtmp(g.pt(), g.eta(), g.phi(), 0.f); |
| 1800 | + gtmp.setConversionPointXYZ(g.vx(), g.vy(), g.vz()); |
| 1801 | + emh1->AddTrackToEventPool(keyDFCollision, gtmp); |
| 1802 | + } |
| 1803 | + }; |
1794 | 1804 | addToPool(g1); |
1795 | 1805 | addToPool(g2); |
1796 | 1806 | } |
1797 | | - if (qaflags.doSinglePhotonQa) |
1798 | | - for (const auto& g : photonsColl) |
| 1807 | + if (qaflags.doSinglePhotonQa) { |
| 1808 | + for (const auto& g : photonsColl) { |
1799 | 1809 | if (cut.template IsSelected<decltype(g), TLegs>(g)) { |
1800 | 1810 | const int gid = g.globalIndex(); |
1801 | | - if (idsAfterDR.count(gid)) |
| 1811 | + if (idsAfterDR.count(gid)) { |
1802 | 1812 | fillSinglePhotonQAStep<1>(g); |
1803 | | - if (idsAfterRZ.count(gid)) |
| 1813 | + } |
| 1814 | + if (idsAfterRZ.count(gid)) { |
1804 | 1815 | fillSinglePhotonQAStep<2>(g); |
1805 | | - if (idsAfterEllipse.count(gid)) |
| 1816 | + } |
| 1817 | + if (idsAfterEllipse.count(gid)) { |
1806 | 1818 | fillSinglePhotonQAStep<3>(g); |
| 1819 | + } |
1807 | 1820 | } |
| 1821 | + } |
| 1822 | + } |
1808 | 1823 | usedPhotonIdsPerCol.clear(); |
1809 | 1824 | if (!mixing.cfgDoMix || ndiphoton == 0) |
1810 | 1825 | continue; |
@@ -1966,17 +1981,20 @@ struct Photonhbt { |
1966 | 1981 | int posId = -1, negId = -1; |
1967 | 1982 | float rTrue = -1.f; |
1968 | 1983 | for (const auto& dId : g.daughtersIds()) { |
1969 | | - if (dId < 0) |
| 1984 | + if (dId < 0) { |
1970 | 1985 | continue; |
| 1986 | + } |
1971 | 1987 | const auto d = emmcParticles.iteratorAt(dId); |
1972 | 1988 | if (d.pdgCode() == kElectron) { |
1973 | 1989 | posId = dId; |
1974 | 1990 | rTrue = std::sqrt(d.vx() * d.vx() + d.vy() * d.vy()); |
1975 | | - } else if (d.pdgCode() == kPositron) |
| 1991 | + } else if (d.pdgCode() == kPositron) { |
1976 | 1992 | negId = dId; |
| 1993 | + } |
1977 | 1994 | } |
1978 | | - if (posId < 0 || negId < 0) |
| 1995 | + if (posId < 0 || negId < 0) { |
1979 | 1996 | continue; |
| 1997 | + } |
1980 | 1998 |
|
1981 | 1999 | const auto mcPosE = emmcParticles.iteratorAt(posId); |
1982 | 2000 | const auto mcNegE = emmcParticles.iteratorAt(negId); |
|
0 commit comments