LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
MultiValuedTransverseTrackHitsTool.cc
Go to the documentation of this file.
1 
9 #include "Pandora/AlgorithmHeaders.h"
10 
12 
13 using namespace pandora;
14 
15 namespace lar_content
16 {
17 
18 void MultiValuedTransverseTrackHitsTool::GetTransverseTrackHit3D(const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHit &protoHit) const
19 {
20  const CaloHit *const pCaloHit2D(protoHit.GetParentCaloHit2D());
21  const HitType hitType(pCaloHit2D->GetHitType());
22  const HitType hitType1((TPC_VIEW_U == hitType) ? TPC_VIEW_V : (TPC_VIEW_V == hitType) ? TPC_VIEW_W : TPC_VIEW_U);
23  const HitType hitType2((TPC_VIEW_U == hitType) ? TPC_VIEW_W : (TPC_VIEW_V == hitType) ? TPC_VIEW_U : TPC_VIEW_V);
24 
25  CartesianPointVector fitPositionList1, fitPositionList2;
26 
27  MatchedSlidingFitMap::const_iterator iter1 = matchedSlidingFitMap.find(hitType1);
28 
29  if (matchedSlidingFitMap.end() != iter1)
30  {
31  const TwoDSlidingFitResult &fitResult1 = iter1->second;
32  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, fitResult1.GetGlobalFitPositionListAtX(pCaloHit2D->GetPositionVector().GetX(), fitPositionList1));
33  }
34 
35  MatchedSlidingFitMap::const_iterator iter2 = matchedSlidingFitMap.find(hitType2);
36 
37  if (matchedSlidingFitMap.end() != iter2)
38  {
39  const TwoDSlidingFitResult &fitResult2 = iter2->second;
40  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, fitResult2.GetGlobalFitPositionListAtX(pCaloHit2D->GetPositionVector().GetX(), fitPositionList2));
41  }
42 
43  unsigned int nViews(1);
44  if (fitPositionList1.size() > 0) ++nViews;
45  if (fitPositionList2.size() > 0) ++nViews;
46 
47  if (nViews < m_minViews)
48  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
49 
50  if (nViews <= 2)
51  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
52 
53  this->GetBestPosition3D(hitType1, hitType2, fitPositionList1, fitPositionList2, protoHit);
54 }
55 
56 } // namespace lar_content
Proto hits are temporary constructs to be used during iterative 3D hit procedure. ...
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
Header file for the multivalued transverse track hit creation tool.
const pandora::CaloHit * GetParentCaloHit2D() const
Get the address of the parent 2D calo hit.
intermediate_table::const_iterator const_iterator
pandora::StatusCode GetGlobalFitPositionListAtX(const float x, pandora::CartesianPointVector &positionList) const
Get a list of projected positions for a given input x coordinate.