Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
MultiValuedTransverseTrackHitsTool.cc
Go to the documentation of this file.
1
10
12
13using namespace pandora;
14
15namespace lar_content
16{
17
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
Grouping of header files for many classes of use in particle flow algorithms.
Header file for the multivalued transverse track hit creation tool.
#define PANDORA_THROW_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
Definition StatusCodes.h:55
virtual void GetBestPosition3D(const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianPointVector &fitPositionList1, const pandora::CartesianPointVector &fitPositionList2, ProtoHit &protoHit) const
Get the three dimensional position using a provided two dimensional calo hit and candidate fit positi...
void GetTransverseTrackHit3D(const MatchedSlidingFitMap &matchedSlidingFitMap, ProtoHit &protoHit) const
Get the three dimensional position using a provided two dimensional calo hit and sliding linear fits ...
Proto hits are temporary constructs to be used during iterative 3D hit procedure.
const pandora::CaloHit * GetParentCaloHit2D() const
Get the address of the parent 2D calo hit.
unsigned int m_minViews
The minimum number of views required for building hits.
std::map< pandora::HitType, TwoDSlidingFitResult > MatchedSlidingFitMap
pandora::StatusCode GetGlobalFitPositionListAtX(const float x, pandora::CartesianPointVector &positionList) const
Get a list of projected positions for a given input x coordinate.
CaloHit class.
Definition CaloHit.h:26
HitType GetHitType() const
Get the calorimeter hit type.
Definition CaloHit.h:441
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
Definition CaloHit.h:350
float GetX() const
Get the cartesian x coordinate.
StatusCodeException class.
HitType
Calorimeter hit type enum.
std::vector< CartesianVector > CartesianPointVector