Belle II Software development
EventLevelTrackingInfo.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#pragma once
9
10#include <mdst/dataobjects/HitPatternCDC.h>
11
12#include <framework/logging/Logger.h>
13
14#include <TObject.h>
15
16#include <algorithm>
17#include <bitset>
18
19namespace Belle2 {
37 class EventLevelTrackingInfo : public TObject {
38 public:
41
42 //--- CDC related Stuff -------------------------------------------------------------------------------------------
44 uint16_t getNCDCHitsNotAssigned() const
45 {
47 }
48
50 void setNCDCHitsNotAssigned(uint16_t const nCDCHitsNotAssigned)
51 {
52 m_nCDCHitsNotAssigned = nCDCHitsNotAssigned;
53 }
54
65 {
67 }
68
70 void setNCDCHitsNotAssignedPostCleaning(uint16_t const nCDCHitsNotAssignedPostCleaning)
71 {
72 m_nCDCHitsNotAssignedPostCleaning = nCDCHitsNotAssignedPostCleaning;
73 }
74
81 bool hasCDCLayer(uint16_t const cdcLayer) const
82 {
84 }
85
87 void setCDCLayer(uint16_t const cdcLayer)
88 {
90 hitPatternCDC.setLayer(cdcLayer);
91 m_hitPatternCDCInitializer = hitPatternCDC.getInteger();
92 }
93
95 bool hasCDCSLayer(uint16_t const cdcSLayer) const
96 {
98 }
99
106 uint16_t getNCDCSegments() const
107 {
109 }
110
112 void setNCDCSegments(uint16_t nHits)
113 {
115 hitPatternCDC.setNHits(nHits);
116 m_hitPatternCDCInitializer = hitPatternCDC.getInteger();
117 }
118
119 //--- VXD related stuff -------------------------------------------------------------------------------------------
129 uint16_t getNVXDClustersInLayer(uint16_t const layer, bool const isU)
130 {
131 if (layer == 1 or layer == 2) {
132 return m_nPXDClusters[layer - 1];
133 }
134 if (layer > 2 and layer < 7) {
135 return m_nSVDClusters[layer - 3 + 4 * isU];
136 }
137 B2FATAL("The VXD only has layer 1 to 6, but you asked for " << layer);
138 }
139
144 uint16_t getNVXDClustersInLayer(uint16_t const layer)
145 {
146 if (layer == 1 or layer == 2) {
147 return getNVXDClustersInLayer(layer, true);
148 }
149 return getNVXDClustersInLayer(layer, true) + getNVXDClustersInLayer(layer, false);
150 }
151
153 void setNVXDClustersInLayer(uint16_t const layer, bool const isU, uint16_t const nClusters)
154 {
155 if (layer == 1 or layer == 2) {
156 m_nPXDClusters[layer - 1] = nClusters;
157 return;
158 }
159 if (layer > 2 and layer < 7) {
160 m_nSVDClusters[layer - 3 + 4 * isU] = std::min(nClusters, static_cast<unsigned short>(255U));
161 return;
162 }
163 B2FATAL("The VXD only has layer 1 to 6, but you asked for " << layer);
164 }
165
176 {
177 return m_sampleTime;
178 }
179
181 void setSVDFirstSampleTime(int8_t const sampleTime)
182 {
183 m_sampleTime = sampleTime;
184 }
185
186 //--- Flag Block related stuff ------------------------------------------------------------------------------------
188 bool hasAnErrorFlag() const
189 {
190 return m_flagBlock.any();
191 }
192
195 {
197 }
198
201 {
203 }
204
207 {
209 }
210
213 {
215 }
216
219 {
221 }
222
225 {
227 }
228
231 {
233 }
234
237 {
239 }
240
243 {
245 }
246
249 {
251 }
252
253 private:
261 };
262
270
277
289
295 uint16_t m_nPXDClusters[2] {0, 0};
296
303 uint8_t m_nSVDClusters[8] {0, 0, 0, 0, 0, 0, 0, 0};
304
306 int8_t m_sampleTime {0};
307
309 std::bitset<16> m_flagBlock;
310
312 };
314}
Tracking-related info on event-level, for example number of unassigned measurements.
bool hasCDCLayer(uint16_t const cdcLayer) const
Getter for presence of hit in specific CDC Layer.
int8_t m_sampleTime
storage for time of first SVD sample.
bool hasCDCSLayer(uint16_t const cdcSLayer) const
Getter for the presence of hit in a SuperLayer.
uint16_t getNCDCSegments() const
Getter for number of segments not used in Tracks.
bool hasSVDCKFAbortionFlag() const
Getter for flag indicating that the SVD CKF was aborted due to high combinatorics in the event.
uint16_t m_nPXDClusters[2]
Storage for number of clusters in the PXD.
bool hasVXDTF2AbortionFlag() const
Getter for flag indicating that the VXDTF2 was aborted due to high combinatorics in the event.
uint16_t m_nCDCHitsNotAssigned
Number of hits in the CDC, that were not assigned to any Track.
uint16_t getNVXDClustersInLayer(uint16_t const layer, bool const isU)
Getter for number of clusters in a specific VXD layer, SVD separated by direction.
ClassDef(EventLevelTrackingInfo, 2)
ROOTification.
std::bitset< 16 > m_flagBlock
Set of further flags useful in the context of tracking reconstruction.
void setSVDSpacePointCreatorAbortionFlag()
Setter for flag indicating that the SVD Space Point Creator was aborted due to very busy event.
bool hasSVDSpacePointCreatorAbortionFlag() const
Getter for flag indicating that the SVD Space Point Creator was aborted due to very busy event.
uint16_t getNVXDClustersInLayer(uint16_t const layer)
Getter for number of clusters in specific VXD layer, SVD directions are accumulated.
void setSVDFirstSampleTime(int8_t const sampleTime)
Setter for time of first SVD sample relatvie to event T0.
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.
uint16_t getNCDCHitsNotAssignedPostCleaning() const
Getter for number of CDC measurements, that are not assigned to any Track nor very likely beam-backgr...
void setNCDCHitsNotAssignedPostCleaning(uint16_t const nCDCHitsNotAssignedPostCleaning)
Setter for number of CDC measurements, that are not assigned to any Track nor very likely beam-backgr...
int8_t getSVDFirstSampleTime() const
Getter for time of first SVD sample relative to event T0.
uint16_t getNCDCHitsNotAssigned() const
Getter for number of CDC measurements, that are not assigned to any Track.
void setVXDTF2AbortionFlag()
Setter for flag indicating that the VXDTF2 was aborted due to high combinatorics in the event.
void setSVDCKFAbortionFlag()
Setter for flag indicating that the SVD CKF was aborted due to high combinatorics in the event.
bool hasAnErrorFlag() const
Check if any flag was set in the event.
EventLevelTrackingInfo()=default
default constructor
uint16_t m_nCDCHitsNotAssignedPostCleaning
Number of unassigned hits in the CDC, that survived the background filter.
bool hasUnspecifiedTrackFindingFailure() const
Getter for unspecified hint of track finding failure.
uint64_t m_hitPatternCDCInitializer
Efficient way of storing, which layers in the CDC have at least a single hit.
void setCDCLayer(uint16_t const cdcLayer)
Setter for presence of hit in specific CDC Layer.
uint8_t m_nSVDClusters[8]
Storage for number of clusters in the SVD.
void setUnspecifiedTrackFindingFailure()
Setter for unspecified hint of track finding failure.
void setPXDCKFAbortionFlag()
Setter for flag indicating that the PXD CKF was aborted due to high combinatorics in the event.
bool hasPXDCKFAbortionFlag() const
Getter for flag indicating that the PXD CKF was aborted due to high combinatorics in the event.
void setNCDCSegments(uint16_t nHits)
Setter for number of Segments not used in Tracks.
void setNCDCHitsNotAssigned(uint16_t const nCDCHitsNotAssigned)
Setter for number of CDC measurements, that are not assigned to any Track.
ETrackingErrorFlags
Enum to specify meaning of bits in m_flagBlock bitset.
@ c_vxdtf2Abortion
Indicating abortion of the VXDTF2 due to high combinatorics in the event.
@ c_pxdckfAbortion
Indicating abortion of the PXD CKF due to high combinatorics in the event.
@ c_svdckfAbortion
Indicating abortion of the SVD CKF due to high combinatorics in the event.
@ c_unspecifiedError
Indicating a unspecified failure during track finding.
@ c_svdSpacePointAbortion
Indicating abortion of the SVD Space Point Creator due to very busy event.
Hit pattern of CDC hits within a track.
Definition: HitPatternCDC.h:35
bool hasSLayer(const unsigned short sLayer) const
Getter for super-layer match.
void setNHits(unsigned short nHits)
Sets the 8 MSBs to the total number of hits in the CDC.
void setLayer(const unsigned short layer)
Set bit corresponding to layer to true.
ULong64_t getInteger() const
Getter for underlying integer type.
bool hasLayer(const unsigned short layer) const
Getter for single layer.
unsigned short getNHits() const
Get the total Number of CDC hits in the fit.
Abstract base class for different kinds of events.