CMS 3D CMS Logo

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

#include <LumiDetails.h>

Public Types

enum  Algos {
  kOCC1, kOCC2, kET, kPLT,
  kMaxNumAlgos
}
 
typedef unsigned int AlgoType
 
typedef std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ErrorRange
 
typedef std::pair< std::vector< short >::const_iterator, std::vector< short >::const_iterator > QualityRange
 
typedef std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ValueRange
 

Public Member Functions

void fill (AlgoType algo, std::vector< float > const &values, std::vector< float > const &errors, std::vector< short > const &qualities)
 
void fillBeamIntensities (std::vector< float > const &beam1Intensities, std::vector< float > const &beam2Intensities)
 
bool isProductEqual (LumiDetails const &lumiDetails) const
 
bool isValid () const
 
std::vector< float > const & lumiBeam1Intensities () const
 
float lumiBeam1Intensity (unsigned int bx) const
 
std::vector< float > const & lumiBeam2Intensities () const
 
float lumiBeam2Intensity (unsigned int bx) const
 
 LumiDetails ()
 
 LumiDetails (std::string const &lumiVersion)
 
float lumiError (AlgoType algo, unsigned int bx) const
 
ErrorRange lumiErrorsForAlgo (AlgoType algo) const
 
QualityRange lumiQualitiesForAlgo (AlgoType algo) const
 
short lumiQuality (AlgoType algo, unsigned int bx) const
 
float lumiValue (AlgoType algo, unsigned int bx) const
 
ValueRange lumiValuesForAlgo (AlgoType algo) const
 
std::string const & lumiVersion () const
 
void setLumiVersion (std::string const &lumiVersion)
 
 ~LumiDetails ()
 

Static Public Member Functions

static std::vector< std::string > const & algoNames ()
 
static std::vector< std::string > const & dipalgoNames ()
 

Private Member Functions

void checkAlgo (AlgoType algo) const
 
void checkAlgoAndBX (AlgoType algo, unsigned int bx) const
 

Private Attributes

std::vector< unsigned int > m_algoToFirstIndex
 
std::vector< float > m_allErrors
 
std::vector< short > m_allQualities
 
std::vector< float > m_allValues
 
std::vector< float > m_beam1Intensities
 
std::vector< float > m_beam2Intensities
 
std::string m_lumiVersion
 

Static Private Attributes

static const std::vector< std::string > m_algoNames
 

Detailed Description

LumiDetails holds Details information: the lumi value, the error on this value, its quality, and 2 beam intensities for each bunch crossing (BX) in a given luminosity section (LS)

Author
Valerie Halyo, David Dagenhart, created June 7, 2007>

Definition at line 20 of file LumiDetails.h.

Member Typedef Documentation

◆ AlgoType

typedef unsigned int LumiDetails::AlgoType

Definition at line 27 of file LumiDetails.h.

◆ ErrorRange

typedef std::pair<std::vector<float>::const_iterator, std::vector<float>::const_iterator> LumiDetails::ErrorRange

Definition at line 29 of file LumiDetails.h.

◆ QualityRange

typedef std::pair<std::vector<short>::const_iterator, std::vector<short>::const_iterator> LumiDetails::QualityRange

Definition at line 30 of file LumiDetails.h.

◆ ValueRange

typedef std::pair<std::vector<float>::const_iterator, std::vector<float>::const_iterator> LumiDetails::ValueRange

Definition at line 28 of file LumiDetails.h.

Member Enumeration Documentation

◆ Algos

Enumerator
kOCC1 
kOCC2 
kET 
kPLT 
kMaxNumAlgos 

Definition at line 26 of file LumiDetails.h.

Constructor & Destructor Documentation

◆ LumiDetails() [1/2]

LumiDetails::LumiDetails ( )

Definition at line 20 of file LumiDetails.cc.

21  : m_lumiVersion("-1"),
23  m_allValues(),
24  m_allErrors(),

◆ LumiDetails() [2/2]

LumiDetails::LumiDetails ( std::string const &  lumiVersion)
explicit

