Belle II Software  release-05-02-19
CDCObservations2D Class Reference

Class serving as a storage of observed drift circles to present to the Riemann fitter. More...

#include <CDCObservations2D.h>

Collaboration diagram for CDCObservations2D:

Public Member Functions

 CDCObservations2D (EFitPos fitPos=EFitPos::c_RecoPos, EFitVariance fitVariance=EFitVariance::c_Proper)
 Constructor taking the flag if the reconstructed positon of the hits should be used when they are available The default is to use the wire position and the drift length signed by the right left passage hypotheses.
 
std::size_t size () const
 Returns the number of observations stored.
 
double * data ()
 Return the pointer to the number buffer.
 
bool empty () const
 Returns true if there are no observations stored.
 
void clear ()
 Removes all observations stored.
 
void reserve (std::size_t nObservations)
 Reserves enough space for nObservations.
 
double getX (int iObservation) const
 Getter for the x value of the observation at the given index.
 
double getY (int iObservation) const
 Getter for the y value of the observation at the given index.
 
double getDriftLength (int iObservation) const
 Getter for the signed drift radius of the observation at the given index.
 
double getWeight (int iObservation) const
 Getter for the weight / inverse variance of the observation at the given index.
 
std::size_t fill (double x, double y, double signedRadius=0.0, double weight=1.0)
 Appends the observed position. More...
 
std::size_t fill (const Vector2D &pos2D, double signedRadius=0.0, double weight=1.0)
 Appends the observed position. More...
 
std::size_t append (const CDCWireHit &wireHit, ERightLeft rlInfo=ERightLeft::c_Unknown)
 Appends the hit circle at wire reference position without a right left passage hypotheses. More...
 
std::size_t append (const CDCWireHit *wireHit, ERightLeft rlInfo=ERightLeft::c_Unknown)
 Appends the position information of the given wire hit to the stored obseravations. More...
 
std::size_t append (const CDCRLWireHit &rlWireHit)
 Appends the hit circle at wire reference position with a right left passage hypotheses. More...
 
std::size_t append (const CDCRLWireHitPair &rlWireHitPair)
 Appends the two observed position.
 
std::size_t append (const CDCRLWireHitTriple &rlWireHitTriple)
 Appends the three observed position.
 
std::size_t append (const CDCFacet &facet)
 Appends the three observed position.
 
std::size_t append (const CDCRecoHit2D &recoHit2D)
 Appends the hit using the reconstructed position if useRecoPos indicates it.
 
std::size_t append (const CDCRecoHit3D &recoHit3D)
 Appends the observed position.
 
std::size_t appendRange (const CDCSegment2D &segment2D)
 Appends all reconstructed hits from the two dimensional segment. More...
 
std::size_t appendRange (const CDCSegment3D &segment3D)
 Appends all reconstructed hits from the three dimensional segment. More...
 
std::size_t appendRange (const CDCAxialSegmentPair &axialSegmentPair)
 Appends all reconstructed hits from the two axial segments,. More...
 
std::size_t appendRange (const CDCTrack &track)
 Appends all reconstructed hits from the three dimensional track. More...
 
std::size_t appendRange (const std::vector< const CDCWire * > &wires)
 Appends all the reference wire positions. More...
 
std::size_t appendRange (const CDCWireHitSegment &wireHits)
 Appends all the wire hit reference positions with the pseudo variance. More...
 
template<class ARange >
std::size_t appendRange (const ARange &range)
 Append all hits from a generic range.
 
Vector2D getFrontPos2D () const
 Get the postion of the first observation.
 
Vector2D getBackPos2D () const
 Get the postion of the first observation.
 
double getTotalPerpS (const CDCTrajectory2D &trajectory2D) const
 Calculate the total transvers travel distance traversed by these observations comparing the travel distance of first and last position.
 
bool isForwardTrajectory (const CDCTrajectory2D &trajectory2D) const
 Checks if the last position of these observations lies at greater travel distance than the first.
 
EForwardBackward isCoaligned (const CDCTrajectory2D &trajectory2D) const
 Checks if the last observation in the vector lies at greater or lower travel distance than the last observation. More...
 
Vector2D getCentralPoint () const
 Extracts the observation center that is at the index in the middle.
 
void passiveMoveBy (const Vector2D &origin)
 Moves all observations passively such that the given vector becomes to origin of the new coordinate system.
 
Vector2D centralize ()
 Picks one observation as a reference point and transform all observations to that new origin.
 
std::size_t getNObservationsWithDriftRadius () const
 Returns the number of observations having a drift radius radius.
 
EFitPos getFitPos () const
 Getter for the indicator that the reconstructed position should be favoured.
 
void setFitPos (EFitPos fitPos)
 Setter for the indicator that the reconstructed position should be favoured.
 
void setFitVariance (EFitVariance fitVariance)
 Setter for the indicator that the drift variance should be used.
 

Static Public Member Functions

