CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Protected Attributes
LHCInterpolatedOpticalFunctionsSet Class Reference

Set of optical functions corresponding to one scoring plane along LHC, including splines for interpolation performance. More...

#include <LHCInterpolatedOpticalFunctionsSet.h>

Inheritance diagram for LHCInterpolatedOpticalFunctionsSet:
LHCOpticalFunctionsSet

Classes

struct  Kinematics
 proton kinematics description More...
 

Public Member Functions

void initializeSplines ()
 builds splines from m_*_values fields More...
 
 LHCInterpolatedOpticalFunctionsSet ()=default
 
 LHCInterpolatedOpticalFunctionsSet (const LHCOpticalFunctionsSet &src)
 
const std::vector< std::shared_ptr< const TSpline3 > > & splines () const
 
void transport (const Kinematics &input, Kinematics &output, bool calculateAngles=false) const
 transports proton according to the splines More...
 
 ~LHCInterpolatedOpticalFunctionsSet ()=default
 
- Public Member Functions inherited from LHCOpticalFunctionsSet
const std::vector< std::vector< double > > & getFcnValues () const
 
double getScoringPlaneZ () const
 returns the position of the scoring plane (LHC/TOTEM convention) More...
 
const std::vector< double > & getXiValues () const
 
 LHCOpticalFunctionsSet ()=default
 
 LHCOpticalFunctionsSet (const std::string &fileName, const std::string &directoryName, double z)
 fills m_*_values fields from a ROOT file More...
 
 ~LHCOpticalFunctionsSet ()=default
 

Protected Attributes

friend CTPPSInterpolatedOpticalFunctionsESSource
 
friend CTPPSModifiedOpticalFunctionsESSource
 
std::vector< std::shared_ptr< const TSpline3 > > m_splines
 
- Protected Attributes inherited from LHCOpticalFunctionsSet
std::vector< std::vector< double > > m_fcn_values
 length unit cm More...
 
std::vector< double > m_xi_values
 
double m_z
 position of the scoring plane, in LHC/TOTEM convention, cm More...
 

Additional Inherited Members

- Public Types inherited from LHCOpticalFunctionsSet
enum  {
  evx, eLx, e14, exd,
  evpx, eLpx, e24, expd,
  e32, evy, eLy, eyd,
  e42, evpy, eLpy, eypd,
  nFunctions
}
 indices for m_fcn_values and m_splines data members More...
 

Detailed Description

Set of optical functions corresponding to one scoring plane along LHC, including splines for interpolation performance.

Definition at line 14 of file LHCInterpolatedOpticalFunctionsSet.h.

Constructor & Destructor Documentation

◆ LHCInterpolatedOpticalFunctionsSet() [1/2]

LHCInterpolatedOpticalFunctionsSet::LHCInterpolatedOpticalFunctionsSet ( )
default

◆ LHCInterpolatedOpticalFunctionsSet() [2/2]

LHCInterpolatedOpticalFunctionsSet::LHCInterpolatedOpticalFunctionsSet ( const LHCOpticalFunctionsSet src)
inline

◆ ~LHCInterpolatedOpticalFunctionsSet()

LHCInterpolatedOpticalFunctionsSet::~LHCInterpolatedOpticalFunctionsSet ( )
default

Member Function Documentation

◆ initializeSplines()

void LHCInterpolatedOpticalFunctionsSet::initializeSplines ( )

builds splines from m_*_values fields

Definition at line 7 of file LHCInterpolatedOpticalFunctionsSet.cc.

References mps_fire::i, LHCOpticalFunctionsSet::m_fcn_values, m_splines, and LHCOpticalFunctionsSet::m_xi_values.

Referenced by CTPPSInterpolatedOpticalFunctionsESSource::produce().

7  {
8  const unsigned int num_xi_vals = m_xi_values.size();
9 
10  m_splines.resize(m_fcn_values.size());
11  for (unsigned int i = 0; i < m_fcn_values.size(); ++i)
12  m_splines[i] = std::make_shared<TSpline3>("", m_xi_values.data(), m_fcn_values[i].data(), num_xi_vals);
13 }
std::vector< std::shared_ptr< const TSpline3 > > m_splines
std::vector< double > m_xi_values
std::vector< std::vector< double > > m_fcn_values
length unit cm

