 |
Belle II Software
release-05-01-25
|
10 #include <tracking/trackFindingCDC/eventdata/utils/RecoTrackUtil.h>
12 #include <tracking/trackFindingCDC/eventdata/tracks/CDCTrack.h>
14 #include <tracking/trackFindingCDC/eventdata/hits/CDCRLWireHit.h>
15 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
17 #include <tracking/trackFindingCDC/topology/ISuperLayer.h>
18 #include <tracking/trackFindingCDC/fitting/CDCSZFitter.h>
19 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectorySZ.h>
21 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCTrajectory3D.h>
22 #include <tracking/trackFindingCDC/eventdata/trajectories/CDCBFieldUtil.h>
24 #include <tracking/trackFindingCDC/numerics/TMatrixConversion.h>
25 #include <tracking/trackFindingCDC/geometry/Vector3D.h>
26 #include <tracking/trackFindingCDC/numerics/ERightLeft.h>
27 #include <tracking/trackFindingCDC/numerics/ESign.h>
29 #include <tracking/dataobjects/RecoTrack.h>
30 #include <tracking/dataobjects/RecoHitInformation.h>
32 #include <framework/datastore/StoreArray.h>
34 #include <TMatrixDSymfwd.h>
35 #include <TMatrixTSym.h>
39 using namespace TrackFindingCDC;
44 ISuperLayer closestLayer = track.getStartISuperLayer();
48 if (hit.isAxial())
continue;
49 firstHits.push_back(hit);
50 if ((hit.getISuperLayer() != closestLayer) and (firstHits.size() > 3))
break;
56 Vector3D position(track.getStartTrajectory3D().getSupport().x(),
57 track.getStartTrajectory3D().getSupport().y(),
58 szTrajectory.
getZ0());
60 Vector3D momentum(track.getStartTrajectory3D().getFlightDirection3DAtSupport());
61 const double z0 = szTrajectory.
getZ0();
62 const double lambda = std::atan(szTrajectory.
getTanLambda());
63 momentum.scale(std::cos(lambda));
64 momentum.setZ(std::sin(lambda));
65 momentum *= momentumSeedMagnitude;
70 closestLayer = track.getEndISuperLayer();
72 for (
auto it = track.rbegin(); it != track.rend(); it++) {
74 if (hit.isAxial())
continue;
75 votes += (hit.getRecoZ() - z0 - std::tan(lambda) * hit.getArcLength2D());
77 if ((hit.getISuperLayer() != closestLayer) and (nHits > 3))
break;
79 votes > 0 ? charge = ESign::c_Plus : charge = ESign::c_Minus;
90 if (not newRecoTrack)
return nullptr;
133 template <
class ARLHitHolderRange>
136 int sortingParameter = -1;
137 for (
const auto& rlWireHitHolder : rlWireHitHolders) {
140 const CDCRLWireHit rlWireHit = rlWireHitHolder.getRLWireHit();
147 if (rlInfo == ERightLeft::c_Left) {
150 RightLeftInformation::c_left,
151 RecoHitInformation::c_CDCTrackFinder);
152 }
else if (rlInfo == ERightLeft::c_Right) {
155 RightLeftInformation::c_right,
156 RecoHitInformation::c_CDCTrackFinder);
157 }
else if (rlInfo == ERightLeft::c_Invalid) {
160 RightLeftInformation::c_invalidRightLeftInformation,
161 RecoHitInformation::c_CDCTrackFinder);
165 RightLeftInformation::c_undefinedRightLeftInformation,
166 RecoHitInformation::c_CDCTrackFinder);
T * appendNew()
Construct a new T object at the end of the array.
bool hasNAN() const
Checks if one of the coordinates is NAN.
Class representing a three dimensional reconstructed hit.
void setTimeSeed(const double timeSeed)
Set the time seed. ATTENTION: This is not the fitted time.
Class representing a sequence of three dimensional reconstructed hits.
static const CDCSZFitter & getFitter()
Getter for a standard sz line fitter instance.
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
ESign
Enumeration for the distinct sign values of floating point variables.
bool isValid(ESign s)
Returns true if sign is ESign::c_Plus, ESign::c_Minus or ESign::c_Zero.
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
Vector3D getMom3DAtSupport(const double bZ) const
Get the momentum at the start point of the trajectory.
Linear trajectory in sz space.
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
static RecoTrack * storeInto(const CDCTrack &track, StoreArray< RecoTrack > &recoTracks, const double momentumSeedMagnitude)
For magnetic monopoles; estimates charge sign from all stereo hits, momentum direction from hits in c...
bool addCDCHit(const UsedCDCHit *cdcHit, const unsigned int sortingParameter, RightLeftInformation rightLeftInformation=RightLeftInformation::c_undefinedRightLeftInformation, OriginTrackFinder foundByTrackFinder=OriginTrackFinder::c_undefinedTrackFinder)
Adds a cdc hit with the given information to the reco track.
This is the Reconstruction Event-Data Model Track.
CDCTrajectorySZ fitWithStereoHits(const CDCTrack &track) const
Returns the fitted sz trajectory of the track with the z-information of all stereo hits of the number...
ERightLeft getRLInfo() const
Getter for the right left passage information.
double getZ0() const
Getter for the z coordinate at zero travel distance.
CovarianceMatrix< 6 > getCartesianCovariance(double bZ) const
Convert the helix parameters to the cartesian coordinates x,y,z,px,py,pz.
Abstract base class for different kinds of events.
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
A three dimensional vector.
Class implementing the z coordinate over travel distance line fit.
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
static double getBFieldZ()
Getter for the signed magnetic field stength in z direction at the origin ( in Tesla )
Vector3D getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
static TMatrixDSym toTMatrix(const CovarianceMatrix< N > &cov)
Translate the covariance matrix to the TMatrix representation.
ESign getChargeSign() const
Gets the charge sign of the trajectory.
A matrix implementation to be used as an interface typ through out the track finder.
Accessor to arrays stored in the data store.
static void fill(const ARLHitHolderRange &rlWireHitHolders, RecoTrack &recoTrack)
Translates a range of hits and inserts them in the reco track.
Class representing a hit wire in the central drift chamber.
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
double getFlightTime() const
Getter for the time when the particle reached the support point position.
Particle full three dimensional trajectory.