Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:02:28

0001 // Original Author:  Jan Kašpar
0002 
0003 #ifndef CondFormats_PPSObjects_LHCInterpolatedOpticalFunctionsSet_h
0004 #define CondFormats_PPSObjects_LHCInterpolatedOpticalFunctionsSet_h
0005 
0006 #include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSet.h"
0007 
0008 #include "TSpline.h"
0009 
0010 class CTPPSInterpolatedOpticalFunctionsESSource;
0011 class CTPPSModifiedOpticalFunctionsESSource;
0012 
0013 /// Set of optical functions corresponding to one scoring plane along LHC, including splines for interpolation performance.
0014 class LHCInterpolatedOpticalFunctionsSet : public LHCOpticalFunctionsSet {
0015 public:
0016   LHCInterpolatedOpticalFunctionsSet() = default;
0017 
0018   LHCInterpolatedOpticalFunctionsSet(const LHCOpticalFunctionsSet &src) : LHCOpticalFunctionsSet(src) {}
0019 
0020   ~LHCInterpolatedOpticalFunctionsSet() = default;
0021 
0022   const std::vector<std::shared_ptr<const TSpline3>> &splines() const { return m_splines; }
0023 
0024   /// builds splines from m_*_values fields
0025   void initializeSplines();
0026 
0027   /// proton kinematics description
0028   struct Kinematics {
0029     double x;     // physics vertex position (beam offset subtracted), cm
0030     double th_x;  // physics scattering angle (crossing angle subtracted), rad
0031     double y;     // physics vertex position, cm
0032     double th_y;  // physics scattering angle, rad
0033     double xi;    // relative momentum loss (positive for diffractive protons)
0034   };
0035 
0036   /// transports proton according to the splines
0037   void transport(const Kinematics &input, Kinematics &output, bool calculateAngles = false) const;
0038 
0039 protected:
0040   friend CTPPSInterpolatedOpticalFunctionsESSource;
0041   friend CTPPSModifiedOpticalFunctionsESSource;
0042 
0043   std::vector<std::shared_ptr<const TSpline3>> m_splines;
0044 };
0045 
0046 #endif