LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LongitudinalTrackHitsBaseTool Class Referenceabstract

LongitudinalTrackHitsBaseTool class. More...

#include "LongitudinalTrackHitsBaseTool.h"

Inheritance diagram for lar_content::LongitudinalTrackHitsBaseTool:
lar_content::TrackHitsBaseTool lar_content::HitCreationBaseTool lar_content::ClearLongitudinalTrackHitsTool lar_content::MultiValuedLongitudinalTrackHitsTool

Public Types

typedef ThreeDHitCreationAlgorithm::ProtoHit ProtoHit
 
typedef ThreeDHitCreationAlgorithm::ProtoHitVector ProtoHitVector
 
typedef ThreeDHitCreationAlgorithm::TrajectorySample TrajectorySample
 

Public Member Functions

 LongitudinalTrackHitsBaseTool ()
 Default constructor. More...
 
virtual void Run (ThreeDHitCreationAlgorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CaloHitVector &inputTwoDHits, ProtoHitVector &protoHitVector)
 Run the algorithm tool. More...
 

Protected Types

typedef std::map< pandora::HitType, TwoDSlidingFitResultMatchedSlidingFitMap
 

Protected Member Functions

virtual void GetLongitudinalTrackHit3D (const MatchedSlidingFitMap &matchedSlidingFitMap, const pandora::CartesianVector &vtx3D, const pandora::CartesianVector &end3D, ProtoHit &protoHit) const =0
 Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits in the other two views. More...
 
virtual void GetTrackHits3D (const pandora::CaloHitVector &inputTwoDHits, const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHitVector &protoHitVector) const
 Calculate 3D hits from an input list of 2D hits. More...
 
virtual pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
virtual void BuildSlidingFitMap (const pandora::ParticleFlowObject *const pPfo, MatchedSlidingFitMap &matchedSlidingFitMap) const
 Calculate sliding fit results for clusters from each view. More...
 
