9#include <alignment/modules/UpdateParticleTrackCand/UpdateParticleTrackCandModule.h>
11#include <analysis/dataobjects/ParticleList.h>
12#include <framework/datastore/StoreObjPtr.h>
13#include <framework/geometry/B2Vector3.h>
14#include <mdst/dataobjects/Track.h>
16#include <genfit/TrackCand.h>
32 setDescription(
"Updates the seed in TrackCand based on fitted state (at vertex)");
51 auto listSize = list->getListSize(
false);
52 for (
unsigned int iParticle = 0; iParticle < listSize; ++iParticle) {
53 auto mother = list->getParticle(iParticle,
false);
54 for (
auto daughter : mother->getDaughters()) {
55 auto particle = daughter;
56 auto track = particle->getTrack();
57 auto trackFitResult = track->getTrackFitResult(
Const::pion);
58 if (not trackFitResult) {
59 B2WARNING(
"Skipping track without valid pion hypothesis.");
62 auto trackCand = trackFitResult->getRelatedFrom<genfit::TrackCand>();
65 genfit::TrackCand copyCand(*trackCand);
67 for (
unsigned int iCandHit = 0; iCandHit < copyCand.getNHits(); ++iCandHit) {
69 double sortingParameter;
70 copyCand.getHit(iCandHit, detID, hitID, sortingParameter);
77 trackCand->addHit(detID, hitID, -1, sortingParameter);
82 B2Vector3D vertexMom = particle->getMomentum();
83 trackCand->setPosMomSeed(vertexPos, vertexMom, particle->getCharge());
84 trackCand->setPdgCode(particle->getPDGCode());
static const ChargedStable pion
charged pion particle
void setDescription(const std::string &description)
Sets the description of the module.
Type-safe access to single objects in the data store.
virtual void initialize() override
init
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.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.