Belle II Software  release-05-02-19
MCRelationCreatorModule.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 
11 #include <tracking/modules/relatedTracksCombiner/MCRelationCreatorModule.h>
12 
13 using namespace Belle2;
14 
15 REG_MODULE(MCRelationCreator);
16 
18  Module()
19 {
20  setDescription("Create relations between MC-matched RecoTracks in CDC and SVD.");
22 
23  addParam("CDCRecoTracksStoreArrayName", m_cdcRecoTracksStoreArrayName , "Name of the input CDC StoreArray.",
25  addParam("VXDRecoTracksStoreArrayName", m_vxdRecoTracksStoreArrayName , "Name of the input VXD StoreArray.",
27 }
28 
30 {
33 
34  m_cdcRecoTracks.registerRelationTo(m_vxdRecoTracks);
35 
36  m_cdcTrackMatchLookUp.reset(new TrackMatchLookUp("MCRecoTracks", m_cdcRecoTracks.getName()));
37  m_vxdTrackMatchLookUp.reset(new TrackMatchLookUp("MCRecoTracks", m_vxdRecoTracks.getName()));
38 }
39 
41 {
42  for (const RecoTrack& cdcRecoTrack : m_cdcRecoTracks) {
43  const RecoTrack* matchedMCRecoTrack = m_cdcTrackMatchLookUp->getMatchedMCRecoTrack(cdcRecoTrack);
44  if (not matchedMCRecoTrack) {
45  continue;
46  }
47 
48  const RecoTrack* matchedVXDRecoTrack = m_vxdTrackMatchLookUp->getMatchedPRRecoTrack(*matchedMCRecoTrack);
49  if (not matchedVXDRecoTrack) {
50  continue;
51  }
52 
53  cdcRecoTrack.addRelationTo(matchedVXDRecoTrack, -1);
54  }
55 }
56 
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::MCRelationCreatorModule::MCRelationCreatorModule
MCRelationCreatorModule()
Constructor of the module. Setting up parameters and description.
Definition: MCRelationCreatorModule.cc:17
Belle2::MCRelationCreatorModule::initialize
void initialize() override
Declare required StoreArray.
Definition: MCRelationCreatorModule.cc:29
Belle2::MCRelationCreatorModule::m_cdcRecoTracksStoreArrayName
std::string m_cdcRecoTracksStoreArrayName
Name of the input CDC StoreArray.
Definition: MCRelationCreatorModule.h:55
Belle2::TrackMatchLookUp
Class to provide convenient methods to look up matching information between pattern recognition and M...
Definition: TrackMatchLookUp.h:43
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::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::MCRelationCreatorModule::m_vxdRecoTracks
StoreArray< RecoTrack > m_vxdRecoTracks
Store Array of the input tracks.
Definition: MCRelationCreatorModule.h:62
Belle2::MCRelationCreatorModule::m_vxdTrackMatchLookUp
std::unique_ptr< TrackMatchLookUp > m_vxdTrackMatchLookUp
TrackMatchLookUp for the matching (VXD)
Definition: MCRelationCreatorModule.h:67
Belle2::MCRelationCreatorModule::event
void event() override
Event processing, combine store array.
Definition: MCRelationCreatorModule.cc:40
Belle2::MCRelationCreatorModule::m_vxdRecoTracksStoreArrayName
std::string m_vxdRecoTracksStoreArrayName
Name of the input VXD StoreArray.
Definition: MCRelationCreatorModule.h:57
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::MCRelationCreatorModule::m_cdcTrackMatchLookUp
std::unique_ptr< TrackMatchLookUp > m_cdcTrackMatchLookUp
TrackMatchLookUp for the matching (CDC)
Definition: MCRelationCreatorModule.h:65
Belle2::MCRelationCreatorModule::m_cdcRecoTracks
StoreArray< RecoTrack > m_cdcRecoTracks
Store Array of the input tracks.
Definition: MCRelationCreatorModule.h:60