Constructor.
787 double Swzz(0.), Swxx(0.), Swzx(0.), Swz(0.), Swx(0.), Sw(0.);
788 double minX(std::numeric_limits<double>::max());
789 double maxX(-std::numeric_limits<double>::max());
791 ClusterList clusterList(1, pSeedCluster);
792 clusterList.insert(clusterList.end(), associatedClusters.begin(), associatedClusters.end());
794 for (ClusterList::const_iterator iterI = clusterList.begin(), iterEndI = clusterList.end(); iterI != iterEndI; ++iterI)
796 for (OrderedCaloHitList::const_iterator iterJ = (*iterI)->GetOrderedCaloHitList().begin(),
797 iterEndJ = (*iterI)->GetOrderedCaloHitList().end();
798 iterJ != iterEndJ; ++iterJ)
800 for (CaloHitList::const_iterator iterK = iterJ->second->begin(), iterEndK = iterJ->second->end(); iterK != iterEndK; ++iterK)
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)));
833 m_direction.SetValues(static_cast<float>(
px), 0.f, static_cast<float>(
pz));
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
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
pandora::CartesianVector m_direction
pandora::ClusterVector m_associatedClusters