47 auto listSize = list->getListSize(
false);
48 for (
unsigned int iParticle = 0; iParticle < listSize; ++iParticle) {
49 auto mother = list->getParticle(iParticle,
false);
50 for (
auto daughter : mother->getDaughters()) {
51 auto particle = daughter;
52 auto track = particle->getTrack();
53 auto trackFitResult = track->getTrackFitResult(
Const::pion);
54 if (not trackFitResult) {
55 B2WARNING(
"Skipping track without valid pion hypothesis.");
58 auto trackCand = trackFitResult->getRelatedFrom<genfit::TrackCand>();
61 genfit::TrackCand copyCand(*trackCand);
63 for (
unsigned int iCandHit = 0; iCandHit < copyCand.getNHits(); ++iCandHit) {
65 double sortingParameter;
66 copyCand.getHit(iCandHit, detID, hitID, sortingParameter);
73 trackCand->addHit(detID, hitID, -1, sortingParameter);
78 B2Vector3D vertexMom = particle->getMomentum();
79 trackCand->setPosMomSeed(vertexPos, vertexMom, particle->getCharge());
80 trackCand->setPdgCode(particle->getPDGCode());
virtual void event() override
update candidates
bool m_removeCDC
Remove CDC hits from TrackCand.
bool m_removePXD
Remove PXD hits from TrackCand.
bool m_removeBKLM
Remove BKLM hits from TrackCand.
bool m_removeSVD
Remove SVD hits from TrackCand.
std::vector< std::string > m_motherListNames
Names of particle list which tracks should be updated.
UpdateParticleTrackCandModule()
Constructor: Sets the description, the properties and the parameters of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.