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 };
28  typedef math::XYZVectorF Vector;
32  enum class ReconstructionMethod { invalid = -1, singleRP, multiRP };
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 };
135  LHCSector lhcSector() const {
136  if (pz() < 0.)
137  return LHCSector::sector56;
138  if (pz() > 0.)
141  }
142 
143  private:
144  static constexpr float mass_ = 0.938272046;
145  static constexpr float massSquared_ = 0.88035443;
146 
148  Point vertex_;
152  float time_;
154  float time_err_;
156  float xi_;
160  float chi2_;
162  unsigned int ndof_;
164  bool valid_fit_;
169  };
170 } // namespace reco
171 
172 #endif
mps_fire.i
i
Definition: mps_fire.py:428
reco::ForwardProton::ReconstructionMethod::singleRP
reco::ForwardProton::momentum_
Vector momentum_
reconstructed momentum vector
Definition: ForwardProton.h:155
math::ErrorF::type
ROOT::Math::SMatrix< float, N, N, ROOT::Math::MatRepSym< float, N > > type
Definition: Error.h:26
reco::ForwardProton::time_
float time_
reconstructed time at forward detectors
Definition: ForwardProton.h:157
reco::ForwardProton::thetaY
float thetaY() const
horizontal scattering angle, in rad
Definition: ForwardProton.h:88
reco::ForwardProton::LHCSector
LHCSector
LHC sector.
Definition: ForwardProton.h:139
reco::ForwardProton::mass
static float mass()
proton mass in GeV
Definition: ForwardProton.h:107
CovarianceMatrix
Definition: CovarianceMatrix.h:27
reco::ForwardProton::setMethod
void setMethod(const ReconstructionMethod &method)
set the reconstruction method for this track
Definition: ForwardProton.h:129
edm::RefVector< CTPPSLocalTrackLiteCollection >
reco::ForwardProton::vertex
const Point & vertex() const
fitted vertex position
Definition: ForwardProton.h:56
reco::ForwardProton::xiError
float xiError() const
uncertainty on longitudinal fractional momentum loss
Definition: ForwardProton.h:96
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::ForwardProton::normalizedChi2
float normalizedChi2() const
chi-squared divided by ndof (or chi-squared * 1e6 if ndof is zero)
Definition: ForwardProton.h:81
findQualityFiles.v
v
Definition: findQualityFiles.py:179
reco::ForwardProton::error
double error(Index i) const
return the uncertainty on a given component
Definition: ForwardProton.h:93
reco::ForwardProton::CovarianceMatrix
math::ErrorF< dimension >::type CovarianceMatrix
dimension-parameter covariance matrix
Definition: ForwardProton.h:31
Vector
ROOT::Math::Plane3D::Vector Vector
Definition: EcalHitMaker.cc:29
reco::ForwardProton::chi2
float chi2() const
chi-squared of the fit
Definition: ForwardProton.h:77
reco::ForwardProton::valid_fit_
bool valid_fit_
fit validity flag
Definition: ForwardProton.h:169
reco::ForwardProton::ForwardProton
ForwardProton()
default constructor
Definition: ForwardProton.cc:12
reco::ForwardProton::chi2_
float chi2_
chi-squared
Definition: ForwardProton.h:165
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::ForwardProton::thetaXError
float thetaXError() const
uncertainty on fitted momentum horizontal angle opening
Definition: ForwardProton.h:98
reco::ForwardProton::time
float time() const
time of proton arrival at forward stations
Definition: ForwardProton.h:116
reco::ForwardProton::px
float px() const
fitted track momentum horizontal component
Definition: ForwardProton.h:70
reco::ForwardProton::vertex_
Point vertex_
reconstructed vertex position at z/s = 0
Definition: ForwardProton.h:153
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
reco::ForwardProton::momentum
const Vector & momentum() const
fitted track direction
Definition: ForwardProton.h:64
reco::ForwardProton::Point
math::XYZPointF Point
point in the space
Definition: ForwardProton.h:35
reco::ForwardProton::mass_
static constexpr float mass_
proton mass, GeV
Definition: ForwardProton.h:149
reco::ForwardProton::contributingLocalTracks
const CTPPSLocalTrackLiteRefVector & contributingLocalTracks() const
list of RP tracks that contributed to this global track
Definition: ForwardProton.h:136
reco::ForwardProton::Index::vtx_y
reco::ForwardProton::ndof_
unsigned int ndof_
number of degrees of freedom
Definition: ForwardProton.h:167
Error.h
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
RefVector.h
reco::ForwardProton::time_err_
float time_err_
uncertainty on reconstructed time at forward detectors
Definition: ForwardProton.h:159
reco::ForwardProton::Index::vtx_x
reco::ForwardProton::py
float py() const
fitted track momentum vertical component
Definition: ForwardProton.h:72
reco::ForwardProton::setTime
void setTime(float time)
Definition: ForwardProton.h:117
reco::ForwardProton::ReconstructionMethod
ReconstructionMethod
type of reconstruction applied for this track
Definition: ForwardProton.h:37
reco::ForwardProton::LHCSector::sector56
reco::ForwardProton::pz
float pz() const
fitted track momentum longitudinal component
Definition: ForwardProton.h:74
reco::ForwardProton::xi
float xi() const
longitudinal fractional momentum loss
Definition: ForwardProton.h:84
reco::ForwardProton::ndof
unsigned int ndof() const
number of degrees of freedom for the track fit
Definition: ForwardProton.h:79
reco::ForwardProton::Index::th_x
reco::ForwardProton::vz
float vz() const
vertex longitudinal position (conventionally set to 0)
Definition: ForwardProton.h:62
reco::ForwardProton::LHCSector::invalid
reco::ForwardProton::Index::th_y
reco::ForwardProton::Index::num_indices
reco::ForwardProton::calculateT
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...
Definition: ForwardProton.cc:44
reco::ForwardProton::method_
ReconstructionMethod method_
type of reconstruction applied
Definition: ForwardProton.h:171
reco::ForwardProton::setValidFit
void setValidFit(bool valid=true)
set the flag for the fit validity
Definition: ForwardProton.h:124
reco::ForwardProton::thetaYError
float thetaYError() const
uncertainty on fitted momentum vertical angle opening
Definition: ForwardProton.h:100
reco::ForwardProton::vxError
float vxError() const
uncertainty on fitted vertex horizontal position
Definition: ForwardProton.h:102
reco::ForwardProton::Index::xi
reco::ForwardProton::method
ReconstructionMethod method() const
reconstruction method for this track
Definition: ForwardProton.h:131
reco::ForwardProton::thetaX
float thetaX() const
vertical scattering angle, in rad
Definition: ForwardProton.h:86
reco::ForwardProton::validFit
bool validFit() const
flag for the fit validity
Definition: ForwardProton.h:126
reco::ForwardProton::vx
float vx() const
fitted vertex horizontal position
Definition: ForwardProton.h:58
reco::ForwardProton::ReconstructionMethod::multiRP
reco::ForwardProton::Index
Index
indices to the covariance matrix
Definition: ForwardProton.h:29
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
reco::ForwardProton::dimension
Definition: ForwardProton.h:30
reco::ForwardProton::LHCSector::sector45
reco::ForwardProton::pt
float pt() const
scalar fitted track transverse momentum
Definition: ForwardProton.h:68
reco::ForwardProton::covariance_
CovarianceMatrix covariance_
5x5 covariance matrix
Definition: ForwardProton.h:163
CTPPSLocalTrackLiteFwd.h
math::XYZVectorF
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float > > XYZVectorF
spatial vector with cartesian internal representation
Definition: Vector3D.h:16
Point3D.h
reco::ForwardProton::ReconstructionMethod::invalid
reco::ForwardProton::vy
float vy() const
fitted vertex vertical position
Definition: ForwardProton.h:60
reco::ForwardProton::p
float p() const
scalar norm of fitted track momentum
Definition: ForwardProton.h:66
reco::ForwardProton::Vector
math::XYZVectorF Vector
spatial vector
Definition: ForwardProton.h:33
reco::ForwardProton::setContributingLocalTracks
void setContributingLocalTracks(const CTPPSLocalTrackLiteRefVector &v)
store the list of RP tracks that contributed to this global track
Definition: ForwardProton.h:134
RunInfoPI::valid
Definition: RunInfoPayloadInspectoHelper.h:16
reco::ForwardProton::timeError
float timeError() const
uncertainty on time of proton arrival at forward stations
Definition: ForwardProton.h:120
reco::ForwardProton::t
float t() const
four-momentum transfer squared, in GeV^2
Definition: ForwardProton.cc:51
reco::ForwardProton::vyError
float vyError() const
uncertainty on fitted vertex vertical position
Definition: ForwardProton.h:104
math::XYZPointF
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float > > XYZPointF
point in space with cartesian internal representation
Definition: Point3D.h:10
reco::ForwardProton::contributing_local_tracks_
CTPPSLocalTrackLiteRefVector contributing_local_tracks_
collection of references to tracks contributing to this object definition
Definition: ForwardProton.h:173
Vector3D.h
reco::ForwardProton::setTimeError
void setTimeError(float time_err)
Definition: ForwardProton.h:121
reco::ForwardProton::xi_
float xi_
fractional momentum loss (positive for diffractive protons)
Definition: ForwardProton.h:161
reco::ForwardProton::massSquared_
static constexpr float massSquared_
proton mass squared, GeV^2
Definition: ForwardProton.h:150
reco::ForwardProton::lhcSector
LHCSector lhcSector() const
Definition: ForwardProton.h:140