virtual void GetBestPosition3D (const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianPointVector &fitPositionList1, const pandora::CartesianPointVector &fitPositionList2, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views. More...
 
virtual void GetBestPosition3D (const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianVector &fitPosition1, const pandora::CartesianVector &fitPosition2, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views. More...
 
virtual void GetBestPosition3D (const pandora::HitType hitType, const pandora::CartesianVector &fitPosition, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and a candidate fit position from another view. More...
 

Protected Attributes

unsigned int m_minViews
 The minimum number of views required for building hits. More...
 
unsigned int m_slidingFitWindow
 The layer window for the sliding linear fits. More...
 
double m_sigmaX2
 The sigmaX squared value, for calculation of chi2 deltaX term. More...
 
double m_chiSquaredCut
 The chi squared cut (accept only values below the cut value) More...
 

Private Member Functions

void GetVertexAndEndPositions (const MatchedSlidingFitMap &inputSlidingFitMap, MatchedSlidingFitMap &outputSlidingFitMap, pandora::CartesianVector &outputVtx3D, pandora::CartesianVector &outputEnd3D) const
 Get reconstructed vertex and end positions for this 3D track. More...
 
void UpdateBestPosition (const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianVector &vtx1, const pandora::CartesianVector &vtx2, pandora::CartesianVector &bestVtx, float &bestChi2) const
 Combine two 2D coordinates to give a 3D coordinate. More...
 

Private Attributes

float m_vtxDisplacementCutSquared
 
float m_minTrackLengthSquared
 

Detailed Description

Member Typedef Documentation

typedef std::map<pandora::HitType, TwoDSlidingFitResult> lar_content::TrackHitsBaseTool::MatchedSlidingFitMap
protectedinherited

Definition at line 35 of file TrackHitsBaseTool.h.

Constructor & Destructor Documentation

lar_content::LongitudinalTrackHitsBaseTool::LongitudinalTrackHitsBaseTool ( )

Default constructor.

Definition at line 21 of file LongitudinalTrackHitsBaseTool.cc.

Member Function Documentation

void lar_content::TrackHitsBaseTool::BuildSlidingFitMap ( const pandora::ParticleFlowObject *const  pPfo,
MatchedSlidingFitMap matchedSlidingFitMap 
) const
protectedvirtualinherited

Calculate sliding fit results for clusters from each view.

Parameters
pPfothe input particle flow object
matchedSlidingFitMapthe group of sliding fit results

Definition at line 57 of file TrackHitsBaseTool.cc.

References lar_content::LArClusterHelper::GetClusterHitType(), lar_content::LArGeometryHelper::GetWirePitch(), lar_content::TrackHitsBaseTool::m_slidingFitWindow, and lar_content::LArClusterHelper::SortByNHits().

Referenced by lar_content::TrackHitsBaseTool::Run().

58 {
59  const ClusterList &pfoClusterList(pPfo->GetClusterList());
60 
61  ClusterVector pfoClusterVector;
62  pfoClusterVector.insert(pfoClusterVector.end(), pfoClusterList.begin(), pfoClusterList.end());
63  std::sort(pfoClusterVector.begin(), pfoClusterVector.end(), LArClusterHelper::SortByNHits);
64 
65  for (const Cluster *const pCluster : pfoClusterVector)
66  {
67  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
68 
69  if (TPC_3D == hitType)
70  continue;
71 
72  if (matchedSlidingFitMap.end() != matchedSlidingFitMap.find(hitType))
73  continue;
74 
75  try
76  {
77  const float slidingFitPitch(LArGeometryHelper::GetWirePitch(this->GetPandora(), LArClusterHelper::GetClusterHitType(pCluster)));
78  const TwoDSlidingFitResult slidingFitResult(pCluster, m_slidingFitWindow, slidingFitPitch);
79 
80  if (!matchedSlidingFitMap.insert(MatchedSlidingFitMap::value_type(hitType, slidingFitResult)).second)
81  throw StatusCodeException(STATUS_CODE_FAILURE);
82  }
83  catch (StatusCodeException &statusCodeException)
84  {
85  if (STATUS_CODE_FAILURE == statusCodeException.GetStatusCode())
86  throw statusCodeException;
87  }
88  }
89 }
static bool SortByNHits(const pandora::Cluster *const pLhs, const pandora::Cluster *const pRhs)
Sort clusters by number of hits, then layer span, then inner layer, then position, then pulse-height.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static float GetWirePitch(const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
unsigned int m_slidingFitWindow
The layer window for the sliding linear fits.
HitType
Definition: HitType.h:12
std::vector< art::Ptr< recob::Cluster > > ClusterVector
virtual void lar_content::HitCreationBaseTool::GetBestPosition3D ( const pandora::HitType  hitType1,
const pandora::HitType  hitType2,
const pandora::CartesianPointVector &  fitPositionList1,
const pandora::CartesianPointVector &  fitPositionList2,
ProtoHit protoHit 
) const
protectedvirtualinherited

Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views.

Parameters
hitType1the hit type identifying the first view
hitType2the hit type identifying the second view
fitPositionList1the candidate sliding fit position in the first view
fitPositionList2the candidate sliding fit position in the second view
protoHitto receive the populated proto hit

Referenced by lar_content::ThreeViewShowerHitsTool::GetShowerHit3D(), and lar_content::HitCreationBaseTool::~HitCreationBaseTool().

virtual void lar_content::HitCreationBaseTool::GetBestPosition3D ( const pandora::HitType  hitType1,
const pandora::HitType  hitType2,
const pandora::CartesianVector &  fitPosition1,
const pandora::CartesianVector &  fitPosition2,
ProtoHit protoHit 
) const
protectedvirtualinherited

Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views.

Parameters
hitType1the hit type identifying the first view
hitType2the hit type identifying the second view
fitPosition1the candidate sliding fit position in the first view
fitPosition2the candidate sliding fit position in the second view
protoHitto receive the populated proto hit
virtual void lar_content::HitCreationBaseTool::GetBestPosition3D ( const pandora::HitType  hitType,
const pandora::CartesianVector &  fitPosition,
ProtoHit protoHit 
) const
protectedvirtualinherited

Get the three dimensional position using a provided two dimensional calo hit and a candidate fit position from another view.

Parameters
hitTypethe hit type identifying the other view
fitPositionthe candidate sliding fit position in the other view
protoHitto receive the populated proto hit
virtual void lar_content::LongitudinalTrackHitsBaseTool::GetLongitudinalTrackHit3D ( const MatchedSlidingFitMap matchedSlidingFitMap,
const pandora::CartesianVector &  vtx3D,
const pandora::CartesianVector &  end3D,
ProtoHit protoHit 
) const
protectedpure virtual

Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits in the other two views.

Parameters
matchedSlidingFitMapmap of sliding fit results from each view
vtx3Dthe 3D vertex position
end3Dthe 3D end position
protoHitto receive the populated proto hit

Implemented in lar_content::ClearLongitudinalTrackHitsTool, and lar_content::MultiValuedLongitudinalTrackHitsTool.

Referenced by GetTrackHits3D().

void lar_content::LongitudinalTrackHitsBaseTool::GetTrackHits3D ( const pandora::CaloHitVector &  inputTwoDHits,
const MatchedSlidingFitMap matchedSlidingFitMap,
ProtoHitVector protoHitVector 
) const
protectedvirtual

Calculate 3D hits from an input list of 2D hits.

Parameters
pAlgorithmthe hit creation algorithm
inputTwoDHitsthe input vector of 2D hits
matchedSlidingFitMapthe group of sliding fit results
protoHitVectorto receive the new three dimensional proto hits

Implements lar_content::TrackHitsBaseTool.

Definition at line 29 of file LongitudinalTrackHitsBaseTool.cc.

References f, lar_content::ThreeDHitCreationAlgorithm::ProtoHit::GetChi2(), GetLongitudinalTrackHit3D(), GetVertexAndEndPositions(), lar_content::ThreeDHitCreationAlgorithm::ProtoHit::IsPositionSet(), and lar_content::HitCreationBaseTool::m_chiSquaredCut.

31 {
32  MatchedSlidingFitMap matchedSlidingFitMap;
33  CartesianVector vtx3D(0.f, 0.f, 0.f), end3D(0.f, 0.f, 0.f);
34  this->GetVertexAndEndPositions(inputSlidingFitMap, matchedSlidingFitMap, vtx3D, end3D);
35 
36  for (const CaloHit *const pCaloHit2D : inputTwoDHits)
37  {
38  try
39  {
40  ProtoHit protoHit(pCaloHit2D);
41  this->GetLongitudinalTrackHit3D(matchedSlidingFitMap, vtx3D, end3D, protoHit);
42 
43  if (protoHit.IsPositionSet() && (protoHit.GetChi2() < m_chiSquaredCut))
44  protoHitVector.push_back(protoHit);
45  }
46  catch (StatusCodeException &)
47  {
48  }
49  }
50 }
ThreeDHitCreationAlgorithm::ProtoHit ProtoHit
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
virtual void GetLongitudinalTrackHit3D(const MatchedSlidingFitMap &matchedSlidingFitMap, const pandora::CartesianVector &vtx3D, const pandora::CartesianVector &end3D, ProtoHit &protoHit) const =0
Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits ...
double m_chiSquaredCut
The chi squared cut (accept only values below the cut value)
TFile f
Definition: plotHisto.C:6
void GetVertexAndEndPositions(const MatchedSlidingFitMap &inputSlidingFitMap, MatchedSlidingFitMap &outputSlidingFitMap, pandora::CartesianVector &outputVtx3D, pandora::CartesianVector &outputEnd3D) const
Get reconstructed vertex and end positions for this 3D track.
void lar_content::LongitudinalTrackHitsBaseTool::GetVertexAndEndPositions ( const MatchedSlidingFitMap inputSlidingFitMap,
MatchedSlidingFitMap outputSlidingFitMap,
pandora::CartesianVector &  outputVtx3D,
pandora::CartesianVector &  outputEnd3D 
) const
private

Get reconstructed vertex and end positions for this 3D track.

Parameters
inputSlidingFitMapinput map of sliding fit results from each view
outputSlidingFitMapoutput map of clean sliding fit results from each view
outputVtx3Dreconstructed start position of 3D track
outputEnd3Dreconstructed end position of 3D track

Definition at line 54 of file LongitudinalTrackHitsBaseTool.cc.

References f, lar_content::TwoDSlidingFitResult::GetGlobalMaxLayerPosition(), lar_content::TwoDSlidingFitResult::GetGlobalMinLayerPosition(), m_minTrackLengthSquared, m_vtxDisplacementCutSquared, lar_content::LArGeometryHelper::ProjectPosition(), and UpdateBestPosition().

Referenced by GetTrackHits3D().

56 {
57  // TODO Tidy up: The code below is quite repetitive...
58  MatchedSlidingFitMap::const_iterator iterU = inputSlidingFitMap.find(TPC_VIEW_U);
59  const bool foundU(inputSlidingFitMap.end() != iterU);
60 
61  MatchedSlidingFitMap::const_iterator iterV = inputSlidingFitMap.find(TPC_VIEW_V);
62  const bool foundV(inputSlidingFitMap.end() != iterV);
63 
64  MatchedSlidingFitMap::const_iterator iterW = inputSlidingFitMap.find(TPC_VIEW_W);
65  const bool foundW(inputSlidingFitMap.end() != iterW);
66 
67  bool useU(false), useV(false), useW(false);
68  float bestChi2(std::numeric_limits<float>::max());
69 
70  for (unsigned int iPermutation = 0; iPermutation < 4; ++iPermutation)
71  {
72  const bool isForwardU((1 == iPermutation) ? false : true);
73  const bool isForwardV((2 == iPermutation) ? false : true);
74  const bool isForwardW((3 == iPermutation) ? false : true);
75 
76  CartesianVector vtxU(0.f, 0.f, 0.f), endU(0.f, 0.f, 0.f);
77  CartesianVector vtxV(0.f, 0.f, 0.f), endV(0.f, 0.f, 0.f);
78  CartesianVector vtxW(0.f, 0.f, 0.f), endW(0.f, 0.f, 0.f);
79 
80  if (foundU)
81  {
82  const TwoDSlidingFitResult &slidingFitResultU = iterU->second;
83  vtxU = (isForwardU ? slidingFitResultU.GetGlobalMinLayerPosition() : slidingFitResultU.GetGlobalMaxLayerPosition());
84  endU = (isForwardU ? slidingFitResultU.GetGlobalMaxLayerPosition() : slidingFitResultU.GetGlobalMinLayerPosition());
85  }
86 
87  if (foundV)
88  {
89  const TwoDSlidingFitResult &slidingFitResultV = iterV->second;
90  vtxV = (isForwardV ? slidingFitResultV.GetGlobalMinLayerPosition() : slidingFitResultV.GetGlobalMaxLayerPosition());
91  endV = (isForwardV ? slidingFitResultV.GetGlobalMaxLayerPosition() : slidingFitResultV.GetGlobalMinLayerPosition());
92  }
93 
94  if (foundW)
95  {
96  const TwoDSlidingFitResult &slidingFitResultW = iterW->second;
97  vtxW = (isForwardW ? slidingFitResultW.GetGlobalMinLayerPosition() : slidingFitResultW.GetGlobalMaxLayerPosition());
98  endW = (isForwardW ? slidingFitResultW.GetGlobalMaxLayerPosition() : slidingFitResultW.GetGlobalMinLayerPosition());
99  }
100 
101  CartesianVector vtx3D(0.f, 0.f, 0.f), end3D(0.f, 0.f, 0.f);
102  float vtxChi2(std::numeric_limits<float>::max()), endChi2(std::numeric_limits<float>::max());
103 
104  if (foundU && foundV)
105  {
106  this->UpdateBestPosition(TPC_VIEW_U, TPC_VIEW_V, vtxU, vtxV, vtx3D, vtxChi2);
107  this->UpdateBestPosition(TPC_VIEW_U, TPC_VIEW_V, endU, endV, end3D, endChi2);
108  }
109 
110  if (foundV && foundW)
111  {
112  this->UpdateBestPosition(TPC_VIEW_V, TPC_VIEW_W, vtxV, vtxW, vtx3D, vtxChi2);
113  this->UpdateBestPosition(TPC_VIEW_V, TPC_VIEW_W, endV, endW, end3D, endChi2);
114  }
115 
116  if (foundW && foundU)
117  {
118  this->UpdateBestPosition(TPC_VIEW_W, TPC_VIEW_U, vtxW, vtxU, vtx3D, vtxChi2);
119  this->UpdateBestPosition(TPC_VIEW_W, TPC_VIEW_U, endW, endU, end3D, endChi2);
120  }
121 
122  bool matchedU(false), matchedV(false), matchedW(false);
123  unsigned int matchedViews(0);
124 
125  if (foundU)
126  {
127  const CartesianVector projVtxU(LArGeometryHelper::ProjectPosition(this->GetPandora(), vtx3D, TPC_VIEW_U));
128  const CartesianVector projEndU(LArGeometryHelper::ProjectPosition(this->GetPandora(), end3D, TPC_VIEW_U));
129 
130  if ((endU - vtxU).GetMagnitudeSquared() > m_minTrackLengthSquared &&
131  (projVtxU - vtxU).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projVtxU - endU).GetMagnitudeSquared()) &&
132  (projEndU - endU).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projEndU - vtxU).GetMagnitudeSquared()))
133  {
134  matchedU = true;
135  ++matchedViews;
136  }
137  }
138 
139  if (foundV)
140  {
141  const CartesianVector projVtxV(LArGeometryHelper::ProjectPosition(this->GetPandora(), vtx3D, TPC_VIEW_V));
142  const CartesianVector projEndV(LArGeometryHelper::ProjectPosition(this->GetPandora(), end3D, TPC_VIEW_V));
143 
144  if ((endV - vtxV).GetMagnitudeSquared() > m_minTrackLengthSquared &&
145  (projVtxV - vtxV).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projVtxV - endV).GetMagnitudeSquared()) &&
146  (projEndV - endV).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projEndV - vtxV).GetMagnitudeSquared()))
147  {
148  matchedV = true;
149  ++matchedViews;
150  }
151  }
152 
153  if (foundW)
154  {
155  const CartesianVector projVtxW(LArGeometryHelper::ProjectPosition(this->GetPandora(), vtx3D, TPC_VIEW_W));
156  const CartesianVector projEndW(LArGeometryHelper::ProjectPosition(this->GetPandora(), end3D, TPC_VIEW_W));
157 
158  if ((endW - vtxW).GetMagnitudeSquared() > m_minTrackLengthSquared &&
159  (projVtxW - vtxW).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projVtxW - endW).GetMagnitudeSquared()) &&
160  (projEndW - endW).GetMagnitudeSquared() < std::min(m_vtxDisplacementCutSquared, (projEndW - vtxW).GetMagnitudeSquared()))
161  {
162  matchedW = true;
163  ++matchedViews;
164  }
165  }
166 
167  if (matchedViews < 2)
168  continue;
169 
170  if (vtxChi2 + endChi2 < bestChi2)
171  {
172  useU = matchedU;
173  useV = matchedV;
174  useW = matchedW;
175 
176  bestVtx3D = vtx3D;
177  bestEnd3D = end3D;
178  bestChi2 = vtxChi2 + endChi2;
179  }
180  }
181 
182  if (useU)
183  outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterU->first, iterU->second));
184 
185  if (useV)
186  outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterV->first, iterV->second));
187 
188  if (useW)
189  outputSlidingFitMap.insert(MatchedSlidingFitMap::value_type(iterW->first, iterW->second));
190 
191  if (outputSlidingFitMap.empty())
192  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
193 }
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
intermediate_table::const_iterator const_iterator
void UpdateBestPosition(const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianVector &vtx1, const pandora::CartesianVector &vtx2, pandora::CartesianVector &bestVtx, float &bestChi2) const
Combine two 2D coordinates to give a 3D coordinate.
TFile f
Definition: plotHisto.C:6
StatusCode lar_content::LongitudinalTrackHitsBaseTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
protectedvirtual

