Public Types | Static Public Member Functions | List of all members
lar_content::LArGeometryHelper Class Reference

LArGeometryHelper class. More...

#include <LArGeometryHelper.h>

Public Types

typedef std::set< unsigned int > UIntSet
 

Static Public Member Functions

static float MergeTwoPositions (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
 Merge two views (U,V) to give a third view (Z). More...
 
static pandora::CartesianVector MergeTwoDirections (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &direction1, const pandora::CartesianVector &direction2)
 Merge two views (U,V) to give a third view (Z). More...
 
static void MergeTwoPositions (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &position3, float &chiSquared)
 Merge 2D positions from two views to give 2D position in third view. More...
 
static void MergeTwoPositions (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared)
 Merge 2D positions from two views to give 2D position in third view. More...
 
static void MergeThreePositions (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared)
 Merge 2D positions from three views to give unified 2D positions for each view. More...
 
static void MergeThreePositions (const pandora::Pandora &pandora, const pandora::CartesianVector &positionU, const pandora::CartesianVector &positionV, const pandora::CartesianVector &positionW, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared)
 Merge 2D positions from three views to give unified 2D positions for each view. More...
 
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. More...
 
static void MergeThreePositions3D (const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &position3D, float &chiSquared)
 Merge 2D positions from three views to give unified 3D position. More...
 
static pandora::CartesianVector ProjectPosition (const pandora::Pandora &pandora, const pandora::CartesianVector &position3D, const pandora::HitType view)
 Project 3D position into a given 2D view. More...
 
static pandora::CartesianVector ProjectDirection (const pandora::Pandora &pandora, const pandora::CartesianVector &direction3D, const pandora::HitType view)
 Project 3D direction into a given 2D view. More...
 
static float GetWireZPitch (const pandora::Pandora &pandora, const float maxWirePitchDiscrepancy=0.01)
 Return the wire pitch. More...
 
static float GetWirePitch (const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy=0.01)
 Return the wire pitch. More...
 
static pandora::CartesianVector GetWireAxis (const pandora::Pandora &pandora, const pandora::HitType view)
 Return the wire axis (vector perpendicular to the wire direction and drift direction) More...
 
static bool IsInGap (const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType, const float gapTolerance=0.f)
 Whether a 2D test point lies in a registered gap with the associated hit type. More...
 
static bool IsInGap3D (const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint3D, const pandora::HitType hitType, const float gapTolerance=0.f)
 Whether a 3D test point lies in a registered gap with the associated hit type. More...
 
static bool IsXSamplingPointInGap (const pandora::Pandora &pandora, const float xSample, const TwoDSlidingFitResult &slidingFitResult, const float gapTolerance=0.f)
 Whether there is a gap in a cluster (described via its sliding fit result) at a specified x sampling position. More...
 
static float CalculateGapDeltaZ (const pandora::Pandora &pandora, const float minZ, const float maxZ, const pandora::HitType hitType)
 Calculate the total distance within a given 2D region that is composed of detector gaps. More...
 
static float GetSigmaUVW (const pandora::Pandora &pandora, const float maxSigmaDiscrepancy=0.01)
 Find the sigmaUVW value for the detector geometry. More...
 
static void GetCommonDaughterVolumes (const pandora::Cluster *const pCluster1, const pandora::Cluster *const pCluster2, UIntSet &intersect)
 Return the set of common daughter volumes between two 2D clusters. More...
 

Detailed Description

LArGeometryHelper class.

Definition at line 32 of file LArGeometryHelper.h.

Member Typedef Documentation

typedef std::set<unsigned int> lar_content::LArGeometryHelper::UIntSet

Definition at line 35 of file LArGeometryHelper.h.

Member Function Documentation

float lar_content::LArGeometryHelper::CalculateGapDeltaZ ( const pandora::Pandora &  pandora,
const float  minZ,
const float  maxZ,
const pandora::HitType  hitType 
)
static

Calculate the total distance within a given 2D region that is composed of detector gaps.

Parameters
pandorathe associated pandora instance
minZthe start position in Z
maxZthe end position in Z
hitTypethe hit type

Definition at line 509 of file LArGeometryHelper.cc.

510 {
511  if (maxZ - minZ < std::numeric_limits<float>::epsilon())
512  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
513 
514  float gapDeltaZ(0.f);
515 
516  for (const DetectorGap *const pDetectorGap : pandora.GetGeometry()->GetDetectorGapList())
517  {
518  const LineGap *const pLineGap = dynamic_cast<const LineGap *>(pDetectorGap);
519 
520  if (!pLineGap)
521  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
522 
523  const LineGapType lineGapType(pLineGap->GetLineGapType());
524 
525  if (!(((TPC_VIEW_U == hitType) && (TPC_WIRE_GAP_VIEW_U == lineGapType)) || ((TPC_VIEW_V == hitType) && (TPC_WIRE_GAP_VIEW_V == lineGapType)) ||
526  ((TPC_VIEW_W == hitType) && (TPC_WIRE_GAP_VIEW_W == lineGapType))))
527  {
528  continue;
529  }
530 
531  if ((pLineGap->GetLineStartZ() > maxZ) || (pLineGap->GetLineEndZ() < minZ))
532  continue;
533 
534  const float gapMinZ(std::max(minZ, pLineGap->GetLineStartZ()));
535  const float gapMaxZ(std::min(maxZ, pLineGap->GetLineEndZ()));
536 
537  if ((gapMaxZ - gapMinZ) > std::numeric_limits<float>::epsilon())
538  gapDeltaZ += (gapMaxZ - gapMinZ);
539  }
540 
541  return gapDeltaZ;
542 }
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55
void lar_content::LArGeometryHelper::GetCommonDaughterVolumes ( const pandora::Cluster *const  pCluster1,
const pandora::Cluster *const  pCluster2,
UIntSet intersect 
)
static

Return the set of common daughter volumes between two 2D clusters.

Parameters
intersectthe set of shared daughter volumes
pCluster1the first cluster
pCluster2the second cluster

Definition at line 436 of file LArGeometryHelper.cc.

437 {
438  UIntSet daughterVolumeIds1, daughterVolumeIds2;
439 
440  LArClusterHelper::GetDaughterVolumeIDs(pCluster1, daughterVolumeIds1);
441  LArClusterHelper::GetDaughterVolumeIDs(pCluster2, daughterVolumeIds2);
442 
443  std::set_intersection(daughterVolumeIds1.begin(), daughterVolumeIds1.end(), daughterVolumeIds2.begin(), daughterVolumeIds2.end(),
444  std::inserter(intersect, intersect.begin()));
445 }
static void GetDaughterVolumeIDs(const pandora::Cluster *const pCluster, UIntSet &daughterVolumeIds)
Get the set of the daughter volumes that contains the cluster.
std::set< unsigned int > UIntSet
float lar_content::LArGeometryHelper::GetSigmaUVW ( const pandora::Pandora &  pandora,
const float  maxSigmaDiscrepancy = 0.01 
)
static

Find the sigmaUVW value for the detector geometry.

Parameters
pandorathe associated pandora instance
maxSigmaDiscrepancymaximum allowed discrepancy between lar tpc sigmaUVW values

Definition at line 546 of file LArGeometryHelper.cc.

547 {
548  const LArTPCMap &larTPCMap(pandora.GetGeometry()->GetLArTPCMap());
549 
550  if (larTPCMap.empty())
551  {
552  std::cout << "LArGeometryHelper::GetSigmaUVW - LArTPC description not registered with Pandora as required " << std::endl;
553  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
554  }
555 
556  const LArTPC *const pFirstLArTPC(larTPCMap.begin()->second);
557  const float sigmaUVW(pFirstLArTPC->GetSigmaUVW());
558 
559  for (const LArTPCMap::value_type &mapEntry : larTPCMap)
560  {
561  const LArTPC *const pLArTPC(mapEntry.second);
562 
563  if (std::fabs(sigmaUVW - pLArTPC->GetSigmaUVW()) > maxSigmaDiscrepancy)
564  {
565  std::cout << "LArGeometryHelper::GetSigmaUVW - Plugin does not support provided LArTPC configurations " << std::endl;
566  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
567  }
568  }
569 
570  return sigmaUVW;
571 }
QTextStream & endl(QTextStream &s)
CartesianVector lar_content::LArGeometryHelper::GetWireAxis ( const pandora::Pandora &  pandora,
const pandora::HitType  view 
)
static

Return the wire axis (vector perpendicular to the wire direction and drift direction)

Parameters
pandorathe associated pandora instance
viewthe 2D projection

Definition at line 411 of file LArGeometryHelper.cc.

412 {
413  if (view == TPC_VIEW_U)
414  {
415  return CartesianVector(0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoU(1.f, 0.f),
416  pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoU(0.f, 1.f));
417  }
418 
419  else if (view == TPC_VIEW_V)
420  {
421  return CartesianVector(0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoV(1.f, 0.f),
422  pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoV(0.f, 1.f));
423  }
424 
425  else if (view == TPC_VIEW_W)
426  {
427  return CartesianVector(0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoW(1.f, 0.f),
428  pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoW(0.f, 1.f));
429  }
430 
431  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
432 }
float lar_content::LArGeometryHelper::GetWirePitch ( const pandora::Pandora &  pandora,
const pandora::HitType  view,
const float  maxWirePitchDiscrepancy = 0.01 
)
static

Return the wire pitch.

Parameters
pandorathe associated pandora instance
viewthe 2D projection
maxWirePitchDiscrepancymaximum allowed discrepancy between lar tpc wire pitch values

Definition at line 376 of file LArGeometryHelper.cc.

377 {
378  if (view != TPC_VIEW_U && view != TPC_VIEW_V && view != TPC_VIEW_W)
379  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
380 
381  const LArTPCMap &larTPCMap(pandora.GetGeometry()->GetLArTPCMap());
382 
383  if (larTPCMap.empty())
384  {
385  std::cout << "LArGeometryHelper::GetWirePitch - LArTPC description not registered with Pandora as required " << std::endl;
386  throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
387  }
388 
389  const LArTPC *const pFirstLArTPC(larTPCMap.begin()->second);
390  const float wirePitch(view == TPC_VIEW_U ? pFirstLArTPC->GetWirePitchU()
391  : (view == TPC_VIEW_V ? pFirstLArTPC->GetWirePitchV() : pFirstLArTPC->GetWirePitchW()));
392 
393  for (const LArTPCMap::value_type &mapEntry : larTPCMap)
394  {
395  const LArTPC *const pLArTPC(mapEntry.second);
396  const float alternateWirePitch(
397  view == TPC_VIEW_U ? pLArTPC->GetWirePitchU() : (view == TPC_VIEW_V ? pLArTPC->GetWirePitchV() : pLArTPC->GetWirePitchW()));
398 
399  if (std::fabs(wirePitch - alternateWirePitch) > maxWirePitchDiscrepancy)
400  {
401  std::cout << "LArGeometryHelper::GetWirePitch - LArTPC configuration not supported" << std::endl;
402  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
403  }
404  }
405 
406  return wirePitch;
407 }
QTextStream & endl(QTextStream &s)
float lar_content::LArGeometryHelper::GetWireZPitch ( const pandora::Pandora &  pandora,
const float  maxWirePitchDiscrepancy = 0.01 
)
inlinestatic

Return the wire pitch.

Parameters
pandorathe associated pandora instance
maxWirePitchDiscrepancymaximum allowed discrepancy between lar tpc wire pitch value in the w view

Definition at line 272 of file LArGeometryHelper.h.

273 {
274  return LArGeometryHelper::GetWirePitch(pandora, pandora::TPC_VIEW_W, maxWirePitchWDiscrepancy);
275 }
static float GetWirePitch(const pandora::Pandora &pandora, const pandora::HitType view, const float maxWirePitchDiscrepancy=0.01)
Return the wire pitch.
bool lar_content::LArGeometryHelper::IsInGap ( const pandora::Pandora &  pandora,
const pandora::CartesianVector &  testPoint2D,
const pandora::HitType  hitType,
const float  gapTolerance = 0.f 
)
static

Whether a 2D test point lies in a registered gap with the associated hit type.

Parameters
pandorathe associated pandora instance
testPointthe test point
hitTypethe hit type
gapTolerancethe gap tolerance
Returns
boolean

Definition at line 449 of file LArGeometryHelper.cc.

450 {
451  // ATTN: input test point MUST be a 2D position vector
452  for (const DetectorGap *const pDetectorGap : pandora.GetGeometry()->GetDetectorGapList())
453  {
454  if (pDetectorGap->IsInGap(testPoint2D, hitType, gapTolerance))
455  return true;
456  }
457 
458  return false;
459 }
bool lar_content::LArGeometryHelper::IsInGap3D ( const pandora::Pandora &  pandora,
const pandora::CartesianVector &  testPoint3D,
const pandora::HitType  hitType,
const float  gapTolerance = 0.f 
)
static

Whether a 3D test point lies in a registered gap with the associated hit type.

Parameters
pandorathe associated pandora instance
testPointthe test point
hitTypethe hit type
gapTolerancethe gap tolerance
Returns
boolean

Definition at line 463 of file LArGeometryHelper.cc.

464 {
465  const CartesianVector testPoint2D(LArGeometryHelper::ProjectPosition(pandora, testPoint3D, hitType));
466  return LArGeometryHelper::IsInGap(pandora, testPoint2D, hitType, gapTolerance);
467 }
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 bool IsInGap(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType, const float gapTolerance=0.f)
Whether a 2D test point lies in a registered gap with the associated hit type.
bool lar_content::LArGeometryHelper::IsXSamplingPointInGap ( const pandora::Pandora &  pandora,
const float  xSample,
const TwoDSlidingFitResult slidingFitResult,
const float  gapTolerance = 0.f 
)
static

Whether there is a gap in a cluster (described via its sliding fit result) at a specified x sampling position.

Parameters
pandorathe associated pandora instance
xSamplethe x sampling position
slidingFitResultthe sliding fit result for a cluster
gapTolerancethe gap tolerance
Returns
boolean

Definition at line 471 of file LArGeometryHelper.cc.

472 {
473  const HitType hitType(LArClusterHelper::GetClusterHitType(slidingFitResult.GetCluster()));
474  const CartesianVector minLayerPosition(slidingFitResult.GetGlobalMinLayerPosition());
475  const CartesianVector maxLayerPosition(slidingFitResult.GetGlobalMaxLayerPosition());
476 
477  const bool minLayerIsAtLowX(minLayerPosition.GetX() < maxLayerPosition.GetX());
478  const CartesianVector &lowXCoordinate(minLayerIsAtLowX ? minLayerPosition : maxLayerPosition);
479  const CartesianVector &highXCoordinate(minLayerIsAtLowX ? maxLayerPosition : minLayerPosition);
480 
481  if ((xSample > lowXCoordinate.GetX()) && (xSample < highXCoordinate.GetX()))
482  {
483  CartesianVector slidingFitPosition(0.f, 0.f, 0.f);
484 
485  if (STATUS_CODE_SUCCESS == slidingFitResult.GetGlobalFitPositionAtX(xSample, slidingFitPosition))
486  return (LArGeometryHelper::IsInGap(pandora, slidingFitPosition, hitType, gapTolerance));
487  }
488 
489  const CartesianVector lowXDirection(
490  minLayerIsAtLowX ? slidingFitResult.GetGlobalMinLayerDirection() : slidingFitResult.GetGlobalMaxLayerDirection());
491  const CartesianVector highXDirection(
492  minLayerIsAtLowX ? slidingFitResult.GetGlobalMaxLayerDirection() : slidingFitResult.GetGlobalMinLayerDirection());
493 
494  const bool sampleIsNearerToLowX(std::fabs(xSample - lowXCoordinate.GetX()) < std::fabs(xSample - highXCoordinate.GetX()));
495  const CartesianVector &startPosition(sampleIsNearerToLowX ? lowXCoordinate : highXCoordinate);
496  const CartesianVector &startDirection(sampleIsNearerToLowX ? lowXDirection : highXDirection);
497 
498  if (std::fabs(startDirection.GetX()) < std::numeric_limits<float>::epsilon())
499  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
500 
501  const float pathLength((xSample - startPosition.GetX()) / startDirection.GetX());
502  const CartesianVector samplingPoint(startPosition + startDirection * pathLength);
503 
504  return (LArGeometryHelper::IsInGap(pandora, samplingPoint, hitType, gapTolerance));
505 }
enum cvn::HType HitType
static pandora::HitType GetClusterHitType(const pandora::Cluster *const pCluster)
Get the hit type associated with a two dimensional cluster.
static bool IsInGap(const pandora::Pandora &pandora, const pandora::CartesianVector &testPoint2D, const pandora::HitType hitType, const float gapTolerance=0.f)
Whether a 2D test point lies in a registered gap with the associated hit type.
static void lar_content::LArGeometryHelper::MergeThreePositions ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const pandora::HitType  view3,
const pandora::CartesianVector &  position1,
const pandora::CartesianVector &  position2,
const pandora::CartesianVector &  position3,
pandora::CartesianVector &  outputU,
pandora::CartesianVector &  outputV,
pandora::CartesianVector &  outputW,
float &  chiSquared 
)
static

