 |
Belle II Software
release-05-02-19
|
10 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory2D.h>
12 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCBFieldUtil.h>
14 #include <tracking/trackFindingCDC/topology/CDCWireTopology.h>
15 #include <tracking/trackFindingCDC/topology/CDCWireLayer.h>
16 #include <tracking/trackFindingCDC/topology/WireLine.h>
17 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
19 #include <tracking/trackFindingCDC/geometry/UncertainPerigeeCircle.h>
20 #include <tracking/trackFindingCDC/geometry/PerigeeCircle.h>
21 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
22 #include <tracking/trackFindingCDC/geometry/Vector2D.h>
24 #include <tracking/trackFindingCDC/numerics/EForwardBackward.h>
25 #include <tracking/trackFindingCDC/numerics/ESign.h>
26 #include <tracking/trackFindingCDC/numerics/Quadratic.h>
28 #include <framework/gearbox/Const.h>
37 using namespace TrackFindingCDC;
41 , m_localPerigeeCircle()
46 : m_localOrigin(0.0, 0.0)
47 , m_localPerigeeCircle(perigeeCircle)
54 : m_localOrigin(localOrigin)
55 , m_localPerigeeCircle(localPerigeeCircle)
56 , m_flightTime(flightTime)
62 const Vector2D& mom2D,
65 : m_localOrigin(pos2D)
66 , m_localPerigeeCircle(CDCBFieldUtil::absMom2DToCurvature(mom2D.norm(), charge, bZ),
75 const Vector2D& mom2D,
77 : m_localOrigin(pos2D)
78 , m_localPerigeeCircle(CDCBFieldUtil::absMom2DToCurvature(mom2D.norm(), charge, pos2D),
112 const double distance,
113 const double z)
const
121 double fastDistance = distance != 0.0 ? localCircle.
fastDistance(distance) : 0.0;
123 double c = localCircle.
fastDistance(localPos2D) - fastDistance;
124 double b = localCircle.
gradient(localPos2D).
dot(movePerZ);
127 const std::pair<double, double> solutionsDeltaZ = solveQuadraticABC(a, b, c);
130 const std::array<double, 2> solutionsZ{solutionsDeltaZ.second + z, solutionsDeltaZ.first + z};
135 const double distance,
136 const double z)
const
138 const std::array<double, 2> solutionsZ =
reconstructBothZ(wireLine, distance, z);
140 bool firstIsInCDC = (wireLine.
backwardZ() < solutionsZ[0] and
141 solutionsZ[0] < wireLine.
forwardZ());
142 bool secondIsInCDC = (wireLine.
backwardZ() < solutionsZ[1] and
143 solutionsZ[1] < wireLine.
forwardZ());
146 assert(not(std::fabs(solutionsZ[0] - z) > std::fabs(solutionsZ[1] - z)));
147 const double recoZ = (firstIsInCDC or not secondIsInCDC) ? solutionsZ[0] : solutionsZ[1];
152 const double distance,
153 const double z)
const
155 const std::array<double, 2> solutionsZ =
reconstructBothZ(wireLine, distance, z);
159 return {{{
getClosest(firstRecoWirePos3D.
xy()), firstRecoWirePos3D.
z()},
160 {
getClosest(secondRecoWirePos3D.
xy()), secondRecoWirePos3D.
z()}
165 const double distance,
166 const double z)
const
168 const double recoZ =
reconstructZ(wireLine, distance, z);
204 if (forwardBackwardInfo == EForwardBackward::c_Backward) {
205 movingOutward = not movingOutward;
223 if (forwardBackwardInfo == EForwardBackward::c_Backward) {
224 movingOutward = not movingOutward;
233 ISuperLayer iSuperLayerStep = nextISuperLayer - startISuperLayer;
234 assert(std::abs(iSuperLayerStep) == 1);
235 bool nextMovingOutward = iSuperLayerStep > 0;
369 return output <<
"Local origin : " << trajectory2D.
getLocalOrigin() <<
", "
ISuperLayer getAxialISuperLayerAfterStart(EForwardBackward forwardBackwardInfo) const
Indicates which axial superlayer is traversed after the one, where the start point of the trajectory ...
bool isOriginer(double factor=1) const
Checks if the trajectory intersects with the inner radius of the CDC time the given tolerance factor.
double getAbsMom2D() const
Get the estimation for the absolute value of the transvers momentum.
HepGeom::Vector3D< double > Vector3D
3D Vector
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
double getMaximalCylindricalR() const
Getter for the maximal distance from the origin.
Vector2D unit() const
Returns a unit vector colaligned with this.
Vector2D getOuterExit(double factor=1) const
Calculates the point where the trajectory meets the outer wall of the CDC.
ISuperLayer getMinimalISuperLayer() const
Indicates the minimal superlayer the trajectory traverses.
A two dimensional vector which is equipped with functions for correct handeling of orientation relat...
Vector2D sagMovePerZ(const double z) const
Gives the two dimensional position with wire sag effect of the line at the given z value.
Vector2D sagPos2DAtZ(const double z) const
Gives the two dimensional position with wire sag effect of the line at the given z value.
const UncertainPerigeeCircle & getLocalCircle() const
Getter for the cirlce in local coordinates.
double normSquared() const
Calculates .
ISuperLayer getNextISuperLayer() const
Indicates which superlayer the trajectory traverses after the one, where the start point of the traje...
static const ISuperLayer c_Invalid
Constant making an invalid superlayer id.
void reverse()
Reverses the trajectory in place.
static CDCWireTopology & getInstance()
Getter for the singleton instance of the wire topology.
ESign getChargeSign() const
Gets the charge sign of the trajectory.
CDCTrajectory2D reversed() const
Returns the reverse trajectory as a copy.
ISuperLayer getStartISuperLayer() const
Indicates the superlayer the trajectory starts in.
double setLocalOrigin(const Vector2D &localOrigin)
Setter for the origin of the local coordinate system.
Vector2D getSupport() const
Get the support point of the trajectory in global coordinates.
ESign
Enumeration for the distinct sign values of floating point variables.
EForwardBackward
Enumeration to represent the distinct possibilities of the right left passage information.
Vector2D getClosest(const Vector2D &point) const
Calculates the closest approach on the trajectory to the given point.
bool isCurler(double factor=1) const
Checks if the trajectory leaves the outer radius of the CDC times the given tolerance factor.
std::array< Vector3D, 2 > reconstructBoth3D(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the two three dimensional points where the drift circle touches the wire line.
double dot(const Vector2D &rhs) const
Calculates the two dimensional dot product.
const std::vector< Belle2::TrackFindingCDC::CDCWireLayer > & getWireLayers() const
Getter for the underlying storing layer vector.
double getInnerCylindricalR() const
Getter for the inner radius of the inner most wire layer.
static double absMom2DToCurvature(double absMom2D, double charge, double bZ)
Conversion helper for momenta to two dimensional curvature.
Particle trajectory as it is seen in xy projection represented as a circle.
static ESign ccwInfoToChargeSign(ERotation ccwInfo)
Conversion helper from clockwise or counterclockwise travel to the charge sign.
ISuperLayer getISuperLayerAfter(ISuperLayer iSuperLayer, bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
double getMinimalCylindricalR() const
Getter for the minimal distance from the origin - same as absolute value of the impact parameter.
Vector2D chooseNextForwardOf(const Vector2D &start, const Vector2D &end1, const Vector2D &end2) const
Returns the one of two end point which is first reached from the given start if one stricly follows t...
ISuperLayer getMaximalISuperLayer() const
Indicates the maximal superlayer the trajectory traverses.
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
double getOuterCylindricalR() const
Getter for outer radius of the layer as taken from the CDCGeometryPar.
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system by the vector by and calculates the new perigee and its covariance matrix...
const Vector2D & getLocalOrigin() const
Getter for the origin of the local coordinate system.
static double curvatureToAbsMom2D(double curvature, double bZ)
Conversion helper for two dimensional curvature to momenta.
static const double speedOfLight
[cm/ns]
Vector3D sagPos3DAtZ(const double z) const
Gives the three dimensional position with wire sag effect of the line at the given z value.
Vector2D m_localOrigin
Memory for local coordinate origin of the circle representing the trajectory in global coordinates.
static bool isInvalid(ISuperLayer iSuperLayer)
Indicates if the given number corresponds to a true cdc superlayer - excludes the logic ids for inner...
Adds an uncertainty matrix to the circle in perigee parameterisation.
Vector2D perigee() const
Getter for the perigee point.
Vector2D apogee() const
Getter for the apogee of the circle. If it was a line both components will be infinity.
ISuperLayer getNextAxialISuperLayer() const
Indicates which axial superlayer the trajectory traverses after the one, where the start point of the...
Abstract base class for different kinds of events.
ISuperLayer getISuperLayerAfterStart(bool movingOutward) const
Returns which superlayer is traversed after the current one following the trajectory outward or inwar...
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
A three dimensional limited line represented by its closest approach to the z-axes (reference positio...
ISuperLayer getISuperLayerAtCylindricalR(double cylindricalR)
Returns the logical superlayer number at the given radius.
double m_flightTime
Memory for the estimation of the time at which the particle arrived at the support point.
A three dimensional vector.
void reverse()
Flips the orientation of the circle in place.
double cylindricalR() const
Gives the cylindrical radius of the vector. Same as norm()
bool isInvalid() const
Indicates if all circle parameters are zero.
Vector3D reconstruct3D(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one three dimensional postions within the CDC closest to the given z where the given drift ...
Extension of the generalized circle also caching the perigee coordinates.
Vector2D atCylindricalRForwardOf(const Vector2D &startPoint, double cylindricalR) const
Approach on the circle with the given cylindrical radius that lies in the forward direction of a star...
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Class representating a sense wire layer in the central drift chamber.
Vector2D getInnerExit() const
Calculates the point where the trajectory meets the inner wall of the CDC.
double reconstructZ(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the one z postions within the CDC closest to the given z where the given drift circle on the wi...
const Vector2D & xy() const
Getter for the xy projected vector ( reference ! )
double forwardZ() const
Gives the forward z coodinate.
bool isFitted() const
Checks if the circle is already set to a valid value.
double norm() const
Calculates the length of the vector.
std::array< double, 2 > reconstructBothZ(const WireLine &wireLine, double distance=0.0, double z=0) const
Gives the two z postions where the given drift circle on the wire line touches the trajectory.
double n3() const
Getter for the generalised circle parameter n3.
double backwardZ() const
Gives the backward z coodinate.
ISuperLayer getPreviousAxialISuperLayer() const
Indicates which axial superlayer the trajectory traverses before the one, where the start point of th...
Vector2D closest(const Vector2D &point) const
Calculates the point of closest approach on the circle to the given point.
void setPosMom2D(const Vector2D &pos2D, const Vector2D &mom2D, double charge)
Setter for start point and momentum at the start point subjected to the charge sign.
double z() const
Getter for the z coordinate.
bool isMovingOutward() const
Indicates if the trajectory is moving outwards or inwards (to or away from the origin) from the start...
Vector2D getExit() const
Calculates the point where the trajectory leaves the CDC.
double getInnerCylindricalR() const
Getter for inner radius of the layer as taken from the CDCGeometryPar.
UncertainPerigeeCircle m_localPerigeeCircle
Memory for the generalized circle describing the trajectory in coordinates from the local origin.
double getOuterCylindricalR() const
Getter for the outer radius of the outer most wire layer.
void set(const double first, const double second)
Setter for both coordinate.
double calcArcLength2D(const Vector2D &point) const
Calculate the travel distance from the start position of the trajectory.
Vector2D gradient(const Vector2D &point) const
Gradient of the distance field, hence indicates the direction of increasing distance.
Class representating the sense wire arrangement in the whole of the central drift chamber.
void clear()
Clears all information from this trajectoy.
void invalidate()
Sets all circle parameters to zero including the covariance matrix.
PerigeeCircle getGlobalCircle() const
Getter for the circle in global coordinates.
ISuperLayer getPreviousISuperLayer() const
Indicates which superlayer the trajectory traverses before the one, where the start point of the traj...
double fastDistance(const Vector2D &point) const
Getter for the linearised distance measure to a point.
CDCTrajectory2D()
Default constructor for ROOT compatibility.