LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LArConnectionPathwayHelper Class Reference

LArConnectionPathwayHelper class. More...

#include "LArConnectionPathwayHelper.h"

Classes

class  SortByDistanceToPoint
 SortByDistanceToPoint class. More...
 

Static Public Member Functions

static bool FindShowerStarts3D (const pandora::Algorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pShowerPfo, const ProtoShowerMatch &protoShowerMatch, const pandora::CartesianVector &nuVertexPosition, const float maxSeparationFromHit, const float maxProjectionSeparation, const float maxXSeparation, pandora::CartesianPointVector &showerStarts3D)
 Create 3D shower start position(s) from three input 2D positions. More...
 
static void FindShowerStartFromPosition (const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &showerStart3D)
 Create 3D shower start position from three input 2D positions, assuming consistency of position. More...
 
static bool FindShowerStartFromDirection (const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &uShowerStart3D, pandora::CartesianVector &vShowerStart3D, pandora::CartesianVector &wShowerStart3D)
 Create a 3D shower start position from each input 2D position, assuming consistency of initial direction. More...
 
static bool FindShowerStartFromDirection (const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShowerA, const ProtoShower &protoShowerB, pandora::CartesianVector &showerStart3D)
 Create a 3D shower start position from an input 2D position, assuming consistency of initial direction. More...
 
static bool ProjectShowerStartByDirection (const ProtoShower &protoShower, const float x, pandora::CartesianVector &showerStart2D)
 Find a 2D shower start, from a drift coordinate by assuming consistency of initial direction. More...
 
