Belle II Software development
MCRelationCreatorModule.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/MCRelationCreatorModule.h>
10
11using namespace Belle2;
12
13REG_MODULE(MCRelationCreator);
14
16 Module()
17{
18 setDescription("Create relations between MC-matched RecoTracks in CDC and SVD.");
20
21 addParam("CDCRecoTracksStoreArrayName", m_cdcRecoTracksStoreArrayName, "Name of the input CDC StoreArray.",
23 addParam("VXDRecoTracksStoreArrayName", m_vxdRecoTracksStoreArrayName, "Name of the input VXD StoreArray.",
25}
26
28{
31
32 m_cdcRecoTracks.registerRelationTo(m_vxdRecoTracks);
33
34 m_cdcTrackMatchLookUp.reset(new TrackMatchLookUp("MCRecoTracks", m_cdcRecoTracks.getName()));
35 m_vxdTrackMatchLookUp.reset(new TrackMatchLookUp("MCRecoTracks", m_vxdRecoTracks.getName()));
36}
37
39{
40 for (const RecoTrack& cdcRecoTrack : m_cdcRecoTracks) {
41 const RecoTrack* matchedMCRecoTrack = m_cdcTrackMatchLookUp->getAnyChargeMatchedMCRecoTrack(cdcRecoTrack);
42 if (not matchedMCRecoTrack) {
43 continue;
44 }
45
46 const RecoTrack* matchedVXDRecoTrack = m_vxdTrackMatchLookUp->getAnyChargeMatchedPRRecoTrack(*matchedMCRecoTrack);
47 if (not matchedVXDRecoTrack) {
48 continue;
49 }
50
51 cdcRecoTrack.addRelationTo(matchedVXDRecoTrack, -1);
52 }
53}
54
std::unique_ptr< TrackMatchLookUp > m_cdcTrackMatchLookUp
TrackMatchLookUp for the matching (CDC)
void initialize() override
Declare required StoreArray.
void event() override
Event processing, combine store array.
StoreArray< RecoTrack > m_vxdRecoTracks
Store Array of the input tracks.
std::unique_ptr< TrackMatchLookUp > m_vxdTrackMatchLookUp
TrackMatchLookUp for the matching (VXD)
std::string m_cdcRecoTracksStoreArrayName
Name of the input CDC StoreArray.
StoreArray< RecoTrack > m_cdcRecoTracks
Store Array of the input tracks.
MCRelationCreatorModule()
Constructor of the module. Setting up parameters and description.
std::string m_vxdRecoTracksStoreArrayName
Name of the input VXD StoreArray.
Base class for Modules.
Definition: Module.h:72
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
@ 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
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
Class to provide convenient methods to look up matching information between pattern recognition and M...
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.