CMS 3D CMS Logo

BeamSpot.h
Go to the documentation of this file.
1 #ifndef BeamSpot_BeamSpot_h
2 #define BeamSpot_BeamSpot_h
3 
13 #include <Rtypes.h>
16 #include <string>
17 #include <sstream>
18 
19 namespace reco {
20 
21  class BeamSpot {
22  public:
24  enum BeamType { Unknown = -1, Fake = 0, LHC = 1, Tracker = 2 };
25 
28  enum { dimension = 7 };
30  enum { dim3 = 3 };
32  enum { resdim = 2 };
34 
36  BeamSpot();
37 
40  double sigmaZ,
41  double dxdz,
42  double dydz,
43  double BeamWidthX,
44  const CovarianceMatrix& error,
45  BeamType type = Unknown) {
46  position_ = point;
47  sigmaZ_ = sigmaZ;
48  dxdz_ = dxdz;
49  dydz_ = dydz;
52  error_ = error;
53  type_ = type;
55  betaStar_ = 0;
56  };
57 
59  const Point& position() const { return position_; }
61  double x0() const { return position_.X(); }
63  double y0() const { return position_.Y(); }
65  double z0() const { return position_.Z(); }
66 
68  double x(const double z) const { return x0() + dxdz() * (z - z0()); }
70  double y(const double z) const { return y0() + dydz() * (z - z0()); }
72  const Point position(const double z) const;
73  // const Point position(const double z) const {Point pos(x(z),y(z),z); return pos;}
74 
76  double sigmaZ() const { return sigmaZ_; }
78  double dxdz() const { return dxdz_; }
80  double dydz() const { return dydz_; }
82  double BeamWidthX() const { return BeamWidthX_; }
84  double BeamWidthY() const { return BeamWidthY_; }
86  double x0Error() const { return sqrt(error_(0, 0)); }
88  double y0Error() const { return sqrt(error_(1, 1)); }
90  double z0Error() const { return sqrt(error_(2, 2)); }
92  double sigmaZ0Error() const { return sqrt(error_(3, 3)); }
94  double dxdzError() const { return sqrt(error_(4, 4)); }
96  double dydzError() const { return sqrt(error_(5, 5)); }
97 
99  double BeamWidthXError() const { return sqrt(error_(6, 6)); }
101  double BeamWidthYError() const { return sqrt(error_(6, 6)); }
102 
104  void setBeamWidthX(double v) { BeamWidthX_ = v; }
105  void setBeamWidthY(double v) { BeamWidthY_ = v; }
106 
108  double covariance(int i, int j) const { return error_(i, j); }
110  CovarianceMatrix covariance() const { return error_; }
114  for (int j = 0; j < 3; j++) {
115  for (int k = j; k < 3; k++) {
116  matrix(j, k) = error_(j, k);
117  }
118  }
119  return matrix;
120  };
122  BeamType type() const { return type_; }
127 
129  double emittanceX() const { return emittanceX_; }
130  double emittanceY() const { return emittanceY_; }
131  double betaStar() const { return betaStar_; }
132  double beamWidthFromBeta(double z, double e) const {
133  return sqrt(e * betaStar_ * (1 + pow((z - position_.Z()) / betaStar_, 2)));
134  }
136  void setEmittanceX(double v) { emittanceX_ = v; }
137  void setEmittanceY(double v) { emittanceY_ = v; }
138  void setbetaStar(double v) { betaStar_ = v; }
139 
141  void print(std::stringstream& ss) const;
142 
143  private:
148 
149  Double32_t sigmaZ_;
150  Double32_t BeamWidthX_;
151  Double32_t BeamWidthY_;
152  Double32_t dxdz_;
153  Double32_t dydz_;
154  Double32_t emittanceX_;
155  Double32_t emittanceY_;
156  Double32_t betaStar_;
157 
159  };
161  std::ostream& operator<<(std::ostream&, BeamSpot beam);
162 
163 } // namespace reco
164 
165 #endif
reco::BeamSpot::BeamSpot
BeamSpot(const Point &point, double sigmaZ, double dxdz, double dydz, double BeamWidthX, const CovarianceMatrix &error, BeamType type=Unknown)
constructor from values
Definition: BeamSpot.h:39
reco::BeamSpot::dimension
Definition: BeamSpot.h:28
mps_fire.i
i
Definition: mps_fire.py:428
reco::BeamSpot::setBeamWidthY
void setBeamWidthY(double v)
Definition: BeamSpot.h:105
reco::BeamSpot::emittanceY_
Double32_t emittanceY_
Definition: BeamSpot.h:155
reco::BeamSpot::emittanceX
double emittanceX() const
additional information
Definition: BeamSpot.h:129
reco::BeamSpot::BeamWidthXError
double BeamWidthXError() const
error on beam width X, assume error in X = Y
Definition: BeamSpot.h:99
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
reco::BeamSpot::setEmittanceY
void setEmittanceY(double v)
Definition: BeamSpot.h:137
reco::BeamSpot::covariance3D
Covariance3DMatrix covariance3D() const
return only 3D position covariance matrix
Definition: BeamSpot.h:112
reco::BeamSpot::z0
double z0() const
z coordinate
Definition: BeamSpot.h:65
reco::BeamSpot::BeamWidthY_
Double32_t BeamWidthY_
Definition: BeamSpot.h:151
reco::BeamSpot::rotatedCovariance3D
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:73
reco::BeamSpot::covariance
double covariance(int i, int j) const
(i,j)-th element of error matrix
Definition: BeamSpot.h:108
CovarianceMatrix
Definition: CovarianceMatrix.h:27
reco::BeamSpot::type_
BeamType type_
Definition: BeamSpot.h:158
reco::BeamSpot::LHC
Definition: BeamSpot.h:24
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
findQualityFiles.v
v
Definition: findQualityFiles.py:179
reco::BeamSpot::dxdz
double dxdz() const
dxdz slope
Definition: BeamSpot.h:78
reco::BeamSpot::dxdzError
double dxdzError() const
error on dxdz
Definition: BeamSpot.h:94
reco::BeamSpot::beamWidthFromBeta
double beamWidthFromBeta(double z, double e) const
Definition: BeamSpot.h:132
relativeConstraints.error
error
Definition: relativeConstraints.py:53
reco::BeamSpot::y0Error
double y0Error() const
error on y
Definition: BeamSpot.h:88
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
reco::BeamSpot::sigmaZ
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
reco::BeamSpot::dydzError
double dydzError() const
error on dydz
Definition: BeamSpot.h:96
reco::BeamSpot::type
BeamType type() const
return beam type
Definition: BeamSpot.h:122
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::BeamSpot
Definition: BeamSpot.h:21
reco::BeamSpot::Tracker
Definition: BeamSpot.h:24
reco::BeamSpot::setBeamWidthX
void setBeamWidthX(double v)
Definition: BeamSpot.h:104
reco::BeamSpot::Fake
Definition: BeamSpot.h:24
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
dqmdumpme.k
k
Definition: dqmdumpme.py:60
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
reco::BeamSpot::setEmittanceX
void setEmittanceX(double v)
Definition: BeamSpot.h:136
reco::BeamSpot::ResCovMatrix
math::Error< resdim >::type ResCovMatrix
Definition: BeamSpot.h:33
reco::BeamSpot::Unknown
Definition: BeamSpot.h:24
Error.h
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::BeamSpot::dim3
Definition: BeamSpot.h:30
reco::BeamSpot::betaStar
double betaStar() const
Definition: BeamSpot.h:131
reco::BeamSpot::setbetaStar
void setbetaStar(double v)
Definition: BeamSpot.h:138
reco::BeamSpot::Covariance3DMatrix
math::Error< dim3 >::type Covariance3DMatrix
Definition: BeamSpot.h:31
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
reco::BeamSpot::sigmaZ_
Double32_t sigmaZ_
Definition: BeamSpot.h:149
reco::BeamSpot::betaStar_
Double32_t betaStar_
Definition: BeamSpot.h:156
reco::BeamSpot::covariance
CovarianceMatrix covariance() const
return full covariance matrix of dim 7
Definition: BeamSpot.h:110
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::BeamSpot::y
double y(const double z) const
y coordinate of the beeam spot position at a given z value (it takes into account the dydz slope)
Definition: BeamSpot.h:70
reco::BeamSpot::z0Error
double z0Error() const
error on z
Definition: BeamSpot.h:90
reco::BeamSpot::dydz_
Double32_t dydz_
Definition: BeamSpot.h:153
reco::BeamSpot::BeamWidthYError
double BeamWidthYError() const
error on beam width Y, assume error in X = Y
Definition: BeamSpot.h:101
reco::BeamSpot::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
Definition: BeamSpot.h:29
reco::BeamSpot::BeamWidthX
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:82
reco::BeamSpot::BeamType
BeamType
beam spot flags
Definition: BeamSpot.h:24
reco::BeamSpot::dxdz_
Double32_t dxdz_
Definition: BeamSpot.h:152
reco::BeamSpot::emittanceX_
Double32_t emittanceX_
Definition: BeamSpot.h:154
reco::BeamSpot::dydz
double dydz() const
dydz slope
Definition: BeamSpot.h:80
reco::BeamSpot::x0
double x0() const
x coordinate
Definition: BeamSpot.h:61
reco::BeamSpot::error_
CovarianceMatrix error_
errors
Definition: BeamSpot.h:147
reco::BeamSpot::BeamSpot
BeamSpot()
default constructor
Definition: BeamSpot.cc:23
reco::BeamSpot::x
double x(const double z) const
x coordinate of the beeam spot position at a given z value (it takes into account the dxdz slope)
Definition: BeamSpot.h:68
reco::BeamSpot::x0Error
double x0Error() const
error on x
Definition: BeamSpot.h:86
reco::BeamSpot::sigmaZ0Error
double sigmaZ0Error() const
error on sigma z
Definition: BeamSpot.h:92
math::Error::type
ErrorD< N >::type type
Definition: Error.h:32
Point3D.h
reco::BeamSpot::BeamWidthX_
Double32_t BeamWidthX_
Definition: BeamSpot.h:150
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
reco::BeamSpot::Point
math::XYZPoint Point
point in the space
Definition: BeamSpot.h:27
reco::BeamSpot::resdim
Definition: BeamSpot.h:32
reco::BeamSpot::setType
void setType(BeamType type)
set beam type
Definition: BeamSpot.h:124
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
reco::BeamSpot::print
void print(std::stringstream &ss) const
print information
Definition: BeamSpot.cc:47
reco::BeamSpot::y0
double y0() const
y coordinate
Definition: BeamSpot.h:63
reco::BeamSpot::emittanceY
double emittanceY() const
Definition: BeamSpot.h:130
reco::BeamSpot::BeamWidthY
double BeamWidthY() const
beam width Y
Definition: BeamSpot.h:84
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
reco::BeamSpot::position_
Point position_
position
Definition: BeamSpot.h:145