Print the shared good hits between all Pfos and MCParticles.
206 if (orderedPfoVector.empty())
208 std::cout <<
"No Pfos supplied." <<
std::endl;
212 if (orderedMCParticleVector.empty())
214 std::cout <<
"No MCParticles supplied." <<
std::endl;
219 unsigned int maxMatches(0);
220 for (
const auto &
entry : mcParticleToPfoHitSharingMap)
221 maxMatches =
std::max(static_cast<unsigned int>(
entry.second.size()), maxMatches);
223 const bool showOthersColumn(maxMatches > nMatches);
224 const unsigned int nMatchesToShow(
std::min(maxMatches, nMatches));
227 std::vector<std::string> tableHeaders({
"MCParticle",
""});
228 for (
unsigned int i = 0; i < nMatchesToShow; ++i)
230 tableHeaders.push_back(
"");
231 tableHeaders.push_back(
"Pfo");
232 tableHeaders.push_back(
"nSharedHits");
235 if (showOthersColumn)
237 tableHeaders.push_back(
"");
238 tableHeaders.push_back(
"");
239 tableHeaders.push_back(
"nOtherPfos");
240 tableHeaders.push_back(
"nSharedHits");
243 LArFormattingHelper::Table table(tableHeaders);
246 for (
unsigned int mcParticleId = 0; mcParticleId < orderedMCParticleVector.size(); ++mcParticleId)
248 const MCParticle *
const pMCParticle(orderedMCParticleVector.at(mcParticleId));
252 if (it != mcParticleToPfoHitSharingMap.end())
253 pfoToSharedHitsVector = it->second;
264 unsigned int nPfosShown(0);
265 unsigned int nOtherHits(0);
266 for (
const auto &pfoNSharedHitsPair : pfoToSharedHitsVector)
268 for (
unsigned int pfoId = 0; pfoId < orderedPfoVector.size(); ++pfoId)
270 if (pfoNSharedHitsPair.first != orderedPfoVector.at(pfoId))
273 if (nPfosShown < nMatchesToShow)
284 nOtherHits += pfoNSharedHitsPair.second.size();
291 for (
unsigned int i = 0; i < nMatchesToShow - nPfosShown; ++i)
293 table.AddElement(
"");
294 table.AddElement(
"");
298 if (!showOthersColumn)
303 table.AddElement(pfoToSharedHitsVector.size() - nPfosShown);
304 table.AddElement(nOtherHits);
308 table.AddElement(
"");
309 table.AddElement(
"");
std::vector< PfoCaloHitListPair > PfoToSharedHitsVector
Color
Style code enumeration.
static bool IsBeamParticle(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary beam MCParticle.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
static bool IsNeutrinoFinalState(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a final-state particle from a neutrino (or antineutrino) interaction.
static bool IsBeamNeutrinoFinalState(const pandora::MCParticle *const pMCParticle)
Returns true if passed a primary neutrino final state MCParticle.
QTextStream & endl(QTextStream &s)