Reimplemented from lar_content::TrackHitsBaseTool.

Definition at line 214 of file LongitudinalTrackHitsBaseTool.cc.

References m_minTrackLengthSquared, m_vtxDisplacementCutSquared, and lar_content::TrackHitsBaseTool::ReadSettings().

215 {
216  float vtxDisplacementCut = std::sqrt(m_vtxDisplacementCutSquared);
217  PANDORA_RETURN_RESULT_IF_AND_IF(
218  STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "VertexDisplacementCut", vtxDisplacementCut));
219  m_vtxDisplacementCutSquared = vtxDisplacementCut * vtxDisplacementCut;
220 
221  float minTrackLength = std::sqrt(m_minTrackLengthSquared);
222  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "MinTrackLength", minTrackLength));
223  m_minTrackLengthSquared = minTrackLength * minTrackLength;
224 
225  return TrackHitsBaseTool::ReadSettings(xmlHandle);
226 }
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void lar_content::TrackHitsBaseTool::Run ( ThreeDHitCreationAlgorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pPfo,
const pandora::CaloHitVector &  inputTwoDHits,
ProtoHitVector protoHitVector 
)
virtualinherited

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
pPfothe address of the pfo
inputTwoDHitsthe vector of input two dimensional hits
protoHitVectorto receive the new three dimensional proto hits

