Kinematics

LHCInterpolatedOpticalFunctionsSet

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
// Original Author:  Jan Kašpar

#ifndef CondFormats_PPSObjects_LHCInterpolatedOpticalFunctionsSet_h
#define CondFormats_PPSObjects_LHCInterpolatedOpticalFunctionsSet_h

#include "CondFormats/PPSObjects/interface/LHCOpticalFunctionsSet.h"

#include "TSpline.h"

class CTPPSInterpolatedOpticalFunctionsESSource;
class CTPPSModifiedOpticalFunctionsESSource;

/// Set of optical functions corresponding to one scoring plane along LHC, including splines for interpolation performance.
class LHCInterpolatedOpticalFunctionsSet : public LHCOpticalFunctionsSet {
public:
  LHCInterpolatedOpticalFunctionsSet() = default;

  LHCInterpolatedOpticalFunctionsSet(const LHCOpticalFunctionsSet &src) : LHCOpticalFunctionsSet(src) {}

  ~LHCInterpolatedOpticalFunctionsSet() = default;

  const std::vector<std::shared_ptr<const TSpline3>> &splines() const { return m_splines; }

  /// builds splines from m_*_values fields
  void initializeSplines();

  /// proton kinematics description
  struct Kinematics {
    double x;     // physics vertex position (beam offset subtracted), cm
    double th_x;  // physics scattering angle (crossing angle subtracted), rad
    double y;     // physics vertex position, cm
    double th_y;  // physics scattering angle, rad
    double xi;    // relative momentum loss (positive for diffractive protons)
  };

  /// transports proton according to the splines
  void transport(const Kinematics &input, Kinematics &output, bool calculateAngles = false) const;

protected:
  friend CTPPSInterpolatedOpticalFunctionsESSource;
  friend CTPPSModifiedOpticalFunctionsESSource;

  std::vector<std::shared_ptr<const TSpline3>> m_splines;
};

#endif