Belle II Software  release-05-02-19
RecoHitInformation.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Nils Braun, Thomas Hauth *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <cdc/dataobjects/CDCHit.h>
14 #include <pxd/dataobjects/PXDCluster.h>
15 #include <svd/dataobjects/SVDCluster.h>
16 #include <klm/dataobjects/bklm/BKLMHit2d.h>
17 #include <klm/dataobjects/eklm/EKLMAlignmentHit.h>
18 
19 #include <framework/datastore/RelationsObject.h>
20 
21 namespace Belle2 {
40  class RecoHitInformation : public RelationsObject {
41  public:
42 
49  typedef SVDCluster UsedSVDHit;
50 
52  typedef PXDCluster UsedPXDHit;
53 
55  typedef CDCHit UsedCDCHit;
56 
58  typedef BKLMHit2d UsedBKLMHit;
59 
61  typedef EKLMAlignmentHit UsedEKLMHit;
62 
65  c_undefinedRightLeftInformation,
66  c_invalidRightLeftInformation,
67  c_right,
68  c_left
69  };
70 
73  c_undefinedTrackFinder,
74  // the Hit has been generated by the MCTrackFinder and its considered important
75  // to find this hit by PR. Which hits get marked as priority and auxiliary solely
76  // depends on the configuration of the TrackFinderMCRTruh
77  c_MCTrackFinderPriorityHit,
78  // the Hit has been generated by the MCTrackFinder and is considered to be of minor
79  // importance to find, for example because it is in one of the downstream loops.
80  // Which hits get marked as priority and auxiliary solely depends on the configuration
81  // of the TrackFinderMCRTruh
82  c_MCTrackFinderAuxiliaryHit,
83  c_invalidTrackFinder,
84  // non CKF-based track finders
85  c_CDCTrackFinder,
86  c_LocalTrackFinder,
87  c_SegmentTrackCombiner,
88  c_VXDTrackFinder,
89  // track finders based on CKF
90  c_SVDtoCDCCKF,
91  c_ECLtoCDCCKF,
92  c_CDCtoSVDCKF,
93  c_SVDtoPXDCKF,
94  // CDC hit finder implemented in the ReattachCDCWireHitsToRecoTracks module:
95  // looks for CDC hits that are close to RecTracks, but that were rejected by the ADC/TOT based filter.
96  c_ReattachCDCWireHitsToRecoTracks,
97  // Belle I's track finder
98  c_Trasan,
99  c_other
100  };
101 
103  enum RecoHitFlag {
104  c_undefinedRecoHitFlag,
105  c_dismissedByFit,
106  c_pruned,
107  };
108 
110  enum RecoHitDetector {
111  c_undefinedTrackingDetector,
112  c_invalidTrackingDetector,
113  c_SVD,
114  c_PXD,
115  c_CDC,
116  c_EKLM,
117  c_BKLM
118  };
119 
120  public:
124  RecoHitInformation() {}
125 
133  RecoHitInformation(const UsedCDCHit* cdcHit, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder,
134  unsigned int sortingParameter) :
135  RecoHitInformation(cdcHit, RecoHitDetector::c_CDC, rightLeftInformation, foundByTrackFinder, sortingParameter)
136  {
137  }
138 
145  RecoHitInformation(const UsedPXDHit* pxdHit, OriginTrackFinder foundByTrackFinder,
146  unsigned int sortingParameter) :
147  RecoHitInformation(pxdHit, RecoHitDetector::c_PXD, RightLeftInformation::c_invalidRightLeftInformation,
148  foundByTrackFinder, sortingParameter)
149  {
150  }
151 
158  RecoHitInformation(const UsedSVDHit* svdHit, OriginTrackFinder foundByTrackFinder,
159  unsigned int sortingParameter) :
160  RecoHitInformation(svdHit, RecoHitDetector::c_SVD, RightLeftInformation::c_invalidRightLeftInformation,
161  foundByTrackFinder, sortingParameter)
162  {
163  }
164 
171  RecoHitInformation(const UsedEKLMHit* eklmHit, OriginTrackFinder foundByTrackFinder,
172  unsigned int sortingParameter) :
173  RecoHitInformation(eklmHit, RecoHitDetector::c_EKLM, RightLeftInformation::c_invalidRightLeftInformation,
174  foundByTrackFinder, sortingParameter)
175  {
176  }
177 
184  RecoHitInformation(const UsedBKLMHit* bklmHit, OriginTrackFinder foundByTrackFinder,
185  unsigned int sortingParameter) :
186  RecoHitInformation(bklmHit, RecoHitDetector::c_BKLM, RightLeftInformation::c_invalidRightLeftInformation,
187  foundByTrackFinder, sortingParameter)
188  {
189  }
190 
193  {
194  return m_flag;
195  }
196 
198  void setFlag(RecoHitFlag flag)
199  {
200  m_flag = flag;
201  }
202 
205  {
207  }
208 
210  void setFoundByTrackFinder(OriginTrackFinder foundByTrackFinder)
211  {
212  m_foundByTrackFinder = foundByTrackFinder;
213  }
214 
216  unsigned int getSortingParameter() const
217  {
219  }
220 
222  void setSortingParameter(unsigned int sortingParameter)
223  {
224  m_sortingParameter = sortingParameter;
225  }
226 
229  {
231  }
232 
234  void setRightLeftInformation(RightLeftInformation rightLeftInformation)
235  {
236  m_rightLeftInformation = rightLeftInformation;
237  }
238 
241  {
243  }
244 
246  bool useInFit() const
247  {
248  return m_useInFit;
249  }
250 
252  void setUseInFit(const bool useInFit = true)
253  {
255  }
256 
261  void setCreatedTrackPointID(int trackPointID)
262  {
263  m_createdTrackPointID = trackPointID;
264  }
265 
273  int getCreatedTrackPointID() const
274  {
275  return m_createdTrackPointID;
276  }
277 
278  private:
280  RecoHitDetector m_trackingDetector = RecoHitDetector::c_undefinedTrackingDetector;
282  RightLeftInformation m_rightLeftInformation = RightLeftInformation::c_undefinedRightLeftInformation;
283 
285  unsigned int m_sortingParameter = 0;
288  OriginTrackFinder m_foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder;
290  RecoHitFlag m_flag = RecoHitFlag::c_undefinedRecoHitFlag;
292  bool m_useInFit = true;
299 
308  template <class HitType>
309  RecoHitInformation(const HitType* hit,
310  RecoHitDetector trackingDetector,
311  RightLeftInformation rightLeftInformation,
312  OriginTrackFinder foundByTrackFinder,
313  unsigned int sortingParameter) :
314  m_trackingDetector(trackingDetector),
315  m_rightLeftInformation(rightLeftInformation),
316  m_sortingParameter(sortingParameter),
317  m_foundByTrackFinder(foundByTrackFinder),
318  m_flag(RecoHitFlag::c_undefinedRecoHitFlag)
319  {
320  addRelationTo(hit);
321  }
322 
324  };
326 }
Belle2::RecoHitInformation::UsedCDCHit
CDCHit UsedCDCHit
Define, use of CDC hits as CDC hits (for symmetry).
Definition: RecoHitInformation.h:63
Belle2::RecoHitInformation::UsedPXDHit
PXDCluster UsedPXDHit
Define, use of clusters or true hits for PXD.
Definition: RecoHitInformation.h:60
Belle2::RecoHitInformation::getTrackingDetector
RecoHitDetector getTrackingDetector() const
Get the detector this hit comes from.
Definition: RecoHitInformation.h:248
Belle2::RecoHitInformation::m_useInFit
bool m_useInFit
Set this flag to falso to not create a measurement out of this hit.
Definition: RecoHitInformation.h:300
Belle2::RecoHitInformation::setFlag
void setFlag(RecoHitFlag flag)
Set the additional flag.
Definition: RecoHitInformation.h:206
Belle2::RecoHitInformation::RecoHitFlag
RecoHitFlag
Another flag to be used (currently unused)
Definition: RecoHitInformation.h:111
Belle2::RecoHitInformation::m_createdTrackPointID
int m_createdTrackPointID
The index for the created TrackPoint in the genfit::Track of the related RecoTrack.
Definition: RecoHitInformation.h:306
Belle2::RecoHitInformation::getRightLeftInformation
RightLeftInformation getRightLeftInformation() const
Get the right-left-information.
Definition: RecoHitInformation.h:236
Belle2::RecoHitInformation::setCreatedTrackPointID
void setCreatedTrackPointID(int trackPointID)
Set the id of the created track point to the one from the genfit::Track.
Definition: RecoHitInformation.h:269
Belle2::RecoHitInformation::UsedSVDHit
SVDCluster UsedSVDHit
Define, use of clusters or true hits for SVD.
Definition: RecoHitInformation.h:57
Belle2::RecoHitInformation::RecoHitInformation
RecoHitInformation()
Empty constructor for root.
Definition: RecoHitInformation.h:132
Belle2::RecoHitInformation::m_trackingDetector
RecoHitDetector m_trackingDetector
The tracking detector this hit comes from (can not be changed once created)
Definition: RecoHitInformation.h:288
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::RecoHitInformation::m_rightLeftInformation
RightLeftInformation m_rightLeftInformation
The right-left-information of the hit. Can be invalid (for VXD hits) or unknown.
Definition: RecoHitInformation.h:290
Belle2::RecoHitInformation::m_sortingParameter
unsigned int m_sortingParameter
The sorting parameter as an index.
Definition: RecoHitInformation.h:293
Belle2::RecoHitInformation::OriginTrackFinder
OriginTrackFinder
The TrackFinder which has added the hit to the track.
Definition: RecoHitInformation.h:80
Belle2::RecoHitInformation::RecoHitDetector
RecoHitDetector
The detector this hit comes from (which is of course also visible in the hit type)
Definition: RecoHitInformation.h:118
Belle2::RecoHitInformation::setSortingParameter
void setSortingParameter(unsigned int sortingParameter)
Set the sorting parameter.
Definition: RecoHitInformation.h:230
Belle2::RecoHitInformation::getFlag
RecoHitFlag getFlag() const
Get the additional flag.
Definition: RecoHitInformation.h:200
Belle2::RecoHitInformation::m_flag
RecoHitFlag m_flag
An additional flag to be used.
Definition: RecoHitInformation.h:298
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RecoHitInformation::setFoundByTrackFinder
void setFoundByTrackFinder(OriginTrackFinder foundByTrackFinder)
Set which track finder has found the track.
Definition: RecoHitInformation.h:218
Belle2::RecoHitInformation::setRightLeftInformation
void setRightLeftInformation(RightLeftInformation rightLeftInformation)
Set the right-left-information.
Definition: RecoHitInformation.h:242
Belle2::RecoHitInformation::m_foundByTrackFinder
OriginTrackFinder m_foundByTrackFinder
Which track finder has found this hit and added it to the reco track.
Definition: RecoHitInformation.h:296
Belle2::RecoHitInformation
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
Definition: RecoHitInformation.h:48
Belle2::RecoHitInformation::useInFit
bool useInFit() const
Get the flag, whether this his should be used in a fit or not.
Definition: RecoHitInformation.h:254
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::RecoHitInformation::UsedEKLMHit
EKLMAlignmentHit UsedEKLMHit
Define, use of EKLMHit2d as EKLM hits.
Definition: RecoHitInformation.h:69
Belle2::RecoHitInformation::getSortingParameter
unsigned int getSortingParameter() const
Get the sorting parameter.
Definition: RecoHitInformation.h:224
Belle2::RecoHitInformation::UsedBKLMHit
BKLMHit2d UsedBKLMHit
Define, use of BKLMHit2d as BKLM hits.
Definition: RecoHitInformation.h:66
Belle2::RecoHitInformation::ClassDef
ClassDef(RecoHitInformation, 6)
This class implements additional information for hits.
Belle2::RecoHitInformation::RightLeftInformation
RightLeftInformation
The RightLeft information of the hit which is only valid for CDC hits.
Definition: RecoHitInformation.h:72
Belle2::RecoHitInformation::getFoundByTrackFinder
OriginTrackFinder getFoundByTrackFinder() const
Get which track finder has found the track.
Definition: RecoHitInformation.h:212
Belle2::RecoHitInformation::getCreatedTrackPointID
int getCreatedTrackPointID() const
Get the id of the TrackPoint related to this reco hit information in the genfit::Track.
Definition: RecoHitInformation.h:281
Belle2::RecoHitInformation::setUseInFit
void setUseInFit(const bool useInFit=true)
Set the hit to be used (default) or not in the next fit.
Definition: RecoHitInformation.h:260