Constructor.
787 double Swzz(0.), Swxx(0.), Swzx(0.), Swz(0.), Swx(0.), Sw(0.);
791 ClusterList clusterList(1, pSeedCluster);
792 clusterList.insert(clusterList.end(), associatedClusters.begin(), associatedClusters.end());
797 iterEndJ = (*iterI)->GetOrderedCaloHitList().end();
798 iterJ != iterEndJ; ++iterJ)
802 const CaloHit *
const pCaloHit = *iterK;
804 if (pCaloHit->GetPositionVector().GetX() < minX)
805 minX = pCaloHit->GetPositionVector().GetX();
807 if (pCaloHit->GetPositionVector().GetX() > maxX)
808 maxX = pCaloHit->GetPositionVector().GetX();
810 Swzz += pCaloHit->GetPositionVector().GetZ() * pCaloHit->GetPositionVector().GetZ();
811 Swxx += pCaloHit->GetPositionVector().GetX() * pCaloHit->GetPositionVector().GetX();
812 Swzx += pCaloHit->GetPositionVector().GetZ() * pCaloHit->GetPositionVector().GetX();
813 Swz += pCaloHit->GetPositionVector().GetZ();
814 Swx += pCaloHit->GetPositionVector().GetX();
822 const double averageX(Swx / Sw);
823 const double averageZ(Swz / Sw);
825 if (Sw * Swxx - Swx * Swx > 0.)
827 double m((Sw * Swzx - Swx * Swz) / (Sw * Swxx - Swx * Swx));
828 double px(1. / std::sqrt(1. +
m *
m));
829 double pz(
m / std::sqrt(1. +
m *
m));
831 m_innerVertex.SetValues(static_cast<float>(minX), 0.
f, static_cast<float>(averageZ +
m * (minX - averageX)));
832 m_outerVertex.SetValues(static_cast<float>(maxX), 0.
f, static_cast<float>(averageZ +
m * (maxX - averageX)));
837 m_innerVertex.SetValues(static_cast<float>(averageX), 0.
f, static_cast<float>(averageZ));
838 m_outerVertex.SetValues(static_cast<float>(averageX), 0.
f, static_cast<float>(averageZ));
844 throw StatusCodeException(STATUS_CODE_NOT_INITIALIZED);
pandora::CartesianVector m_outerVertex
const pandora::Cluster * m_pSeedCluster
pandora::CartesianVector m_innerVertex
pandora::CartesianVector m_direction
static int max(int a, int b)
pandora::ClusterVector m_associatedClusters