static bool FindShowerStartFromXProjection (const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
 Create a 3D shower start position from an input 2D position, assuming consistency of the drift coordinate. More...
 
static bool FindClosestSpinePosition (const ProtoShower &protoShower, const pandora::CartesianVector &showerStart3D, const float maxXSeparation, pandora::CartesianVector &foundShowerStart)
 Find the 2D spine hit that is closest to the neutrino vertex and shares a drift coordinate with an input 3D position. More...
 
static bool FindShowerStartFromXProjectionRelaxed (const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
 A relaxed approach to create a 3D shower start position from an input 2D position, assuming consistency of the drift coordinate. More...
 
static void GetMinMiddleMax (const float value1, const float value2, const float value3, float &minValue, float &middleValue, float &maxValue)
 Determine the lowest, median and highest value from an input of three numbers. More...
 

Detailed Description

LArConnectionPathwayHelper class.

Definition at line 21 of file LArConnectionPathwayHelper.h.

Member Function Documentation

bool lar_content::LArConnectionPathwayHelper::FindClosestSpinePosition ( const ProtoShower protoShower,
const pandora::CartesianVector &  showerStart3D,
const float  maxXSeparation,
pandora::CartesianVector &  foundShowerStart 
)
static

Find the 2D spine hit that is closest to the neutrino vertex and shares a drift coordinate with an input 3D position.

Parameters
protoShowerthe input ProtoShower in which to search
showerStart3Dthe input 3D shower start position
maxXSeparationthe max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit
foundShowerStartthe output matched 2D hit position
Returns
whether a 2D spine hit could be found

Definition at line 270 of file LArConnectionPathwayHelper.cc.

References f, lar_content::ProtoShower::GetConnectionPathway(), lar_content::ProtoShower::GetSpineHitList(), lar_content::ConnectionPathway::GetStartDirection(), and lar_content::ConnectionPathway::GetStartPosition().

272 {
273  bool found(false);
274  float lowestL(std::numeric_limits<float>::max());
275 
276  for (const CaloHit *const pCaloHit : protoShower.GetSpineHitList())
277  {
278  if (std::fabs(pCaloHit->GetPositionVector().GetX() - showerStart3D.GetX()) > maxXSeparation)
279  continue;
280 
281  const float lVertex(protoShower.GetConnectionPathway().GetStartDirection().GetDotProduct(
282  pCaloHit->GetPositionVector() - protoShower.GetConnectionPathway().GetStartPosition()));
283 
284  if ((lVertex > 0.f) && (lVertex < lowestL))
285  {
286  lowestL = lVertex;
287  foundShowerStart = pCaloHit->GetPositionVector();
288  found = true;
289  }
290  }
291 
292  return found;
293 }
TFile f
Definition: plotHisto.C:6
static bool lar_content::LArConnectionPathwayHelper::FindShowerStartFromDirection ( const pandora::Algorithm *const  pAlgorithm,
const ProtoShower protoShowerU,
const ProtoShower protoShowerV,
const ProtoShower protoShowerW,
pandora::CartesianVector &  uShowerStart3D,
pandora::CartesianVector &  vShowerStart3D,
pandora::CartesianVector &  wShowerStart3D 
)
static

Create a 3D shower start position from each input 2D position, assuming consistency of initial direction.

Parameters
pAlgorithmthe calling algorithm
protoShowerUthe U view ProtoShower
protoShowerVthe V view ProtoShower
protoShowerWthe W view ProtoShower
uShowerStart3Dthe output 3D shower start created from the U view shower start position
vShowerStart3Dthe output 3D shower start created from the V view shower start position
wShowerStart3Dthe output 3D shower start created from the W view shower start position
Returns
whether the 3D shower start positions could be created
static bool lar_content::LArConnectionPathwayHelper::FindShowerStartFromDirection ( const pandora::Algorithm *const  pAlgorithm,
const ProtoShower protoShower,
const ProtoShower protoShowerA,
const ProtoShower protoShowerB,
pandora::CartesianVector &  showerStart3D 
)
static

Create a 3D shower start position from an input 2D position, assuming consistency of initial direction.

Parameters
pAlgorithmthe calling algorithm
protoShowerthe input 2D position ProtoShower owner
protoShowerAthe ProtoShower of another view
protoShowerBthe ProtoShower in the remaining view
showerStart3Dthe output 3D shower start
Returns
whether a 3D shower start position could be created
void lar_content::LArConnectionPathwayHelper::FindShowerStartFromPosition ( const pandora::Algorithm *const  pAlgorithm,
const ProtoShower protoShowerU,
const ProtoShower protoShowerV,
const ProtoShower protoShowerW,
pandora::CartesianVector &  showerStart3D 
)
static

Create 3D shower start position from three input 2D positions, assuming consistency of position.

Parameters
pAlgorithmthe calling algorithm
protoShowerUthe U view ProtoShower
protoShowerVthe V view ProtoShower
protoShowerWthe W view ProtoShower
showerStart3Dthe output 3D shower start position

Definition at line 148 of file LArConnectionPathwayHelper.cc.

References f, lar_content::ProtoShower::GetShowerCore(), lar_content::ProtoShower::GetSpineHitList(), lar_content::ShowerCore::GetStartPosition(), and x.

150 {
151  const CartesianVector showerStartU(protoShowerU.GetShowerCore().GetStartPosition());
152  const CartesianVector showerStartV(protoShowerV.GetShowerCore().GetStartPosition());
153  const CartesianVector showerStartW(protoShowerW.GetShowerCore().GetStartPosition());
154 
155  float chi2(0.0);
157  pAlgorithm->GetPandora(), TPC_VIEW_U, TPC_VIEW_V, TPC_VIEW_W, showerStartU, showerStartV, showerStartW, showerStart3D, chi2);
158 }
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.
bool lar_content::LArConnectionPathwayHelper::FindShowerStartFromXProjection ( const pandora::Algorithm *const  pAlgorithm,
const ProtoShower protoShower,
const ProtoShower protoShower1,
const ProtoShower protoShower2,
const float  maxSeparation,
const float  maxXSeparation,
pandora::CartesianVector &  showerStart3D 
)
static

Create a 3D shower start position from an input 2D position, assuming consistency of the drift coordinate.

Parameters
pAlgorithmthe calling algorithm
protoShowerthe ProtoShower from which the input 2D shower start is obtained
protoShower1a matched ProtoShower from another view
protoShower2the matched ProtoShower from the final view
maxSeparationthe max. separation between the projected 3D shower start and the shower start of that view
maxXSeparationthe max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit
showerStart3Dthe output 3D shower start
Returns
whether the 3D shower start positions could be created

Definition at line 228 of file LArConnectionPathwayHelper.cc.

References f, lar_content::ProtoShower::GetShowerCore(), lar_content::ProtoShower::GetSpineHitList(), and lar_content::ShowerCore::GetStartPosition().

230 {
231  const CartesianVector showerStart(protoShower.GetShowerCore().GetStartPosition());
232  CartesianVector showerStart1(0.f, 0.f, 0.f), showerStart2(0.f, 0.f, 0.f);
233 
234  const HitType hitType(protoShower.GetSpineHitList().front()->GetHitType());
235  const HitType hitType1(protoShower1.GetSpineHitList().front()->GetHitType());
236  const HitType hitType2(protoShower2.GetSpineHitList().front()->GetHitType());
237 
238  if (!LArConnectionPathwayHelper::FindClosestSpinePosition(protoShower1, showerStart, maxXSeparation, showerStart1))
239  return false;
240 
241  if (!LArConnectionPathwayHelper::FindClosestSpinePosition(protoShower2, showerStart, maxXSeparation, showerStart2))
242  return false;
243 
244  float chi2(0.f);
245  CartesianVector projection(0.f, 0.f, 0.f), projection1(0.f, 0.f, 0.f), projection2(0.f, 0.f, 0.f);
246 
247  LArGeometryHelper::MergeTwoPositions(pAlgorithm->GetPandora(), hitType1, hitType2, showerStart1, showerStart2, projection, chi2);
248  const float separationSquared((projection - showerStart).GetMagnitudeSquared());
249 
250  LArGeometryHelper::MergeTwoPositions(pAlgorithm->GetPandora(), hitType, hitType2, showerStart, showerStart2, projection1, chi2);
251  const float separationSquared1((projection1 - showerStart1).GetMagnitudeSquared());
252 
253  LArGeometryHelper::MergeTwoPositions(pAlgorithm->GetPandora(), hitType, hitType1, showerStart, showerStart1, projection2, chi2);
254  const float separationSquared2((projection2 - showerStart2).GetMagnitudeSquared());
255 
256  if ((separationSquared > maxSeparation * maxSeparation) || (separationSquared1 > maxSeparation * maxSeparation) ||
257  (separationSquared2 > maxSeparation * maxSeparation))
258  {
259  return false;
260  }
261 
263  pAlgorithm->GetPandora(), hitType, hitType1, hitType2, showerStart, showerStart1, showerStart2, showerStart3D, chi2);
264 
265  return true;
266 }
static bool FindClosestSpinePosition(const ProtoShower &protoShower, const pandora::CartesianVector &showerStart3D, const float maxXSeparation, pandora::CartesianVector &foundShowerStart)
Find the 2D spine hit that is closest to the neutrino vertex and shares a drift coordinate with an in...
TFile f
Definition: plotHisto.C:6
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).
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.
HitType
Definition: HitType.h:12
bool lar_content::LArConnectionPathwayHelper::FindShowerStartFromXProjectionRelaxed ( const pandora::Algorithm *const  pAlgorithm,
const ProtoShower protoShower,
const ProtoShower protoShower1,
const ProtoShower protoShower2,
const float  maxSeparation,
const float  maxXSeparation,
pandora::CartesianVector &  showerStart3D 
)
static

