LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::LArVertexHelper Class Reference

LArVertexHelper class. More...

#include "LArVertexHelper.h"

Public Types

enum  ClusterDirection { DIRECTION_FORWARD_IN_Z, DIRECTION_BACKWARD_IN_Z, DIRECTION_UNKNOWN }
 

Static Public Member Functions

static ClusterDirection GetClusterDirectionInZ (const pandora::Pandora &pandora, const pandora::Vertex *const pVertex, const pandora::Cluster *const pCluster, const float tanAngle, const float apexShift)
 Get the direction of the cluster in z, using a projection of the provided vertex. More...
 

Detailed Description

LArVertexHelper class.

Definition at line 20 of file LArVertexHelper.h.

Member Enumeration Documentation

Member Function Documentation

LArVertexHelper::ClusterDirection lar_content::LArVertexHelper::GetClusterDirectionInZ ( const pandora::Pandora &  pandora,
const pandora::Vertex *const  pVertex,
const pandora::Cluster *const  pCluster,
const float  tanAngle,
const float  apexShift 
)
static

Get the direction of the cluster in z, using a projection of the provided vertex.

Parameters
pandorathe pandora instance
pVertexthe address of the vertex
pClusterthe address of the cluster
tanAnglelook for vertex inside triangle with apex shifted along the cluster length
apexShiftlook for vertex inside triangle with apex shifted along the cluster length
Returns
the cluster direction in z

Definition at line 21 of file LArVertexHelper.cc.

References lar_content::LArPointingCluster::GetInnerVertex(), lar_content::LArPointingCluster::GetOuterVertex(), lar_content::LArPointingCluster::Vertex::GetPosition(), and max.

Referenced by lar_content::ShowerGrowingAlgorithm::AreClustersAssociated(), and lar_content::VertexBasedPfoMopUpAlgorithm::GetClusterAssociation().

23 {
24  if ((VERTEX_3D != pVertex->GetVertexType()) || (tanAngle < std::numeric_limits<float>::epsilon()))
25  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
26 
27  const HitType hitType(LArClusterHelper::GetClusterHitType(pCluster));
28  const CartesianVector theVertex2D(LArGeometryHelper::ProjectPosition(pandora, pVertex->GetPosition(), hitType));
29 
30  try
31  {
32  const LArPointingCluster pointingCluster(pCluster);
33  const float length((pointingCluster.GetInnerVertex().GetPosition() - pointingCluster.GetOuterVertex().GetPosition()).GetMagnitude());
34  const bool innerIsAtLowerZ(pointingCluster.GetInnerVertex().GetPosition().GetZ() < pointingCluster.GetOuterVertex().GetPosition().GetZ());
35 
38  LArPointingClusterHelper::GetImpactParameters(pointingCluster.GetInnerVertex(), theVertex2D, rLInner, rTInner);
39  LArPointingClusterHelper::GetImpactParameters(pointingCluster.GetOuterVertex(), theVertex2D, rLOuter, rTOuter);
40 
41  const bool innerIsVertexAssociated(rLInner > (rTInner / tanAngle) - (length * apexShift));
42  const bool outerIsVertexAssociated(rLOuter > (rTInner / tanAngle) - (length * apexShift));
43 
44  if (innerIsVertexAssociated == outerIsVertexAssociated)
45  return DIRECTION_UNKNOWN;
46 
47  if ((innerIsVertexAssociated && innerIsAtLowerZ) || (outerIsVertexAssociated && !innerIsAtLowerZ))
49 
50  if ((innerIsVertexAssociated && !innerIsAtLowerZ) || (outerIsVertexAssociated && innerIsAtLowerZ))
52  }
53  catch (StatusCodeException &)
54  {
55  return DIRECTION_UNKNOWN;
56  }
57 
58  throw StatusCodeException(STATUS_CODE_FAILURE);
59 }
static void GetImpactParameters(const LArPointingCluster::Vertex &pointingVertex, const LArPointingCluster::Vertex &targetVertex, float &longitudinal, float &transverse)
Calculate impact parameters between a pair of pointing vertices.
static pandora::CartesianVector ProjectPosition(const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
Project 3D position into a given 2D view.
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
Int_t max
Definition: plot.C:27

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