Merge 2D positions from three views to give unified 2D positions for each view.

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
view3the third view
position1the position in the first view
position2the position in the second view
position3the position in the third view
positionUoutput position in the U view
positionVoutput position in the V view
positionWoutput position in the W view
chi-squared
static void lar_content::LArGeometryHelper::MergeThreePositions ( const pandora::Pandora &  pandora,
const pandora::CartesianVector &  positionU,
const pandora::CartesianVector &  positionV,
const pandora::CartesianVector &  positionW,
pandora::CartesianVector &  outputU,
pandora::CartesianVector &  outputV,
pandora::CartesianVector &  outputW,
float &  chiSquared 
)
static

Merge 2D positions from three views to give unified 2D positions for each view.

Parameters
pandorathe associated pandora instance
positionUinput position in the U view
positionVinput position in the V view
positionWinput position in the W view
positionUoutput position in the U view
positionVoutput position in the V view
positionWoutput position in the W view
chi-squared
void lar_content::LArGeometryHelper::MergeThreePositions3D ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const pandora::HitType  view3,
const pandora::CartesianVector &  position1,
const pandora::CartesianVector &  position2,
const pandora::CartesianVector &  position3,
pandora::CartesianVector &  position3D,
float &  chiSquared 
)
static

Merge 2D positions from three views to give unified 3D position.

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
view3the third view
position1the position in the first view
position2the position in the second view
position3the position in the third view
position3Doutput position in 3D
chi-squared

