LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
HitAngleVertexSelectionAlgorithm.cc
Go to the documentation of this file.
1 
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},
31  {TPC_VIEW_V, kdTreeV},
32  {TPC_VIEW_W, kdTreeW}};
33 
34  float bestFastScore(0.f);
35  for (const Vertex *const pVertex : vertexVector)
36  {
37  const float beamDeweightingScore(this->IsBeamModeOn() ? std::exp(this->GetBeamDeweightingScore(beamConstants, pVertex)) : 1.f);
38 
39  const float rPhiScore(LArMvaHelper::CalculateFeaturesOfType<RPhiFeatureTool>(m_featureToolVector, this, pVertex, SlidingFitDataListMap(),
40  ClusterListMap(), kdTreeMap, ShowerClusterListMap(), beamDeweightingScore, bestFastScore).at(0).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
Class that implements the KDTree partition of 2D space and a closest point search algorithm...
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
TFile f
Definition: plotHisto.C:6
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.
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.
Header file for the r/phi feature tool class.
std::vector< art::Ptr< recob::Vertex > > VertexVector