Belle II Software  release-08-01-10
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 43 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 107 of file CDCObservations2D.cc.

108 {
109  const ERightLeft rlInfo = rlWireHit.getRLInfo();
110 
111  const double driftLength = rlWireHit.getRefDriftLength();
112  const double driftLengthVariance = rlWireHit.getRefDriftLengthVariance();
113 
114  const Vector2D& wireRefPos2D = rlWireHit.getRefPos2D();
115 
116  double signedDriftLength = 0;
117  if (m_fitPos == EFitPos::c_RLDriftCircle and isValid(rlInfo)) {
118  signedDriftLength = static_cast<double>(rlInfo) * driftLength;
119  } else {
120  signedDriftLength = 0;
121  }
122 
123  double variance = 1;
124  if (m_fitVariance == EFitVariance::c_Unit) {
125  variance = 1;
126  } else if (m_fitVariance == EFitVariance::c_Nominal) {
128  } else if (m_fitVariance == EFitVariance::c_DriftLength) {
129  variance = fabs(driftLength);
130  } else if (m_fitVariance == EFitVariance::c_Pseudo) {
131  variance = getPseudoDriftLengthVariance(driftLength, driftLengthVariance);
132  } else if (m_fitVariance == EFitVariance::c_Proper) {
133  if (abs(rlInfo) != 1) {
134  variance = getPseudoDriftLengthVariance(driftLength, driftLengthVariance);
135  } else {
136  variance = driftLengthVariance;
137  }
138  }
139 
140  return fill(wireRefPos2D, signedDriftLength, 1 / variance);
141 }
EFitPos m_fitPos
Indicator which positional information should preferably be extracted from hits in calls to append.
static double getPseudoDriftLengthVariance(double driftLength, double driftLengthVariance)
Gets the pseudo variance.
std::size_t fill(double x, double y, double signedRadius=0.0, double weight=1.0)
Appends the observed position.
EFitVariance m_fitVariance
Indicator which variance information should preferably be extracted from hits in calls to append.
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:222
double getRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:204
const Vector2D & getRefPos2D() const
The two dimensional reference position of the underlying wire.
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRLWireHit.h:234
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:64
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Definition: Vector2D.h:35
bool isValid(EForwardBackward eForwardBackward)
Check whether the given enum instance is one of the valid values.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25

◆ 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.

Definition at line 67 of file CDCObservations2D.cc.

◆ 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.

Definition at line 98 of file CDCObservations2D.cc.

◆ 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 258 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 240 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 249 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 275 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 298 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 284 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.

Definition at line 62 of file CDCObservations2D.cc.

◆ 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.

Definition at line 39 of file CDCObservations2D.cc.

◆ 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 68 of file CDCObservations2D.h.

70  {
71  return driftLength * driftLength + driftLengthVariance;
72  }

◆ 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 295 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 343 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 350 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 336 of file CDCObservations2D.h.


The documentation for this class was generated from the following files: