CMS 3D CMS Logo

ForwardProton.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Authors:
3  * Jan Kašpar
4  * Laurent Forthomme
5  ****************************************************************************/
6 
7 #ifndef DataFormats_ProtonReco_ForwardProton_h
8 #define DataFormats_ProtonReco_ForwardProton_h
9 
13 
15 
17 
18 namespace reco {
19  class ForwardProton {
20  public:
22  enum { dimension = 5 };
24  enum struct Index { xi, th_x, vtx_x, th_y, vtx_y, num_indices = dimension };
33 
34  public:
36  ForwardProton();
38  ForwardProton(double chi2,
39  double ndof,
40  const Point& vtx,
41  const Vector& momentum,
42  float xi,
43  const CovarianceMatrix& cov,
45  const CTPPSLocalTrackLiteRefVector& local_tracks,
46  bool valid,
47  const float time = 0.,
48  const float time_err = 0.);
49 
51  const Point& vertex() const { return vertex_; }
53  float vx() const { return vertex_.x(); }
55  float vy() const { return vertex_.y(); }
57  float vz() const { return vertex_.z(); }
59  const Vector& momentum() const { return momentum_; }
61  float p() const { return momentum_.r(); }
63  float pt() const { return momentum_.rho(); }
65  float px() const { return momentum_.x(); }
67  float py() const { return momentum_.y(); }
69  float pz() const { return momentum_.z(); }
70 
72  float chi2() const { return chi2_; }
74  unsigned int ndof() const { return ndof_; }
76  float normalizedChi2() const { return (ndof_ != 0) ? chi2_ / ndof_ : chi2_ * 1.e6; }
77 
79  float xi() const { return xi_; }
81  float thetaX() const { return px() / p(); }
83  float thetaY() const { return py() / p(); }
84 
85  // vertex position can be obtained via TrackBase::vx() and vy() functions
86 
88  double error(Index i) const { return sqrt(covariance_((unsigned int)i, (unsigned int)i)); }
89 
91  float xiError() const { return error(Index::xi); }
93  float thetaXError() const { return error(Index::th_x); }
95  float thetaYError() const { return error(Index::th_y); }
97  float vxError() const { return error(Index::vtx_x); }
99  float vyError() const { return error(Index::vtx_y); }
100 
102  static float mass() { return mass_; }
103 
105  static float calculateT(double beam_mom, double proton_mom, double theta);
106 
108  float t() const;
109 
111  float time() const { return time_; }
112  void setTime(float time) { time_ = time; }
113 
115  float timeError() const { return time_err_; }
116  void setTimeError(float time_err) { time_err_ = time_err; }
117 
119  void setValidFit(bool valid = true) { valid_fit_ = valid; }
121  bool validFit() const { return valid_fit_; }
122 
126  ReconstructionMethod method() const { return method_; }
127 
132 
134  enum class LHCSector { invalid = -1, sector45, sector56 };
136  if (pz() < 0.)
137  return LHCSector::sector56;
138  if (pz() > 0.)
139  return LHCSector::sector45;
140  return LHCSector::invalid;
141  }
142 
143  private:
144  static constexpr float mass_ = 0.938272046;
145  static constexpr float massSquared_ = 0.88035443;
146 
152  float time_;
154  float time_err_;
156  float xi_;
160  float chi2_;
162  unsigned int ndof_;
169  };
170 } // namespace reco
171 
172 #endif
float chi2_
chi-squared
LHCSector lhcSector() const
float time() const
time of proton arrival at forward stations
float thetaYError() const
uncertainty on fitted momentum vertical angle opening
Definition: ForwardProton.h:95
float vxError() const
uncertainty on fitted vertex horizontal position
Definition: ForwardProton.h:97
math::XYZPointF Point
point in the space
Definition: ForwardProton.h:30
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
float vz() const
vertex longitudinal position (conventionally set to 0)
Definition: ForwardProton.h:57
float pz() const
fitted track momentum longitudinal component
Definition: ForwardProton.h:69
static float calculateT(double beam_mom, double proton_mom, double theta)
compute the squared four-momentum transfer from incident and scattered momenta, and angular informati...
float time_err_
uncertainty on reconstructed time at forward detectors
float xiError() const
uncertainty on longitudinal fractional momentum loss
Definition: ForwardProton.h:91
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:83
void setMethod(const ReconstructionMethod &method)
set the reconstruction method for this track
ROOT::Math::SMatrix< float, N, N, ROOT::Math::MatRepSym< float, N > > type
Definition: Error.h:26
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
float thetaX() const
vertical scattering angle, in rad
Definition: ForwardProton.h:81
CovarianceMatrix covariance_
5x5 covariance matrix
float normalizedChi2() const
chi-squared divided by ndof (or chi-squared * 1e6 if ndof is zero)
Definition: ForwardProton.h:76
double error(Index i) const
return the uncertainty on a given component
Definition: ForwardProton.h:88
math::ErrorF< dimension >::type CovarianceMatrix
dimension-parameter covariance matrix
Definition: ForwardProton.h:26
float xi_
fractional momentum loss (positive for diffractive protons)
ForwardProton()
default constructor
Point vertex_
reconstructed vertex position at z/s = 0
float vyError() const
uncertainty on fitted vertex vertical position
Definition: ForwardProton.h:99
float thetaXError() const
uncertainty on fitted momentum horizontal angle opening
Definition: ForwardProton.h:93
float timeError() const
uncertainty on time of proton arrival at forward stations
fixed size vector
Definition: Vector.h:24
void setTimeError(float time_err)
T sqrt(T t)
Definition: SSEVec.h:19
float py() const
fitted track momentum vertical component
Definition: ForwardProton.h:67
static constexpr float mass_
proton mass, GeV
unsigned int ndof_
number of degrees of freedom
void setTime(float time)
Vector momentum_
reconstructed momentum vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:79
unsigned int ndof() const
number of degrees of freedom for the track fit
Definition: ForwardProton.h:74
static constexpr float massSquared_
proton mass squared, GeV^2
float time_
reconstructed time at forward detectors
void setValidFit(bool valid=true)
set the flag for the fit validity
ReconstructionMethod method() const
reconstruction method for this track
bool validFit() const
flag for the fit validity
LHCSector
LHC sector.
static float mass()
proton mass in GeV
ReconstructionMethod method_
type of reconstruction applied
float chi2() const
chi-squared of the fit
Definition: ForwardProton.h:72
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:51
float pt() const
scalar fitted track transverse momentum
Definition: ForwardProton.h:63
fixed size matrix
float vy() const
fitted vertex vertical position
Definition: ForwardProton.h:55
Structure Point Contains parameters of Gaussian fits to DMRs.
bool valid_fit_
fit validity flag
float vx() const
fitted vertex horizontal position
Definition: ForwardProton.h:53
float p() const
scalar norm of fitted track momentum
Definition: ForwardProton.h:61
math::XYZVectorF Vector
spatial vector
Definition: ForwardProton.h:28
Index
indices to the covariance matrix
Definition: ForwardProton.h:24
float px() const
fitted track momentum horizontal component
Definition: ForwardProton.h:65
const Vector & momentum() const
fitted track direction
Definition: ForwardProton.h:59
CTPPSLocalTrackLiteRefVector contributing_local_tracks_
collection of references to tracks contributing to this object definition
Geom::Theta< T > theta() const
float t() const
four-momentum transfer squared, in GeV^2
void setContributingLocalTracks(const CTPPSLocalTrackLiteRefVector &v)
store the list of RP tracks that contributed to this global track
ReconstructionMethod
type of reconstruction applied for this track
Definition: ForwardProton.h:32