Belle II Software development
RecoTrackUtil Struct Reference

Structure to summarize utility function to output a list of hits into a RecoTrack. More...

#include <RecoTrackUtil.h>

Static Public Member Functions

static RecoTrackstoreInto (const CDCTrack &track, StoreArray< RecoTrack > &recoTracks, const double momentumSeedMagnitude)
 For magnetic monopoles; estimates charge sign from all stereo hits, momentum direction from hits in closest superlayer, fixing magnitude with given value. Ignores building CDCTrajectory3D since it is based on a helix.
 
static RecoTrackstoreInto (const CDCTrack &track, StoreArray< RecoTrack > &recoTracks)
 Copies the track information to the RecoTrack.
 
static RecoTrackstoreInto (const CDCTrajectory3D &traj3D, StoreArray< RecoTrack > &recoTracks)
 Copies the trajectory information to the RecoTrack.
 
static RecoTrackstoreInto (const CDCTrajectory3D &traj3D, const double bZ, StoreArray< RecoTrack > &recoTracks)
 Copies the trajectory information to the RecoTrack.
 
template<class ARLHitHolderRange >
static void fill (const ARLHitHolderRange &rlWireHitHolders, RecoTrack &recoTrack)
 Translates a range of hits and inserts them in the reco track.
 

Detailed Description

Structure to summarize utility function to output a list of hits into a RecoTrack.

Definition at line 24 of file RecoTrackUtil.h.

Member Function Documentation

◆ fill()

void fill ( const ARLHitHolderRange &  rlWireHitHolders,
RecoTrack recoTrack 
)
static

Translates a range of hits and inserts them in the reco track.

fill() specialisation for a class that holds right-left wire-hit information

List of explicit specialisations - at the moment only CDCTrack.

Currently only instantiated for RecoTrack.

Parameters
rlWireHitHoldersA range of hits, which elements support ->getRLWireHit() to access a wire hit including a right left passage hypotheses.
[out]recoTrackRecoTrack to be filled.

Definition at line 132 of file RecoTrackUtil.cc.

133{
134 int sortingParameter = -1;
135 for (const auto& rlWireHitHolder : rlWireHitHolders) {
136 ++sortingParameter;
137
138 const CDCRLWireHit rlWireHit = rlWireHitHolder.getRLWireHit();
139 const CDCWireHit& wireHit = rlWireHit.getWireHit();
140 const CDCHit* cdcHit = wireHit.getHit();
141
142 // Right left ambiguity resolution
143 ERightLeft rlInfo = rlWireHit.getRLInfo();
144 using RightLeftInformation = RecoHitInformation::RightLeftInformation;
145 if (rlInfo == ERightLeft::c_Left) {
146 recoTrack.addCDCHit(cdcHit,
147 sortingParameter,
148 RightLeftInformation::c_left,
149 RecoHitInformation::c_CDCTrackFinder);
150 } else if (rlInfo == ERightLeft::c_Right) {
151 recoTrack.addCDCHit(cdcHit,
152 sortingParameter,
153 RightLeftInformation::c_right,
154 RecoHitInformation::c_CDCTrackFinder);
155 } else if (rlInfo == ERightLeft::c_Invalid) {
156 recoTrack.addCDCHit(cdcHit,
157 sortingParameter,
158 RightLeftInformation::c_invalidRightLeftInformation,
159 RecoHitInformation::c_CDCTrackFinder);
160 } else {
161 recoTrack.addCDCHit(cdcHit,
162 sortingParameter,
163 RightLeftInformation::c_undefinedRightLeftInformation,
164 RecoHitInformation::c_CDCTrackFinder);
165 }
166 }
167}
Class containing the result of the unpacker in raw data and the result of the digitizer in simulation...
Definition: CDCHit.h:40
RightLeftInformation
The RightLeft information of the hit which is only valid for CDC hits.
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.
Definition: RecoTrack.h:243
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:41
const CDCWireHit & getWireHit() const
Getter for the wire hit associated with the oriented hit.
Definition: CDCRLWireHit.h:192
ERightLeft getRLInfo() const
Getter for the right left passage information.
Definition: CDCRLWireHit.h:234
Class representing a hit wire in the central drift chamber.
Definition: CDCWireHit.h:55
const CDCHit * getHit() const
Getter for the CDCHit pointer into the StoreArray.
Definition: CDCWireHit.h:159
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25

