CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
BeamCurrentInfo Class Reference

#include <BeamCurrentInfo.h>

Public Member Functions

 BeamCurrentInfo ()
 default constructor More...
 
 BeamCurrentInfo (const std::vector< float > &beam1Intensities, const std::vector< float > &beam2Intensities)
 constructor with fill More...
 
void fill (const std::vector< float > &beam1Intensities, const std::vector< float > &beam2Intensities)
 
void fillBeamIntensities (const std::vector< float > &beam1Intensities, const std::vector< float > &beam2Intensities)
 
const std::vector< float > & getBeam1Intensities () const
 
const std::vector< uint16_t > & getBeam1IntensitiesPacked () const
 
float getBeam1IntensityBX (int bx) const
 
const std::vector< float > & getBeam2Intensities () const
 
const std::vector< uint16_t > & getBeam2IntensitiesPacked () const
 
float getBeam2IntensityBX (int bx) const
 
bool isProductEqual (BeamCurrentInfo const &next) const
 
 ~BeamCurrentInfo ()
 destructor More...
 

Static Public Member Functions

static void unpackData (const std::vector< uint16_t > &packed, std::vector< float > &unpacked)
 

Static Public Attributes

static const float scaleFactor = 1e10
 

Private Member Functions

void packData ()
 
void unpackData ()
 

Private Attributes

std::vector< uint16_t > beam1IntensitiesPacked_
 
std::vector< float > beam1IntensitiesUnpacked_
 
std::vector< uint16_t > beam2IntensitiesPacked_
 
std::vector< float > beam2IntensitiesUnpacked_
 

Detailed Description

BeamCurrentInfo has been created by splitting off the beam current information from LumiInfo. See LumiInfo for more details.

Author
Valerie Halyo David Dagenhart Zhen Xie Paul Lujan
Version
October 21, 2014

Definition at line 32 of file BeamCurrentInfo.h.

Constructor & Destructor Documentation

◆ BeamCurrentInfo() [1/2]

BeamCurrentInfo::BeamCurrentInfo ( )
inline

◆ BeamCurrentInfo() [2/2]

BeamCurrentInfo::BeamCurrentInfo ( const std::vector< float > &  beam1Intensities,
const std::vector< float > &  beam2Intensities 
)
inline

constructor with fill

Definition at line 45 of file BeamCurrentInfo.h.

45  {
46  beam1IntensitiesUnpacked_.assign(beam1Intensities.begin(), beam1Intensities.end());
47  beam2IntensitiesUnpacked_.assign(beam2Intensities.begin(), beam2Intensities.end());
48  packData();
49  }

References beam1IntensitiesUnpacked_, beam2IntensitiesUnpacked_, and packData().

◆ ~BeamCurrentInfo()

BeamCurrentInfo::~BeamCurrentInfo ( )
inline

destructor

Definition at line 52 of file BeamCurrentInfo.h.

52 {}

Member Function Documentation

◆ fill()

void BeamCurrentInfo::fill ( const std::vector< float > &  beam1Intensities,
const std::vector< float > &  beam2Intensities 
)

Definition at line 30 of file BeamCurrentInfo.cc.

30  {
31  fillBeamIntensities(beam1Intensities, beam2Intensities);
32 }

References fillBeamIntensities().

◆ fillBeamIntensities()

void BeamCurrentInfo::fillBeamIntensities ( const std::vector< float > &  beam1Intensities,
const std::vector< float > &  beam2Intensities 
)

Definition at line 23 of file BeamCurrentInfo.cc.

24  {
25  beam1IntensitiesUnpacked_.assign(beam1Intensities.begin(), beam1Intensities.end());
26  beam2IntensitiesUnpacked_.assign(beam2Intensities.begin(), beam2Intensities.end());
27  packData();
28 }

References beam1IntensitiesUnpacked_, beam2IntensitiesUnpacked_, and packData().

Referenced by fill().

◆ getBeam1Intensities()

const std::vector< float > & BeamCurrentInfo::getBeam1Intensities ( ) const

Definition at line 12 of file BeamCurrentInfo.cc.

12 { return beam1IntensitiesUnpacked_; }

References beam1IntensitiesUnpacked_.

Referenced by operator<<().

◆ getBeam1IntensitiesPacked()

const std::vector<uint16_t>& BeamCurrentInfo::getBeam1IntensitiesPacked ( ) const
inline

Definition at line 61 of file BeamCurrentInfo.h.

61 { return beam1IntensitiesPacked_; }

References beam1IntensitiesPacked_.

Referenced by operator<<().

◆ getBeam1IntensityBX()

float BeamCurrentInfo::getBeam1IntensityBX ( int  bx) const

Definition at line 10 of file BeamCurrentInfo.cc.

10 { return beam1IntensitiesUnpacked_.at(bx); }

