Belle II Software  release-05-01-25
RecoTrackStoreArrayCombiner.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Simon Kurz *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <tracking/modules/relatedTracksCombiner/RecoTrackStoreArrayCombiner.h>
12 #include <tracking/trackFitting/fitter/base/TrackFitter.h>
13 
14 using namespace Belle2;
15 
16 REG_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("recoTracksStoreArrayName", m_recoTracksStoreArrayName, "Name of the output StoreArray.", m_recoTracksStoreArrayName);
29 }
30 
32 {
35 
38 
39  m_recoTracks.registerRelationTo(m_temp1RecoTracks);
40  m_recoTracks.registerRelationTo(m_temp2RecoTracks);
41 }
42 
44 {
45  TrackFitter trackFitter;
46 
47  for (RecoTrack& temp1RecoTrack : m_temp1RecoTracks) {
48  RecoTrack* newTrack = temp1RecoTrack.copyToStoreArray(m_recoTracks);
49  newTrack->addHitsFromRecoTrack(&temp1RecoTrack, newTrack->getNumberOfTotalHits());
50  newTrack->addRelationTo(&temp1RecoTrack);
51  }
52 
53  for (RecoTrack& temp2RecoTrack : m_temp2RecoTracks) {
54  RecoTrack* newTrack = temp2RecoTrack.copyToStoreArray(m_recoTracks);
55  newTrack->addHitsFromRecoTrack(&temp2RecoTrack, newTrack->getNumberOfTotalHits());
56  newTrack->addRelationTo(&temp2RecoTrack);
57  }
58 }
59 
Belle2::RecoTrack::registerRequiredRelations
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:42
Belle2::RecoTrack::addHitsFromRecoTrack
size_t addHitsFromRecoTrack(const RecoTrack *recoTrack, unsigned int sortingParameterOffset=0, bool reversed=false, boost::optional< double > optionalMinimalWeight=boost::none)
Add all hits from another RecoTrack to this RecoTrack.
Definition: RecoTrack.cc:230
Belle2::Module::setDescription
void setDescription(const std::string &description)
Sets the description of the module.
Definition: Module.cc:216
REG_MODULE
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Definition: Module.h:652
Belle2::Module::c_ParallelProcessingCertified
@ 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:82
Belle2::RecoTrackStoreArrayCombinerModule::m_recoTracks
StoreArray< RecoTrack > m_recoTracks
Store Array of the output tracks.
Definition: RecoTrackStoreArrayCombiner.h:59
Belle2::RecoTrackStoreArrayCombinerModule::m_temp1RecoTracks
StoreArray< RecoTrack > m_temp1RecoTracks
Store Array of the input tracks.
Definition: RecoTrackStoreArrayCombiner.h:55
Belle2::RecoTrackStoreArrayCombinerModule::RecoTrackStoreArrayCombinerModule
RecoTrackStoreArrayCombinerModule()
Constructor of the module. Setting up parameters and description.
Definition: RecoTrackStoreArrayCombiner.cc:18
Belle2::RelationsInterface::addRelationTo
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).
Definition: RelationsObject.h:144
Belle2::RecoTrackStoreArrayCombinerModule::m_temp1RecoTracksStoreArrayName
std::string m_temp1RecoTracksStoreArrayName
Name of the input CDC StoreArray.
Definition: RecoTrackStoreArrayCombiner.h:48
Belle2::RecoTrack::copyToStoreArray
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:506
Belle2::Module
Base class for Modules.
Definition: Module.h:74
Belle2::Module::setPropertyFlags
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
Definition: Module.cc:210
Belle2::TrackFitter
Algorithm class to handle the fitting of RecoTrack objects.
Definition: TrackFitter.h:116
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RecoTrackStoreArrayCombinerModule::m_temp2RecoTracksStoreArrayName
std::string m_temp2RecoTracksStoreArrayName
Name of the input VXD StoreArray.
Definition: RecoTrackStoreArrayCombiner.h:50
Belle2::DataStore::c_ErrorIfAlreadyRegistered
@ c_ErrorIfAlreadyRegistered
If the object/array was already registered, produce an error (aborting initialisation).
Definition: DataStore.h:74
Belle2::Module::addParam
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:562
Belle2::RecoTrackStoreArrayCombinerModule::event
void event() override
Event processing, combine store array.
Definition: RecoTrackStoreArrayCombiner.cc:43
Belle2::RecoTrack::getNumberOfTotalHits
unsigned int getNumberOfTotalHits() const
Return the number of cdc + svd + pxd + bklm + eklm hits.
Definition: RecoTrack.h:432
Belle2::RecoTrackStoreArrayCombinerModule::initialize
void initialize() override
Declare required StoreArray.
Definition: RecoTrackStoreArrayCombiner.cc:31
Belle2::RecoTrackStoreArrayCombinerModule::m_temp2RecoTracks
StoreArray< RecoTrack > m_temp2RecoTracks
Store Array of the input tracks.
Definition: RecoTrackStoreArrayCombiner.h:57
Belle2::RecoTrackStoreArrayCombinerModule::m_recoTracksStoreArrayName
std::string m_recoTracksStoreArrayName
Name of the output StoreArray.
Definition: RecoTrackStoreArrayCombiner.h:52