35 if (fitPositionList1.empty() && fitPositionList2.empty())
39 else if (fitPositionList1.empty())
41 if (fitPositionList2.size() != 1)
46 else if (fitPositionList2.empty())
48 if (fitPositionList1.size() != 1)
60 this->
GetBestPosition3D(hitType1, hitType2, fitPosition1, fitPosition2, thisProtoHit);
63 protoHit = thisProtoHit;
81 const double sigmaHit(sigmaFit);
84 double chi2(std::numeric_limits<double>::max());
93 const double sigmaU((
TPC_VIEW_U == hitType) ? sigmaHit : sigmaFit);
94 const double sigmaV((
TPC_VIEW_V == hitType) ? sigmaHit : sigmaFit);
95 const double sigmaW((
TPC_VIEW_W == hitType) ? sigmaHit : sigmaFit);
97 double bestY(std::numeric_limits<double>::max()), bestZ(std::numeric_limits<double>::max());
103 const double chi2X(((deltaX1 * deltaX1) /
m_sigmaX2) + ((deltaX2 * deltaX2) /
m_sigmaX2));
122 float chi2(std::numeric_limits<float>::max());
128 const double chi2X((deltaX * deltaX) /
m_sigmaX2);
144 if (
m_sigmaX2 < std::numeric_limits<double>::epsilon())
146 std::cout <<
"HitCreationBaseTool - Invalid parameter, SigmaX: " << sigmaX << std::endl;
147 return STATUS_CODE_INVALID_PARAMETER;
152 return STATUS_CODE_SUCCESS;
Header file for the geometry helper class.
#define PANDORA_RETURN_RESULT_IF_AND_IF(StatusCode1, StatusCode2, Operator, Command)
ThreeDHitCreationAlgorithm::TrajectorySample TrajectorySample
double m_sigmaX2
The sigmaX squared value, for calculation of chi2 deltaX term.
virtual ~HitCreationBaseTool()
Destructor.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
Read the algorithm settings.
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...
double m_chiSquaredCut
The chi squared cut (accept only values below the cut value)
HitCreationBaseTool()
Default constructor.
static float GetSigmaUVW(const pandora::Pandora &pandora, const float maxSigmaDiscrepancy=0.01)
Find the sigmaUVW value for the detector geometry.
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.
Proto hits are temporary constructs to be used during iterative 3D hit procedure.
void SetPosition3D(const pandora::CartesianVector &position3D, const double chi2)
Set position 3D.
double GetChi2() const
Get the chi squared value.
void AddTrajectorySample(const TrajectorySample &trajectorySample)
Add a trajectory sample.
bool IsPositionSet() const
Whether the proto hit position is set.
const pandora::CaloHit * GetParentCaloHit2D() const
Get the address of the parent 2D calo hit.
HitType GetHitType() const
Get the calorimeter hit type.
const CartesianVector & GetPositionVector() const
Get the position vector of center of calorimeter cell, units mm.
void SetValues(float x, float y, float z)
Set the values of cartesian vector components.
float GetX() const
Get the cartesian x coordinate.
float GetZ() const
Get the cartesian z coordinate.
const PluginManager * GetPlugins() const
Get the pandora plugin instance, providing access to user registered functions and calculators.
const LArTransformationPlugin * GetLArTransformationPlugin() const
Get the address of the lar transformation plugin.
const Pandora & GetPandora() const
Get the associated pandora instance.
StatusCodeException class.
static StatusCode ReadValue(const TiXmlHandle &xmlHandle, const std::string &xmlElementName, T &t)
Read a value from an xml element.
HitType
Calorimeter hit type enum.
std::vector< CartesianVector > CartesianPointVector
StatusCode
The StatusCode enum.