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 {
21  {
22  public:
24  enum { dimension = 5 };
26  enum struct Index { xi, th_x, vtx_x, th_y, vtx_y, num_indices = dimension };
34  enum class ReconstructionMethod { invalid = -1, singleRP, multiRP };
35 
36  public:
38  ForwardProton();
40  ForwardProton( double chi2, double ndof, const Point& vtx, const Vector& momentum, float xi,
41  const CovarianceMatrix& cov, ReconstructionMethod method,
42  const CTPPSLocalTrackLiteRefVector& local_tracks, bool valid,
43  const float time=0., const float time_err=0. );
44 
46  const Point& vertex() const { return vertex_; }
48  float vx() const { return vertex_.x(); }
50  float vy() const { return vertex_.y(); }
52  float vz() const { return vertex_.z(); }
54  const Vector& momentum() const { return momentum_; }
56  float p() const { return momentum_.r(); }
58  float pt() const { return momentum_.rho(); }
60  float px() const { return momentum_.x(); }
62  float py() const { return momentum_.y(); }
64  float pz() const { return momentum_.z(); }
65 
67  float chi2() const { return chi2_; }
69  unsigned int ndof() const { return ndof_; }
71  float normalizedChi2() const {
72  return ( ndof_ != 0 ) ? chi2_ / ndof_ : chi2_ * 1.e6;
73  }
74 
76  float xi() const { return xi_; }
78  float thetaX() const { return px() / p(); }
80  float thetaY() const { return py() / p(); }
81 
82  // vertex position can be obtained via TrackBase::vx() and vy() functions
83 
85  double error( Index i ) const {
86  return sqrt( covariance_( (unsigned int)i, (unsigned int)i ) );
87  }
88 
90  float xiError() const { return error( Index::xi ); }
92  float thetaXError() const { return error( Index::th_x ); }
94  float thetaYError() const { return error( Index::th_y ); }
96  float vxError() const { return error( Index::vtx_x ); }
98  float vyError() const { return error( Index::vtx_y ); }
99 
101  static float mass() { return mass_; }
102 
104  static float calculateT( double beam_mom, double proton_mom, double theta );
105 
107  float t() const;
108 
110  float time() const { return time_; }
111  void setTime(float time) { time_ = time; }
112 
114  float timeError() const { return time_err_; }
115  void setTimeError(float time_err) { time_err_ = time_err; }
116 
118  void setValidFit( bool valid = true ) { valid_fit_ = valid; }
120  bool validFit() const { return valid_fit_; }
121 
123  void setMethod( const ReconstructionMethod& method ) { method_ = method; }
125  ReconstructionMethod method() const { return method_; }
126 
131 
133  enum class LHCSector { invalid = -1, sector45, sector56 };
135  {
136  if ( pz() < 0. ) return LHCSector::sector56;
137  if ( pz() > 0. ) return LHCSector::sector45;
138  return LHCSector::invalid;
139  }
140 
141  private:
142  static constexpr float mass_ = 0.938272046;
143  static constexpr float massSquared_ = 0.88035443;
144 
146  Point vertex_;
148  Vector momentum_;
150  float time_;
152  float time_err_;
154  float xi_;
156  CovarianceMatrix covariance_;
158  float chi2_;
160  unsigned int ndof_;
167  };
168 }
169 
170 #endif
float py() const
fitted track momentum vertical component
Definition: ForwardProton.h:62
float chi2_
chi-squared
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:46
math::XYZPointF Point
point in the space
Definition: ForwardProton.h:32
float vz() const
vertex longitudinal position (conventionally set to 0)
Definition: ForwardProton.h:52
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:94
Geom::Theta< T > theta() const
ROOT::Math::SMatrix< float, N, N, ROOT::Math::MatRepSym< float, N > > type
Definition: Error.h:27
float p() const
scalar norm of fitted track momentum
Definition: ForwardProton.h:56
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:60
float chi2() const
chi-squared of the fit
Definition: ForwardProton.h:67
math::ErrorF< dimension >::type CovarianceMatrix
dimension-parameter covariance matrix
Definition: ForwardProton.h:28
float vyError() const
uncertainty on fitted vertex vertical position
Definition: ForwardProton.h:98
float thetaX() const
vertical scattering angle, in rad
Definition: ForwardProton.h:78
float xi_
fractional momentum loss (positive for diffractive protons)
const Vector & momentum() const
fitted track direction
Definition: ForwardProton.h:54
ForwardProton()
default constructor
Point vertex_
reconstructed vertex position at z/s = 0
float vy() const
fitted vertex vertical position
Definition: ForwardProton.h:50
void setTimeError(float time_err)
T sqrt(T t)
Definition: SSEVec.h:18
float pt() const
scalar fitted track transverse momentum
Definition: ForwardProton.h:58
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:71
unsigned int ndof_
number of degrees of freedom
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:76
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:17
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
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:90
float vx() const
fitted vertex horizontal position
Definition: ForwardProton.h:48
void setValidFit(bool valid=true)
set the flag for the fit validity
static float mass_
proton mass, GeV
bool validFit() const
flag for the fit validity
float pz() const
fitted track momentum longitudinal component
Definition: ForwardProton.h:64
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:96
double error(Index i) const
return the uncertainty on a given component
Definition: ForwardProton.h:85
fixed size matrix
bool valid_fit_
fit validity flag
math::XYZVectorF Vector
spatial vector
Definition: ForwardProton.h:30
Index
indices to the covariance matrix
Definition: ForwardProton.h:26
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:80
CTPPSLocalTrackLiteRefVector contributing_local_tracks_
collection of references to tracks contributing to this object definition
static float massSquared_
proton mass squared, GeV^2
float time() const
time of proton arrival at forward stations
float thetaXError() const
uncertainty on fitted momentum horizontal angle opening
Definition: ForwardProton.h:92
void setContributingLocalTracks(const CTPPSLocalTrackLiteRefVector &v)
store the list of RP tracks that contributed to this global track
#define constexpr
LHCSector lhcSector() const
ReconstructionMethod
type of reconstruction applied for this track
Definition: ForwardProton.h:34
unsigned int ndof() const
number of degrees of freedom for the track fit
Definition: ForwardProton.h:69