Definition at line 311 of file LArGeometryHelper.cc.

313 {
314  CartesianVector positionU(0.f, 0.f, 0.f), positionV(0.f, 0.f, 0.f), positionW(0.f, 0.f, 0.f);
315  LArGeometryHelper::MergeThreePositions(pandora, view1, view2, view3, position1, position2, position3, positionU, positionV, positionW, chiSquared);
316 
317  position3D.SetValues(positionW.GetX(), pandora.GetPlugins()->GetLArTransformationPlugin()->UVtoY(positionU.GetZ(), positionV.GetZ()),
318  pandora.GetPlugins()->GetLArTransformationPlugin()->UVtoZ(positionU.GetZ(), positionV.GetZ()));
319 }
static void MergeThreePositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const pandora::HitType view3, const pandora::CartesianVector &position1, const pandora::CartesianVector &position2, const pandora::CartesianVector &position3, pandora::CartesianVector &outputU, pandora::CartesianVector &outputV, pandora::CartesianVector &outputW, float &chiSquared)
Merge 2D positions from three views to give unified 2D positions for each view.
CartesianVector lar_content::LArGeometryHelper::MergeTwoDirections ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const pandora::CartesianVector &  direction1,
const pandora::CartesianVector &  direction2 
)
static

Merge two views (U,V) to give a third view (Z).

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
direction1the direction in the first view
direction2the direction in the second view

