8 #include <tracking/modules/fitter/FittedTracksStorerModule.h>
9 #include <tracking/dataobjects/RecoTrack.h>
10 #include <mdst/dataobjects/MCParticle.h>
11 #include <mdst/dataobjects/Track.h>
21 setPropertyFlags(c_ParallelProcessingCertified);
22 setDescription(
"A module to copy only the fitted reco tracks to the output store array.");
24 addParam(
"inputRecoTracksStoreArrayName", m_param_inputRecoTracksStoreArrayName,
"StoreArray name of the input reco tracks.",
25 m_param_inputRecoTracksStoreArrayName);
26 addParam(
"outputRecoTracksStoreArrayName", m_param_outputRecoTracksStoreArrayName,
"StoreArray name of the output reco tracks.",
27 m_param_outputRecoTracksStoreArrayName);
28 addParam(
"minimalWeight", m_param_minimalWeight,
"Minimal weight for copying the hits.", m_param_minimalWeight);
31 void FittedTracksStorerModule::initialize()
39 RecoTrack::registerRequiredRelations(outputRecoTracks);
49 if (tracks.isOptional()) {
50 tracks.registerRelationTo(outputRecoTracks);
55 void FittedTracksStorerModule::event()
60 for (
RecoTrack& recoTrack : inputRecoTracks) {
61 if (recoTrack.wasFitSuccessful()) {
62 auto newRecoTrack = recoTrack.copyToStoreArray(outputRecoTracks);
63 newRecoTrack->addHitsFromRecoTrack(&recoTrack, 0,
false, m_param_minimalWeight);
66 auto relatedTrack = recoTrack.getRelated<
Track>();
71 auto relatedParticle = recoTrack.getRelated<
MCParticle>();
72 if (relatedParticle) {
76 recoTrack.addRelationTo(newRecoTrack);
A module to copy only the fitted reco tracks to the output store array.
A Class to store the Monte Carlo particle information.
This is the Reconstruction Event-Data Model Track.
void addRelationTo(const RelationsInterface< BASE > *object, float weight=1.0, const std::string &namedRelation="") const
Add a relation from this object to another object (with caching).
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
bool isOptional(const std::string &name="")
Tell the DataStore about an optional input.
bool registerInDataStore(DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut)
Register the object/array in the DataStore.
Accessor to arrays stored in the data store.
bool registerRelationTo(const StoreArray< TO > &toArray, DataStore::EDurability durability=DataStore::c_Event, DataStore::EStoreFlags storeFlags=DataStore::c_WriteOut, const std::string &namedRelation="") const
Register a relation to the given StoreArray.
Class that bundles various TrackFitResults.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.