Definition at line 29 of file LumiDetails.cc.

◆ ~LumiDetails()

LumiDetails::~LumiDetails ( )

Definition at line 38 of file LumiDetails.cc.

38 {}

Member Function Documentation

◆ algoNames()

std::vector< std::string > const & LumiDetails::algoNames ( )
static

Definition at line 113 of file LumiDetails.cc.

113  {
114  assert(m_algoNames.size() == kMaxNumAlgos);
115  return m_algoNames;
116 }

References cms::cuda::assert(), kMaxNumAlgos, and m_algoNames.

Referenced by operator<<().

◆ checkAlgo()

void LumiDetails::checkAlgo ( AlgoType  algo) const
private

Definition at line 129 of file LumiDetails.cc.

129  {
130  if (algo >= kMaxNumAlgos) {
132  << "Algorithm type argument out of range in a call to a function in LumiDetails\n";
133  }
134 }

References Exception, kMaxNumAlgos, and edm::errors::LogicError.

Referenced by checkAlgoAndBX(), fill(), lumiErrorsForAlgo(), lumiQualitiesForAlgo(), and lumiValuesForAlgo().

◆ checkAlgoAndBX()

void LumiDetails::checkAlgoAndBX ( AlgoType  algo,
unsigned int  bx 
) const
private

Definition at line 136 of file LumiDetails.cc.

136  {
137  checkAlgo(algo);
140  << "Branch crossing argument out of range in call to a function in LumiDetails\n";
141  }
142 }

References l1GtPatternGenerator_cfi::bx, checkAlgo(), Exception, edm::errors::LogicError, m_algoToFirstIndex, and mitigatedMETSequence_cff::U.

Referenced by lumiError(), lumiQuality(), and lumiValue().

◆ dipalgoNames()

std::vector< std::string > const & LumiDetails::dipalgoNames ( )
static

Definition at line 118 of file LumiDetails.cc.

118 { return s_dipalgoNames; }

References s_dipalgoNames.

Referenced by operator<<().

◆ fill()

void LumiDetails::fill ( AlgoType  algo,
std::vector< float > const &  values,
std::vector< float > const &  errors,
std::vector< short > const &  qualities 
)

Definition at line 46 of file LumiDetails.cc.

49  {
50  checkAlgo(algo);
51  if (values.size() != errors.size() || values.size() != qualities.size() ||
53  throw edm::Exception(edm::errors::LogicError) << "Illegal input values passed to LumiDetails::fill.\n"
54  << "The current implementation of LumiDetails only allows filling\n"
55  << "vectors for each algorithm once and the input vectors must\n"
56  << "all be the same size.\n";
57  }
58  m_allValues.insert(m_allValues.begin() + m_algoToFirstIndex[algo], values.begin(), values.end());
59  m_allErrors.insert(m_allErrors.begin() + m_algoToFirstIndex[algo], errors.begin(), errors.end());
60  m_allQualities.insert(m_allQualities.begin() + m_algoToFirstIndex[algo], qualities.begin(), qualities.end());
61  for (unsigned i = algo + 1U; i <= kMaxNumAlgos; ++i) {
62  m_algoToFirstIndex[i] += values.size();
63  }
64 }

References checkAlgo(), Exception, mps_fire::i, kMaxNumAlgos, edm::errors::LogicError, m_algoToFirstIndex, m_allErrors, m_allQualities, m_allValues, mitigatedMETSequence_cff::U, and contentValuesCheck::values.

◆ fillBeamIntensities()

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

Definition at line 66 of file LumiDetails.cc.

67  {
68  m_beam1Intensities = beam1Intensities;
69  m_beam2Intensities = beam2Intensities;
70 }

References m_beam1Intensities, and m_beam2Intensities.

◆ isProductEqual()

bool LumiDetails::isProductEqual ( LumiDetails const &  lumiDetails) const

Definition at line 119 of file LumiDetails.cc.

