Split cluster.
133 const Cluster *
const pCluster = slidingFitResult.GetCluster();
136 FloatVector displacementVector;
138 for (CartesianPointVector::const_iterator pIter = splitPositionVector.begin(), pIterEnd = splitPositionVector.end(); pIter != pIterEnd; ++pIter)
140 const CartesianVector &splitPosition = *pIter;
142 float rL(0.f), rT(0.f);
143 slidingFitResult.GetLocalPosition(splitPosition, rL, rT);
144 displacementVector.push_back(rL);
147 const float bigL(2.f * slidingFitResult.GetL(slidingFitResult.GetMaxLayer()));
148 displacementVector.push_back(-bigL);
149 displacementVector.push_back(+bigL);
151 std::sort(displacementVector.begin(), displacementVector.end());
154 const ClusterList clusterList(1, pCluster);
155 std::string clusterListToSave, clusterListToDelete;
157 PANDORA_RETURN_RESULT_IF(
158 STATUS_CODE_SUCCESS, !=, PandoraContentApi::InitializeFragmentation(*
this, clusterList, clusterListToDelete, clusterListToSave));
160 CaloHitList oldCaloHitList;
161 pCluster->GetOrderedCaloHitList().FillCaloHitList(oldCaloHitList);
163 bool foundPreviousL(
false);
166 for (FloatVector::const_iterator fIter = displacementVector.begin(), fIterEnd = displacementVector.end(); fIter != fIterEnd; ++fIter)
168 const float nextL(*fIter);
173 CaloHitList newCaloHitList;
175 for (CaloHitList::const_iterator hIter = oldCaloHitList.begin(), hIterEnd = oldCaloHitList.end(); hIter != hIterEnd; ++hIter)
177 const CaloHit *
const pCaloHit = *hIter;
179 float rL(0.f), rT(0.f);
180 slidingFitResult.GetLocalPosition(pCaloHit->GetPositionVector(), rL, rT);
182 if (rL >= prevL && rL < nextL)
183 newCaloHitList.push_back(pCaloHit);
186 if (newCaloHitList.empty())
191 newParameters.m_caloHitList = newCaloHitList;
193 const Cluster *pNewCluster(NULL);
194 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::Cluster::Create(*
this, newParameters, pNewCluster));
198 foundPreviousL =
true;
202 PANDORA_RETURN_RESULT_IF(STATUS_CODE_SUCCESS, !=, PandoraContentApi::EndFragmentation(*
this, clusterListToSave, clusterListToDelete));
204 return STATUS_CODE_SUCCESS;
fhicl::Table< sbnd::crt::CRTDetSimParams > Parameters