◆ splines()

const std::vector<std::shared_ptr<const TSpline3> >& LHCInterpolatedOpticalFunctionsSet::splines ( ) const
inline

Definition at line 22 of file LHCInterpolatedOpticalFunctionsSet.h.

References m_splines.

Referenced by ProtonReconstructionAlgorithm::init().

22 { return m_splines; }
std::vector< std::shared_ptr< const TSpline3 > > m_splines

◆ transport()

void LHCInterpolatedOpticalFunctionsSet::transport ( const Kinematics input,
LHCInterpolatedOpticalFunctionsSet::Kinematics output,
bool  calculateAngles = false 
) const

transports proton according to the splines

Definition at line 17 of file LHCInterpolatedOpticalFunctionsSet.cc.

References LHCOpticalFunctionsSet::e14, LHCOpticalFunctionsSet::e24, LHCOpticalFunctionsSet::e32, LHCOpticalFunctionsSet::e42, LHCOpticalFunctionsSet::eLpx, LHCOpticalFunctionsSet::eLpy, LHCOpticalFunctionsSet::eLx, LHCOpticalFunctionsSet::eLy, LHCOpticalFunctionsSet::evpx, LHCOpticalFunctionsSet::evpy, LHCOpticalFunctionsSet::evx, LHCOpticalFunctionsSet::evy, LHCOpticalFunctionsSet::exd, LHCOpticalFunctionsSet::expd, LHCOpticalFunctionsSet::eyd, LHCOpticalFunctionsSet::eypd, input, m_splines, convertSQLitetoXML_cfg::output, and protons_cff::xi.

Referenced by CTPPSOpticsPlotter::analyze(), and ProtonReconstructionAlgorithm::init().

19  {
20  const double xi = input.xi;
21 
22  output.x = m_splines[exd]->Eval(xi) + m_splines[evx]->Eval(xi) * input.x + m_splines[eLx]->Eval(xi) * input.th_x +
23  m_splines[e14]->Eval(xi) * input.th_y;
24 
25  output.th_x = (!calculateAngles) ? 0.
26  : m_splines[expd]->Eval(xi) + m_splines[evpx]->Eval(xi) * input.x +
27  m_splines[eLpx]->Eval(xi) * input.th_x + m_splines[e24]->Eval(xi) * input.th_y;
28 
29  output.y = m_splines[eyd]->Eval(xi) + m_splines[evy]->Eval(xi) * input.y + m_splines[eLy]->Eval(xi) * input.th_y +
30  m_splines[e32]->Eval(xi) * input.th_x;
31 
32  output.th_y = (!calculateAngles) ? 0.
33  : m_splines[eypd]->Eval(xi) + m_splines[evpy]->Eval(xi) * input.y +
34  m_splines[eLpy]->Eval(xi) * input.th_y + m_splines[e42]->Eval(xi) * input.th_x;
35 
36  output.xi = input.xi;
37 }
static std::string const input
Definition: EdmProvDump.cc:47
std::vector< std::shared_ptr< const TSpline3 > > m_splines

Member Data Documentation

◆ CTPPSInterpolatedOpticalFunctionsESSource

friend LHCInterpolatedOpticalFunctionsSet::CTPPSInterpolatedOpticalFunctionsESSource
protected

Definition at line 40 of file LHCInterpolatedOpticalFunctionsSet.h.

◆ CTPPSModifiedOpticalFunctionsESSource

friend LHCInterpolatedOpticalFunctionsSet::CTPPSModifiedOpticalFunctionsESSource
protected

Definition at line 41 of file LHCInterpolatedOpticalFunctionsSet.h.

◆ m_splines

std::vector<std::shared_ptr<const TSpline3> > LHCInterpolatedOpticalFunctionsSet::m_splines
protected

Definition at line 43 of file LHCInterpolatedOpticalFunctionsSet.h.

Referenced by initializeSplines(), splines(), and transport().