CMS 3D CMS Logo

BeamSpot.cc
Go to the documentation of this file.
1 
16 
17 #include <iostream>
18 
19 namespace reco {
20 
21  using namespace math;
22 
24  // initialize
25  position_ = Point(0., 0., 0.);
26  sigmaZ_ = 0.;
27  dxdz_ = 0.;
28  dydz_ = 0.;
29  BeamWidthX_ = 0.;
30  BeamWidthY_ = 0;
31  for (int j = 0; j < 7; j++) {
32  for (int k = j; k < 7; k++) {
33  error_(j, k) = 0.;
34  }
35  }
36  type_ = Unknown;
37  emittanceX_ = 0;
38  emittanceY_ = 0;
39  betaStar_ = 0;
40  }
41 
42  const BeamSpot::Point BeamSpot::position(const double z) const {
43  Point pos(x(z), y(z), z);
44  return pos;
45  }
46 
47  void BeamSpot::print(std::stringstream& ss) const {
48  ss << "-----------------------------------------------------\n"
49  << " Beam Spot Data\n\n"
50  << " Beam type = " << type() << "\n"
51  << " X0 = " << x0() << " +/- " << x0Error() << " [cm]\n"
52  << " Y0 = " << y0() << " +/- " << y0Error() << " [cm]\n"
53  << " Z0 = " << z0() << " +/- " << z0Error() << " [cm]\n"
54  << " Sigma Z0 = " << sigmaZ() << " +/- " << sigmaZ0Error() << " [cm]\n"
55  << " dxdz = " << dxdz() << " +/- " << dxdzError() << " [radians]\n"
56  << " dydz = " << dydz() << " +/- " << dydzError() << " [radians]\n"
57  << " Beam width X = " << BeamWidthX() << " +/- " << BeamWidthXError() << " [cm]\n"
58  << " Beam width Y = " << BeamWidthY() << " +/- " << BeamWidthYError() << " [cm]\n"
59  << " EmittanceX = " << emittanceX() << " [cm]\n"
60  << " EmittanceY = " << emittanceY() << " [cm]\n"
61  << " beta-star = " << betaStar() << " [cm]\n"
62  << "-----------------------------------------------------\n\n";
63  }
64 
65  //
66  std::ostream& operator<<(std::ostream& os, BeamSpot beam) {
67  std::stringstream ss;
68  beam.print(ss);
69  os << ss.str();
70  return os;
71  }
72 
74  AlgebraicVector3 newZ(dxdz(), dydz(), 1.);
75  AlgebraicVector3 globalZ(0., 0., 1.);
76  AlgebraicVector3 rotationAxis = ROOT::Math::Cross(globalZ.Unit(), newZ.Unit());
77  float rotationAngle = -acos(ROOT::Math::Dot(globalZ.Unit(), newZ.Unit()));
78  Basic3DVector<float> aa(rotationAxis[0], rotationAxis[1], rotationAxis[2]);
79  TkRotation<float> rotation(aa, rotationAngle);
81  rotationMatrix(0, 0) = rotation.xx();
82  rotationMatrix(0, 1) = rotation.xy();
83  rotationMatrix(0, 2) = rotation.xz();
84  rotationMatrix(1, 0) = rotation.yx();
85  rotationMatrix(1, 1) = rotation.yy();
86  rotationMatrix(1, 2) = rotation.yz();
87  rotationMatrix(2, 0) = rotation.zx();
88  rotationMatrix(2, 1) = rotation.zy();
89  rotationMatrix(2, 2) = rotation.zz();
90 
91  AlgebraicSymMatrix33 diagError;
92  diagError(0, 0) = pow(BeamWidthX(), 2);
93  diagError(1, 1) = pow(BeamWidthY(), 2);
94  diagError(2, 2) = pow(sigmaZ(), 2);
95 
97  matrix = ROOT::Math::Similarity(rotationMatrix, diagError) + covariance3D();
98  return matrix;
99  }
100 
101 } // namespace reco
TkRotation< float >
AlgebraicVector3
ROOT::Math::SVector< double, 3 > AlgebraicVector3
Definition: AlgebraicROOTObjects.h:12
AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
BeamSpotPI::sigmaZ
Definition: BeamSpotPayloadInspectorHelper.h:36
makeMuonMisalignmentScenario.matrix
list matrix
Definition: makeMuonMisalignmentScenario.py:141
AlgebraicObjects.h
BeamSpotFakeParameters_cfi.betaStar
betaStar
Definition: BeamSpotFakeParameters_cfi.py:19
pos
Definition: PixelAliasList.h:18
reco::BeamSpot::rotatedCovariance3D
Covariance3DMatrix rotatedCovariance3D() const
Definition: BeamSpot.cc:73
reco::Unknown
Definition: MuonSimInfo.h:32
AlgebraicMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33
Definition: AlgebraicROOTObjects.h:41
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
Point
math::XYZPoint Point
Definition: TrackerDpgAnalysis.cc:106
brokenline::rotationMatrix
__host__ __device__ riemannFit::Matrix2d rotationMatrix(double slope)
Computes the 2D rotation matrix that transforms the line y=slope*x into the line y=0.
Definition: BrokenLine.h:77
BeamSpotFakeParameters_cfi.emittanceX
emittanceX
Definition: BeamSpotFakeParameters_cfi.py:17
BeamSpot.h
reco::BeamSpot
Definition: BeamSpot.h:21
BeamSpotPI::dxdz
Definition: BeamSpotPayloadInspectorHelper.h:37
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
dqmdumpme.k
k
Definition: dqmdumpme.py:60
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
TkRotation.h
BeamSpotFakeParameters_cfi.emittanceY
emittanceY
Definition: BeamSpotFakeParameters_cfi.py:18
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
idealTransformation.rotation
dictionary rotation
Definition: idealTransformation.py:1
reco::BeamSpot::Covariance3DMatrix
math::Error< dim3 >::type Covariance3DMatrix
Definition: BeamSpot.h:31
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
BeamSpotPI::dydz
Definition: BeamSpotPayloadInspectorHelper.h:38
reco::operator<<
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:66
reco::BeamSpot::BeamSpot
BeamSpot()
default constructor
Definition: BeamSpot.cc:23
math
Definition: choleskyInversion.h:19
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
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
reco::BeamSpot::print
void print(std::stringstream &ss) const
print information
Definition: BeamSpot.cc:47
Basic3DVector< float >