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, parameters::lastLumi > 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 115 of file BeamSpotPayloadInspectorHelper.h.

Member Typedef Documentation

◆ bshelpdata

template<class PayloadType >
typedef std::array<double, parameters::lastLumi> beamSpotPI::BSParamsHelper< PayloadType >::bshelpdata
private

Definition at line 116 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 119 of file BeamSpotPayloadInspectorHelper.h.

References cms::cuda::bs, dxdz, dydz, beamSpotPI::BSParamsHelper< PayloadType >::m_errors, beamSpotPI::BSParamsHelper< PayloadType >::m_values, simBeamSpotPI::sigmaX, simBeamSpotPI::sigmaY, simBeamSpotPI::sigmaZ, X, simBeamSpotPI::Y, and simBeamSpotPI::Z.

119  {
120  // fill in the central values
122  m_values[parameters::sigmaX] = bs->beamWidthX(), m_values[parameters::sigmaY] = bs->beamWidthY(),
123  m_values[parameters::sigmaZ] = bs->sigmaZ();
124  m_values[parameters::dxdz] = bs->dxdz(), m_values[parameters::dydz] = bs->dydz();
125 
126  // fill in the errors
127  m_errors[parameters::X] = bs->xError(), m_errors[parameters::Y] = bs->yError(),
128  m_errors[parameters::Z] = bs->zError();
129  m_errors[parameters::sigmaX] = bs->beamWidthXError(), m_errors[parameters::sigmaY] = bs->beamWidthYError(),
130  m_errors[parameters::sigmaZ] = bs->sigmaZError();
131  m_errors[parameters::dxdz] = bs->dxdzError(), m_errors[parameters::dydz] = bs->dydzError();
132  }
float dydz
float dxdz
#define X(str)
Definition: MuonsGrabber.cc:38

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 148 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().

148  {
149  bshelpdata ret;
150  for (uint i = parameters::X; i <= parameters::dydz; i++) {
151  ret[i] = this->centralValues()[i] - bs2.centralValues()[i];
152  if (isPull)
153  (this->centralValues()[i] != 0.) ? ret[i] /= this->centralValues()[i] : 0.;
154  }
155  return ret;
156  }
float dydz
ret
prodAgent to be discontinued
#define X(str)
Definition: MuonsGrabber.cc:38
std::array< double, parameters::lastLumi > bshelpdata

◆ diffErrors()

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

Definition at line 159 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().

159  {
160  bshelpdata ret;
161  for (uint i = parameters::X; i <= parameters::dydz; i++) {
162  ret[i] = this->errors()[i] - bs2.errors()[i];
163  if (isPull)
164  (this->errors()[i] != 0.) ? ret[i] /= this->errors()[i] : 0.;
165  }
166  return ret;
167  }
float dydz
ret
prodAgent to be discontinued
#define X(str)
Definition: MuonsGrabber.cc:38
std::array< double, parameters::lastLumi > bshelpdata

◆ 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 134 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().

134  {
135  ss << "Dumping BeamSpot parameters Data:" << std::endl;
136  for (uint i = parameters::X; i <= parameters::dydz; i++) {
137  parameters par = static_cast<parameters>(i);
138  ss << getStringFromParamEnum(par) << " : " << m_values[i] << std::endl;
139  ss << getStringFromParamEnum(par) << " error: " << m_errors[i] << std::endl;
140  ss << std::endl;
141  }
142  }
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