Implements lar_content::HitCreationBaseTool.

Definition at line 31 of file TrackHitsBaseTool.cc.

References lar_content::TrackHitsBaseTool::BuildSlidingFitMap(), lar_content::TrackHitsBaseTool::GetTrackHits3D(), and lar_content::LArPfoHelper::IsTrack().

33 {
34  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
35  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
36 
37  try
38  {
39  if (!LArPfoHelper::IsTrack(pPfo))
40  return;
41 
42  MatchedSlidingFitMap matchedSlidingFitMap;
43  this->BuildSlidingFitMap(pPfo, matchedSlidingFitMap);
44 
45  if (matchedSlidingFitMap.size() < 2)
46  return;
47 
48  this->GetTrackHits3D(inputTwoDHits, matchedSlidingFitMap, protoHitVector);
49  }
50  catch (StatusCodeException &)
51  {
52  }
53 }
virtual void GetTrackHits3D(const pandora::CaloHitVector &inputTwoDHits, const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHitVector &protoHitVector) const =0
Calculate 3D hits from an input list of 2D hits.
virtual void BuildSlidingFitMap(const pandora::ParticleFlowObject *const pPfo, MatchedSlidingFitMap &matchedSlidingFitMap) const
Calculate sliding fit results for clusters from each view.
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
static bool IsTrack(const pandora::ParticleFlowObject *const pPfo)
Return track flag based on Pfo Particle ID.
void lar_content::LongitudinalTrackHitsBaseTool::UpdateBestPosition ( const pandora::HitType  hitType1,
const pandora::HitType  hitType2,
const pandora::CartesianVector &  vtx1,
const pandora::CartesianVector &  vtx2,
pandora::CartesianVector &  bestVtx,
float &  bestChi2 
) const
private

