Belle II Software development
RecoTrackStoreArrayCombiner.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <tracking/modules/relatedTracksCombiner/RecoTrackStoreArrayCombiner.h>
10#include <tracking/trackFitting/fitter/base/TrackFitter.h>
11#include <tracking/dataobjects/RecoTrack.h>
12#include <tracking/spacePointCreation/SpacePointTrackCand.h>
13
14using namespace Belle2;
15
16REG_MODULE(RecoTrackStoreArrayCombiner);
17
19 Module()
20{
21 setDescription("Combine two collections of tracks without additional checks.");
23
24 addParam("Temp1RecoTracksStoreArrayName", m_temp1RecoTracksStoreArrayName, "Name of the first input StoreArray.",
26 addParam("Temp2RecoTracksStoreArrayName", m_temp2RecoTracksStoreArrayName, "Name of the second input StoreArray.",
28 addParam("Temp1SPTrackCandsStoreArrayName", m_temp1SPTrackCandsStoreArrayName,
29 "Name of the SPTrackCands related with first StoreArray.",
31 addParam("Temp2SPTrackCandsStoreArrayName", m_temp2SPTrackCandsStoreArrayName,
32 "Name of the SPTrackCands related with second StoreArray.",
34 addParam("recoTracksStoreArrayName", m_recoTracksStoreArrayName, "Name of the output StoreArray.", m_recoTracksStoreArrayName);
35}
36
53
55{
56 TrackFitter trackFitter;
57
58 for (RecoTrack& temp1RecoTrack : m_temp1RecoTracks) {
59 RecoTrack* newTrack = temp1RecoTrack.copyToStoreArray(m_recoTracks);
60 newTrack->addHitsFromRecoTrack(&temp1RecoTrack, newTrack->getNumberOfTotalHits());
61 newTrack->addRelationTo(&temp1RecoTrack);
63 newTrack->addRelationTo(newSPTrackCands1);
64
65 }
66
67 for (RecoTrack& temp2RecoTrack : m_temp2RecoTracks) {
68 RecoTrack* newTrack = temp2RecoTrack.copyToStoreArray(m_recoTracks);
69 newTrack->addHitsFromRecoTrack(&temp2RecoTrack, newTrack->getNumberOfTotalHits());
70 newTrack->addRelationTo(&temp2RecoTrack);
72 newTrack->addRelationTo(newSPTrackCands2);
73 }
74}
75
void setDescription(const std::string &description)
Sets the description of the module.
Definition Module.cc:214
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition Module.cc:208
Module()
Constructor.
Definition Module.cc:30
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
Definition Module.h:80
void initialize() override
Declare required StoreArray.
StoreArray< RecoTrack > m_temp1RecoTracks
Store Array of the input tracks.
StoreArray< SpacePointTrackCand > m_temp1SPTrackCands
Store Array of the input SPTrackCands.
void event() override
Event processing, combine store array.
std::string m_temp2RecoTracksStoreArrayName
Name of the input VXD StoreArray.
StoreArray< RecoTrack > m_temp2RecoTracks
Store Array of the input tracks.
std::string m_temp1RecoTracksStoreArrayName
Name of the input CDC StoreArray.
std::string m_temp2SPTrackCandsStoreArrayName
Name of the input VXD SPTrackCands.
StoreArray< RecoTrack > m_recoTracks
Store Array of the output tracks.
std::string m_temp1SPTrackCandsStoreArrayName
Name of the input CDC SPTrackCands.
RecoTrackStoreArrayCombinerModule()
Constructor of the module. Setting up parameters and description.
StoreArray< SpacePointTrackCand > m_temp2SPTrackCands
Store Array of the input SPTrackCands.
std::string m_recoTracksStoreArrayName
Name of the output StoreArray.
This is the Reconstruction Event-Data Model Track.
Definition RecoTrack.h:79
size_t addHitsFromRecoTrack(const RecoTrack *recoTrack, unsigned int sortingParameterOffset=0, bool reversed=false, std::optional< double > optionalMinimalWeight=std::nullopt)
Add all hits from another RecoTrack to this RecoTrack.
Definition RecoTrack.cc:240
RecoTrack * copyToStoreArray(StoreArray< RecoTrack > &storeArray) const
Append a new RecoTrack to the given store array and copy its general properties, but not the hits the...
Definition RecoTrack.cc:529
static void registerRequiredRelations(StoreArray< RecoTrack > &recoTracks, std::string const &pxdHitsStoreArrayName="", std::string const &svdHitsStoreArrayName="", std::string const &cdcHitsStoreArrayName="", std::string const &bklmHitsStoreArrayName="", std::string const &eklmHitsStoreArrayName="", std::string const &recoHitInformationStoreArrayName="")
Convenience method which registers all relations required to fully use a RecoTrack.
Definition RecoTrack.cc:53
unsigned int getNumberOfTotalHits() const
Return the number of cdc + svd + pxd + bklm + eklm hits.
Definition RecoTrack.h:436
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).
T * getRelated(const std::string &name="", const std::string &namedRelation="") const
Get the object to or from which this object has a relation.
Storage for (VXD) SpacePoint-based track candidates.
Algorithm class to handle the fitting of RecoTrack objects.
void addParam(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
Definition Module.h:559
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition Module.h:649
Abstract base class for different kinds of events.