New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend TrackBase and Track to include time and velocity #24465
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,9 @@ class Track : public TrackBase | |
/// constructor from fit parameters and error matrix | ||
Track(double chi2, double ndof, const Point & referencePoint, | ||
const Vector & momentum, int charge, const CovarianceMatrix &, | ||
TrackAlgorithm = undefAlgorithm, TrackQuality quality = undefQuality); | ||
TrackAlgorithm = undefAlgorithm, TrackQuality quality = undefQuality, | ||
double t0 = 0, double beta = 0, | ||
double covt0t0 = -1., double covbetabeta = -1.); | ||
|
||
/// return true if the outermost hit is valid | ||
bool outerOk() const { | ||
|
@@ -50,7 +52,7 @@ class Track : public TrackBase | |
bool innerOk() const { | ||
return extra_->innerOk(); | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the empty space change is not necessary |
||
/// position of the innermost hit | ||
const math::XYZPoint & innerPosition() const { | ||
return extra_->innerPosition(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -170,11 +170,16 @@ class TrackBase | |
TrackBase(double chi2, double ndof, const Point &vertex, | ||
const Vector &momentum, int charge, const CovarianceMatrix &cov, | ||
TrackAlgorithm = undefAlgorithm, TrackQuality quality = undefQuality, | ||
signed char nloops = 0, uint8_t stopReason = 0); | ||
signed char nloops = 0, uint8_t stopReason = 0, | ||
double t0 = 0, double beta = 0, | ||
double covt0t0 = -1., double covbetabeta = -1.); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
/// virtual destructor | ||
virtual ~TrackBase(); | ||
|
||
/// return true if timing measurement is usable | ||
bool isTimeOk() const { return covt0t0_ > 0.f; } | ||
|
||
/// chi-squared of the fit | ||
double chi2() const; | ||
|
||
|
@@ -244,6 +249,12 @@ class TrackBase | |
/// Reference point on the track | ||
const Point &referencePoint() const; | ||
|
||
/// time at the reference point | ||
double t0() const; | ||
|
||
/// velocity at the reference point | ||
double beta() const; | ||
|
||
/// reference point on the track. This method is DEPRECATED, please use referencePoint() instead | ||
const Point &vertex() const ; | ||
//__attribute__((deprecated("This method is DEPRECATED, please use referencePoint() instead."))); | ||
|
@@ -305,6 +316,12 @@ class TrackBase | |
/// error on dz | ||
double dzError() const; | ||
|
||
/// error on t0 | ||
double t0Error() const; | ||
|
||
/// error on beta | ||
double betaError() const; | ||
|
||
/// fill SMatrix | ||
CovarianceMatrix &fill(CovarianceMatrix &v) const; | ||
|
||
|
@@ -407,14 +424,24 @@ class TrackBase | |
/// perigee 5x5 covariance matrix | ||
float covariance_[covarianceSize]; | ||
|
||
/// errors for time and velocity (separate from cov for now) | ||
float covt0t0_, covbetabeta_; | ||
|
||
/// chi-squared | ||
float chi2_; | ||
|
||
/// innermost (reference) point on track | ||
Point vertex_; | ||
|
||
/// time at the reference point on track | ||
float t0_; | ||
|
||
/// momentum vector at innermost point | ||
Vector momentum_; | ||
|
||
/// norm of the particle velocity at innermost point on track | ||
/// can multiply by momentum_.Unit() to get velocity vector | ||
float beta_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please define default values here or in the default constructor. |
||
|
||
/// algo mask, bit set for the algo where it was reconstructed + each algo a track was found overlapping by the listmerger | ||
std::bitset<algoSize> algoMask_; | ||
|
@@ -683,6 +710,18 @@ inline const TrackBase::Point & TrackBase::referencePoint() const | |
return vertex_; | ||
} | ||
|
||
// Time at the reference point on the track | ||
inline double TrackBase::t0() const | ||
{ | ||
return t0_; | ||
} | ||
|
||
// Velocity at the reference point on the track | ||
inline double TrackBase::beta() const | ||
{ | ||
return beta_; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an absolute velocity, or is it normalized to c? Please clarify in the comments. |
||
} | ||
|
||
// reference point on the track. This method is DEPRECATED, please use referencePoint() instead | ||
inline const TrackBase::Point & TrackBase::vertex() const | ||
{ | ||
|
@@ -816,6 +855,18 @@ inline double TrackBase::dzError() const | |
return error(i_dsz) * p() / pt(); | ||
} | ||
|
||
// error on t0 | ||
inline double TrackBase::t0Error() const | ||
{ | ||
return std::sqrt(covt0t0_); | ||
} | ||
|
||
// error on beta | ||
inline double TrackBase::betaError() const | ||
{ | ||
return std::sqrt(covbetabeta_); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. there should also be a way to get these without sqrt. |
||
} | ||
|
||
// number of valid hits found | ||
inline unsigned short TrackBase::numberOfValidHits() const | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,11 @@ using namespace reco; | |
|
||
Track::Track(double chi2, double ndof, const Point &vertex, const Vector &momentum, | ||
int charge, const CovarianceMatrix &cov, TrackAlgorithm algo, | ||
TrackQuality quality) : | ||
TrackBase(chi2, ndof, vertex, momentum, charge, cov, algo, quality) | ||
TrackQuality quality, double t0, double beta, | ||
double covt0t0, double covbetabeta) : | ||
TrackBase(chi2, ndof, vertex, momentum, charge, cov, algo, quality, | ||
0,0, // nloops and stop reason | ||
t0,beta,covt0t0,covbetabeta) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation |
||
{ | ||
; | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,10 +89,15 @@ TrackBase::TrackBase() : | |
|
||
TrackBase::TrackBase(double chi2, double ndof, const Point &vertex, const Vector &momentum, | ||
int charge, const CovarianceMatrix &cov, TrackAlgorithm algorithm, | ||
TrackQuality quality, signed char nloops, uint8_t stopReason): | ||
TrackQuality quality, signed char nloops, uint8_t stopReason, | ||
double t0, double beta, double covt0t0, double covbetabeta): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indentation |
||
covt0t0_(covt0t0), | ||
covbetabeta_(covbetabeta), | ||
chi2_(chi2), | ||
vertex_(vertex), | ||
t0_(t0), | ||
momentum_(momentum), | ||
beta_(beta), | ||
ndof_(ndof), | ||
charge_(charge), | ||
algorithm_(algorithm), | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm the indentation was matched in my text editor....
Changed to double... Ditto for the other similar comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the "usual" mixture of tabs and spaces, works with one tab width but not others.