Definition at line 71 of file LArGeometryHelper.cc.

73 {
74  // x components must be consistent
75  if (direction1.GetX() * direction2.GetX() < 0.f)
76  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
77 
78  // scale x components to a common value
79  const float s1((std::fabs(direction1.GetX()) > std::numeric_limits<float>::epsilon()) ? 100.f * std::fabs(direction2.GetX()) : 1.f);
80  const float s2((std::fabs(direction2.GetX()) > std::numeric_limits<float>::epsilon()) ? 100.f * std::fabs(direction1.GetX()) : 1.f);
81 
82  float pX(s1 * direction1.GetX()), pU(0.f), pV(0.f), pW(0.f);
83  HitType newView(HIT_CUSTOM);
84 
85  if ((view1 == TPC_VIEW_U) && (view2 == TPC_VIEW_V))
86  {
87  pU = s1 * direction1.GetZ();
88  pV = s2 * direction2.GetZ();
89  newView = TPC_VIEW_W;
90  }
91 
92  if ((view1 == TPC_VIEW_V) && (view2 == TPC_VIEW_U))
93  {
94  pV = s1 * direction1.GetZ();
95  pU = s2 * direction2.GetZ();
96  newView = TPC_VIEW_W;
97  }
98 
99  if ((view1 == TPC_VIEW_W) && (view2 == TPC_VIEW_U))
100  {
101  pW = s1 * direction1.GetZ();
102  pU = s2 * direction2.GetZ();
103  newView = TPC_VIEW_V;
104  }
105 
106  if ((view1 == TPC_VIEW_U) && (view2 == TPC_VIEW_W))
107  {
108  pU = s1 * direction1.GetZ();
109  pW = s2 * direction2.GetZ();
110  newView = TPC_VIEW_V;
111  }
112 
113  if ((view1 == TPC_VIEW_V) && (view2 == TPC_VIEW_W))
114  {
115  pV = s1 * direction1.GetZ();
116  pW = s2 * direction2.GetZ();
117  newView = TPC_VIEW_U;
118  }
119 
120  if ((view1 == TPC_VIEW_W) && (view2 == TPC_VIEW_V))
121  {
122  pW = s1 * direction1.GetZ();
123  pV = s2 * direction2.GetZ();
124  newView = TPC_VIEW_U;
125  }
126 
127  if (newView == TPC_VIEW_W)
128  return CartesianVector(pX, 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->UVtoW(pU, pV)).GetUnitVector();
129 
130  if (newView == TPC_VIEW_U)
131  return CartesianVector(pX, 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->VWtoU(pV, pW)).GetUnitVector();
132 
133  if (newView == TPC_VIEW_V)
134  return CartesianVector(pX, 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->WUtoV(pW, pU)).GetUnitVector();
135 
136  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
137 }
enum cvn::HType HitType
static float lar_content::LArGeometryHelper::MergeTwoPositions ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const float  position1,
const float  position2 
)
static