static double getPseudoDriftLengthVariance (double driftLength, double driftLengthVariance)
 Gets the pseudo variance. More...
 
static double getPseudoDriftLengthVariance (const CDCWireHit &wireHit)
 Calculate the pseudo variance from the drift length and its variance.
 

Private Attributes

std::vector< double > m_observations
 Memory for the individual observations. More...
 
EFitPos m_fitPos
 Indicator which positional information should preferably be extracted from hits in calls to append. More...
 
EFitVariance m_fitVariance
 Indicator which variance information should preferably be extracted from hits in calls to append. More...
 

Detailed Description

Class serving as a storage of observed drift circles to present to the Riemann fitter.

Definition at line 53 of file CDCObservations2D.h.

Member Function Documentation

◆ append() [1/3]

std::size_t append ( const CDCRLWireHit rlWireHit)

Appends the hit circle at wire reference position with a right left passage hypotheses.

Note
Observations are skipped, if one of the contained variables is NAN.
The left right passage information is always set to the right left passage hypotheses of the give hit.
Parameters
rlWireHitHit information to be appended as observation. XY position, signed drift length and inverse variance are taken at the wire reference position.
Returns
Number of observations added. One if the observation was added. Zero if one of the given variables is NAN.

Definition at line 109 of file CDCObservations2D.cc.

110 {
111  const ERightLeft rlInfo = rlWireHit.getRLInfo();
112 
113  const double driftLength = rlWireHit.getRefDriftLength();
114  const double driftLengthVariance = rlWireHit.getRefDriftLengthVariance();
115 
116  const Vector2D& wireRefPos2D = rlWireHit.getRefPos2D();
117 
118  double signedDriftLength = 0;
119  if (m_fitPos == EFitPos::c_RLDriftCircle and isValid(rlInfo)) {
120  signedDriftLength = rlInfo * driftLength;
121  } else {
122  signedDriftLength = 0;
123  }
124 
125  double variance = 1;
126  if (m_fitVariance == EFitVariance::c_Unit) {
127  variance = 1;
128  } else if (m_fitVariance == EFitVariance::c_Nominal) {
130  } else if (m_fitVariance == EFitVariance::c_DriftLength) {
131  variance = fabs(driftLength);
132  } else if (m_fitVariance == EFitVariance::c_Pseudo) {
133  variance = getPseudoDriftLengthVariance(driftLength, driftLengthVariance);
134  } else if (m_fitVariance == EFitVariance::c_Proper) {
135  if (abs(rlInfo) != 1) {
136  variance = getPseudoDriftLengthVariance(driftLength, driftLengthVariance);
137  } else {
138  variance = driftLengthVariance;
139  }
140  }
141 
142  return fill(wireRefPos2D, signedDriftLength, 1 / variance);
143 }

◆ append() [2/3]

std::size_t append ( const CDCWireHit wireHit,
ERightLeft  rlInfo = ERightLeft::c_Unknown 
)

Appends the hit circle at wire reference position without a right left passage hypotheses.

Note
Observations are skipped, if one of the contained variables is NAN.
The left right passage information is always set to ERightLeft::c_Right, since on specific assumption can be made from the wire hit alone.
Parameters
wireHitHit information to be appended as observation. XY position, drift length and inverse variance are taken at the wire reference position.
rlInfoRight left passage information with which the drift length should be signed.
Returns
Number of observations added. One if the observation was added. Zero if one of the given variables is NAN.

◆ append() [3/3]

std::size_t append ( const CDCWireHit wireHit,
ERightLeft  rlInfo = ERightLeft::c_Unknown 
)

Appends the position information of the given wire hit to the stored obseravations.

Obtionally includes the drift length with the given right left orientation

Parameters
wireHitHit information to be appended as observation.
rlInfoRight left passage information with which the drift length should be signed.
Returns
Number of observations added. One if the observation was added. Zero if one of the given variables is NAN.

◆ appendRange() [1/6]

std::size_t appendRange ( const CDCAxialSegmentPair axialSegmentPair)

Appends all reconstructed hits from the two axial segments,.

Returns
Number of added hits

Definition at line 260 of file CDCObservations2D.cc.

◆ appendRange() [2/6]

std::size_t appendRange ( const CDCSegment2D segment2D)

Appends all reconstructed hits from the two dimensional segment.

Returns
Number of added hits

Definition at line 242 of file CDCObservations2D.cc.

◆ appendRange() [3/6]

std::size_t appendRange ( const CDCSegment3D segment3D)

Appends all reconstructed hits from the three dimensional segment.

Returns
Number of added hits

Definition at line 251 of file CDCObservations2D.cc.

◆ appendRange() [4/6]

std::size_t appendRange ( const CDCTrack track)

Appends all reconstructed hits from the three dimensional track.

Returns
Number of added hits

Definition at line 277 of file CDCObservations2D.cc.

◆ appendRange() [5/6]

std::size_t appendRange ( const CDCWireHitSegment wireHits)