◆ storeInto() [1/4]

RecoTrack * storeInto ( const CDCTrack track,
StoreArray< RecoTrack > &  recoTracks 
)
static

Copies the track information to the RecoTrack.

Definition at line 84 of file RecoTrackUtil.cc.

85{
86 const CDCTrajectory3D& traj3D = track.getStartTrajectory3D();
87 RecoTrack* newRecoTrack = storeInto(traj3D, recoTracks);
88 if (not newRecoTrack) return nullptr;
89
90 RecoTrackUtil::fill(track, *newRecoTrack);
91 return newRecoTrack;
92}
This is the Reconstruction Event-Data Model Track.
Definition: RecoTrack.h:79
Particle full three dimensional trajectory.
static void fill(const ARLHitHolderRange &rlWireHitHolders, RecoTrack &recoTrack)
Translates a range of hits and inserts them in the reco track.
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...

◆ storeInto() [2/4]

RecoTrack * storeInto ( const CDCTrack track,
StoreArray< RecoTrack > &  recoTracks,
const double  momentumSeedMagnitude 
)
static

For magnetic monopoles; estimates charge sign from all stereo hits, momentum direction from hits in closest superlayer, fixing magnitude with given value. Ignores building CDCTrajectory3D since it is based on a helix.

Definition at line 39 of file RecoTrackUtil.cc.

40{
41 CDCTrack firstHits;
42 ISuperLayer closestLayer = track.getStartISuperLayer();
43 if (ISuperLayerUtil::isAxial(closestLayer)) closestLayer = ISuperLayerUtil::getNextOutwards(closestLayer);
44
45 for (const CDCRecoHit3D hit : track) {
46 if (hit.isAxial()) continue;
47 firstHits.push_back(hit);
48 if ((hit.getISuperLayer() != closestLayer) and (firstHits.size() > 3)) break;
49 }
50
51 const CDCSZFitter& szFitter = CDCSZFitter::getFitter();
52 const CDCTrajectorySZ& szTrajectory = szFitter.fitWithStereoHits(firstHits);
53
54 Vector3D position(track.getStartTrajectory3D().getSupport().x(),
55 track.getStartTrajectory3D().getSupport().y(),
56 szTrajectory.getZ0());
57
58 Vector3D momentum(track.getStartTrajectory3D().getFlightDirection3DAtSupport());
59 const double z0 = szTrajectory.getZ0();
60 const double lambda = std::atan(szTrajectory.getTanLambda());
61 momentum.scale(std::cos(lambda));
62 momentum.setZ(std::sin(lambda));
63 momentum *= momentumSeedMagnitude;
64
66 double votes(0);
67 int nHits(0);
68 closestLayer = track.getEndISuperLayer();
69 if (ISuperLayerUtil::isAxial(closestLayer)) closestLayer = ISuperLayerUtil::getNextInwards(closestLayer);
70 for (auto it = track.rbegin(); it != track.rend(); it++) {
71 CDCRecoHit3D hit = *it;
72 if (hit.isAxial()) continue;
73 votes += (hit.getRecoZ() - z0 - std::tan(lambda) * hit.getArcLength2D());
74 nHits++;
75 if ((hit.getISuperLayer() != closestLayer) and (nHits > 3)) break;
76 }
77 votes > 0 ? charge = ESign::c_Plus : charge = ESign::c_Minus;
78
79 RecoTrack* newRecoTrack = recoTracks.appendNew(position, momentum, charge);
80 RecoTrackUtil::fill(track, *newRecoTrack);
81 return newRecoTrack;
82}
T * appendNew()
Construct a new T object at the end of the array.
Definition: StoreArray.h:246
Class representing a three dimensional reconstructed hit.
Definition: CDCRecoHit3D.h:52
Class implementing the z coordinate over travel distance line fit.
Definition: CDCSZFitter.h:27
static const CDCSZFitter & getFitter()
Getter for a standard sz line fitter instance.
Definition: CDCSZFitter.cc:36
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...
Definition: CDCSZFitter.cc:125
Class representing a sequence of three dimensional reconstructed hits.
Definition: CDCTrack.h:41
Linear trajectory in sz space.
double getTanLambda() const
Getter for the slope over the travel distance coordinate.
double getZ0() const
Getter for the z coordinate at zero travel distance.
A three dimensional vector.
Definition: Vector3D.h:33
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44
ESign
Enumeration for the distinct sign values of floating point variables.
Definition: ESign.h:27
static bool isAxial(ISuperLayer iSuperLayer)
Returns if the super layer with the given id is axial.
Definition: ISuperLayer.cc:21
static ISuperLayer getNextInwards(ISuperLayer iSuperLayer)
Returns the super layer that is inside of the given super layer.
Definition: ISuperLayer.cc:63
static ISuperLayer getNextOutwards(ISuperLayer iSuperLayer)
Returns the super layer that is outside of the given super layer.
Definition: ISuperLayer.cc:72

