CMS 3D CMS Logo

SimBeamSpotObjects.cc
Go to the documentation of this file.
2 
3 #include <cmath>
4 #include <iostream>
5 
6 // Get SigmaX and SigmaY:
7 // - directly fSigmaX if >= 0 (in case of Gaussian Smearing)
8 // - else from LPC-like calculation (in case of BetaFunc Smearing)
9 double SimBeamSpotObjects::sigmaX() const {
10  if (fSigmaX >= 0.) // Gaussian smearing
11  return fSigmaX;
12  else // BetaFunc smearing
13  return (1 / std::sqrt(2)) * std::sqrt(femittance * fbetastar);
14 }
15 
17  if (fSigmaY >= 0.) // Gaussian smearing
18  return fSigmaY;
19  else // BetaFunc smearing
20  return (1 / std::sqrt(2)) * std::sqrt(femittance * fbetastar);
21 }
22 
23 // Printout SimBeamSpotObjects
24 void SimBeamSpotObjects::print(std::stringstream& ss) const {
25  ss << "-----------------------------------------------------\n"
26  << " Sim Beam Spot Data\n\n"
27  << " X0 = " << x() << " [cm]\n"
28  << " Y0 = " << y() << " [cm]\n"
29  << " Z0 = " << z() << " [cm]\n"
30  << " MeanX = " << meanX() << " [cm]\n"
31  << " MeanY = " << meanY() << " [cm]\n"
32  << " MeanZ = " << meanZ() << " [cm]\n"
33  << " Sigma X0 = " << sigmaX() << " [cm]\n"
34  << " Sigma Y0 = " << sigmaY() << " [cm]\n"
35  << " Sigma Z0 = " << sigmaZ() << " [cm]\n"
36  << " Beta star = " << betaStar() << " [cm]\n"
37  << " Emittance X = " << emittance() << " [cm]\n"
38  << " Phi = " << phi() << " [radians]\n"
39  << " Alpha = " << alpha() << " [radians]\n"
40  << " TimeOffset = " << timeOffset() << " [ns]\n"
41  << "-----------------------------------------------------\n\n";
42 }
43 
44 std::ostream& operator<<(std::ostream& os, SimBeamSpotObjects beam) {
45  std::stringstream ss;
46  beam.print(ss);
47  os << ss.str();
48  return os;
49 }
double sigmaZ() const
void print(std::stringstream &ss) const
print sim beam spot parameters
double sigmaX() const
get sigmaX, sigmaY, sigmaZ
double meanX() const
get meanX, meanY, meanZ position
double alpha() const
T sqrt(T t)
Definition: SSEVec.h:23
double timeOffset() const
double meanY() const
std::ostream & operator<<(std::ostream &os, SimBeamSpotObjects beam)
double meanZ() const
double emittance() const
double phi() const
get Phi, Alpha and TimeOffset
double betaStar() const
get BetaStar and Emittance
double x() const
get X, Y, Z position