Print matching information in a provided validation info object, and write information to tree if configured to do so.
248 ? validationInfo.GetMCToPfoHitSharingMap()
249 : useInterpretedMatching ? validationInfo.GetInterpretedMCToPfoHitSharingMap() : validationInfo.GetMCToPfoHitSharingMap());
253 for (
auto &
entry : foldedTargetMCToHitsMap)
263 std::stringstream stringStream;
265 for (
const MCParticle *
const pCosmicRay : mcCRVector)
268 if (foldedMCToPfoHitSharingMap.at(pCosmicRay).empty())
272 int nReconstructableChildCRLs(0), nCorrectChildCRLs(0);
276 float mcE_CR(0.
f), mcPX_CR(0.
f), mcPY_CR(0.
f), mcPZ_CR(0.
f);
277 int nMCHitsTotal_CR(0), nMCHitsU_CR(0), nMCHitsV_CR(0), nMCHitsW_CR(0);
278 float mcVertexX_CR(0.
f), mcVertexY_CR(0.
f), mcVertexZ_CR(0.
f), mcEndX_CR(0.
f), mcEndY_CR(0.
f), mcEndZ_CR(0.
f);
284 IntVector nMCHitsTotal_CRL, nMCHitsU_CRL, nMCHitsV_CRL, nMCHitsW_CRL;
285 FloatVector mcVertexX_CRL, mcVertexY_CRL, mcVertexZ_CRL, mcEndX_CRL, mcEndY_CRL, mcEndZ_CRL;
286 IntVector nAboveThresholdMatches_CRL, isCorrect_CRL, isCorrectParentLink_CRL;
287 IntVector bestMatchNHitsTotal_CRL, bestMatchNHitsU_CRL, bestMatchNHitsV_CRL, bestMatchNHitsW_CRL;
288 IntVector bestMatchNSharedHitsTotal_CRL, bestMatchNSharedHitsU_CRL, bestMatchNSharedHitsV_CRL, bestMatchNSharedHitsW_CRL;
289 IntVector bestMatchNParentTrackHitsTotal_CRL, bestMatchNParentTrackHitsU_CRL, bestMatchNParentTrackHitsV_CRL, bestMatchNParentTrackHitsW_CRL;
290 IntVector bestMatchNOtherTrackHitsTotal_CRL, bestMatchNOtherTrackHitsU_CRL, bestMatchNOtherTrackHitsV_CRL, bestMatchNOtherTrackHitsW_CRL;
291 IntVector bestMatchNOtherShowerHitsTotal_CRL, bestMatchNOtherShowerHitsU_CRL, bestMatchNOtherShowerHitsV_CRL, bestMatchNOtherShowerHitsW_CRL;
292 IntVector totalCRLHitsInBestMatchParentCR_CRL, uCRLHitsInBestMatchParentCR_CRL, vCRLHitsInBestMatchParentCR_CRL, wCRLHitsInBestMatchParentCR_CRL;
293 FloatVector bestMatchVertexX_CRL, bestMatchVertexY_CRL, bestMatchVertexZ_CRL;
296 IntVector bestMatchOtherShowerHitsID_CRL, bestMatchOtherTrackHitsID_CRL, bestMatchParentTrackHitsID_CRL, bestMatchCRLHitsInCRID_CRL;
297 FloatVector bestMatchOtherShowerHitsDistance_CRL, bestMatchOtherTrackHitsDistance_CRL, bestMatchParentTrackHitsDistance_CRL,
298 bestMatchCRLHitsInCRDistance_CRL;
303 for (
const MCParticle *
const pCosmicRayChild : pCosmicRay->GetDaughterList())
307 int mcIndex((
size_t)(intptr_t *)pCosmicRayChild->GetUid());
320 if (foldedTargetMCToHitsMap.find(pCosmicRayChild) == foldedTargetMCToHitsMap.end())
323 childLeadingParticles.push_back(pCosmicRayChild);
327 if (childLeadingParticles.empty())
338 const CaloHitList &cosmicRayHitList(foldedAllMCToHitsMap.at(pCosmicRay));
344 std::cout <<
"MC COSMIC RAY HITS" <<
std::endl;
347 const CartesianVector
vertex(pCosmicRay->GetVertex()), endpoint(pCosmicRay->GetEndpoint());
348 const float x0(cosmicRayHitList.front()->GetX0());
349 const CartesianVector shiftedVertex(
vertex.GetX() - x0,
vertex.GetY(),
vertex.GetZ());
350 const CartesianVector shiftedEndpoint(endpoint.GetX() - x0,
vertex.GetY(),
vertex.GetZ());
352 PandoraMonitoringApi::AddMarkerToVisualization(this->GetPandora(), &shiftedVertex,
"T0 shifted vertex ", BLACK, 2);
353 PandoraMonitoringApi::AddMarkerToVisualization(this->GetPandora(), &shiftedEndpoint,
"T0 shifted endpoint", BLACK, 2);
354 PandoraMonitoringApi::ViewEvent(this->GetPandora());
361 mcE_CR = pCosmicRay->GetEnergy();
362 mcPX_CR = pCosmicRay->GetMomentum().GetX();
363 mcPY_CR = pCosmicRay->GetMomentum().GetY();
364 mcPZ_CR = pCosmicRay->GetMomentum().GetZ();
365 mcVertexX_CR = pCosmicRay->GetVertex().GetX();
366 mcVertexY_CR = pCosmicRay->GetVertex().GetY();
367 mcVertexZ_CR = pCosmicRay->GetVertex().GetZ();
368 mcEndX_CR = pCosmicRay->GetEndpoint().GetX();
369 mcEndY_CR = pCosmicRay->GetEndpoint().GetY();
370 mcEndZ_CR = pCosmicRay->GetEndpoint().GetZ();
371 nMCHitsTotal_CR = cosmicRayHitList.size();
376 nReconstructableChildCRLs = childLeadingParticles.size();
378 stringStream <<
"\033[34m" 379 <<
"(Parent CR: " << muonCount <<
") " 381 <<
"Energy " << pCosmicRay->GetEnergy() <<
", Dist. " << (pCosmicRay->GetEndpoint() - pCosmicRay->GetVertex()).GetMagnitude()
385 <<
", nReconstructableCRLs " << nReconstructableChildCRLs <<
std::endl;
390 for (
const MCParticle *
const pLeadingParticle : childLeadingParticles)
395 const CaloHitList &leadingParticleHitList(foldedAllMCToHitsMap.at(pLeadingParticle));
401 size_t mcIndex((
size_t)(intptr_t *)pLeadingParticle->GetUid());
403 std::cout <<
"mcID: " << mcIndex <<
std::endl;
404 std::cout <<
"MC DELTA RAY HITS" <<
std::endl;
406 this->
PrintHits(leadingParticleHitList,
false);
408 const CartesianVector
vertex(pLeadingParticle->GetVertex()), endpoint(pLeadingParticle->GetEndpoint());
409 const float x0(leadingParticleHitList.front()->GetX0());
410 const CartesianVector shiftedVertex(
vertex.GetX() - x0,
vertex.GetY(),
vertex.GetZ());
411 const CartesianVector shiftedEndpoint(endpoint.GetX() - x0,
vertex.GetY(),
vertex.GetZ());
413 PandoraMonitoringApi::AddMarkerToVisualization(this->GetPandora(), &shiftedVertex,
"T0 shifted vertex", BLACK, 2);
414 PandoraMonitoringApi::AddMarkerToVisualization(this->GetPandora(), &shiftedEndpoint,
"T0 shifted endpoint", BLACK, 2);
415 PandoraMonitoringApi::ViewEvent(this->GetPandora());
420 mcE_CRL.push_back(pLeadingParticle->GetEnergy());
421 ID_CRL.push_back(leadingCount);
422 mcPX_CRL.push_back(pLeadingParticle->GetMomentum().GetX());
423 mcPY_CRL.push_back(pLeadingParticle->GetMomentum().GetY());
424 mcPZ_CRL.push_back(pLeadingParticle->GetMomentum().GetZ());
425 mcVertexX_CRL.push_back(pLeadingParticle->GetVertex().GetX());
426 mcVertexY_CRL.push_back(pLeadingParticle->GetVertex().GetY());
427 mcVertexZ_CRL.push_back(pLeadingParticle->GetVertex().GetZ());
428 mcEndX_CRL.push_back(pLeadingParticle->GetEndpoint().GetX());
429 mcEndY_CRL.push_back(pLeadingParticle->GetEndpoint().GetY());
430 mcEndZ_CRL.push_back(pLeadingParticle->GetEndpoint().GetZ());
431 nMCHitsTotal_CRL.push_back(leadingParticleHitList.size());
436 stringStream <<
"\033[33m" 437 <<
"(Child " << (
m_deltaRayMode ?
"DR: " :
"Michel: ") << leadingCount <<
") " 439 <<
"Energy " << pLeadingParticle->GetEnergy() <<
", Dist. " 440 << (pLeadingParticle->GetEndpoint() - pLeadingParticle->GetVertex()).GetMagnitude() <<
", nMCHits " 446 int nMatches(0), nAboveThresholdMatches(0);
447 bool isCorrectParentLink(
false);
453 const ParticleFlowObject *
const pMatchedPfo(pfoToSharedHits.first);
454 const CaloHitList &pfoHitList(foldedPfoToHitsMap.at(pMatchedPfo));
455 const CaloHitList &sharedHitList(pfoToSharedHits.second);
456 const bool isGoodMatch(this->
IsGoodMatch(leadingParticleHitList, pfoHitList, sharedHitList));
459 ++nAboveThresholdMatches;
461 CaloHitList parentTrackHits, otherTrackHits, otherShowerHits;
465 CaloHitList mcParentMatchedPfoHits;
466 bool isMatchedToCorrectCosmicRay(
false);
470 foldedMCToPfoHitSharingMap.at(pCosmicRay).begin();
471 cosmicRayMatchedPfoPair != foldedMCToPfoHitSharingMap.at(pCosmicRay).end(); ++cosmicRayMatchedPfoPair)
473 const ParticleFlowObject *
const pCosmicRayPfo(cosmicRayMatchedPfoPair->first);
475 mcParentMatchedPfoHits.insert(mcParentMatchedPfoHits.end(), foldedPfoToHitsMap.at(pCosmicRayPfo).begin(),
476 foldedPfoToHitsMap.at(pCosmicRayPfo).end());
478 if (pCosmicRayPfo == pParentPfo)
479 isMatchedToCorrectCosmicRay =
true;
482 CaloHitList leadingParticleHitsInParentCosmicRay;
484 mcParentMatchedPfoHits, leadingParticleHitList, leadingParticleHitsInParentCosmicRay);
486 if ((nAboveThresholdMatches == 1) && isGoodMatch)
488 isCorrectParentLink = isMatchedToCorrectCosmicRay;
490 bestMatchNHitsTotal_CRL.push_back(pfoHitList.size());
495 bestMatchNSharedHitsTotal_CRL.push_back(sharedHitList.size());
500 bestMatchNParentTrackHitsTotal_CRL.push_back(parentTrackHits.size());
505 bestMatchNOtherTrackHitsTotal_CRL.push_back(otherTrackHits.size());
510 bestMatchNOtherShowerHitsTotal_CRL.push_back(otherShowerHits.size());
515 totalCRLHitsInBestMatchParentCR_CRL.push_back(leadingParticleHitsInParentCosmicRay.size());
520 bestMatchOtherShowerHitsID_CRL.insert(bestMatchOtherShowerHitsID_CRL.end(), otherShowerHits.size(), leadingCount);
523 bestMatchOtherTrackHitsID_CRL.insert(bestMatchOtherTrackHitsID_CRL.end(), otherTrackHits.size(), leadingCount);
526 bestMatchParentTrackHitsID_CRL.insert(bestMatchParentTrackHitsID_CRL.end(), parentTrackHits.size(), leadingCount);
529 bestMatchCRLHitsInCRID_CRL.insert(bestMatchCRLHitsInCRID_CRL.end(), leadingParticleHitsInParentCosmicRay.size(), leadingCount);
532 const VertexList &deltaRayVertexList(pMatchedPfo->GetVertexList());
534 if (deltaRayVertexList.size() > 1)
536 std::cout <<
"ISOBEL: DELTA RAY RECO VERTEX LIST LARGER THAN 1" <<
std::endl;
540 bestMatchVertexX_CRL.push_back(deltaRayVertexList.empty() ? 1000001 : deltaRayVertexList.front()->GetPosition().GetX());
541 bestMatchVertexY_CRL.push_back(deltaRayVertexList.empty() ? 1000001 : deltaRayVertexList.front()->GetPosition().GetY());
542 bestMatchVertexZ_CRL.push_back(deltaRayVertexList.empty() ? 1000001 : deltaRayVertexList.front()->GetPosition().GetZ());
545 stringStream <<
"-" << (!isGoodMatch ?
"(Below threshold) " :
"") <<
"nPfoHits " << pfoHitList.size() <<
" (" 552 <<
", nCRLHitsInParentCR " << leadingParticleHitsInParentCosmicRay.size() <<
" (" 556 << (!isGoodMatch ?
" " :
" ") <<
"nParentTrackHits " << parentTrackHits.size() <<
" (" 560 <<
", nOtherTrackHits " << otherTrackHits.size() <<
" (" 564 <<
", nOtherShowerHits " << otherShowerHits.size() <<
" (" 568 << (!isGoodMatch ?
" " :
" ") << (isMatchedToCorrectCosmicRay ?
"Correct" :
"Incorrect") <<
"\033[0m" 575 std::cout << stringStream.str() <<
std::endl;
576 std::cout <<
"DELTA RAY PFO HITS" <<
std::endl;
578 this->
PrintHits(pfoHitList, otherShowerHits, otherTrackHits, parentTrackHits,
"DR_PFO");
580 if (pParentPfo != pMatchedPfo)
584 const CaloHitList &parentCRHits(foldedPfoToHitsMap.at(pParentPfo));
585 this->
PrintHits(parentCRHits, leadingParticleHitList,
"DR_PARENT_PFO");
588 const VertexList &deltaRayVertexList(pMatchedPfo->GetVertexList());
590 if (deltaRayVertexList.size() > 1)
592 std::cout <<
"ISOBEL: DELTA RAY RECO VERTEX LIST LARGER THAN 1" <<
std::endl;
596 if (deltaRayVertexList.empty())
598 std::cout <<
"No reconstructed vertex" <<
std::endl;
602 const PfoList deltaRayList({pMatchedPfo}), cosmicList({pParentPfo});
603 const CartesianVector &
vertex(deltaRayVertexList.front()->GetPosition());
605 PandoraMonitoringApi::VisualizeParticleFlowObjects(this->GetPandora(), &deltaRayList,
"Delta Ray Pfo", BLACK,
false,
false);
606 PandoraMonitoringApi::VisualizeParticleFlowObjects(this->GetPandora(), &cosmicList,
"Delta Ray Pfo", RED,
false,
false);
607 PandoraMonitoringApi::AddMarkerToVisualization(this->GetPandora(), &
vertex,
"vertex", RED, 2);
608 PandoraMonitoringApi::ViewEvent(this->GetPandora());
615 nAboveThresholdMatches_CRL.push_back(nAboveThresholdMatches);
616 isCorrectParentLink_CRL.push_back(isCorrectParentLink ? 1 : 0);
618 const bool isCorrect((nAboveThresholdMatches == 1) && isCorrectParentLink);
623 isCorrect_CRL.push_back(1);
627 isCorrect_CRL.push_back(0);
630 if (foldedMCToPfoHitSharingMap.at(pLeadingParticle).empty())
636 std::cout << stringStream.str() <<
std::endl;
639 if (nAboveThresholdMatches == 0)
641 bestMatchNHitsTotal_CRL.push_back(0);
642 bestMatchNHitsU_CRL.push_back(0);
643 bestMatchNHitsV_CRL.push_back(0);
644 bestMatchNHitsW_CRL.push_back(0);
645 bestMatchNSharedHitsTotal_CRL.push_back(0);
646 bestMatchNSharedHitsU_CRL.push_back(0);
647 bestMatchNSharedHitsV_CRL.push_back(0);
648 bestMatchNSharedHitsW_CRL.push_back(0);
649 bestMatchNParentTrackHitsTotal_CRL.push_back(0);
650 bestMatchNParentTrackHitsU_CRL.push_back(0);
651 bestMatchNParentTrackHitsV_CRL.push_back(0);
652 bestMatchNParentTrackHitsW_CRL.push_back(0);
653 bestMatchNOtherTrackHitsTotal_CRL.push_back(0);
654 bestMatchNOtherTrackHitsU_CRL.push_back(0), bestMatchNOtherTrackHitsV_CRL.push_back(0);
655 bestMatchNOtherTrackHitsW_CRL.push_back(0);
656 bestMatchNOtherShowerHitsTotal_CRL.push_back(0);
657 bestMatchNOtherShowerHitsU_CRL.push_back(0);
658 bestMatchNOtherShowerHitsV_CRL.push_back(0), bestMatchNOtherShowerHitsW_CRL.push_back(0);
659 totalCRLHitsInBestMatchParentCR_CRL.push_back(0);
660 uCRLHitsInBestMatchParentCR_CRL.push_back(0);
661 vCRLHitsInBestMatchParentCR_CRL.push_back(0);
662 wCRLHitsInBestMatchParentCR_CRL.push_back(0);
665 stringStream << nAboveThresholdMatches <<
" above threshold matches" << std::endl
666 <<
"Reconstruction is " << (isCorrect ?
"\033[32m" :
"\033[31m") << (isCorrect ?
"CORRECT" :
"INCORRECT")
670 std::cout << stringStream.str() <<
std::endl;
675 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"eventNumber",
m_eventNumber - 1));
676 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"ID_CR", ID_CR));
677 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcE_CR", mcE_CR));
678 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPX_CR", mcPX_CR));
679 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPY_CR", mcPY_CR));
680 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPZ_CR", mcPZ_CR));
681 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsTotal_CR", nMCHitsTotal_CR));
682 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsU_CR", nMCHitsU_CR));
683 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsV_CR", nMCHitsV_CR));
684 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsW_CR", nMCHitsW_CR));
685 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexX_CR", mcVertexX_CR));
686 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexY_CR", mcVertexY_CR));
687 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexZ_CR", mcVertexZ_CR));
688 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndX_CR", mcEndX_CR));
689 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndY_CR", mcEndY_CR));
690 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndZ_CR", mcEndZ_CR));
691 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nReconstructableChildCRLs", nReconstructableChildCRLs));
692 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nCorrectChildCRLs", nCorrectChildCRLs));
694 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"ID_CRL", &ID_CRL));
695 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcE_CRL", &mcE_CRL));
696 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPX_CRL", &mcPX_CRL));
697 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPY_CRL", &mcPY_CRL));
698 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcPZ_CRL", &mcPZ_CRL));
699 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsTotal_CRL", &nMCHitsTotal_CRL));
700 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsU_CRL", &nMCHitsU_CRL));
701 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsV_CRL", &nMCHitsV_CRL));
702 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nMCHitsW_CRL", &nMCHitsW_CRL));
703 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexX_CRL", &mcVertexX_CRL));
704 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexY_CRL", &mcVertexY_CRL));
705 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcVertexZ_CRL", &mcVertexZ_CRL));
706 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndX_CRL", &mcEndX_CRL));
707 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndY_CRL", &mcEndY_CRL));
708 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"mcEndZ_CRL", &mcEndZ_CRL));
709 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"nAboveThresholdMatches_CRL", &nAboveThresholdMatches_CRL));
710 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"isCorrect_CRL", &isCorrect_CRL));
711 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"isCorrectParentLink_CRL", &isCorrectParentLink_CRL));
712 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNHitsTotal_CRL", &bestMatchNHitsTotal_CRL));
713 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNHitsU_CRL", &bestMatchNHitsU_CRL));
714 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNHitsV_CRL", &bestMatchNHitsV_CRL));
715 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNHitsW_CRL", &bestMatchNHitsW_CRL));
716 PANDORA_MONITORING_API(
717 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNSharedHitsTotal_CRL", &bestMatchNSharedHitsTotal_CRL));
718 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNSharedHitsU_CRL", &bestMatchNSharedHitsU_CRL));
719 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNSharedHitsV_CRL", &bestMatchNSharedHitsV_CRL));
720 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNSharedHitsW_CRL", &bestMatchNSharedHitsW_CRL));
721 PANDORA_MONITORING_API(SetTreeVariable(
722 this->GetPandora(),
m_treeName.c_str(),
"bestMatchNParentTrackHitsTotal_CRL", &bestMatchNParentTrackHitsTotal_CRL));
723 PANDORA_MONITORING_API(
724 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNParentTrackHitsU_CRL", &bestMatchNParentTrackHitsU_CRL));
725 PANDORA_MONITORING_API(
726 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNParentTrackHitsV_CRL", &bestMatchNParentTrackHitsV_CRL));
727 PANDORA_MONITORING_API(
728 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNParentTrackHitsW_CRL", &bestMatchNParentTrackHitsW_CRL));
729 PANDORA_MONITORING_API(
730 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherTrackHitsTotal_CRL", &bestMatchNOtherTrackHitsTotal_CRL));
731 PANDORA_MONITORING_API(
732 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherTrackHitsU_CRL", &bestMatchNOtherTrackHitsU_CRL));
733 PANDORA_MONITORING_API(
734 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherTrackHitsV_CRL", &bestMatchNOtherTrackHitsV_CRL));
735 PANDORA_MONITORING_API(
736 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherTrackHitsW_CRL", &bestMatchNOtherTrackHitsW_CRL));
737 PANDORA_MONITORING_API(SetTreeVariable(
738 this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherShowerHitsTotal_CRL", &bestMatchNOtherShowerHitsTotal_CRL));
739 PANDORA_MONITORING_API(
740 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherShowerHitsU_CRL", &bestMatchNOtherShowerHitsU_CRL));
741 PANDORA_MONITORING_API(
742 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherShowerHitsV_CRL", &bestMatchNOtherShowerHitsV_CRL));
743 PANDORA_MONITORING_API(
744 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchNOtherShowerHitsW_CRL", &bestMatchNOtherShowerHitsW_CRL));
745 PANDORA_MONITORING_API(SetTreeVariable(
746 this->GetPandora(),
m_treeName.c_str(),
"totalCRLHitsInBestMatchParentCR_CRL", &totalCRLHitsInBestMatchParentCR_CRL));
747 PANDORA_MONITORING_API(
748 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"uCRLHitsInBestMatchParentCR_CRL", &uCRLHitsInBestMatchParentCR_CRL));
749 PANDORA_MONITORING_API(
750 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"vCRLHitsInBestMatchParentCR_CRL", &vCRLHitsInBestMatchParentCR_CRL));
751 PANDORA_MONITORING_API(
752 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"wCRLHitsInBestMatchParentCR_CRL", &wCRLHitsInBestMatchParentCR_CRL));
754 PANDORA_MONITORING_API(
755 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchOtherShowerHitsID_CRL", &bestMatchOtherShowerHitsID_CRL));
756 PANDORA_MONITORING_API(SetTreeVariable(
757 this->GetPandora(),
m_treeName.c_str(),
"bestMatchOtherShowerHitsDistance_CRL", &bestMatchOtherShowerHitsDistance_CRL));
758 PANDORA_MONITORING_API(
759 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchOtherTrackHitsID_CRL", &bestMatchOtherTrackHitsID_CRL));
760 PANDORA_MONITORING_API(SetTreeVariable(
761 this->GetPandora(),
m_treeName.c_str(),
"bestMatchOtherTrackHitsDistance_CRL", &bestMatchOtherTrackHitsDistance_CRL));
762 PANDORA_MONITORING_API(
763 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchParentTrackHitsID_CRL", &bestMatchParentTrackHitsID_CRL));
764 PANDORA_MONITORING_API(SetTreeVariable(
765 this->GetPandora(),
m_treeName.c_str(),
"bestMatchParentTrackHitsDistance_CRL", &bestMatchParentTrackHitsDistance_CRL));
766 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchCRLHitsInCRID_CRL", &bestMatchCRLHitsInCRID_CRL));
767 PANDORA_MONITORING_API(
768 SetTreeVariable(this->GetPandora(),
m_treeName.c_str(),
"bestMatchCRLHitsInCRDistance_CRL", &bestMatchCRLHitsInCRDistance_CRL));
770 PANDORA_MONITORING_API(FillTree(this->GetPandora(),
m_treeName.c_str()));
773 stringStream <<
"------------------------------------------------------------------------------------------------" <<
std::endl;
774 stringStream << nCorrectChildCRLs <<
" / " << nReconstructableChildCRLs <<
" CRLs correctly reconstructed" <<
std::endl;
775 stringStream <<
"------------------------------------------------------------------------------------------------" <<
std::endl;
776 stringStream <<
"------------------------------------------------------------------------------------------------" <<
std::endl;
779 if (printToScreen && !(
m_visualize && useInterpretedMatching))
781 std::cout << stringStream.str() <<
std::endl;
static void GetMuonPfoContaminationContribution(const pandora::CaloHitList &cosmicRayPfoHitList, const pandora::CaloHitList &leadingMCHitList, pandora::CaloHitList &leadingHitsInParentCosmicRay)
Determine the leading MCParticle hits within a cosmic ray pfo hit list.
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
bool m_deltaRayMode
Whether to run in delta ray mode.
int m_eventNumber
The event number.
std::map< const pandora::MCParticle *, PfoToSharedHitsVector > MCParticleToPfoHitSharingMap
std::vector< int > m_deltaRayIDs
If filled, to contain the list leading particles to run metrics over.
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
bool m_michelMode
Whether to run in michel mode.
bool m_visualize
Whether to visualize the MC and reco leading particles.
QCollection::Item first()
int m_cosmicRaysToSkip
The number of reconstructable cosmic rays to skip.
static bool SortByMomentum(const pandora::MCParticle *const pLhs, const pandora::MCParticle *const pRhs)
Sort mc particles by their momentum.
static bool IsCosmicRay(const pandora::MCParticle *const pMCParticle)
Return true if passed a primary cosmic ray MCParticle.
static bool IsMichel(const pandora::MCParticle *const pMCParticle)
Return true if input MCParticle is a child of a cosmic ray and has 'decay' process tag...
static const pandora::ParticleFlowObject * GetParentPfo(const pandora::ParticleFlowObject *const pPfo)
Get the primary parent pfo.
static void GetPfoMatchContamination(const pandora::MCParticle *const pLeadingParticle, const pandora::CaloHitList &matchedPfoHitList, pandora::CaloHitList &parentTrackHits, pandora::CaloHitList &otherTrackHits, pandora::CaloHitList &otherShowerHits)
Separate a leading pfo hit list according to the true owner of the hit e.g. other shower...
void PrintHits(const pandora::CaloHitList totalCaloHitList, const pandora::CaloHitList leadingCaloHitList, const std::string &stringTag) const
Print leading MCParticle hits.
std::vector< int > IntVector
void FillContaminationHitsDistance(const pandora::CaloHitList &contaminationHits, const pandora::CaloHitList &leadingMCHits, pandora::FloatVector &bestMatchContaminationHitsDistance) const
Fill an input contamination hit distance vector with the closest distance of each contaminant hit to ...
std::pair< const pandora::ParticleFlowObject *, pandora::CaloHitList > PfoCaloHitListPair
std::string m_treeName
Name of output tree.
bool m_writeRawMatchesToTree
Whether to write all matches to output tree.
Dft::FloatVector FloatVector
bool IsGoodMatch(const pandora::CaloHitList &trueHits, const pandora::CaloHitList &recoHits, const pandora::CaloHitList &sharedHits) const
Whether a provided mc primary and pfo are deemed to be a good match.
std::unordered_map< const pandora::ParticleFlowObject *, pandora::CaloHitList > PfoContributionMap
static unsigned int CountHitsByType(const pandora::HitType hitType, const pandora::CaloHitList &caloHitList)
Count the number of calo hits, in a provided list, of a specified type.
std::list< Vertex > VertexList
QTextStream & endl(QTextStream &s)
static bool IsDeltaRay(const pandora::MCParticle *const pMCParticle)
Return true if input MCParticle is a child of a cosmic ray and has 'delta ray' process tag...