Belle II Software  release-06-02-00
RecoHitInformation.h
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 #pragma once
10 
11 #include <cdc/dataobjects/CDCHit.h>
12 #include <pxd/dataobjects/PXDCluster.h>
13 #include <svd/dataobjects/SVDCluster.h>
14 #include <klm/dataobjects/bklm/BKLMHit2d.h>
15 #include <klm/dataobjects/eklm/EKLMAlignmentHit.h>
16 
17 #include <framework/datastore/RelationsObject.h>
18 
19 namespace Belle2 {
39  public:
40 
48 
51 
53  typedef CDCHit UsedCDCHit;
54 
57 
60 
63  c_undefinedRightLeftInformation,
64  c_invalidRightLeftInformation,
65  c_right,
66  c_left
67  };
68 
71  c_undefinedTrackFinder,
72  // the Hit has been generated by the MCTrackFinder and its considered important
73  // to find this hit by PR. Which hits get marked as priority and auxiliary solely
74  // depends on the configuration of the TrackFinderMCRTruh
75  c_MCTrackFinderPriorityHit,
76  // the Hit has been generated by the MCTrackFinder and is considered to be of minor
77  // importance to find, for example because it is in one of the downstream loops.
78  // Which hits get marked as priority and auxiliary solely depends on the configuration
79  // of the TrackFinderMCRTruh
80  c_MCTrackFinderAuxiliaryHit,
81  c_invalidTrackFinder,
82  // non CKF-based track finders
83  c_CDCTrackFinder,
84  c_LocalTrackFinder,
85  c_SegmentTrackCombiner,
86  c_VXDTrackFinder,
87  // track finders based on CKF
88  c_SVDtoCDCCKF,
89  c_ECLtoCDCCKF,
90  c_CDCtoSVDCKF,
91  c_SVDtoPXDCKF,
92  // CDC hit finder implemented in the ReattachCDCWireHitsToRecoTracks module:
93  // looks for CDC hits that are close to RecTracks, but that were rejected by the ADC/TOT based filter.
94  c_ReattachCDCWireHitsToRecoTracks,
95  // Belle I's track finder
96  c_Trasan,
97  c_other
98  };
99 
101  enum RecoHitFlag {
102  c_undefinedRecoHitFlag,
103  c_dismissedByFit,
104  c_pruned,
105  };
106 
109  c_undefinedTrackingDetector,
110  c_invalidTrackingDetector,
111  c_SVD,
112  c_PXD,
113  c_CDC,
114  c_EKLM,
115  c_BKLM
116  };
117 
118  public:
123 
131  RecoHitInformation(const UsedCDCHit* cdcHit, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder,
132  unsigned int sortingParameter) :
133  RecoHitInformation(cdcHit, RecoHitDetector::c_CDC, rightLeftInformation, foundByTrackFinder, sortingParameter)
134  {
135  }
136 
143  RecoHitInformation(const UsedPXDHit* pxdHit, OriginTrackFinder foundByTrackFinder,
144  unsigned int sortingParameter) :
145  RecoHitInformation(pxdHit, RecoHitDetector::c_PXD, RightLeftInformation::c_invalidRightLeftInformation,
146  foundByTrackFinder, sortingParameter)
147  {
148  }
149 
156  RecoHitInformation(const UsedSVDHit* svdHit, OriginTrackFinder foundByTrackFinder,
157  unsigned int sortingParameter) :
158  RecoHitInformation(svdHit, RecoHitDetector::c_SVD, RightLeftInformation::c_invalidRightLeftInformation,
159  foundByTrackFinder, sortingParameter)
160  {
161  }
162 
169  RecoHitInformation(const UsedEKLMHit* eklmHit, OriginTrackFinder foundByTrackFinder,
170  unsigned int sortingParameter) :
171  RecoHitInformation(eklmHit, RecoHitDetector::c_EKLM, RightLeftInformation::c_invalidRightLeftInformation,
172  foundByTrackFinder, sortingParameter)
173  {
174  }
175 
182  RecoHitInformation(const UsedBKLMHit* bklmHit, OriginTrackFinder foundByTrackFinder,
183  unsigned int sortingParameter) :
184  RecoHitInformation(bklmHit, RecoHitDetector::c_BKLM, RightLeftInformation::c_invalidRightLeftInformation,
185  foundByTrackFinder, sortingParameter)
186  {
187  }
188 
191  {
192  return m_flag;
193  }
194 
196  void setFlag(RecoHitFlag flag)
197  {
198  m_flag = flag;
199  }
200 
203  {
204  return m_foundByTrackFinder;
205  }
206 
208  void setFoundByTrackFinder(OriginTrackFinder foundByTrackFinder)
209  {
210  m_foundByTrackFinder = foundByTrackFinder;
211  }
212 
214  unsigned int getSortingParameter() const
215  {
216  return m_sortingParameter;
217  }
218 
220  void setSortingParameter(unsigned int sortingParameter)
221  {
222  m_sortingParameter = sortingParameter;
223  }
224 
227  {
228  return m_rightLeftInformation;
229  }
230 
233  {
234  m_rightLeftInformation = rightLeftInformation;
235  }
236 
239  {
240  return m_trackingDetector;
241  }
242 
244  bool useInFit() const
245  {
246  return m_useInFit;
247  }
248 
250  void setUseInFit(const bool useInFit = true)
251  {
253  }
254 
259  void setCreatedTrackPointID(int trackPointID)
260  {
261  m_createdTrackPointID = trackPointID;
262  }
263 
272  {
273  return m_createdTrackPointID;
274  }
275 
276  private:
278  RecoHitDetector m_trackingDetector = RecoHitDetector::c_undefinedTrackingDetector;
280  RightLeftInformation m_rightLeftInformation = RightLeftInformation::c_undefinedRightLeftInformation;
281 
283  unsigned int m_sortingParameter = 0;
286  OriginTrackFinder m_foundByTrackFinder = OriginTrackFinder::c_undefinedTrackFinder;
288  RecoHitFlag m_flag = RecoHitFlag::c_undefinedRecoHitFlag;
290  bool m_useInFit = true;
297 
306  template <class HitType>
307  RecoHitInformation(const HitType* hit,
308  RecoHitDetector trackingDetector,
309  RightLeftInformation rightLeftInformation,
310  OriginTrackFinder foundByTrackFinder,
311  unsigned int sortingParameter) :
312  m_trackingDetector(trackingDetector),
313  m_rightLeftInformation(rightLeftInformation),
314  m_sortingParameter(sortingParameter),
315  m_foundByTrackFinder(foundByTrackFinder),
316  m_flag(RecoHitFlag::c_undefinedRecoHitFlag)
317  {
318  addRelationTo(hit);
319  }
320 
322  };
324 }
Store one BKLM strip hit as a ROOT object.
Definition: BKLMHit2d.h:32
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
This dataobject is used only for EKLM alignment.
The PXD Cluster class This class stores all information about reconstructed PXD clusters The position...
Definition: PXDCluster.h:30
This class stores additional information to every CDC/SVD/PXD hit stored in a RecoTrack.
RecoHitInformation(const UsedPXDHit *pxdHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a PXD hit with the given information.
RecoHitDetector m_trackingDetector
The tracking detector this hit comes from (can not be changed once created)
void setUseInFit(const bool useInFit=true)
Set the hit to be used (default) or not in the next fit.
RightLeftInformation m_rightLeftInformation
The right-left-information of the hit. Can be invalid (for VXD hits) or unknown.
RightLeftInformation getRightLeftInformation() const
Get the right-left-information.
OriginTrackFinder
The TrackFinder which has added the hit to the track.
RightLeftInformation
The RightLeft information of the hit which is only valid for CDC hits.
CDCHit UsedCDCHit
Define, use of CDC hits as CDC hits (for symmetry).
void setSortingParameter(unsigned int sortingParameter)
Set the sorting parameter.
RecoHitInformation(const UsedCDCHit *cdcHit, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a CDC hit with the given information.
RecoHitFlag
Another flag to be used (currently unused)
RecoHitInformation(const UsedEKLMHit *eklmHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a EKLM hit with the given information.
OriginTrackFinder getFoundByTrackFinder() const
Get which track finder has found the track.
RecoHitDetector getTrackingDetector() const
Get the detector this hit comes from.
void setRightLeftInformation(RightLeftInformation rightLeftInformation)
Set the right-left-information.
EKLMAlignmentHit UsedEKLMHit
Define, use of EKLMHit2d as EKLM hits.
RecoHitDetector
The detector this hit comes from (which is of course also visible in the hit type)
RecoHitFlag m_flag
An additional flag to be used.
RecoHitInformation()
Empty constructor for root.
int m_createdTrackPointID
The index for the created TrackPoint in the genfit::Track of the related RecoTrack.
bool useInFit() const
Get the flag, whether this his should be used in a fit or not.
RecoHitInformation(const UsedBKLMHit *bklmHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a BKLM hit with the given information.
RecoHitInformation(const UsedSVDHit *svdHit, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a SVD hit with the given information.
void setFlag(RecoHitFlag flag)
Set the additional flag.
unsigned int m_sortingParameter
The sorting parameter as an index.
void setCreatedTrackPointID(int trackPointID)
Set the id of the created track point to the one from the genfit::Track.
ClassDef(RecoHitInformation, 6)
This class implements additional information for hits.
PXDCluster UsedPXDHit
Define, use of clusters or true hits for PXD.
RecoHitInformation(const HitType *hit, RecoHitDetector trackingDetector, RightLeftInformation rightLeftInformation, OriginTrackFinder foundByTrackFinder, unsigned int sortingParameter)
Create hit information for a generic hit with the given information.
int getCreatedTrackPointID() const
Get the id of the TrackPoint related to this reco hit information in the genfit::Track.
SVDCluster UsedSVDHit
Define, use of clusters or true hits for SVD.
OriginTrackFinder m_foundByTrackFinder
Which track finder has found this hit and added it to the reco track.
unsigned int getSortingParameter() const
Get the sorting parameter.
BKLMHit2d UsedBKLMHit
Define, use of BKLMHit2d as BKLM hits.
void setFoundByTrackFinder(OriginTrackFinder foundByTrackFinder)
Set which track finder has found the track.
RecoHitFlag getFlag() const
Get the additional flag.
bool m_useInFit
Set this flag to falso to not create a measurement out of this hit.
Defines interface for accessing relations of objects in StoreArray.
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).
The SVD Cluster class This class stores all information about reconstructed SVD clusters.
Definition: SVDCluster.h:28
Abstract base class for different kinds of events.