CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 py() const
fitted track momentum vertical component
Definition: ForwardProton.h:67
float chi2_
chi-squared
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:51
math::XYZPointF Point
point in the space
Definition: ForwardProton.h:30
float vz() const
vertex longitudinal position (conventionally set to 0)
Definition: ForwardProton.h:57
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
void setMethod(const ReconstructionMethod &method)
set the reconstruction method for this track
float t() const
four-momentum transfer squared, in GeV^2
float thetaYError() const
uncertainty on fitted momentum vertical angle opening
Definition: ForwardProton.h:95
Geom::Theta< T > theta() const
ROOT::Math::SMatrix< float, N, N, ROOT::Math::MatRepSym< float, N > > type
Definition: Error.h:26
float p() const
scalar norm of fitted track momentum
Definition: ForwardProton.h:61
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
CovarianceMatrix covariance_
5x5 covariance matrix
float px() const
fitted track momentum horizontal component
Definition: ForwardProton.h:65
float chi2() const
chi-squared of the fit
Definition: ForwardProton.h:72
math::ErrorF< dimension >::type CovarianceMatrix
dimension-parameter covariance matrix
Definition: ForwardProton.h:26
float vyError() const
uncertainty on fitted vertex vertical position
Definition: ForwardProton.h:99
float thetaX() const
vertical scattering angle, in rad
Definition: ForwardProton.h:81
float xi_
fractional momentum loss (positive for diffractive protons)
const Vector & momentum() const
fitted track direction
Definition: ForwardProton.h:59
ForwardProton()
default constructor
Point vertex_
reconstructed vertex position at z/s = 0
float vy() const
fitted vertex vertical position
Definition: ForwardProton.h:55
fixed size vector
Definition: Vector.h:24
void setTimeError(float time_err)
T sqrt(T t)
Definition: SSEVec.h:19
float pt() const
scalar fitted track transverse momentum
Definition: ForwardProton.h:63
float timeError() const
uncertainty on time of proton arrival at forward stations
float normalizedChi2() const
chi-squared divided by ndof (or chi-squared * 1e6 if ndof is zero)
Definition: ForwardProton.h:76
static constexpr float mass_
proton mass, GeV
unsigned int ndof_
number of degrees of freedom
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:79
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
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
static constexpr float massSquared_
proton mass squared, GeV^2
float time_
reconstructed time at forward detectors
ReconstructionMethod method() const
reconstruction method for this track
float xiError() const
uncertainty on longitudinal fractional momentum loss
Definition: ForwardProton.h:91
float vx() const
fitted vertex horizontal position
Definition: ForwardProton.h:53
void setValidFit(bool valid=true)
set the flag for the fit validity
bool validFit() const
flag for the fit validity
float pz() const
fitted track momentum longitudinal component
Definition: ForwardProton.h:69
LHCSector
LHC sector.
static float mass()
proton mass in GeV
ReconstructionMethod method_
type of reconstruction applied
float vxError() const
uncertainty on fitted vertex horizontal position
Definition: ForwardProton.h:97
double error(Index i) const
return the uncertainty on a given component
Definition: ForwardProton.h:88
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
bool valid_fit_
fit validity flag
math::XYZVectorF Vector
spatial vector
Definition: ForwardProton.h:28
Index
indices to the covariance matrix
Definition: ForwardProton.h:24
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:83
CTPPSLocalTrackLiteRefVector contributing_local_tracks_
collection of references to tracks contributing to this object definition
float time() const
time of proton arrival at forward stations
float thetaXError() const
uncertainty on fitted momentum horizontal angle opening
Definition: ForwardProton.h:93
void setContributingLocalTracks(const CTPPSLocalTrackLiteRefVector &v)
store the list of RP tracks that contributed to this global track
LHCSector lhcSector() const
ReconstructionMethod
type of reconstruction applied for this track
Definition: ForwardProton.h:32
unsigned int ndof() const
number of degrees of freedom for the track fit
Definition: ForwardProton.h:74