10 #include <tracking/modules/fitter/FittedTracksStorerModule.h>
11 #include <tracking/dataobjects/RecoTrack.h>
12 #include <mdst/dataobjects/MCParticle.h>
13 #include <mdst/dataobjects/Track.h>
23 setPropertyFlags(c_ParallelProcessingCertified);
24 setDescription(
"A module to copy only the fitted reco tracks to the output store array.");
26 addParam(
"inputRecoTracksStoreArrayName", m_param_inputRecoTracksStoreArrayName,
"StoreArray name of the input reco tracks.",
27 m_param_inputRecoTracksStoreArrayName);
28 addParam(
"outputRecoTracksStoreArrayName", m_param_outputRecoTracksStoreArrayName,
"StoreArray name of the output reco tracks.",
29 m_param_outputRecoTracksStoreArrayName);
30 addParam(
"minimalWeight", m_param_minimalWeight,
"Minimal weight for copying the hits.", m_param_minimalWeight);
33 void FittedTracksStorerModule::initialize()
36 inputRecoTracks.isRequired();
39 outputRecoTracks.registerInDataStore(DataStore::c_ErrorIfAlreadyRegistered);
41 RecoTrack::registerRequiredRelations(outputRecoTracks);
46 if (mcParticles.isOptional()) {
51 if (tracks.isOptional()) {
52 tracks.registerRelationTo(outputRecoTracks);
57 void FittedTracksStorerModule::event()
65 for (
RecoTrack& recoTrack : inputRecoTracks) {
66 if (recoTrack.wasFitSuccessful()) {
67 auto newRecoTrack = recoTrack.copyToStoreArray(outputRecoTracks);
68 newRecoTrack->addHitsFromRecoTrack(&recoTrack, 0,
false, m_param_minimalWeight);
71 auto relatedTrack = recoTrack.getRelated<
Track>();
76 auto relatedParticle = recoTrack.getRelated<
MCParticle>();
77 if (relatedParticle) {
81 recoTrack.addRelationTo(newRecoTrack);