Merge two views (U,V) to give a third view (Z).

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
position1the position in the first view
position2the position in the second view
static void lar_content::LArGeometryHelper::MergeTwoPositions ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const pandora::CartesianVector &  position1,
const pandora::CartesianVector &  position2,
pandora::CartesianVector &  position3,
float &  chiSquared 
)
static

Merge 2D positions from two views to give 2D position in third view.

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
position1the position in the first view
position2the position in the second view
position3output position in the third view
chi-squared
static void lar_content::LArGeometryHelper::MergeTwoPositions ( const pandora::Pandora &  pandora,
const pandora::HitType  view1,
const pandora::HitType  view2,
const pandora::CartesianVector &  position1,
const pandora::CartesianVector &  position2,
pandora::CartesianVector &  outputU,
pandora::CartesianVector &  outputV,
pandora::CartesianVector &  outputW,
float &  chiSquared 
)
static

Merge 2D positions from two views to give 2D position in third view.

Parameters
view1the first view
view2the second view
position1the position in the first view
position2the position in the second view
positionUoutput position in the U view
positionVoutput position in the V view
positionWoutput position in the W view
chi-squared
void lar_content::LArGeometryHelper::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 
)
static

Merge 2D positions from two views to give unified 3D position.

Parameters
pandorathe associated pandora instance
view1the first view
view2the second view
position1the position in the first view
position2the position in the second view
position3Doutput position in 3D
chi-squared

