CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Friends
LHCOpticalFunctionsSet Class Reference

Set of optical functions corresponding to one scoring plane along LHC. More...

#include <LHCOpticalFunctionsSet.h>

Inheritance diagram for LHCOpticalFunctionsSet:
LHCInterpolatedOpticalFunctionsSet

Public Types

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...
 

Public Member Functions

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

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...
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Set of optical functions corresponding to one scoring plane along LHC.

Definition at line 13 of file LHCOpticalFunctionsSet.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

indices for m_fcn_values and m_splines data members

Enumerator
evx 
eLx 
e14 
exd 
evpx 
eLpx 
e24 
expd 
e32 
evy 
eLy 
eyd 
e42 
evpy 
eLpy 
eypd 
nFunctions 

Definition at line 16 of file LHCOpticalFunctionsSet.h.

Constructor & Destructor Documentation

◆ LHCOpticalFunctionsSet() [1/2]

LHCOpticalFunctionsSet::LHCOpticalFunctionsSet ( )
default

◆ LHCOpticalFunctionsSet() [2/2]

LHCOpticalFunctionsSet::LHCOpticalFunctionsSet ( const std::string &  fileName,
const std::string &  directoryName,
double  z 
)

fills m_*_values fields from a ROOT file

Definition at line 12 of file LHCOpticalFunctionsSet.cc.

13  : m_z(z) {
14  TFile *f_in = TFile::Open(fileName.c_str());
15  if (f_in == nullptr)
16  throw cms::Exception("LHCOpticalFunctionsSet") << "Cannot open file " << fileName << ".";
17 
18  std::vector<TGraph *> graphs(nFunctions);
19  for (unsigned int fi = 0; fi < nFunctions; ++fi) {
21  if (fi == evx)
22  tag = "v_x";
23  else if (fi == eLx)
24  tag = "L_x";
25  else if (fi == e14)
26  tag = "E_14";
27  else if (fi == exd)
28  tag = "x_D";
29  else if (fi == evpx)
30  tag = "vp_x";
31  else if (fi == eLpx)
32  tag = "Lp_x";
33  else if (fi == e24)
34  tag = "E_24";
35  else if (fi == expd)
36  tag = "xp_D";
37  else if (fi == e32)
38  tag = "E_32";
39  else if (fi == evy)
40  tag = "v_y";
41  else if (fi == eLy)
42  tag = "L_y";
43  else if (fi == eyd)
44  tag = "y_D";
45  else if (fi == e42)
46  tag = "E_42";
47  else if (fi == evpy)
48  tag = "vp_y";
49  else if (fi == eLpy)
50  tag = "Lp_y";
51  else if (fi == eypd)
52  tag = "yp_D";
53  else
54  throw cms::Exception("LHCOpticalFunctionsSet") << "Invalid tag for optical functions: \"" << fi << "\"";
55 
56  std::string objPath = directoryName + "/g_" + tag + "_vs_xi";
57  auto gr_obj = dynamic_cast<TGraph *>(f_in->Get(objPath.c_str()));
58  if (!gr_obj)
59  throw cms::Exception("LHCOpticalFunctionsSet")
60  << "Cannot load object " << objPath << " from file " << fileName << ".";
61 
62  graphs[fi] = gr_obj;
63  }
64 
65  const unsigned int num_xi_vals = graphs[0]->GetN();
66  m_xi_values.resize(num_xi_vals);
67 
68  m_fcn_values.resize(nFunctions);
69 
70  for (unsigned int fi = 0; fi < nFunctions; ++fi)
71  m_fcn_values[fi].resize(num_xi_vals);
72 
73  for (unsigned int pi = 0; pi < num_xi_vals; ++pi) {
74  const double xi = graphs[0]->GetX()[pi];
75  m_xi_values[pi] = xi;
76 
77  for (unsigned int fi = 0; fi < m_fcn_values.size(); ++fi)
78  m_fcn_values[fi][pi] = graphs[fi]->Eval(xi);
79  }
80 
81  delete f_in;
82 }

