MultiValuedTransverseTrackHitsTool.cc
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArThreeDReco/LArHitCreation/MultiValuedTransverseTrackHitsTool.cc
3  *
4  * @brief Implementation of the multivalued transverse track hit creation tool.
5  *
6  * $Log: $
7  */
8 
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, !=,
33  fitResult1.GetGlobalFitPositionListAtX(pCaloHit2D->GetPositionVector().GetX(), fitPositionList1));
34  }
35 
36  MatchedSlidingFitMap::const_iterator iter2 = matchedSlidingFitMap.find(hitType2);
37 
38  if (matchedSlidingFitMap.end() != iter2)
39  {
40  const TwoDSlidingFitResult &fitResult2 = iter2->second;
41  PANDORA_THROW_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=,
42  fitResult2.GetGlobalFitPositionListAtX(pCaloHit2D->GetPositionVector().GetX(), fitPositionList2));
43  }
44 
45  unsigned int nViews(1);
46  if (fitPositionList1.size() > 0)
47  ++nViews;
48  if (fitPositionList2.size() > 0)
49  ++nViews;
50 
51  if (nViews < m_minViews)
52  throw StatusCodeException(STATUS_CODE_NOT_FOUND);
53 
54  if (nViews <= 2)
55  throw StatusCodeException(STATUS_CODE_INVALID_PARAMETER);
56 
57  this->GetBestPosition3D(hitType1, hitType2, fitPositionList1, fitPositionList2, protoHit);
58 }
59 
60 } // namespace lar_content
Proto hits are temporary constructs to be used during iterative 3D hit procedure. ...
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
enum cvn::HType HitType
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.