◆ storeInto() [3/4]

RecoTrack * storeInto ( const CDCTrajectory3D traj3D,
const double  bZ,
StoreArray< RecoTrack > &  recoTracks 
)
static

Copies the trajectory information to the RecoTrack.

Definition at line 101 of file RecoTrackUtil.cc.

104{
105 // Set the start parameters
106 Vector3D position = traj3D.getSupport();
107 Vector3D momentum =
108 bZ == 0 ? traj3D.getFlightDirection3DAtSupport() : traj3D.getMom3DAtSupport(bZ);
109 ESign charge = traj3D.getChargeSign();
110
111 // Do not propagate invalid fits, signal that the fit is invalid to the caller.
112 if (not ESignUtil::isValid(charge) or momentum.hasNAN() or position.hasNAN()) {
113 return nullptr;
114 }
115
116 RecoTrack* newRecoTrack = recoTracks.appendNew(position, momentum, charge);
117 if (std::isfinite(traj3D.getFlightTime())) {
118 newRecoTrack->setTimeSeed(traj3D.getFlightTime());
119 }
120
121 const CovarianceMatrix<6>& cov6 = traj3D.getCartesianCovariance(bZ);
122 TMatrixDSym covSeed = TMatrixConversion::toTMatrix(cov6);
123 newRecoTrack->setSeedCovariance(covSeed);
124 return newRecoTrack;
125}
void setTimeSeed(const double timeSeed)
Set the time seed. ATTENTION: This is not the fitted time.
Definition: RecoTrack.h:604
void setSeedCovariance(const TMatrixDSym &seedCovariance)
Set the covariance of the seed. ATTENTION: This is not the fitted covariance.
Definition: RecoTrack.h:614
Vector3D getMom3DAtSupport(const double bZ) const
Get the momentum at the start point of the trajectory.
CovarianceMatrix< 6 > getCartesianCovariance(double bZ) const
Convert the helix parameters to the cartesian coordinates x,y,z,px,py,pz.
double getFlightTime() const
Getter for the time when the particle reached the support point position.
ESign getChargeSign() const
Gets the charge sign of the trajectory.
Vector3D getFlightDirection3DAtSupport() const
Get the unit momentum at the start point of the trajectory.
Vector3D getSupport() const
Getter for the support point of the trajectory in global coordinates, where arcLength2D = 0.
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
bool hasNAN() const
Checks if one of the coordinates is NAN.
Definition: Vector3D.h:165
bool isValid(ESign s)
Returns true if sign is ESign::c_Plus, ESign::c_Minus or ESign::c_Zero.
Definition: ESign.h:46
static TMatrixDSym toTMatrix(const CovarianceMatrix< N > &cov)
Translate the covariance matrix to the TMatrix representation.

◆ storeInto() [4/4]

RecoTrack * storeInto ( const CDCTrajectory3D traj3D,
StoreArray< RecoTrack > &  recoTracks 
)
static

Copies the trajectory information to the RecoTrack.

Definition at line 95 of file RecoTrackUtil.cc.

96{
97 Vector3D position = traj3D.getSupport();
98 return storeInto(traj3D, CDCBFieldUtil::getBFieldZ(position), recoTracks);
99}
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )

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