All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HitAngleVertexSelectionAlgorithm.cc
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArVertex/HitAngleVertexSelectionAlgorithm.cc
3  *
4  * @brief Implementation of the hit angle vertex selection algorithm class.
5  *
6  * $Log: $
7  */
8 #include "Pandora/AlgorithmHeaders.h"
9 
11 
13 
15 
16 using namespace pandora;
17 
18 namespace lar_content
19 {
20 
21 HitAngleVertexSelectionAlgorithm::HitAngleVertexSelectionAlgorithm()
22 {
23 }
24 
25 //------------------------------------------------------------------------------------------------------------------------------------------
26 
27 void HitAngleVertexSelectionAlgorithm::GetVertexScoreList(const VertexVector &vertexVector, const BeamConstants &beamConstants,
28  HitKDTree2D &kdTreeU, HitKDTree2D &kdTreeV, HitKDTree2D &kdTreeW, VertexScoreList &vertexScoreList) const
29 {
30  const KDTreeMap kdTreeMap{{TPC_VIEW_U, kdTreeU}, {TPC_VIEW_V, kdTreeV}, {TPC_VIEW_W, kdTreeW}};
31 
32  float bestFastScore(0.f);
33  for (const Vertex *const pVertex : vertexVector)
34  {
35  const float beamDeweightingScore(this->IsBeamModeOn() ? std::exp(this->GetBeamDeweightingScore(beamConstants, pVertex)) : 1.f);
36 
37  const float rPhiScore(LArMvaHelper::CalculateFeaturesOfType<RPhiFeatureTool>(m_featureToolVector, this, pVertex,
38  SlidingFitDataListMap(), ClusterListMap(), kdTreeMap, ShowerClusterListMap(), beamDeweightingScore, bestFastScore)
39  .at(0)
40  .Get());
41 
42  vertexScoreList.emplace_back(pVertex, beamDeweightingScore * rPhiScore);
43  }
44 }
45 
46 //------------------------------------------------------------------------------------------------------------------------------------------
47 //------------------------------------------------------------------------------------------------------------------------------------------
48 
49 StatusCode HitAngleVertexSelectionAlgorithm::ReadSettings(const TiXmlHandle xmlHandle)
50 {
51  AlgorithmToolVector algorithmToolVector;
52  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, XmlHelper::ProcessAlgorithmToolList(*this, xmlHandle, "FeatureTools", algorithmToolVector));
53 
54  for (AlgorithmTool *const pAlgorithmTool : algorithmToolVector)
55  PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, LArMvaHelper::AddFeatureToolToVector(pAlgorithmTool, m_featureToolVector));
56 
57  return VertexSelectionBaseAlgorithm::ReadSettings(xmlHandle);
58 }
59 
60 } // namespace lar_content
std::map< pandora::HitType, const ShowerClusterList > ShowerClusterListMap
Map of shower cluster lists for passing to tools.
std::map< pandora::HitType, const pandora::ClusterList & > ClusterListMap
Map array of cluster lists for passing to tools.
Header file for the hit angle vertex selection algorithm class.
required by fuzzyCluster table::sbnd_g4_services gaushitTruthMatch pandora
Definition: reco_sbnd.fcl:182
std::map< pandora::HitType, const SlidingFitDataList > SlidingFitDataListMap
Map of sliding fit data lists for passing to tools.
std::map< pandora::HitType, const std::reference_wrapper< HitKDTree2D > > KDTreeMap
Map array of hit kd trees for passing to tools.
std::array< float, 2 > VertexVector(const recob::Vertex &vert, const geo::PlaneID &plane, const geo::GeometryCore *geo, const detinfo::DetectorPropertiesData &dprop)
Header file for the r/phi feature tool class.