A relaxed approach to create a 3D shower start position from an input 2D position, assuming consistency of the drift coordinate.

Parameters
pAlgorithmthe calling algorithm
protoShowerthe ProtoShower from which the input 2D shower start is obtained
protoShower1a matched ProtoShower from another view
protoShower2the matched ProtoShower from the final view
maxSeparationthe max. separation between the projected 3D shower start and the shower start of that view
maxXSeparationthe max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit
ShowerStart3Dthe output 3D shower start
Returns
whether the 3D shower start position could be created

Definition at line 297 of file LArConnectionPathwayHelper.cc.

References f, lar_content::ProtoShower::GetShowerCore(), lar_content::ProtoShower::GetSpineHitList(), and lar_content::ShowerCore::GetStartPosition().

299 {
300  const CartesianVector showerStart(protoShower.GetShowerCore().GetStartPosition());
301  CartesianVector showerStart1(0.f, 0.f, 0.f);
302 
303  const HitType hitType(protoShower.GetSpineHitList().front()->GetHitType());
304  const HitType hitType1(protoShower1.GetSpineHitList().front()->GetHitType());
305 
306  if (!LArConnectionPathwayHelper::FindClosestSpinePosition(protoShower1, showerStart, maxXSeparation, showerStart1))
307  return false;
308 
309  float chi2(0.f);
310  CartesianVector projection2(0.f, 0.f, 0.f);
311 
312  LArGeometryHelper::MergeTwoPositions(pAlgorithm->GetPandora(), hitType, hitType1, showerStart, showerStart1, projection2, chi2);
313 
314  // Now make sure that they agree...
315  const CaloHitList &caloHitList2(protoShower2.GetSpineHitList());
316  const float separation(LArClusterHelper::GetClosestDistance(projection2, caloHitList2));
317 
318  if (separation > maxSeparation)
319  return false;
320 
321  LArGeometryHelper::MergeTwoPositions3D(pAlgorithm->GetPandora(), hitType, hitType1, showerStart, showerStart1, showerStart3D, chi2);
322 
323  return true;
324 }
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.
static bool FindClosestSpinePosition(const ProtoShower &protoShower, const pandora::CartesianVector &showerStart3D, const float maxXSeparation, pandora::CartesianVector &foundShowerStart)
Find the 2D spine hit that is closest to the neutrino vertex and shares a drift coordinate with an in...
TFile f
Definition: plotHisto.C:6
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).
HitType
Definition: HitType.h:12
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
bool lar_content::LArConnectionPathwayHelper::FindShowerStarts3D ( const pandora::Algorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pShowerPfo,
const ProtoShowerMatch protoShowerMatch,
const pandora::CartesianVector &  nuVertexPosition,
const float  maxSeparationFromHit,
const float  maxProjectionSeparation,
const float  maxXSeparation,
pandora::CartesianPointVector &  showerStarts3D 
)
static

