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)");
35 addParam(
"motherListNames", m_motherListNames,
"Names of particle list which daughters have to be updated");
37 addParam(
"removePXD", m_removePXD,
"Remove PXD hits from TrackCand?",
bool(
false));
38 addParam(
"removeSVD", m_removeSVD,
"Remove SVD hits from TrackCand?",
bool(
false));
39 addParam(
"removeCDC", m_removeCDC,
"Remove CDC hits from TrackCand?",
bool(
false));
40 addParam(
"removeBKLM", m_removeBKLM,
"Remove BKLM hits from TrackCand?",
bool(
false));
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.");
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
Type-safe access to single objects in the data store.
Updates the seed in TrackCand based on fitted state (at vertex)
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.
Track candidate – seed values and indices.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.