CMS 3D CMS Logo

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

#include <BeamSpotPayloadInspectorHelper.h>

Public Member Functions

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

Private Types

typedef std::array< double, parameters::END_OF_TYPESbshelpdata
 

Private Attributes

bshelpdata m_values
 

Detailed Description

template<class PayloadType>
class simBeamSpotPI::SimBSParamsHelper< PayloadType >

Helper class for operations on the Sim 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 765 of file BeamSpotPayloadInspectorHelper.h.

Member Typedef Documentation

◆ bshelpdata

template<class PayloadType >
typedef std::array<double, parameters::END_OF_TYPES> simBeamSpotPI::SimBSParamsHelper< PayloadType >::bshelpdata
private

Definition at line 766 of file BeamSpotPayloadInspectorHelper.h.

Constructor & Destructor Documentation

◆ SimBSParamsHelper()

template<class PayloadType >
simBeamSpotPI::SimBSParamsHelper< PayloadType >::SimBSParamsHelper ( const std::shared_ptr< PayloadType > &  bs)
inline

Definition at line 769 of file BeamSpotPayloadInspectorHelper.h.

References simBeamSpotPI::alpha, simBeamSpotPI::betaStar, cms::cuda::bs, simBeamSpotPI::emittance, simBeamSpotPI::expTransWidth, f, simBeamSpotPI::SimBSParamsHelper< PayloadType >::m_values, simBeamSpotPI::phi, simBeamSpotPI::sigmaZ, mathSSE::sqrt(), simBeamSpotPI::timeOffset, X, simBeamSpotPI::Y, and simBeamSpotPI::Z.

769  {
770  // fill in the values
772  m_values[parameters::sigmaZ] = bs->sigmaZ(), m_values[parameters::betaStar] = bs->betaStar(),
773  m_values[parameters::emittance] = bs->emittance();
774  m_values[parameters::expTransWidth] = (1 / std::sqrt(2)) * std::sqrt(bs->emittance() * bs->betaStar()) * 10000.f;
775  m_values[parameters::phi] = bs->phi(), m_values[parameters::alpha] = bs->alpha(),
776  m_values[parameters::timeOffset] = bs->timeOffset();
777  }
#define X(str)
Definition: MuonsGrabber.cc:38
T sqrt(T t)
Definition: SSEVec.h:19
double f[11][100]

Member Function Documentation

◆ centralValues()

template<class PayloadType >
const bshelpdata simBeamSpotPI::SimBSParamsHelper< PayloadType >::centralValues ( ) const
inline

◆ diffCentralValues()

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

Definition at line 791 of file BeamSpotPayloadInspectorHelper.h.

References simBeamSpotPI::SimBSParamsHelper< PayloadType >::centralValues(), mps_fire::i, runTheMatrix::ret, simBeamSpotPI::timeOffset, parallelization::uint, and X.

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

791  {
792  bshelpdata ret;
793  for (uint i = parameters::X; i <= parameters::timeOffset; i++) {
794  ret[i] = this->centralValues()[i] - bs2.centralValues()[i];
795  if (isPull)
796  (this->centralValues()[i] != 0.) ? ret[i] /= this->centralValues()[i] : 0.;
797  }
798  return ret;
799  }
ret
prodAgent to be discontinued
#define X(str)
Definition: MuonsGrabber.cc:38
std::array< double, parameters::END_OF_TYPES > bshelpdata

◆ printDebug()

template<class PayloadType >
void simBeamSpotPI::SimBSParamsHelper< PayloadType >::printDebug ( std::stringstream &  ss)
inline

Definition at line 779 of file BeamSpotPayloadInspectorHelper.h.

References simBeamSpotPI::getStringFromParamEnum(), mps_fire::i, simBeamSpotPI::SimBSParamsHelper< PayloadType >::m_values, contentValuesCheck::ss, simBeamSpotPI::timeOffset, parallelization::uint, and X.

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

779  {
780  ss << "Dumping SimBeamSpot parameters Data:" << std::endl;
781  for (uint i = parameters::X; i <= parameters::timeOffset; i++) {
782  parameters par = static_cast<parameters>(i);
783  ss << getStringFromParamEnum(par) << " : " << m_values[i] << std::endl;
784  ss << std::endl;
785  }
786  }
#define X(str)
Definition: MuonsGrabber.cc:38
std::string getStringFromParamEnum(const parameters &parameter, const bool addUnits=false)

Member Data Documentation

◆ m_values

template<class PayloadType >
bshelpdata simBeamSpotPI::SimBSParamsHelper< PayloadType >::m_values
private