Definition at line 299 of file LArGeometryHelper.cc.

301 {
302  CartesianVector positionU(0.f, 0.f, 0.f), positionV(0.f, 0.f, 0.f), positionW(0.f, 0.f, 0.f);
303  LArGeometryHelper::MergeTwoPositions(pandora, view1, view2, position1, position2, positionU, positionV, positionW, chiSquared);
304 
305  position3D.SetValues(positionW.GetX(), pandora.GetPlugins()->GetLArTransformationPlugin()->UVtoY(positionU.GetZ(), positionV.GetZ()),
306  pandora.GetPlugins()->GetLArTransformationPlugin()->UVtoZ(positionU.GetZ(), positionV.GetZ()));
307 }
static float MergeTwoPositions(const pandora::Pandora &pandora, const pandora::HitType view1, const pandora::HitType view2, const float position1, const float position2)
Merge two views (U,V) to give a third view (Z).
CartesianVector lar_content::LArGeometryHelper::ProjectDirection ( const pandora::Pandora &  pandora,
const pandora::CartesianVector &  direction3D,
const pandora::HitType  view 
)
static

Project 3D direction into a given 2D view.

Parameters
pandorathe associated pandora instance
direction3Dthe direction in 3D
viewthe 2D projection

Definition at line 348 of file LArGeometryHelper.cc.