119  {
120  if (m_lumiVersion == lumiDetails.m_lumiVersion && m_algoToFirstIndex == lumiDetails.m_algoToFirstIndex &&
121  m_allValues == lumiDetails.m_allValues && m_allErrors == lumiDetails.m_allErrors &&
122  m_allQualities == lumiDetails.m_allQualities && m_beam1Intensities == lumiDetails.m_beam1Intensities &&
123  m_beam2Intensities == lumiDetails.m_beam2Intensities) {
124  return true;
125  }
126  return false;
127 }

References m_algoToFirstIndex, m_allErrors, m_allQualities, m_allValues, m_beam1Intensities, m_beam2Intensities, and m_lumiVersion.

◆ isValid()

bool LumiDetails::isValid ( void  ) const

◆ lumiBeam1Intensities()

std::vector< float > const & LumiDetails::lumiBeam1Intensities ( ) const

Definition at line 109 of file LumiDetails.cc.

109 { return m_beam1Intensities; }

References m_beam1Intensities.

Referenced by operator<<().

◆ lumiBeam1Intensity()

float LumiDetails::lumiBeam1Intensity ( unsigned int  bx) const

Definition at line 87 of file LumiDetails.cc.

87 { return m_beam1Intensities.at(bx); }

References l1GtPatternGenerator_cfi::bx, and m_beam1Intensities.

◆ lumiBeam2Intensities()

std::vector< float > const & LumiDetails::lumiBeam2Intensities ( ) const

Definition at line 111 of file LumiDetails.cc.

111 { return m_beam2Intensities; }

References m_beam2Intensities.

Referenced by operator<<().

◆ lumiBeam2Intensity()

float LumiDetails::lumiBeam2Intensity ( unsigned int  bx) const

Definition at line 89 of file LumiDetails.cc.

89 { return m_beam2Intensities.at(bx); }

References l1GtPatternGenerator_cfi::bx, and m_beam2Intensities.

◆ lumiError()

float LumiDetails::lumiError ( AlgoType  algo,
unsigned int  bx 
) const

Definition at line 77 of file LumiDetails.cc.

77  {
80 }

References l1GtPatternGenerator_cfi::bx, checkAlgoAndBX(), m_algoToFirstIndex, and m_allErrors.

◆ lumiErrorsForAlgo()

LumiDetails::ErrorRange LumiDetails::lumiErrorsForAlgo ( AlgoType  algo) const

Definition at line 97 of file LumiDetails.cc.

97  {
98  checkAlgo(algo);
100  m_allErrors.begin() + m_algoToFirstIndex[algo + 1U]);
101 }

References checkAlgo(), m_algoToFirstIndex, m_allErrors, and mitigatedMETSequence_cff::U.

Referenced by operator<<().

◆ lumiQualitiesForAlgo()

LumiDetails::QualityRange LumiDetails::lumiQualitiesForAlgo ( AlgoType  algo) const

Definition at line 103 of file LumiDetails.cc.

103  {
104  checkAlgo(algo);
106  m_allQualities.begin() + m_algoToFirstIndex[algo + 1U]);
107 }

References checkAlgo(), m_algoToFirstIndex, m_allQualities, and mitigatedMETSequence_cff::U.

Referenced by operator<<().

◆ lumiQuality()

short LumiDetails::lumiQuality ( AlgoType  algo,
unsigned int  bx 
) const

◆ lumiValue()

float LumiDetails::lumiValue ( AlgoType  algo,
unsigned int  bx 
) const

◆ lumiValuesForAlgo()

LumiDetails::ValueRange LumiDetails::lumiValuesForAlgo ( AlgoType  algo) const

Definition at line 91 of file LumiDetails.cc.

91  {
92  checkAlgo(algo);
94  m_allValues.begin() + m_algoToFirstIndex[algo + 1U]);
95 }

References checkAlgo(), m_algoToFirstIndex, m_allValues, and mitigatedMETSequence_cff::U.

Referenced by operator<<().

◆ lumiVersion()

std::string const & LumiDetails::lumiVersion ( ) const

