Private Member Functions | List of all members
lar_content::ClearLongitudinalTrackHitsTool Class Reference

ClearLongitudinalTrackHitsTool class. More...

#include <ClearLongitudinalTrackHitsTool.h>

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

Private Member Functions

void GetLongitudinalTrackHit3D (const MatchedSlidingFitMap &matchedSlidingFitMap, const pandora::CartesianVector &vtx3D, const pandora::CartesianVector &end3D, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits in the other two views. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::HitCreationBaseTool
typedef ThreeDHitCreationAlgorithm::ProtoHit ProtoHit
 
typedef ThreeDHitCreationAlgorithm::ProtoHitVector ProtoHitVector
 
typedef ThreeDHitCreationAlgorithm::TrajectorySample TrajectorySample
 
- Public Member Functions inherited from lar_content::LongitudinalTrackHitsBaseTool
 LongitudinalTrackHitsBaseTool ()
 Default constructor. More...
 
- Public Member Functions inherited from lar_content::TrackHitsBaseTool
 TrackHitsBaseTool ()
 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...
 
- Public Member Functions inherited from lar_content::HitCreationBaseTool
 HitCreationBaseTool ()
 Default constructor. More...
 
virtual ~HitCreationBaseTool ()
 Destructor. More...
 
- Protected Types inherited from lar_content::TrackHitsBaseTool
typedef std::map< pandora::HitType, TwoDSlidingFitResultMatchedSlidingFitMap
 
- Protected Member Functions inherited from lar_content::LongitudinalTrackHitsBaseTool
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)
 
- Protected Member Functions inherited from lar_content::TrackHitsBaseTool
virtual void BuildSlidingFitMap (const pandora::ParticleFlowObject *const pPfo, MatchedSlidingFitMap &matchedSlidingFitMap) const
 Calculate sliding fit results for clusters from each view. More...
 
- Protected Member Functions inherited from lar_content::HitCreationBaseTool
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 inherited from lar_content::TrackHitsBaseTool
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...
 
- Protected Attributes inherited from lar_content::HitCreationBaseTool
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...
 

Detailed Description

ClearLongitudinalTrackHitsTool class.

Definition at line 19 of file ClearLongitudinalTrackHitsTool.h.

Member Function Documentation

void lar_content::ClearLongitudinalTrackHitsTool::GetLongitudinalTrackHit3D ( const MatchedSlidingFitMap matchedSlidingFitMap,
const pandora::CartesianVector &  vtx3D,
const pandora::CartesianVector &  end3D,
ProtoHit protoHit 
) const
privatevirtual

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

Implements lar_content::LongitudinalTrackHitsBaseTool.

Definition at line 20 of file ClearLongitudinalTrackHitsTool.cc.

22 {
23  const CaloHit *const pCaloHit2D(protoHit.GetParentCaloHit2D());
24  const HitType hitType(pCaloHit2D->GetHitType());
25  const HitType hitType1((TPC_VIEW_U == hitType) ? TPC_VIEW_V : (TPC_VIEW_V == hitType) ? TPC_VIEW_W : TPC_VIEW_U);
26  const HitType hitType2((TPC_VIEW_U == hitType) ? TPC_VIEW_W : (TPC_VIEW_V == hitType) ? TPC_VIEW_U : TPC_VIEW_V);
27 
28  const CartesianVector vtx2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), vtx3D, hitType));
29  const CartesianVector end2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), end3D, hitType));
30 
31  if ((end2D - vtx2D).GetMagnitudeSquared() < std::numeric_limits<float>::epsilon())
32  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
33 
34  const float frac((end2D - vtx2D).GetDotProduct(pCaloHit2D->GetPositionVector() - vtx2D) / (end2D - vtx2D).GetMagnitudeSquared());
35  const CartesianVector projection3D(vtx3D + (end3D - vtx3D) * frac);
36 
37  CartesianPointVector fitPositionList1, fitPositionList2;
38 
39  MatchedSlidingFitMap::const_iterator fIter1 = matchedSlidingFitMap.find(hitType1);
40  if (matchedSlidingFitMap.end() != fIter1)
41  {
42  const TwoDSlidingFitResult &fitResult1 = fIter1->second;
43  const CartesianVector position2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), projection3D, hitType1));
44 
45  float rL1(0.f), rT1(0.f);
46  CartesianVector position1(0.f, 0.f, 0.f);
47  fitResult1.GetLocalPosition(position2D, rL1, rT1);
48  const StatusCode statusCode(fitResult1.GetTransverseProjection(pCaloHit2D->GetPositionVector().GetX(), fitResult1.GetFitSegment(rL1), position1));
49 
50  if ((STATUS_CODE_SUCCESS != statusCode) && (STATUS_CODE_NOT_FOUND != statusCode))
51  throw StatusCodeException(statusCode);
52 
53  if (STATUS_CODE_SUCCESS == statusCode)
54  fitPositionList1.push_back(position1);
55  }
56 
57  MatchedSlidingFitMap::const_iterator fIter2 = matchedSlidingFitMap.find(hitType2);
58  if (matchedSlidingFitMap.end() != fIter2)
59  {
60  const TwoDSlidingFitResult &fitResult2 = fIter2->second;
61  const CartesianVector position2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), projection3D, hitType2));
62 
63  float rL2(0.f), rT2(0.f);
64  CartesianVector position2(0.f, 0.f, 0.f);
65  fitResult2.GetLocalPosition(position2D, rL2, rT2);
66  const StatusCode statusCode(fitResult2.GetTransverseProjection(pCaloHit2D->GetPositionVector().GetX(), fitResult2.GetFitSegment(rL2), position2));
67 
68  if ((STATUS_CODE_SUCCESS != statusCode) && (STATUS_CODE_NOT_FOUND != statusCode))
69  throw StatusCodeException(statusCode);
70 
71  if (STATUS_CODE_SUCCESS == statusCode)
72  fitPositionList2.push_back(position2);
73  }
74 
75  unsigned int nViews(1);
76  if (fitPositionList1.size() > 0)
77  ++nViews;
78  if (fitPositionList2.size() > 0)
79  ++nViews;
80 
81  if (nViews < m_minViews)
82  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
83 
84  this->GetBestPosition3D(hitType1, hitType2, fitPositionList1, fitPositionList2, protoHit);
85 }
enum cvn::HType HitType
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
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 positi...
unsigned int m_minViews
The minimum number of views required for building hits.

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