Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:35:36

0001 #ifndef SIMBEAMSPOTOBJECTS_H
0002 #define SIMBEAMSPOTOBJECTS_H
0003 
0004 /** \class SimBeamSpotObjects
0005  *
0006  * Provide the vertex smearing parameters from DB
0007  *
0008  * This Object contains the parameters needed by the vtx smearing functions used up to Run 3:
0009  *   - BetafuncEvtVtxGenerator (realistic Run1/Run2/Run3 conditions)
0010  *     Parameters used:
0011  *        - fX0, fY0, fZ0
0012  *        - fSigmaZ
0013  *        - fbetastar, femittance
0014  *        - fPhi, fAlpha
0015  *        - fTimeOffset
0016  *   - GaussEvtVtxGenerator (design Run1/Run2/Run3 conditions)
0017  *     Parameters used:
0018  *        - fMeanX, fMeanY, fMeanZ
0019  *        - fSigmaX, fSigmaY, fSigmaZ
0020  *        - fTimeOffset
0021  *
0022  */
0023 
0024 #include "CondFormats/Serialization/interface/Serializable.h"
0025 
0026 #include <sstream>
0027 
0028 class SimBeamSpotObjects {
0029 public:
0030   /// default constructor
0031   SimBeamSpotObjects() {
0032     fX0 = 0.0;
0033     fY0 = 0.0;
0034     fZ0 = 0.0;
0035     fMeanX = 0.0;
0036     fMeanY = 0.0;
0037     fMeanZ = 0.0;
0038     fSigmaX = -1.0;
0039     fSigmaY = -1.0;
0040     fSigmaZ = 0.0;
0041     fbetastar = 0.0;
0042     femittance = 0.0;
0043     fPhi = 0.0;
0044     fAlpha = 0.0;
0045     fTimeOffset = 0.0;
0046   };
0047 
0048   virtual ~SimBeamSpotObjects() {}
0049 
0050   /// set X, Y, Z positions
0051   void setX(double val) { fX0 = val; }
0052   void setY(double val) { fY0 = val; }
0053   void setZ(double val) { fZ0 = val; }
0054   /// set meanX, meanY, meanZ
0055   void setMeanX(double val) { fMeanX = val; }
0056   void setMeanY(double val) { fMeanY = val; }
0057   void setMeanZ(double val) { fMeanZ = val; }
0058   /// set sigmaX, sigmaY, sigmaZ
0059   void setSigmaX(double val) { fSigmaX = val; }
0060   void setSigmaY(double val) { fSigmaY = val; }
0061   void setSigmaZ(double val) { fSigmaZ = val; }
0062   /// set BetaStar and Emittance
0063   void setBetaStar(double val) { fbetastar = val; }
0064   void setEmittance(double val) { femittance = val; }
0065   /// set Phi, Alpha and TimeOffset
0066   void setPhi(double val) { fPhi = val; }
0067   void setAlpha(double val) { fAlpha = val; }
0068   void setTimeOffset(double val) { fTimeOffset = val; }
0069 
0070   /// get X, Y, Z position
0071   double x() const { return fX0; }
0072   double y() const { return fY0; }
0073   double z() const { return fZ0; }
0074   /// get meanX, meanY, meanZ position
0075   double meanX() const { return fMeanX; }
0076   double meanY() const { return fMeanY; }
0077   double meanZ() const { return fMeanZ; }
0078   /// get sigmaX, sigmaY, sigmaZ
0079   double sigmaX() const;
0080   double sigmaY() const;
0081   double sigmaZ() const { return fSigmaZ; }
0082   /// get BetaStar and Emittance
0083   double betaStar() const { return fbetastar; }
0084   double emittance() const { return femittance; }
0085   /// get Phi, Alpha and TimeOffset
0086   double phi() const { return fPhi; }
0087   double alpha() const { return fAlpha; }
0088   double timeOffset() const { return fTimeOffset; }
0089 
0090   /// print sim beam spot parameters
0091   void print(std::stringstream& ss) const;
0092 
0093 private:
0094   double fX0, fY0, fZ0;
0095   double fMeanX, fMeanY, fMeanZ;
0096   double fSigmaX, fSigmaY, fSigmaZ;
0097   double fbetastar, femittance;
0098   double fPhi, fAlpha;
0099   double fTimeOffset;
0100 
0101   COND_SERIALIZABLE;
0102 };
0103 
0104 std::ostream& operator<<(std::ostream&, SimBeamSpotObjects beam);
0105 
0106 #endif