Definition at line 42 of file LumiDetails.cc.

42 { return m_lumiVersion; }

References m_lumiVersion.

Referenced by operator<<(), and setLumiVersion().

◆ setLumiVersion()

void LumiDetails::setLumiVersion ( std::string const &  lumiVersion)

Definition at line 40 of file LumiDetails.cc.

References lumiVersion(), and m_lumiVersion.

Member Data Documentation

◆ m_algoNames

const std::vector< std::string > LumiDetails::m_algoNames
staticprivate
Initial value:
= {
{"OCC1"},
{"OCC2"},
{"ET"},
{"PLT"}}

Definition at line 72 of file LumiDetails.h.

Referenced by algoNames().

◆ m_algoToFirstIndex

std::vector<unsigned int> LumiDetails::m_algoToFirstIndex
private

◆ m_allErrors

std::vector<float> LumiDetails::m_allErrors
private

Definition at line 85 of file LumiDetails.h.

Referenced by fill(), isProductEqual(), lumiError(), and lumiErrorsForAlgo().

◆ m_allQualities

std::vector<short> LumiDetails::m_allQualities
private

Definition at line 86 of file LumiDetails.h.

Referenced by fill(), isProductEqual(), lumiQualitiesForAlgo(), and lumiQuality().

◆ m_allValues

std::vector<float> LumiDetails::m_allValues
private

Definition at line 84 of file LumiDetails.h.

Referenced by fill(), isProductEqual(), isValid(), lumiValue(), and lumiValuesForAlgo().

◆ m_beam1Intensities

std::vector<float> LumiDetails::m_beam1Intensities
private

◆ m_beam2Intensities

std::vector<float> LumiDetails::m_beam2Intensities
private

◆ m_lumiVersion

std::string LumiDetails::m_lumiVersion
private

Definition at line 74 of file LumiDetails.h.

Referenced by isProductEqual(), lumiVersion(), and setLumiVersion().

LumiDetails::checkAlgo
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
LumiDetails::kET
Definition: LumiDetails.h:26
mps_fire.i
i
Definition: mps_fire.py:355
LumiDetails::m_allErrors
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
edm::errors::LogicError
Definition: EDMException.h:37
s_dipalgoNames
static const std::vector< std::string > s_dipalgoNames
Definition: LumiDetails.cc:18
LumiDetails::QualityRange
std::pair< std::vector< short >::const_iterator, std::vector< short >::const_iterator > QualityRange
Definition: LumiDetails.h:30
LumiDetails::m_lumiVersion
std::string m_lumiVersion
Definition: LumiDetails.h:74
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
cms::cuda::assert
assert(be >=bs)
LumiDetails::kOCC1
Definition: LumiDetails.h:26
LumiDetails::kPLT
Definition: LumiDetails.h:26
LumiDetails::m_algoNames
static const std::vector< std::string > m_algoNames
Definition: LumiDetails.h:72
cmsdt::algo
algo
Definition: constants.h:164
LumiDetails::ValueRange
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ValueRange
Definition: LumiDetails.h:28
errors
Definition: errors.py:1
LumiDetails::m_allValues
std::vector< float > m_allValues
Definition: LumiDetails.h:84
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
LumiDetails::checkAlgoAndBX
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:136
LumiDetails::m_algoToFirstIndex
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
LumiDetails::ErrorRange
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ErrorRange
Definition: LumiDetails.h:29
LumiDetails::m_beam2Intensities
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88
mitigatedMETSequence_cff.U
U
Definition: mitigatedMETSequence_cff.py:36
LumiDetails::kMaxNumAlgos
Definition: LumiDetails.h:26
LumiDetails::m_allQualities
std::vector< short > m_allQualities
Definition: LumiDetails.h:86
LumiDetails::m_beam1Intensities
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87
LumiDetails::lumiVersion
std::string const & lumiVersion() const
Definition: LumiDetails.cc:42
Exception
Definition: hltDiff.cc:246
LumiDetails::kOCC2
Definition: LumiDetails.h:26