5 std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> >
8 if(particles.empty())
throw VertexException(
"Sorting particles for vertex fitter::number of particles = 0");
9 std::vector<RefCountedKinematicParticle> sortedParticles;
10 std::vector<FreeTrajectoryState> sortedStates;
14 for(std::vector<RefCountedKinematicParticle>::const_iterator
i = particles.begin();
i != particles.end();
i++)
16 if((*i)->correspondingTree() !=
nullptr)
18 sortedParticles.push_back((*i)->correspondingTree()->topParticle());
19 sortedStates.push_back((*i)->correspondingTree()->topParticle()->currentState().freeTrajectoryState());
21 sortedParticles.push_back(*
i);
22 sortedStates.push_back((*i)->currentState().freeTrajectoryState());
25 return std::pair<std::vector<RefCountedKinematicParticle>, std::vector<FreeTrajectoryState> >(sortedParticles, sortedStates);
28 std::vector<RefCountedKinematicParticle>
InputSort::sort(
const std::vector<RefCountedKinematicTree> &trees)
const 30 if(trees.empty())
throw VertexException(
"Input Sort::Zero vector of trees passed");
31 std::vector<RefCountedKinematicParticle>
res;
32 for(std::vector<RefCountedKinematicTree>::const_iterator
i = trees.begin();
i!=trees.end();
i++)
34 (*i)->movePointerToTheTop();
35 res.push_back((*i)->currentParticle());