Create 3D shower start position(s) from three input 2D positions.

Parameters
pAlgorithmthe calling algorithm
pShowerPfothe shower pfo
protoShowerMatchthe ProtoShowerMatch object
nuVertexPositionthe 3D neutrino vertex
maxSeparationFromHitthe max. separation between a projected 3D shower start and the closest 2D shower hit
maxProjectionSeparationthe max. separation between the projected 3D shower start and the shower start of that view
maxXSeparationthe max. drift-coordinate separation between a 3D shower start and a matched 2D shower hit
showerStarts3Dthe output vector of 3D shower starts (ordered closest -> furthest from the neutrino vertex)
Returns
whether a consistent 3D shower start position could be created

Definition at line 45 of file LArConnectionPathwayHelper.cc.

References lar_content::DIRECTION, f, lar_content::ProtoShowerMatch::GetConsistencyType(), lar_content::ProtoShowerMatch::GetProtoShowerU(), lar_content::ProtoShowerMatch::GetProtoShowerV(), lar_content::ProtoShowerMatch::GetProtoShowerW(), lar_content::POSITION, and lar_content::X_PROJECTION.

Referenced by lar_content::ElectronInitialRegionRefinementAlgorithm::RefineShower().

48 {
49  const ProtoShower &protoShowerU(protoShowerMatch.GetProtoShowerU());
50  const ProtoShower &protoShowerV(protoShowerMatch.GetProtoShowerV());
51  const ProtoShower &protoShowerW(protoShowerMatch.GetProtoShowerW());
52  const Consistency consistency(protoShowerMatch.GetConsistencyType());
53 
54  bool uFound(false), vFound(false), wFound(false);
55  CartesianVector uShowerStart3D(0.f, 0.f, 0.f), vShowerStart3D(0.f, 0.f, 0.f), wShowerStart3D(0.f, 0.f, 0.f);
56 
57  CaloHitList caloHitList3D;
58  LArPfoHelper::GetCaloHits(pShowerPfo, TPC_3D, caloHitList3D);
59 
60  if (consistency == Consistency::POSITION)
61  {
62  LArConnectionPathwayHelper::FindShowerStartFromPosition(pAlgorithm, protoShowerU, protoShowerV, protoShowerW, uShowerStart3D);
63  vShowerStart3D = uShowerStart3D;
64  wShowerStart3D = uShowerStart3D;
65 
66  if (LArClusterHelper::GetClosestDistance(uShowerStart3D, caloHitList3D) < maxSeparationFromHit)
67  {
68  uFound = true;
69  vFound = true;
70  wFound = true;
71  }
72  }
73  else if (consistency == Consistency::DIRECTION)
74  {
76  pAlgorithm, protoShowerU, protoShowerV, protoShowerW, uShowerStart3D, vShowerStart3D, wShowerStart3D))
77  {
78  if (LArClusterHelper::GetClosestDistance(uShowerStart3D, caloHitList3D) < maxSeparationFromHit)
79  uFound = true;
80 
81  if (LArClusterHelper::GetClosestDistance(vShowerStart3D, caloHitList3D) < maxSeparationFromHit)
82  vFound = true;
83 
84  if (LArClusterHelper::GetClosestDistance(wShowerStart3D, caloHitList3D) < maxSeparationFromHit)
85  wFound = true;
86  }
87  }
88 
89  if (!uFound || (consistency == Consistency::X_PROJECTION))
90  {
92  pAlgorithm, protoShowerU, protoShowerV, protoShowerW, maxProjectionSeparation, maxXSeparation, uShowerStart3D) ||
94  pAlgorithm, protoShowerU, protoShowerV, protoShowerW, maxProjectionSeparation, maxXSeparation, uShowerStart3D) ||
96  pAlgorithm, protoShowerU, protoShowerW, protoShowerV, maxProjectionSeparation, maxXSeparation, uShowerStart3D))
97  {
98  uFound = true;
99  }
100 
102  pAlgorithm, protoShowerV, protoShowerW, protoShowerU, maxProjectionSeparation, maxXSeparation, vShowerStart3D) ||
104  pAlgorithm, protoShowerV, protoShowerW, protoShowerU, maxProjectionSeparation, maxXSeparation, vShowerStart3D) ||
106  pAlgorithm, protoShowerV, protoShowerU, protoShowerW, maxProjectionSeparation, maxXSeparation, vShowerStart3D))
107  {
108  vFound = true;
109  }
110 
112  pAlgorithm, protoShowerW, protoShowerU, protoShowerV, maxProjectionSeparation, maxXSeparation, wShowerStart3D) ||
114  pAlgorithm, protoShowerW, protoShowerU, protoShowerV, maxProjectionSeparation, maxXSeparation, wShowerStart3D) ||
116  pAlgorithm, protoShowerW, protoShowerV, protoShowerU, maxProjectionSeparation, maxXSeparation, wShowerStart3D))
117  {
118  wFound = true;
119  }
120  }
121 
122  CartesianPointVector foundShowerStarts3D;
123 
124  if (uFound)
125  foundShowerStarts3D.push_back(uShowerStart3D);
126 
127  if (vFound)
128  foundShowerStarts3D.push_back(vShowerStart3D);
129 
130  if (wFound)
131  foundShowerStarts3D.push_back(wShowerStart3D);
132 
133  if (foundShowerStarts3D.empty())
134  return false;
135 
136  std::sort(foundShowerStarts3D.begin(), foundShowerStarts3D.end(), LArConnectionPathwayHelper::SortByDistanceToPoint(nuVertexPosition));
137 
138  // ATTN: We need there to be three
139  showerStarts3D.push_back(foundShowerStarts3D.front());
140  showerStarts3D.push_back((foundShowerStarts3D.size() == 3) ? foundShowerStarts3D[1] : foundShowerStarts3D[0]);
141  showerStarts3D.push_back(foundShowerStarts3D.back());
142 
143  return true;
144 }
Consistency
Consistency enumeration.
static bool FindShowerStartFromXProjection(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
Create a 3D shower start position from an input 2D position, assuming consistency of the drift coordi...
TFile f
Definition: plotHisto.C:6
static void FindShowerStartFromPosition(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &showerStart3D)
Create 3D shower start position from three input 2D positions, assuming consistency of position...
static bool FindShowerStartFromDirection(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShowerU, const ProtoShower &protoShowerV, const ProtoShower &protoShowerW, pandora::CartesianVector &uShowerStart3D, pandora::CartesianVector &vShowerStart3D, pandora::CartesianVector &wShowerStart3D)
Create a 3D shower start position from each input 2D position, assuming consistency of initial direct...
static void GetCaloHits(const pandora::PfoList &pfoList, const pandora::HitType &hitType, pandora::CaloHitList &caloHitList)
Get a list of calo hits of a particular hit type from a list of pfos.
static float GetClosestDistance(const pandora::ClusterList &clusterList1, const pandora::ClusterList &clusterList2)
Get closest distance between clusters in a pair of cluster lists.
static bool FindShowerStartFromXProjectionRelaxed(const pandora::Algorithm *const pAlgorithm, const ProtoShower &protoShower, const ProtoShower &protoShower1, const ProtoShower &protoShower2, const float maxSeparation, const float maxXSeparation, pandora::CartesianVector &showerStart3D)
A relaxed approach to create a 3D shower start position from an input 2D position, assuming consistency of the drift coordinate.
void lar_content::LArConnectionPathwayHelper::GetMinMiddleMax ( const float  value1,
const float  value2,
const float  value3,
float &  minValue,
float &  middleValue,
float &  maxValue 
)
static

Determine the lowest, median and highest value from an input of three numbers.

Parameters
value1the first value
value2the second value
value3the third value
minValuethe minimum value
middleValuethe median value
maxValuethe maximum value

Definition at line 330 of file LArConnectionPathwayHelper.cc.

References util::values().

Referenced by lar_content::ConnectionRegionFeatureTool::Get2DKink(), lar_content::InitialRegionFeatureTool::InitialRegionFeatureTool(), and lar_content::ShowerRegionFeatureTool::ShowerRegionFeatureTool().

332 {
333  FloatVector values({value1, value2, value3});
334 
335  std::sort(values.begin(), values.end());
336 
337  minValue = values.at(0);
338  middleValue = values.at(1);
339  maxValue = values.at(2);
340 }
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
bool lar_content::LArConnectionPathwayHelper::ProjectShowerStartByDirection ( const ProtoShower protoShower,
const float  x,
pandora::CartesianVector &  showerStart2D 
)
static

Find a 2D shower start, from a drift coordinate by assuming consistency of initial direction.

Parameters
protoShowerthe ProtoShower for which to find the shower start
xthe drift-coordinate
showerStart2Dthe output 2D shower start
Returns
whether a 2D shower start position could be found

Definition at line 207 of file LArConnectionPathwayHelper.cc.

References f, lar_content::ProtoShower::GetConnectionPathway(), lar_content::ProtoShower::GetShowerCore(), lar_content::ConnectionPathway::GetStartDirection(), lar_content::ShowerCore::GetStartPosition(), and lar_content::ConnectionPathway::GetStartPosition().

208 {
209  const CartesianVector &viewShowerStart(protoShower.GetShowerCore().GetStartPosition());
210  const CartesianVector &viewNuVertex(protoShower.GetConnectionPathway().GetStartPosition());
211  const CartesianVector &viewPeakDirection(protoShower.GetConnectionPathway().GetStartDirection());
212  const CartesianVector &displacement(viewShowerStart - viewNuVertex);
213  const float transverse(viewPeakDirection.GetCrossProduct(displacement).GetMagnitude());
214 
215  if (transverse > 1.f)
216  return false;
217 
218  const CartesianVector xAxis(1.f, 0.f, 0.f);
219  const float cosTheta(std::fabs(viewPeakDirection.GetCosOpeningAngle(xAxis)));
220 
221  showerStart2D = viewNuVertex + (viewPeakDirection * (std::fabs(x - viewNuVertex.GetX()) * cosTheta));
222 
223  return true;
224 }
Float_t x
Definition: compare.C:6
TFile f
Definition: plotHisto.C:6

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