References e14, e24, e32, e42, eLpx, eLpy, eLx, eLy, evpx, evpy, evx, evy, Exception, exd, expd, eyd, eypd, MillePedeFileConverter_cfg::fileName, cuy::graphs, m_fcn_values, m_xi_values, nFunctions, pi, AlCaHLTBitMon_QueryRunRegistry::string, makeGlobalPositionRcd_cfg::tag, and protons_cff::xi.

◆ ~LHCOpticalFunctionsSet()

LHCOpticalFunctionsSet::~LHCOpticalFunctionsSet ( )
default

Member Function Documentation

◆ getFcnValues()

const std::vector<std::vector<double> >& LHCOpticalFunctionsSet::getFcnValues ( ) const
inline

Definition at line 29 of file LHCOpticalFunctionsSet.h.

29 { return m_fcn_values; }

References m_fcn_values.

Referenced by ProtonReconstructionAlgorithm::init().

◆ getScoringPlaneZ()

double LHCOpticalFunctionsSet::getScoringPlaneZ ( ) const
inline

returns the position of the scoring plane (LHC/TOTEM convention)

Definition at line 26 of file LHCOpticalFunctionsSet.h.

26 { return m_z; }

References m_z.

◆ getXiValues()

const std::vector<double>& LHCOpticalFunctionsSet::getXiValues ( ) const
inline

Definition at line 28 of file LHCOpticalFunctionsSet.h.

28 { return m_xi_values; }

References m_xi_values.

Referenced by ProtonReconstructionAlgorithm::init().

◆ serialize()

template<class Archive >
void LHCOpticalFunctionsSet::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 38 of file LHCOpticalFunctionsSet.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 38 of file LHCOpticalFunctionsSet.h.

Member Data Documentation

◆ m_fcn_values

std::vector<std::vector<double> > LHCOpticalFunctionsSet::m_fcn_values
protected

◆ m_xi_values

std::vector<double> LHCOpticalFunctionsSet::m_xi_values
protected

◆ m_z

double LHCOpticalFunctionsSet::m_z
protected

position of the scoring plane, in LHC/TOTEM convention, cm

Definition at line 33 of file LHCOpticalFunctionsSet.h.

Referenced by getScoringPlaneZ(), and CTPPSInterpolatedOpticalFunctionsESSource::produce().

LHCOpticalFunctionsSet::eypd
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::evx
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::e14
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::m_fcn_values
std::vector< std::vector< double > > m_fcn_values
length unit cm
Definition: LHCOpticalFunctionsSet.h:36
LHCOpticalFunctionsSet::nFunctions
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::expd
Definition: LHCOpticalFunctionsSet.h:16
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
LHCOpticalFunctionsSet::exd
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::eLpx
Definition: LHCOpticalFunctionsSet.h:16
DDAxes::z
LHCOpticalFunctionsSet::m_z
double m_z
position of the scoring plane, in LHC/TOTEM convention, cm
Definition: LHCOpticalFunctionsSet.h:33
LHCOpticalFunctionsSet::eyd
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::evpx
Definition: LHCOpticalFunctionsSet.h:16
makeGlobalPositionRcd_cfg.tag
tag
Definition: makeGlobalPositionRcd_cfg.py:6
LHCOpticalFunctionsSet::eLpy
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::e32
Definition: LHCOpticalFunctionsSet.h:16
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
protons_cff.xi
xi
Definition: protons_cff.py:31
LHCOpticalFunctionsSet::eLy
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::evpy
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::evy
Definition: LHCOpticalFunctionsSet.h:16
Exception
Definition: hltDiff.cc:245
LHCOpticalFunctionsSet::e24
Definition: LHCOpticalFunctionsSet.h:16
LHCOpticalFunctionsSet::e42
Definition: LHCOpticalFunctionsSet.h:16
pi
const Double_t pi
Definition: trackSplitPlot.h:36
cuy.graphs
graphs
Definition: cuy.py:961
LHCOpticalFunctionsSet::m_xi_values
std::vector< double > m_xi_values
Definition: LHCOpticalFunctionsSet.h:35
LHCOpticalFunctionsSet::eLx
Definition: LHCOpticalFunctionsSet.h:16