349 {
350  if (view == TPC_VIEW_U)
351  {
352  return CartesianVector(
353  direction3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoU(direction3D.GetY(), direction3D.GetZ()))
354  .GetUnitVector();
355  }
356 
357  else if (view == TPC_VIEW_V)
358  {
359  return CartesianVector(
360  direction3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoV(direction3D.GetY(), direction3D.GetZ()))
361  .GetUnitVector();
362  }
363 
364  else if (view == TPC_VIEW_W)
365  {
366  return CartesianVector(
367  direction3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoW(direction3D.GetY(), direction3D.GetZ()))
368  .GetUnitVector();
369  }
370 
371  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
372 }
CartesianVector lar_content::LArGeometryHelper::ProjectPosition ( const pandora::Pandora &  pandora,
const pandora::CartesianVector &  position3D,
const pandora::HitType  view 
)
static

Project 3D position into a given 2D view.

Parameters
pandorathe associated pandora instance
position3Dthe position in 3D
viewthe 2D projection

Definition at line 323 of file LArGeometryHelper.cc.

324 {
325  if (view == TPC_VIEW_U)
326  {
327  return CartesianVector(
328  position3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoU(position3D.GetY(), position3D.GetZ()));
329  }
330 
331  else if (view == TPC_VIEW_V)
332  {
333  return CartesianVector(
334  position3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoV(position3D.GetY(), position3D.GetZ()));
335  }
336 
337  else if (view == TPC_VIEW_W)
338  {
339  return CartesianVector(
340  position3D.GetX(), 0.f, pandora.GetPlugins()->GetLArTransformationPlugin()->YZtoW(position3D.GetY(), position3D.GetZ()));
341  }
342 
343  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
344 }

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