Belle II Software development
RelationApplier.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#include <tracking/ckf/svd/findlets/RelationApplier.h>
9#include <tracking/ckf/general/utilities/SearchDirection.h>
10
11#include <tracking/trackFindingCDC/utilities/StringManipulation.h>
12
13#include <tracking/dataobjects/RecoTrack.h>
14
15#include <framework/core/ModuleParamList.h>
16
17using namespace Belle2;
18
20{
22
24 relationFromTracks.isRequired();
25
27 relationToTracks.isRequired();
28
29 relationFromTracks.registerRelationTo(relationToTracks);
30
32}
33
35 relationsCDCToSVD)
36{
37 for (const TrackFindingCDC::WeightedRelation<const RecoTrack, const RecoTrack>& relation : relationsCDCToSVD) {
38 const RecoTrack* cdcTrack = relation.getFrom();
39 const RecoTrack* svdTrack = relation.getTo();
40 cdcTrack->addRelationTo(svdTrack, m_param_writeOutDirection);
41 }
42}
43
44void RelationApplier::exposeParameters(ModuleParamList* moduleParamList, const std::string& prefix)
45{
46 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "writeOutDirection"),
48 "Write out the relations with the direction of the VXD part as weight");
49
50 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "fromRelationStoreArrayName"), m_param_fromRelationsStoreArrayName,
51 "Create relations from this store array.");
52
53 moduleParamList->addParameter(TrackFindingCDC::prefixed(prefix, "toRelationStoreArrayName"), m_param_toRelationsStoreArrayName,
54 "Create relations to this store array.");
55}
The Module parameter list class.
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
void initialize() final
Receive signal before the start of the event processing.
std::string m_param_fromRelationsStoreArrayName
Create relations from this store array.
void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix) final
Expose parameters.
std::string m_param_toRelationsStoreArrayName
Create relations to this store array.
TrackFindingCDC::EForwardBackward m_param_writeOutDirection
Direction parameter converted from the string parameters.
void apply(const std::vector< TrackFindingCDC::WeightedRelation< const RecoTrack, const RecoTrack > > &relationsCDCToSVD) final
Copy the relations to the store array.
std::string m_param_writeOutDirectionAsString
Parameter for the distance given to the framework (can not handle EForwardBackward directly)
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.
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
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.
Definition: StoreArray.h:140
void initialize() override
Receive and dispatch signal before the start of the event processing.
Type for two related objects with a weight.
void addParameter(const std::string &name, T &paramVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module list.
TrackFindingCDC::EForwardBackward fromString(const std::string &directionString)
Helper function to turn a direction string into a valid forward backward information.
Abstract base class for different kinds of events.