11 #include <alignment/modules/UpdateParticleTrackCand/UpdateParticleTrackCandModule.h>
13 #include <analysis/dataobjects/ParticleList.h>
14 #include <framework/datastore/StoreObjPtr.h>
15 #include <framework/geometry/B2Vector3.h>
16 #include <mdst/dataobjects/Track.h>
18 #include <genfit/TrackCand.h>
34 setDescription(
"Updates the seed in TrackCand based on fitted state (at vertex)");
37 addParam(
"motherListNames", m_motherListNames,
"Names of particle list which daughters have to be updated");
39 addParam(
"removePXD", m_removePXD,
"Remove PXD hits from TrackCand?",
bool(
false));
40 addParam(
"removeSVD", m_removeSVD,
"Remove SVD hits from TrackCand?",
bool(
false));
41 addParam(
"removeCDC", m_removeCDC,
"Remove CDC hits from TrackCand?",
bool(
false));
42 addParam(
"removeBKLM", m_removeBKLM,
"Remove BKLM hits from TrackCand?",
bool(
false));
53 auto listSize = list->getListSize(
false);
54 for (
unsigned int iParticle = 0; iParticle < listSize; ++iParticle) {
55 auto mother = list->getParticle(iParticle,
false);
56 for (
auto daughter : mother->getDaughters()) {
57 auto particle = daughter;
58 auto track = particle->getTrack();
59 auto trackFitResult = track->getTrackFitResult(
Const::pion);
60 if (not trackFitResult) {
61 B2WARNING(
"Skipping track without valid pion hypothesis.");
69 for (
unsigned int iCandHit = 0; iCandHit < copyCand.getNHits(); ++iCandHit) {
71 double sortingParameter;
72 copyCand.getHit(iCandHit, detID, hitID, sortingParameter);
79 trackCand->addHit(detID, hitID, -1, sortingParameter);
84 B2Vector3D vertexMom = particle->getMomentum();
85 trackCand->setPosMomSeed(vertexPos, vertexMom, particle->getCharge());
86 trackCand->setPdgCode(particle->getPDGCode());