File indexing completed on 2023-03-17 10:51:04
0001
0002
0003
0004
0005
0006
0007 #ifndef DataFormats_ProtonReco_ForwardProton_h
0008 #define DataFormats_ProtonReco_ForwardProton_h
0009
0010 #include "DataFormats/Math/interface/Error.h"
0011 #include "DataFormats/Math/interface/Point3D.h"
0012 #include "DataFormats/Math/interface/Vector3D.h"
0013
0014 #include "DataFormats/Common/interface/RefVector.h"
0015
0016 #include "DataFormats/CTPPSReco/interface/CTPPSLocalTrackLiteFwd.h"
0017
0018 namespace reco {
0019 class ForwardProton {
0020 public:
0021
0022 enum { dimension = 5 };
0023
0024 enum struct Index { xi, th_x, vtx_x, th_y, vtx_y, num_indices = dimension };
0025
0026 typedef math::ErrorF<dimension>::type CovarianceMatrix;
0027
0028 typedef math::XYZVectorF Vector;
0029
0030 typedef math::XYZPointF Point;
0031
0032 enum class ReconstructionMethod { invalid = -1, singleRP, multiRP };
0033
0034 public:
0035
0036 ForwardProton();
0037
0038 ForwardProton(double chi2,
0039 double ndof,
0040 const Point& vtx,
0041 const Vector& momentum,
0042 float xi,
0043 const CovarianceMatrix& cov,
0044 ReconstructionMethod method,
0045 const CTPPSLocalTrackLiteRefVector& local_tracks,
0046 bool valid,
0047 const float time = 0.,
0048 const float time_err = 0.);
0049
0050
0051 const Point& vertex() const { return vertex_; }
0052
0053 float vx() const { return vertex_.x(); }
0054
0055 float vy() const { return vertex_.y(); }
0056
0057 float vz() const { return vertex_.z(); }
0058
0059 const Vector& momentum() const { return momentum_; }
0060
0061 float p() const { return momentum_.r(); }
0062
0063 float pt() const { return momentum_.rho(); }
0064
0065 float px() const { return momentum_.x(); }
0066
0067 float py() const { return momentum_.y(); }
0068
0069 float pz() const { return momentum_.z(); }
0070
0071
0072 float chi2() const { return chi2_; }
0073
0074 unsigned int ndof() const { return ndof_; }
0075
0076 float normalizedChi2() const { return (ndof_ != 0) ? chi2_ / ndof_ : chi2_ * 1.e6; }
0077
0078
0079 float xi() const { return xi_; }
0080
0081 float thetaX() const { return px() / p(); }
0082
0083 float thetaY() const { return py() / p(); }
0084
0085
0086
0087
0088 double error(Index i) const { return sqrt(covariance_((unsigned int)i, (unsigned int)i)); }
0089
0090
0091 float xiError() const { return error(Index::xi); }
0092
0093 float thetaXError() const { return error(Index::th_x); }
0094
0095 float thetaYError() const { return error(Index::th_y); }
0096
0097 float vxError() const { return error(Index::vtx_x); }
0098
0099 float vyError() const { return error(Index::vtx_y); }
0100
0101
0102 static float mass() { return mass_; }
0103
0104
0105 static float calculateT(double beam_mom, double proton_mom, double theta);
0106
0107
0108 float t() const;
0109
0110
0111 float time() const { return time_; }
0112 void setTime(float time) { time_ = time; }
0113
0114
0115 float timeError() const { return time_err_; }
0116 void setTimeError(float time_err) { time_err_ = time_err; }
0117
0118
0119 void setValidFit(bool valid = true) { valid_fit_ = valid; }
0120
0121 bool validFit() const { return valid_fit_; }
0122
0123
0124 void setMethod(const ReconstructionMethod& method) { method_ = method; }
0125
0126 ReconstructionMethod method() const { return method_; }
0127
0128
0129 void setContributingLocalTracks(const CTPPSLocalTrackLiteRefVector& v) { contributing_local_tracks_ = v; }
0130
0131 const CTPPSLocalTrackLiteRefVector& contributingLocalTracks() const { return contributing_local_tracks_; }
0132
0133
0134 enum class LHCSector { invalid = -1, sector45, sector56 };
0135 LHCSector lhcSector() const {
0136 if (pz() < 0.)
0137 return LHCSector::sector56;
0138 if (pz() > 0.)
0139 return LHCSector::sector45;
0140 return LHCSector::invalid;
0141 }
0142
0143 private:
0144 static constexpr float mass_ = 0.938272046;
0145 static constexpr float massSquared_ = 0.88035443;
0146
0147
0148 Point vertex_;
0149
0150 Vector momentum_;
0151
0152 float time_;
0153
0154 float time_err_;
0155
0156 float xi_;
0157
0158 CovarianceMatrix covariance_;
0159
0160 float chi2_;
0161
0162 unsigned int ndof_;
0163
0164 bool valid_fit_;
0165
0166 ReconstructionMethod method_;
0167
0168 CTPPSLocalTrackLiteRefVector contributing_local_tracks_;
0169 };
0170 }
0171
0172 #endif