Combine two 2D coordinates to give a 3D coordinate.

Parameters
hitType1the view corresponding to the first position
hitType2the view corresponding to the second position
vtx1the first position
vtx2the second position
bestVtxthe combined vertex position
bestChi2the chi-squared from the combination

Definition at line 197 of file LongitudinalTrackHitsBaseTool.cc.

References f, and lar_content::LArGeometryHelper::MergeTwoPositions3D().

Referenced by GetVertexAndEndPositions().

199 {
200  CartesianVector mergedVtx(0.f, 0.f, 0.f);
201  float mergedChi2(std::numeric_limits<float>::max());
202 
203  LArGeometryHelper::MergeTwoPositions3D(this->GetPandora(), hitType1, hitType2, vtx1, vtx2, mergedVtx, mergedChi2);
204 
205  if (mergedChi2 < bestChi2)
206  {
207  bestVtx = mergedVtx;
208  bestChi2 = mergedChi2;
209  }
210 }
static void MergeTwoPositions3D(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &position3D, float &chiSquared)
Merge 2D positions from two views to give unified 3D position.
TFile f
Definition: plotHisto.C:6

Member Data Documentation

double lar_content::HitCreationBaseTool::m_chiSquaredCut
protectedinherited

The chi squared cut (accept only values below the cut value)

