Belle II Software development
CDCSZObservations.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 <tracking/trackFindingCDC/fitting/EFitVariance.h>
11
12#include <vector>
13
14namespace Belle2 {
19
20 namespace TrackingUtilities {
21 class Vector2D;
22 class CDCTrack;
23 class CDCRecoHit3D;
24 class CDCSegment3D;
25 }
26
27 namespace TrackFindingCDC {
28
31
32 public:
40 explicit CDCSZObservations(EFitVariance fitVariance = EFitVariance::c_Proper,
41 bool onlyStereo = false)
42 : m_fitVariance(fitVariance)
43 , m_onlyStereo(onlyStereo)
44 {
45 }
46
47 public:
49 std::size_t size() const
50 {
51 return m_szObservations.size() / 3;
52 }
53
55 double* data()
56 {
57 return m_szObservations.data();
58 }
59
61 bool empty() const
62 {
63 return m_szObservations.empty();
64 }
65
67 void clear()
68 {
69 m_szObservations.clear();
70 }
71
73 void reserve(std::size_t nObservations)
74 {
75 m_szObservations.reserve(nObservations * 3);
76 }
77
79 double getS(int iObservation) const
80 {
81 return m_szObservations[iObservation * 3];
82 }
83
85 double getZ(int iObservation) const
86 {
87 return m_szObservations[iObservation * 3 + 1];
88 }
89
91 double getWeight(int iObservation) const
92 {
93 return m_szObservations[iObservation * 3 + 2];
94 }
95
107 std::size_t fill(double s, double z, double weight = 1.0);
108
110 std::size_t append(const TrackingUtilities::CDCRecoHit3D& recoHit3D);
111
116 std::size_t appendRange(const std::vector<TrackingUtilities::CDCRecoHit3D>& recoHit3Ds);
117
122 std::size_t appendRange(const TrackingUtilities::CDCSegment3D& segment3D);
123
128 std::size_t appendRange(const TrackingUtilities::CDCTrack& track);
129
132
134 void passiveMoveBy(const TrackingUtilities::Vector2D& origin);
135
138
139 public:
141 void setFitVariance(EFitVariance fitVariance)
142 {
143 m_fitVariance = fitVariance;
144 }
145
146 private:
151 std::vector<double> m_szObservations;
152
158 EFitVariance m_fitVariance;
159
162 };
163 }
165}
std::size_t append(const TrackingUtilities::CDCRecoHit3D &recoHit3D)
Appends the observed position.
bool m_onlyStereo
Switch to only use information from stereo hits.
std::size_t fill(double s, double z, double weight=1.0)
Appends the observed position.
CDCSZObservations(EFitVariance fitVariance=EFitVariance::c_Proper, bool onlyStereo=false)
Constructor taking in preferred variance which is taken from the various hit objects if present.
TrackingUtilities::Vector2D centralize()
Picks one observation as a reference point and transform all observations to that new origin.
void reserve(std::size_t nObservations)
Reserves enough space for nObservations.
void setFitVariance(EFitVariance fitVariance)
Setter for the indicator that the drift variance should be used.
bool empty() const
Returns true if there are no observations stored.
TrackingUtilities::Vector2D getCentralPoint() const
Extracts the observation center that is at the index in the middle.
void passiveMoveBy(const TrackingUtilities::Vector2D &origin)
Moves all observations passively such that the given vector becomes to origin of the new coordinate s...
std::size_t appendRange(const std::vector< TrackingUtilities::CDCRecoHit3D > &recoHit3Ds)
Appends all reconstructed hits from the three dimensional track.
double getWeight(int iObservation) const
Getter for the weight / inverse variance of the observation at the given index.
double getZ(int iObservation) const
Getter for the z value of the observation at the given index.
std::vector< double > m_szObservations
Memory for the individual observations.
double * data()
Return the pointer to the number buffer.
void clear()
Removes all observations stored.
EFitVariance m_fitVariance
Indicator which variance information should preferably be extracted from hits in calls to append.
std::size_t size() const
Returns the number of observations stored.
double getS(int iObservation) const
Getter for the arc length value of the observation at the given index.
Class representing a three dimensional reconstructed hit.
A segment consisting of three dimensional reconstructed hits.
Class representing a sequence of three dimensional reconstructed hits.
Definition CDCTrack.h:39
A two dimensional vector which is equipped with functions for correct handling of orientation relate...
Definition Vector2D.h:36
Abstract base class for different kinds of events.