CMS 3D CMS Logo

List of all members | Public Member Functions | Private Types | Private Attributes
BeamSpotPI::BSParamsHelper< PayloadType > Class Template Reference

#include <BeamSpotPayloadInspectorHelper.h>

Public Member Functions

 BSParamsHelper (const std::shared_ptr< PayloadType > &bs)
 
const bshelpdata centralValues () const
 
const bshelpdata diffCentralValues (const BSParamsHelper &bs2, const bool isPull=false) const
 
const bshelpdata diffErrors (const BSParamsHelper &bs2, const bool isPull=false) const
 
const bshelpdata errors () const
 
void printDebug (std::stringstream &ss)
 

Private Types

typedef std::array< double, 8 > bshelpdata
 

Private Attributes

bshelpdata m_errors
 
bshelpdata m_values
 

Detailed Description

template<class PayloadType>
class BeamSpotPI::BSParamsHelper< PayloadType >

Helper class for operations on the Beam Spot Parameters It's a simplified representation of the beamspot data used as the underlying type for data transfers and comparisons

Definition at line 93 of file BeamSpotPayloadInspectorHelper.h.

Member Typedef Documentation

◆ bshelpdata

template<class PayloadType >
typedef std::array<double, 8> BeamSpotPI::BSParamsHelper< PayloadType >::bshelpdata
private

Definition at line 94 of file BeamSpotPayloadInspectorHelper.h.

Constructor & Destructor Documentation

◆ BSParamsHelper()

template<class PayloadType >
BeamSpotPI::BSParamsHelper< PayloadType >::BSParamsHelper ( const std::shared_ptr< PayloadType > &  bs)
inline

Definition at line 97 of file BeamSpotPayloadInspectorHelper.h.

References cms::cuda::bs, BeamSpotPI::BSParamsHelper< PayloadType >::m_errors, and BeamSpotPI::BSParamsHelper< PayloadType >::m_values.

97  {
98  // fill in the central values
99  m_values[0] = bs->x(), m_values[1] = bs->y(), m_values[2] = bs->z();
100  m_values[3] = bs->beamWidthX(), m_values[4] = bs->beamWidthY(), m_values[5] = bs->sigmaZ();
101  m_values[6] = bs->dxdz(), m_values[7] = bs->dydz();
102 
103  // fill in the errors
104  m_errors[0] = bs->xError(), m_errors[1] = bs->yError(), m_errors[2] = bs->zError();
105  m_errors[3] = bs->beamWidthXError(), m_errors[4] = bs->beamWidthYError(), m_errors[5] = bs->sigmaZError();
106  m_errors[6] = bs->dxdzError(), m_errors[7] = bs->dydzError();
107  }

Member Function Documentation

◆ centralValues()

template<class PayloadType >
const bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::centralValues ( ) const
inline

◆ diffCentralValues()

template<class PayloadType >
const bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::diffCentralValues ( const BSParamsHelper< PayloadType > &  bs2,
const bool  isPull = false 
) const
inline

Definition at line 123 of file BeamSpotPayloadInspectorHelper.h.

References BeamSpotPI::BSParamsHelper< PayloadType >::centralValues(), dydz, mps_fire::i, runTheMatrix::ret, parallelization::uint, and X.

Referenced by BeamSpotPI::DisplayParametersDiff< PayloadType, nIOVs, ntags >::fill().

123  {
124  bshelpdata ret;
125  for (uint i = parameters::X; i <= parameters::dydz; i++) {
126  ret[i] = this->centralValues()[i] - bs2.centralValues()[i];
127  if (isPull)
128  (this->centralValues()[i] != 0.) ? ret[i] /= this->centralValues()[i] : 0.;
129  }
130  return ret;
131  }
float dydz
ret
prodAgent to be discontinued
#define X(str)
Definition: MuonsGrabber.cc:38

◆ diffErrors()

template<class PayloadType >
const bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::diffErrors ( const BSParamsHelper< PayloadType > &  bs2,
const bool  isPull = false 
) const
inline

Definition at line 134 of file BeamSpotPayloadInspectorHelper.h.

References dydz, BeamSpotPI::BSParamsHelper< PayloadType >::errors(), mps_fire::i, runTheMatrix::ret, parallelization::uint, and X.

Referenced by BeamSpotPI::DisplayParametersDiff< PayloadType, nIOVs, ntags >::fill().

134  {
135  bshelpdata ret;
136  for (uint i = parameters::X; i <= parameters::dydz; i++) {
137  ret[i] = this->errors()[i] - bs2.errors()[i];
138  if (isPull)
139  (this->errors()[i] != 0.) ? ret[i] /= this->errors()[i] : 0.;
140  }
141  return ret;
142  }
float dydz
ret
prodAgent to be discontinued
#define X(str)
Definition: MuonsGrabber.cc:38

◆ errors()

template<class PayloadType >
const bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::errors ( ) const
inline

◆ printDebug()

template<class PayloadType >
void BeamSpotPI::BSParamsHelper< PayloadType >::printDebug ( std::stringstream &  ss)
inline

Definition at line 109 of file BeamSpotPayloadInspectorHelper.h.

References dydz, BeamSpotPI::getStringFromParamEnum(), mps_fire::i, BeamSpotPI::BSParamsHelper< PayloadType >::m_errors, BeamSpotPI::BSParamsHelper< PayloadType >::m_values, contentValuesCheck::ss, parallelization::uint, and X.

Referenced by BeamSpotPI::DisplayParametersDiff< PayloadType, nIOVs, ntags >::fill().

109  {
110  ss << "Dumping BeamSpot parameters Data:" << std::endl;
111  for (uint i = parameters::X; i <= parameters::dydz; i++) {
112  parameters par = static_cast<parameters>(i);
113  ss << getStringFromParamEnum(par) << " : " << m_values[i] << std::endl;
114  ss << getStringFromParamEnum(par) << " error: " << m_errors[i] << std::endl;
115  ss << std::endl;
116  }
117  }
float dydz
#define X(str)
Definition: MuonsGrabber.cc:38
std::string getStringFromParamEnum(const parameters &parameter, const bool addUnits=false)

Member Data Documentation

◆ m_errors

template<class PayloadType >
bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::m_errors
private

◆ m_values

template<class PayloadType >
bshelpdata BeamSpotPI::BSParamsHelper< PayloadType >::m_values
private