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 777 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 778 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 781 of file BeamSpotPayloadInspectorHelper.h.

References simBeamSpotPI::alpha, simBeamSpotPI::betaStar, cms::cuda::bs, simBeamSpotPI::emittance, simBeamSpotPI::SimBSParamsHelper< PayloadType >::m_values, simBeamSpotPI::meanX, simBeamSpotPI::meanY, simBeamSpotPI::meanZ, simBeamSpotPI::phi, simBeamSpotPI::sigmaX, simBeamSpotPI::sigmaY, simBeamSpotPI::sigmaZ, simBeamSpotPI::timeOffset, X, simBeamSpotPI::Y, and simBeamSpotPI::Z.

781  {
782  // fill in the values
784  m_values[parameters::meanX] = bs->meanX(), m_values[parameters::meanY] = bs->meanY();
785  m_values[parameters::meanZ] = bs->meanZ();
786  m_values[parameters::sigmaX] = bs->sigmaX() * 10000.f;
787  m_values[parameters::sigmaY] = bs->sigmaY() * 10000.f;
788  m_values[parameters::sigmaZ] = bs->sigmaZ();
789  m_values[parameters::betaStar] = bs->betaStar(), m_values[parameters::emittance] = bs->emittance();
790  m_values[parameters::phi] = bs->phi(), m_values[parameters::alpha] = bs->alpha(),
791  m_values[parameters::timeOffset] = bs->timeOffset();
792  }
#define X(str)
Definition: MuonsGrabber.cc:38

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

806  {
807  bshelpdata ret;
808  for (uint i = parameters::X; i <= parameters::timeOffset; i++) {
809  ret[i] = this->centralValues()[i] - bs2.centralValues()[i];
810  if (isPull)
811  (this->centralValues()[i] != 0.) ? ret[i] /= this->centralValues()[i] : 0.;
812  }
813  return ret;
814  }
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 794 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().

794  {
795  ss << "Dumping SimBeamSpot parameters Data:" << std::endl;
796  for (uint i = parameters::X; i <= parameters::timeOffset; i++) {
797  parameters par = static_cast<parameters>(i);
798  ss << getStringFromParamEnum(par) << " : " << m_values[i] << std::endl;
799  ss << std::endl;
800  }
801  }
#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