Appends all the wire hit reference positions with the pseudo variance.

Note
For cross check to legendre finder.
Returns
Number of added hits

Definition at line 300 of file CDCObservations2D.cc.

◆ appendRange() [6/6]

std::size_t appendRange ( const std::vector< const CDCWire * > &  wires)

Appends all the reference wire positions.

Note
For cross check to legendre finder.
Returns
Number of added hits

Definition at line 286 of file CDCObservations2D.cc.

◆ fill() [1/2]

std::size_t fill ( const Vector2D pos2D,
double  signedRadius = 0.0,
double  weight = 1.0 
)

Appends the observed position.

Note
Observations are skipped, if one of the given variables is NAN.
Parameters
pos2DX, Y coordinate of the center of the observed circle.
signedRadiusThe radius of the observed circle signed with right left passage hypotheses. Defaults to 0.
weightThe relative weight of the observation. In order to generate a unit less chi^2 measure the weight should be chosen as the inverse variance of the drift length. Defaults to 1.
Returns
Number of observations added. One if the observation was added. Zero if one of the given variables is NAN.

◆ fill() [2/2]

std::size_t fill ( double  x,
double  y,
double  signedRadius = 0.0,
double  weight = 1.0 
)

Appends the observed position.

Note
Observations are skipped, if one of the given variables is NAN.
Parameters
xX coordinate of the center of the observed circle.
yY coordinate of the center of the observed circle.
signedRadiusThe radius of the observed circle signed with right left passage hypotheses. Defaults to 0.
weightThe relative weight of the observation. In order to generate a unit less chi^2 measure the weight should be chosen as the inverse variance of the drift length. Defaults to 1.
Returns
Number of observations added. One if the observation was added. Zero if one of the given variables is NAN.

◆ getPseudoDriftLengthVariance()

static double getPseudoDriftLengthVariance ( double  driftLength,
double  driftLengthVariance 
)
inlinestatic

Gets the pseudo variance.

The pseudo drift length variance is a measure that tries to incorporate the drift length into the fit to drift circles where the right left passage ambiguity could not be resolved. In such situations only the position of an hit can be used, however if only the position that can be determined is the wire position the information of the drift length should at least weaken the gravity of that wire in relation to the fitted trajectory. The pseudo variance is therefore the square of the drift length itself (square for unit conformity) plus its reference drift length variance.

Definition at line 78 of file CDCObservations2D.h.

81  {
82  return m_observations.size() / 4;

◆ isCoaligned()

EForwardBackward isCoaligned ( const CDCTrajectory2D trajectory2D) const
inline

Checks if the last observation in the vector lies at greater or lower travel distance than the last observation.

Return values
EForwardBackward::c_Forwardif the last observation lies behind the first.
EForwardBackward::c_Backwardif the last observation lies before the first.

Definition at line 305 of file CDCObservations2D.h.

Member Data Documentation

◆ m_fitPos

EFitPos m_fitPos
private

Indicator which positional information should preferably be extracted from hits in calls to append.

Meaning of the constants detailed in EFitPos.

Definition at line 353 of file CDCObservations2D.h.

◆ m_fitVariance

EFitVariance m_fitVariance
private

Indicator which variance information should preferably be extracted from hits in calls to append.

Meaning of the constants detailed in EFitVariance.

Definition at line 360 of file CDCObservations2D.h.

◆ m_observations

std::vector<double> m_observations
private

Memory for the individual observations.

Arrangement of values is x,y, drift raduis, weight, x, y, .....

Definition at line 346 of file CDCObservations2D.h.


The documentation for this class was generated from the following files:
Belle2::TrackFindingCDC::CDCObservations2D::m_observations
std::vector< double > m_observations
Memory for the individual observations.
Definition: CDCObservations2D.h:346
Belle2::TrackFindingCDC::NForwardBackward::isValid
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.
Definition: EForwardBackward.h:55
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::CDCObservations2D::getPseudoDriftLengthVariance
static double getPseudoDriftLengthVariance(double driftLength, double driftLengthVariance)
Gets the pseudo variance.
Definition: CDCObservations2D.h:78
Belle2::TrackFindingCDC::CDCWireHit::c_simpleDriftLengthVariance
static constexpr const double c_simpleDriftLengthVariance
A default value for the drift length variance if no variance from the drift length translation is ava...
Definition: CDCWireHit.h:74
Belle2::TrackFindingCDC::CDCObservations2D::fill
std::size_t fill(double x, double y, double signedRadius=0.0, double weight=1.0)
Appends the observed position.
Belle2::TrackFindingCDC::CDCObservations2D::m_fitPos
EFitPos m_fitPos
Indicator which positional information should preferably be extracted from hits in calls to append.
Definition: CDCObservations2D.h:353
Belle2::TrackFindingCDC::CDCObservations2D::m_fitVariance
EFitVariance m_fitVariance
Indicator which variance information should preferably be extracted from hits in calls to append.
Definition: CDCObservations2D.h:360