66 const MCParticleList *pMCParticleList{
nullptr};
67 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*
this, pMCParticleList));
68 const PfoList *pPfoList{
nullptr};
69 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::GetCurrentList(*
this, pPfoList));
74 const MCParticle *pTrueNeutrino{
nullptr};
75 const ParticleFlowObject *pRecoNeutrino{
nullptr};
76 if (!primaries.empty())
78 for (
const MCParticle *primary : primaries)
80 const MCParticleList &parents{primary->GetParentList()};
83 pTrueNeutrino = parents.front();
89 for (
const ParticleFlowObject *pPfo : *pPfoList)
98 if (pRecoNeutrino && pTrueNeutrino)
100 const LArTransformationPlugin *
transform{this->GetPandora().GetPlugins()->GetLArTransformationPlugin()};
101 const CartesianVector &trueVertex{pTrueNeutrino->GetVertex()};
105 const CartesianVector tu(trueVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoU(trueVertex.GetY(), trueVertex.GetZ())));
106 const CartesianVector tv(trueVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoV(trueVertex.GetY(), trueVertex.GetZ())));
107 const CartesianVector tw(trueVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoW(trueVertex.GetY(), trueVertex.GetZ())));
109 const CartesianVector ru(recoVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoU(recoVertex.GetY(), recoVertex.GetZ())));
110 const CartesianVector rv(recoVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoV(recoVertex.GetY(), recoVertex.GetZ())));
111 const CartesianVector rw(recoVertex.GetX(), 0.f,
static_cast<float>(
transform->YZtoW(recoVertex.GetY(), recoVertex.GetZ())));
113 const float du{(ru - tu).GetMagnitude()};
114 const float dv{(rv - tv).GetMagnitude()};
115 const float dw{(rw - tw).GetMagnitude()};
117 std::cout <<
"delta(u, v, w): (" << du <<
", " << dv <<
"," << dw <<
")" << std::endl;
119 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &tu,
"U true vertex",
BLUE, 2));
120 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &tv,
"V true vertex",
BLUE, 2));
121 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &tw,
"W true vertex",
BLUE, 2));
122 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &ru,
"U reco vertex", RED, 2));
123 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &rv,
"V reco vertex", RED, 2));
124 PANDORA_MONITORING_API(AddMarkerToVisualization(this->GetPandora(), &rw,
"W reco vertex", RED, 2));
129 const CartesianVector delta{recoVertex - trueVertex};
130 const float dx{delta.GetX()}, dy{delta.GetY()}, dz{delta.GetZ()}, dr{delta.GetMagnitude()};
131 const float trueNuEnergy{pTrueNeutrino->GetEnergy()};
132 const int success{1};
133 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"success", success));
134 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"trueNuEnergy", trueNuEnergy));
135 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dx", dx));
136 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dy", dy));
137 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dz", dz));
138 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dr", dr));
139 PANDORA_MONITORING_API(FillTree(this->GetPandora(),
m_treename.c_str()));
142 else if (pTrueNeutrino)
144 const CartesianVector &trueVertex{pTrueNeutrino->GetVertex()};
148 const int success{0};
149 const float dx{-999.f}, dy{-999.f}, dz{-999.f}, dr{-999.f};
150 const float trueNuEnergy{pTrueNeutrino->GetEnergy()};
151 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"success", success));
152 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"trueNuEnergy", trueNuEnergy));
153 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dx", dx));
154 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dy", dy));
155 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dz", dz));
156 PANDORA_MONITORING_API(SetTreeVariable(this->GetPandora(),
m_treename.c_str(),
"dr", dr));
157 PANDORA_MONITORING_API(FillTree(this->GetPandora(),
m_treename.c_str()));
161 return STATUS_CODE_SUCCESS;
std::unordered_map< const pandora::MCParticle *, pandora::CaloHitList > MCContributionMap
static const pandora::Vertex * GetVertex(const pandora::ParticleFlowObject *const pPfo)
Get the pfo vertex.
std::vector< art::Ptr< simb::MCParticle > > MCParticleVector
static bool IsNeutrino(const pandora::ParticleFlowObject *const pPfo)
Whether a pfo is a neutrino or (antineutrino)
static bool IsInFiducialVolume(const pandora::Pandora &pandora, const pandora::CartesianVector &vertex, const std::string &detector)
Determine if a vertex is within a detector's fiducial volume. This throws a STATUS_CODE_INVALID_PARAM...
static void GetPrimaryMCParticleList(const pandora::MCParticleList *const pMCParticleList, pandora::MCParticleVector &mcPrimaryVector)
Get vector of primary MC particles from an input list of MC particles.
BEGIN_PROLOG could also be cout
static bool IsNeutrino(const pandora::MCParticle *const pMCParticle)
Whether a mc particle is a neutrino or antineutrino.