References beam1IntensitiesUnpacked_, and l1GtPatternGenerator_cfi::bx.

◆ getBeam2Intensities()

const std::vector< float > & BeamCurrentInfo::getBeam2Intensities ( ) const

Definition at line 16 of file BeamCurrentInfo.cc.

16 { return beam2IntensitiesUnpacked_; }

References beam2IntensitiesUnpacked_.

Referenced by operator<<().

◆ getBeam2IntensitiesPacked()

const std::vector<uint16_t>& BeamCurrentInfo::getBeam2IntensitiesPacked ( ) const
inline

Definition at line 62 of file BeamCurrentInfo.h.

62 { return beam2IntensitiesPacked_; }

References beam2IntensitiesPacked_.

◆ getBeam2IntensityBX()

float BeamCurrentInfo::getBeam2IntensityBX ( int  bx) const

Definition at line 14 of file BeamCurrentInfo.cc.

14 { return beam2IntensitiesUnpacked_.at(bx); }

References beam2IntensitiesUnpacked_, and l1GtPatternGenerator_cfi::bx.

◆ isProductEqual()

bool BeamCurrentInfo::isProductEqual ( BeamCurrentInfo const &  next) const

Definition at line 18 of file BeamCurrentInfo.cc.

18  {
19  return (beam1IntensitiesPacked_ == next.beam1IntensitiesPacked_ &&
20  beam2IntensitiesPacked_ == next.beam2IntensitiesPacked_);
21 }

References beam1IntensitiesPacked_, beam2IntensitiesPacked_, and GetRecoTauVFromDQM_MC_cff::next.

◆ packData()

void BeamCurrentInfo::packData ( )
private

◆ unpackData() [1/2]

void BeamCurrentInfo::unpackData ( )
private

◆ unpackData() [2/2]

void BeamCurrentInfo::unpackData ( const std::vector< uint16_t > &  packed,
std::vector< float > &  unpacked 
)
static

Definition at line 51 of file BeamCurrentInfo.cc.

51  {
52  unpacked.resize(packed.size());
53 
54  for (unsigned int i = 0; i < packed.size(); i++) {
55  unpacked[i] = MiniFloatConverter::float16to32(packed[i]) * scaleFactor;
56  }
57 }

References MiniFloatConverter::float16to32(), mps_fire::i, and scaleFactor.

Member Data Documentation

◆ beam1IntensitiesPacked_

std::vector<uint16_t> BeamCurrentInfo::beam1IntensitiesPacked_
private

◆ beam1IntensitiesUnpacked_

std::vector<float> BeamCurrentInfo::beam1IntensitiesUnpacked_
private

◆ beam2IntensitiesPacked_

std::vector<uint16_t> BeamCurrentInfo::beam2IntensitiesPacked_
private

◆ beam2IntensitiesUnpacked_

std::vector<float> BeamCurrentInfo::beam2IntensitiesUnpacked_
private

◆ scaleFactor

const float BeamCurrentInfo::scaleFactor = 1e10
static

Definition at line 34 of file BeamCurrentInfo.h.

Referenced by packData(), and unpackData().

mps_fire.i
i
Definition: mps_fire.py:355
LumiConstants::numBX
static const unsigned int numBX
Definition: LumiConstants.h:8
BeamCurrentInfo::fillBeamIntensities
void fillBeamIntensities(const std::vector< float > &beam1Intensities, const std::vector< float > &beam2Intensities)
Definition: BeamCurrentInfo.cc:23
BeamCurrentInfo::packData
void packData()
Definition: BeamCurrentInfo.cc:35
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
BeamCurrentInfo::scaleFactor
static const float scaleFactor
Definition: BeamCurrentInfo.h:34
BeamCurrentInfo::beam1IntensitiesUnpacked_
std::vector< float > beam1IntensitiesUnpacked_
Definition: BeamCurrentInfo.h:81
MiniFloatConverter::float16to32
static float float16to32(uint16_t h)
Definition: libminifloat.h:12
BeamCurrentInfo::unpackData
void unpackData()
Definition: BeamCurrentInfo.cc:59
BeamCurrentInfo::beam2IntensitiesPacked_
std::vector< uint16_t > beam2IntensitiesPacked_
Definition: BeamCurrentInfo.h:80
BeamCurrentInfo::beam2IntensitiesUnpacked_
std::vector< float > beam2IntensitiesUnpacked_
Definition: BeamCurrentInfo.h:82
MiniFloatConverter::float32to16
static uint16_t float32to16(float x)
Definition: libminifloat.h:20
BeamCurrentInfo::beam1IntensitiesPacked_
std::vector< uint16_t > beam1IntensitiesPacked_
Definition: BeamCurrentInfo.h:79
GetRecoTauVFromDQM_MC_cff.next
next
Definition: GetRecoTauVFromDQM_MC_cff.py:31