Definition at line 86 of file HitCreationBaseTool.h.

Referenced by lar_content::ShowerHitsBaseTool::GetShowerHits3D(), GetTrackHits3D(), and lar_content::HitCreationBaseTool::ReadSettings().

float lar_content::LongitudinalTrackHitsBaseTool::m_minTrackLengthSquared
private

Definition at line 70 of file LongitudinalTrackHitsBaseTool.h.

Referenced by GetVertexAndEndPositions(), and ReadSettings().

unsigned int lar_content::TrackHitsBaseTool::m_minViews
protectedinherited

The minimum number of views required for building hits.

Definition at line 58 of file TrackHitsBaseTool.h.

Referenced by lar_content::TrackHitsBaseTool::ReadSettings().

double lar_content::HitCreationBaseTool::m_sigmaX2
protectedinherited

The sigmaX squared value, for calculation of chi2 deltaX term.

Definition at line 85 of file HitCreationBaseTool.h.

Referenced by lar_content::HitCreationBaseTool::ReadSettings(), and lar_content::HitCreationBaseTool::~HitCreationBaseTool().

unsigned int lar_content::TrackHitsBaseTool::m_slidingFitWindow
protectedinherited

The layer window for the sliding linear fits.

Definition at line 59 of file TrackHitsBaseTool.h.

Referenced by lar_content::TrackHitsBaseTool::BuildSlidingFitMap(), and lar_content::TrackHitsBaseTool::ReadSettings().

float lar_content::LongitudinalTrackHitsBaseTool::m_vtxDisplacementCutSquared
private

Definition at line 69 of file LongitudinalTrackHitsBaseTool.h.

Referenced by GetVertexAndEndPositions(), and ReadSettings().


The documentation for this class was generated from the following files: