All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Protected Member Functions | Private Member Functions | List of all members
lar_content::TransverseTrackHitsBaseTool Class Referenceabstract

TransverseTrackHitsBaseTool class. More...

#include <TransverseTrackHitsBaseTool.h>

Inheritance diagram for lar_content::TransverseTrackHitsBaseTool:
lar_content::TrackHitsBaseTool lar_content::HitCreationBaseTool lar_content::ClearTransverseTrackHitsTool lar_content::MultiValuedTransverseTrackHitsTool

Protected Member Functions

virtual void GetTransverseTrackHit3D (const MatchedSlidingFitMap &matchedSlidingFitMap, 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 void AddTransverseChi2 (const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHit &protoHit) const
 Calculate an additional contribution to the chi-squared based on the steepness of the track. More...
 
- 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...
 
virtual pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
- 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...
 

Private Member Functions

double GetTransverseChi2 (const pandora::CartesianVector &position2D, const TwoDSlidingFitResult &fitResult) const
 Calculate an additional contribution to the chi-squared based on the steepness of the track. 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::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,
TwoDSlidingFitResult
MatchedSlidingFitMap
 
- 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

TransverseTrackHitsBaseTool class.

Definition at line 19 of file TransverseTrackHitsBaseTool.h.

Member Function Documentation

void lar_content::TransverseTrackHitsBaseTool::AddTransverseChi2 ( const MatchedSlidingFitMap matchedSlidingFitMap,
ProtoHit protoHit 
) const
protectedvirtual

Calculate an additional contribution to the chi-squared based on the steepness of the track.

Parameters
matchedSlidingFitMapmap of sliding fit results from each view
protoHitto receive the modified proto hit

Definition at line 43 of file TransverseTrackHitsBaseTool.cc.

44 {
45  // TODO Develop a proper treatment of the |dz/dx| * sigmaX uncertainty
46  double chiSquared(protoHit.GetChi2());
47  const HitType inputHitType(protoHit.GetParentCaloHit2D()->GetHitType());
48  const CartesianVector &inputPosition3D(protoHit.GetPosition3D());
49 
50  for (const MatchedSlidingFitMap::value_type &mapEntry : matchedSlidingFitMap)
51  {
52  if (mapEntry.first == inputHitType)
53  continue;
54 
55  const CartesianVector inputPosition2D(LArGeometryHelper::ProjectPosition(this->GetPandora(), inputPosition3D, mapEntry.first));
56  chiSquared += this->GetTransverseChi2(inputPosition2D, mapEntry.second);
57  }
58 
59  protoHit.SetPosition3D(inputPosition3D, chiSquared);
60 }
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
double GetTransverseChi2(const pandora::CartesianVector &position2D, const TwoDSlidingFitResult &fitResult) const
Calculate an additional contribution to the chi-squared based on the steepness of the track...
void lar_content::TransverseTrackHitsBaseTool::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 21 of file TransverseTrackHitsBaseTool.cc.

23 {
24  for (const CaloHit *const pCaloHit2D : inputTwoDHits)
25  {
26  try
27  {
28  ProtoHit protoHit(pCaloHit2D);
29  this->GetTransverseTrackHit3D(matchedSlidingFitMap, protoHit);
30  this->AddTransverseChi2(matchedSlidingFitMap, protoHit);
31 
32  if (protoHit.IsPositionSet() && (protoHit.GetChi2() < m_chiSquaredCut))
33  protoHitVector.push_back(protoHit);
34  }
35  catch (StatusCodeException &)
36  {
37  }
38  }
39 }
ThreeDHitCreationAlgorithm::ProtoHit ProtoHit
double m_chiSquaredCut
The chi squared cut (accept only values below the cut value)
virtual void AddTransverseChi2(const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHit &protoHit) const
Calculate an additional contribution to the chi-squared based on the steepness of the track...
virtual void GetTransverseTrackHit3D(const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHit &protoHit) const =0
Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits ...
double lar_content::TransverseTrackHitsBaseTool::GetTransverseChi2 ( const pandora::CartesianVector &  position2D,
const TwoDSlidingFitResult fitResult 
) const
private

Calculate an additional contribution to the chi-squared based on the steepness of the track.

Parameters
position2Dthe calculated two dimensional position
fitResultthe sliding fit to the track

Definition at line 64 of file TransverseTrackHitsBaseTool.cc.

65 {
66  const float minLayerX(fitResult.GetGlobalMinLayerPosition().GetX());
67  const float maxLayerX(fitResult.GetGlobalMaxLayerPosition().GetX());
68 
69  const float minX(std::min(minLayerX, maxLayerX));
70  const float maxX(std::max(minLayerX, maxLayerX));
71 
72  if (((position2D.GetX() - minX) > -std::numeric_limits<float>::epsilon()) && ((position2D.GetX() - maxX) < +std::numeric_limits<float>::epsilon()))
73  return 0.;
74 
75  const float minLayerDistanceSquared((position2D - fitResult.GetGlobalMinLayerPosition()).GetMagnitudeSquared());
76  const float maxLayerDistanceSquared((position2D - fitResult.GetGlobalMaxLayerPosition()).GetMagnitudeSquared());
77 
78  double px(0.), pz(0.);
79 
80  if (minLayerDistanceSquared < maxLayerDistanceSquared)
81  {
82  px = fitResult.GetGlobalMinLayerDirection().GetX();
83  pz = fitResult.GetGlobalMinLayerDirection().GetZ();
84  }
85  else if (maxLayerDistanceSquared < minLayerDistanceSquared)
86  {
87  px = fitResult.GetGlobalMaxLayerDirection().GetX();
88  pz = fitResult.GetGlobalMaxLayerDirection().GetZ();
89  }
90 
91  if (std::fabs(px) > std::numeric_limits<double>::epsilon())
92  {
93  return (0.5 * (pz * pz) / (px * px)); // TODO: Figure out the appropriate scale factor
94  }
95 
96  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
97 }
BEGIN_PROLOG pz
Definition: filemuons.fcl:10
BEGIN_PROLOG px
Definition: filemuons.fcl:10
virtual void lar_content::TransverseTrackHitsBaseTool::GetTransverseTrackHit3D ( const MatchedSlidingFitMap matchedSlidingFitMap,
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
protoHitto receive the populated proto hit

Implemented in lar_content::ClearTransverseTrackHitsTool, and lar_content::MultiValuedTransverseTrackHitsTool.


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