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