Belle II Software  release-05-02-19
EventLevelTrackingInfo.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2012 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Tracking Group 2017 *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <mdst/dataobjects/HitPatternCDC.h>
13 
14 #include <framework/logging/Logger.h>
15 
16 #include <TObject.h>
17 
18 #include <algorithm>
19 #include <bitset>
20 
21 namespace Belle2 {
39  class EventLevelTrackingInfo : public TObject {
40  public:
42  EventLevelTrackingInfo() = default;
43 
44  //--- CDC related Stuff -------------------------------------------------------------------------------------------
46  uint16_t getNCDCHitsNotAssigned() const
47  {
48  return m_nCDCHitsNotAssigned;
49  }
50 
52  void setNCDCHitsNotAssigned(uint16_t const nCDCHitsNotAssigned)
53  {
54  m_nCDCHitsNotAssigned = nCDCHitsNotAssigned;
55  }
56 
66  uint16_t getNCDCHitsNotAssignedPostCleaning() const
67  {
69  }
70 
72  void setNCDCHitsNotAssignedPostCleaning(uint16_t const nCDCHitsNotAssignedPostCleaning)
73  {
74  m_nCDCHitsNotAssignedPostCleaning = nCDCHitsNotAssignedPostCleaning;
75  }
76 
83  bool hasCDCLayer(uint16_t const cdcLayer) const
84  {
86  }
87 
89  void setCDCLayer(uint16_t const cdcLayer)
90  {
92  hitPatternCDC.setLayer(cdcLayer);
93  m_hitPatternCDCInitializer = hitPatternCDC.getInteger();
94  }
95 
97  bool hasCDCSLayer(uint16_t const cdcSLayer) const
98  {
100  }
101 
108  uint16_t getNCDCSegments() const
109  {
111  }
112 
114  void setNCDCSegments(uint16_t nHits)
115  {
117  hitPatternCDC.setNHits(nHits);
118  m_hitPatternCDCInitializer = hitPatternCDC.getInteger();
119  }
120 
121  //--- VXD related stuff -------------------------------------------------------------------------------------------
131  uint16_t getNVXDClustersInLayer(uint16_t const layer, bool const isU)
132  {
133  if (layer == 1 or layer == 2) {
134  return m_nPXDClusters[layer - 1];
135  }
136  if (layer > 2 and layer < 7) {
137  return m_nSVDClusters[layer - 3 + 4 * isU];
138  }
139  B2FATAL("The VXD only has layer 1 to 6, but you asked for " << layer);
140  }
141 
146  uint16_t getNVXDClustersInLayer(uint16_t const layer)
147  {
148  if (layer == 1 or layer == 2) {
149  return getNVXDClustersInLayer(layer, true);
150  }
151  return getNVXDClustersInLayer(layer, true) + getNVXDClustersInLayer(layer, false);
152  }
153 
155  void setNVXDClustersInLayer(uint16_t const layer, bool const isU, uint16_t const nClusters)
156  {
157  if (layer == 1 or layer == 2) {
158  m_nPXDClusters[layer - 1] = nClusters;
159  return;
160  }
161  if (layer > 2 and layer < 7) {
162  m_nSVDClusters[layer - 3 + 4 * isU] = std::min(nClusters, static_cast<unsigned short>(255U));
163  return;
164  }
165  B2FATAL("The VXD only has layer 1 to 6, but you asked for " << layer);
166  }
167 
177  int8_t getSVDFirstSampleTime() const
178  {
179  return m_sampleTime;
180  }
181 
183  void setSVDFirstSampleTime(int8_t const sampleTime)
184  {
185  m_sampleTime = sampleTime;
186  }
187 
188  //--- Flag Block related stuff ------------------------------------------------------------------------------------
190  bool hasAnErrorFlag() const
191  {
192  return m_flagBlock.any();
193  }
194 
197  {
199  }
200 
203  {
205  }
206 
208  bool hasVXDTF2AbortionFlag() const
209  {
211  }
212 
214  void setVXDTF2AbortionFlag()
215  {
217  }
218 
220  bool hasSVDCKFAbortionFlag() const
221  {
223  }
224 
226  void setSVDCKFAbortionFlag()
227  {
229  }
230 
232  bool hasPXDCKFAbortionFlag() const
233  {
235  }
236 
238  void setPXDCKFAbortionFlag()
239  {
241  }
242 
243  private:
245  enum ETrackingErrorFlags {
247  c_vxdtf2Abortion = 1,
248  c_svdckfAbortion = 2,
249  c_pxdckfAbortion = 3,
250  };
251 
258  uint16_t m_nCDCHitsNotAssigned {0};
259 
266 
277  uint64_t m_hitPatternCDCInitializer {0};
278 
284  uint16_t m_nPXDClusters[2] {0, 0};
285 
292  uint8_t m_nSVDClusters[8] {0, 0, 0, 0, 0, 0, 0, 0};
293 
295  int8_t m_sampleTime {0};
296 
298  std::bitset<16> m_flagBlock;
299 
301  };
303 }
Belle2::EventLevelTrackingInfo::getSVDFirstSampleTime
int8_t getSVDFirstSampleTime() const
Getter for time of first SVD sample relative to event T0.
Definition: EventLevelTrackingInfo.h:185
Belle2::EventLevelTrackingInfo::setNCDCHitsNotAssigned
void setNCDCHitsNotAssigned(uint16_t const nCDCHitsNotAssigned)
Setter for number of CDC measurements, that are not assigned to any Track.
Definition: EventLevelTrackingInfo.h:60
Belle2::EventLevelTrackingInfo::ETrackingErrorFlags
ETrackingErrorFlags
Enum to specify meaning of bits in m_flagBlock bitset.
Definition: EventLevelTrackingInfo.h:253
Belle2::EventLevelTrackingInfo::setSVDFirstSampleTime
void setSVDFirstSampleTime(int8_t const sampleTime)
Setter for time of first SVD sample relatvie to event T0.
Definition: EventLevelTrackingInfo.h:191
Belle2::HitPatternCDC::hasSLayer
bool hasSLayer(const unsigned short sLayer) const
Getter for super-layer match.
Definition: HitPatternCDC.cc:116
Belle2::EventLevelTrackingInfo::getNCDCHitsNotAssigned
uint16_t getNCDCHitsNotAssigned() const
Getter for number of CDC measurements, that are not assigned to any Track.
Definition: EventLevelTrackingInfo.h:54
Belle2::EventLevelTrackingInfo::setSVDCKFAbortionFlag
void setSVDCKFAbortionFlag()
Setter for flag indicating that the SVD CKF was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:234
Belle2::EventLevelTrackingInfo::hasCDCSLayer
bool hasCDCSLayer(uint16_t const cdcSLayer) const
Getter for the presence of hit in a SuperLayer.
Definition: EventLevelTrackingInfo.h:105
Belle2::EventLevelTrackingInfo::hasAnErrorFlag
bool hasAnErrorFlag() const
Check if any flag was set in the event.
Definition: EventLevelTrackingInfo.h:198
Belle2::EventLevelTrackingInfo::c_svdckfAbortion
@ c_svdckfAbortion
Indicating abortion of the SVD CKF due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:256
Belle2::EventLevelTrackingInfo::getNCDCHitsNotAssignedPostCleaning
uint16_t getNCDCHitsNotAssignedPostCleaning() const
Getter for number of CDC measurements, that are not assigned to any Track nor very likely beam-backgr...
Definition: EventLevelTrackingInfo.h:74
Belle2::EventLevelTrackingInfo::hasUnspecifiedTrackFindingFailure
bool hasUnspecifiedTrackFindingFailure() const
Getter for unspecified hint of track finding failure.
Definition: EventLevelTrackingInfo.h:204
Belle2::EventLevelTrackingInfo::c_pxdckfAbortion
@ c_pxdckfAbortion
Indicating abortion of the PXD CKF due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:257
Belle2::EventLevelTrackingInfo::m_flagBlock
std::bitset< 16 > m_flagBlock
Set of further flags useful in the context of tracking reconstruction.
Definition: EventLevelTrackingInfo.h:306
Belle2::EventLevelTrackingInfo::m_sampleTime
int8_t m_sampleTime
storage for time of first SVD sample.
Definition: EventLevelTrackingInfo.h:303
Belle2::EventLevelTrackingInfo::setNCDCSegments
void setNCDCSegments(uint16_t nHits)
Setter for number of Segments not used in Tracks.
Definition: EventLevelTrackingInfo.h:122
Belle2::EventLevelTrackingInfo::EventLevelTrackingInfo
EventLevelTrackingInfo()=default
default constructor
Belle2::EventLevelTrackingInfo::hasVXDTF2AbortionFlag
bool hasVXDTF2AbortionFlag() const
Getter for flag indicating that the VXDTF2 was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:216
Belle2::EventLevelTrackingInfo::m_nCDCHitsNotAssigned
uint16_t m_nCDCHitsNotAssigned
Number of hits in the CDC, that were not assigned to any Track.
Definition: EventLevelTrackingInfo.h:266
Belle2::EventLevelTrackingInfo::m_nPXDClusters
uint16_t m_nPXDClusters[2]
Storage for number of clusters in the PXD.
Definition: EventLevelTrackingInfo.h:292
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EventLevelTrackingInfo::m_nCDCHitsNotAssignedPostCleaning
uint16_t m_nCDCHitsNotAssignedPostCleaning
Number of unassigned hits in the CDC, that survived the background filter.
Definition: EventLevelTrackingInfo.h:273
Belle2::EventLevelTrackingInfo::setPXDCKFAbortionFlag
void setPXDCKFAbortionFlag()
Setter for flag indicating that the PXD CKF was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:246
Belle2::EventLevelTrackingInfo::c_unspecifiedError
@ c_unspecifiedError
Indicating a unspecified failure during track finding.
Definition: EventLevelTrackingInfo.h:254
Belle2::EventLevelTrackingInfo::setVXDTF2AbortionFlag
void setVXDTF2AbortionFlag()
Setter for flag indicating that the VXDTF2 was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:222
Belle2::EventLevelTrackingInfo::getNVXDClustersInLayer
uint16_t getNVXDClustersInLayer(uint16_t const layer, bool const isU)
Getter for number of clusters in a specific VXD layer, SVD separated by direction.
Definition: EventLevelTrackingInfo.h:139
Belle2::EventLevelTrackingInfo::setUnspecifiedTrackFindingFailure
void setUnspecifiedTrackFindingFailure()
Setter for unspecified hint of track finding failure.
Definition: EventLevelTrackingInfo.h:210
Belle2::EventLevelTrackingInfo::setCDCLayer
void setCDCLayer(uint16_t const cdcLayer)
Setter for presence of hit in specific CDC Layer.
Definition: EventLevelTrackingInfo.h:97
Belle2::EventLevelTrackingInfo::getNCDCSegments
uint16_t getNCDCSegments() const
Getter for number of segments not used in Tracks.
Definition: EventLevelTrackingInfo.h:116
Belle2::EventLevelTrackingInfo
Tracking-related info on event-level, for example number of unassigned measurements.
Definition: EventLevelTrackingInfo.h:47
Belle2::EventLevelTrackingInfo::hasSVDCKFAbortionFlag
bool hasSVDCKFAbortionFlag() const
Getter for flag indicating that the SVD CKF was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:228
Belle2::EventLevelTrackingInfo::ClassDef
ClassDef(EventLevelTrackingInfo, 2)
ROOTification.
Belle2::EventLevelTrackingInfo::setNCDCHitsNotAssignedPostCleaning
void setNCDCHitsNotAssignedPostCleaning(uint16_t const nCDCHitsNotAssignedPostCleaning)
Setter for number of CDC measurements, that are not assigned to any Track nor very likely beam-backgr...
Definition: EventLevelTrackingInfo.h:80
Belle2::EventLevelTrackingInfo::hasCDCLayer
bool hasCDCLayer(uint16_t const cdcLayer) const
Getter for presence of hit in specific CDC Layer.
Definition: EventLevelTrackingInfo.h:91
Belle2::HitPatternCDC::hasLayer
bool hasLayer(const unsigned short layer) const
Getter for single layer.
Definition: HitPatternCDC.cc:92
Belle2::HitPatternCDC::getNHits
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
Definition: HitPatternCDC.cc:49
Belle2::EventLevelTrackingInfo::hasPXDCKFAbortionFlag
bool hasPXDCKFAbortionFlag() const
Getter for flag indicating that the PXD CKF was aborted due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:240
Belle2::EventLevelTrackingInfo::c_vxdtf2Abortion
@ c_vxdtf2Abortion
Indicating abortion of the VXDTF2 due to high combinatorics in the event.
Definition: EventLevelTrackingInfo.h:255
Belle2::EventLevelTrackingInfo::setNVXDClustersInLayer
void setNVXDClustersInLayer(uint16_t const layer, bool const isU, uint16_t const nClusters)
Setter for number of clusters in specific VXD layer, SVD directions are separated.
Definition: EventLevelTrackingInfo.h:163
Belle2::EventLevelTrackingInfo::m_hitPatternCDCInitializer
uint64_t m_hitPatternCDCInitializer
Efficient way of storing, which layers in the CDC have at least a single hit.
Definition: EventLevelTrackingInfo.h:285
Belle2::EventLevelTrackingInfo::m_nSVDClusters
uint8_t m_nSVDClusters[8]
Storage for number of clusters in the SVD.
Definition: EventLevelTrackingInfo.h:300
Belle2::HitPatternCDC
Hit pattern of CDC hits within a track.
Definition: HitPatternCDC.h:45