Belle II Software  release-05-02-19
ReattachCDCWireHitsToRecoTracksModule.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2019 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Cyrille Praz, Tracking group *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <tracking/dataobjects/RecoTrack.h>
15 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
16 #include <tracking/trackFindingCDC/rootification/StoreWrappedObjPtr.h>
17 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
18 
19 namespace Belle2 {
24  namespace TrackFindingCDC {
25 
26 
35  class ReattachCDCWireHitsToRecoTracksModule : public Module {
36 
37  public:
38 
41 
43  void initialize() override;
44 
46  void event() override;
47 
48  private:
49 
51  struct ReconstructionResults {
53  double arcLength = 0.0;
55  double z = 0.0;
57  double distanceToTrack = 0.0;
59  ERightLeft rlInfo = ERightLeft::c_Unknown;
61  bool isValid = false;
62  };
63 
65  struct HitToAddInfo {
67  CDCWireHit* hit = nullptr;
69  ERightLeft rlInfo = ERightLeft::c_Unknown;
70  };
71 
73  void findHits();
74 
76  void addHits();
77 
80  const RecoTrack& recoTrack,
81  const RecoHitInformation* recoHitInformation) const;
82 
85 
86  private:
87 
89  std::string m_CDCWireHitsStoreArrayName = "CDCWireHitVector";
91  std::string m_inputRecoTracksStoreArrayName = "CDCRecoTracks";
93  std::string m_outputRecoTracksStoreArrayName = "ExtendedCDCRecoTracks";
95  double m_maximumDistance = 0.1;
97  int m_minimumADC = 1;
99  int m_minimumTOT = 1;
101  double m_maximumAbsD0 = 13.5;
103  double m_maximumAbsZ0 = 35.0;
104 
111 
113  std::unordered_map<RecoTrack*, std::vector<CDCHit*> > m_mapToHitsOnTrack;
115  std::unordered_map<RecoTrack*, std::vector<HitToAddInfo> > m_mapToHitsToAdd;
116  };
117  }
119 }
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_maximumDistance
double m_maximumDistance
Distance (cm) below which (exclusive) a CDC hit can be reattached to a track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:103
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_inputRecoTracksStoreArrayName
std::string m_inputRecoTracksStoreArrayName
Name of the input RecoTrack StoreArray.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:99
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults
Internal structure to store the results of the reconstruction.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:59
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_outputRecoTracks
StoreArray< RecoTrack > m_outputRecoTracks
Output tracks.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:118
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_maximumAbsD0
double m_maximumAbsD0
Only tracks with an absolute value of d0 below (exclusive) this parameter (cm) are considered.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:109
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::initialize
void initialize() override
Declare required StoreArray.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:54
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_minimumADC
int m_minimumADC
ADC above which (inclusive) a CDC hit can be reattached to a track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:105
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReattachCDCWireHitsToRecoTracksModule
ReattachCDCWireHitsToRecoTracksModule()
Constructor of the module. Setting up parameters and description.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:26
Belle2::TrackFindingCDC::StoreWrappedObjPtr
This class is for convenience access and registration of objects, that are stored inside the StoreWra...
Definition: StoreWrappedObjPtr.h:40
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_mapToHitsToAdd
std::unordered_map< RecoTrack *, std::vector< HitToAddInfo > > m_mapToHitsToAdd
Map from a RecoTrack ptr to the vector of the hits that need to be added to this track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:123
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults::z
double z
Reconstructed z position of the hit.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:63
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_CDCWireHitsStoreArrayName
std::string m_CDCWireHitsStoreArrayName
Name of the input CDCWireHit StoreWrappedObjPtr.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:97
Belle2::RecoTrack
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:78
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::reconstruct
ReconstructionResults reconstruct(const CDCWireHit &wireHit, const RecoTrack &recoTrack, const RecoHitInformation *recoHitInformation) const
Compute distance from a CDCWireHit to a RecoTrack using the mSoP found with a RecoHitInformation.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:224
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults::rlInfo
ERightLeft rlInfo
Right-left information of the hit.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:67
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_inputRecoTracks
StoreArray< RecoTrack > m_inputRecoTracks
Input tracks.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:116
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::event
void event() override
Event processing, combine store array.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:63
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_mapToHitsOnTrack
std::unordered_map< RecoTrack *, std::vector< CDCHit * > > m_mapToHitsOnTrack
Map from a RecoTrack ptr to the vector of the hits that belong to this track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:121
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::RecoHitInformation
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
Definition: RecoHitInformation.h:48
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::HitToAddInfo
Internal structure to store the information about a hit to be added.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:73
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::addHits
void addHits()
Add the selected CDC hits to the RecoTracks.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:157
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::rightLeftInformationTranslator
RecoHitInformation::RightLeftInformation rightLeftInformationTranslator(ERightLeft rlInfo) const
Translate a TrackFindingCDC::ERightLeft into a RecoHitInformation::RightLeftInformation.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:280
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults::isValid
bool isValid
Success status of the reconstruction.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:69
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::HitToAddInfo::hit
CDCWireHit * hit
Pointer the hit to be added.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:75
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_outputRecoTracksStoreArrayName
std::string m_outputRecoTracksStoreArrayName
Name of the output RecoTrack StoreArray.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:101
Belle2::StoreArray
Accessor to arrays stored in the data store.
Definition: ECLMatchingPerformanceExpertModule.h:33
Belle2::TrackFindingCDC::CDCWireHit
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:65
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_maximumAbsZ0
double m_maximumAbsZ0
Only tracks with an absolute value of z0 below (exclusive) this parameter (cm) are considered.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:111
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::findHits
void findHits()
Find the hits that can be added to the RecoTracks.
Definition: ReattachCDCWireHitsToRecoTracksModule.cc:71
Belle2::RecoHitInformation::RightLeftInformation
RightLeftInformation
The RightLeft information of the hit which is only valid for CDC hits.
Definition: RecoHitInformation.h:72
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_minimumTOT
int m_minimumTOT
TOT above which (inclusive) a CDC hit can be reattached to a track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:107
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::HitToAddInfo::rlInfo
ERightLeft rlInfo
Right-left information of the hit.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:77
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults::distanceToTrack
double distanceToTrack
Distance from the hit to the track.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:65
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::ReconstructionResults::arcLength
double arcLength
Arc length of the hit w.r.t. to a genfit::MeasuredStateOnPlane.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:61
Belle2::TrackFindingCDC::ReattachCDCWireHitsToRecoTracksModule::m_CDCWireHits
StoreWrappedObjPtr< std::vector< CDCWireHit > > m_CDCWireHits
Input CDCWireHits.
Definition: ReattachCDCWireHitsToRecoTracksModule.h:114