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 std::vector< std::string > const 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(),
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88
std::string m_lumiVersion
Definition: LumiDetails.h:74
std::vector< float > m_allValues
Definition: LumiDetails.h:84
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ LumiDetails() [2/2]

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

Definition at line 29 of file LumiDetails.cc.

32  m_allValues(),
33  m_allErrors(),
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88
std::string m_lumiVersion
Definition: LumiDetails.h:74
std::string const & lumiVersion() const
Definition: LumiDetails.cc:42
std::vector< float > m_allValues
Definition: LumiDetails.h:84
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ ~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.

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

Referenced by operator<<().

113  {
114  assert(m_algoNames.size() == kMaxNumAlgos);
115  return m_algoNames;
116 }
assert(be >=bs)
static std::vector< std::string > const m_algoNames
Definition: LumiDetails.h:72

◆ checkAlgo()

void LumiDetails::checkAlgo ( AlgoType  algo) const
private

Definition at line 129 of file LumiDetails.cc.

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

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

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

◆ checkAlgoAndBX()

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

Definition at line 136 of file LumiDetails.cc.

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

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

136  {
137  checkAlgo(algo);
140  << "Branch crossing argument out of range in call to a function in LumiDetails\n";
141  }
142 }
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83

◆ dipalgoNames()

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

Definition at line 118 of file LumiDetails.cc.

References s_dipalgoNames.

Referenced by operator<<().

118 { return s_dipalgoNames; }
static std::vector< std::string > const s_dipalgoNames
Definition: LumiDetails.cc:18

◆ 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.

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

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 }
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
std::vector< float > m_allValues
Definition: LumiDetails.h:84
const char * qualities[3]
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86
Definition: errors.py:1

◆ fillBeamIntensities()

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

Definition at line 66 of file LumiDetails.cc.

References m_beam1Intensities, and m_beam2Intensities.

67  {
68  m_beam1Intensities = beam1Intensities;
69  m_beam2Intensities = beam2Intensities;
70 }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ isProductEqual()

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

Definition at line 119 of file LumiDetails.cc.

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

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 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88
std::string m_lumiVersion
Definition: LumiDetails.h:74
std::vector< float > m_allValues
Definition: LumiDetails.h:84
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ isValid()

bool LumiDetails::isValid ( void  ) const

◆ lumiBeam1Intensities()

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

Definition at line 109 of file LumiDetails.cc.

References m_beam1Intensities.

Referenced by operator<<().

109 { return m_beam1Intensities; }
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ lumiBeam1Intensity()

float LumiDetails::lumiBeam1Intensity ( unsigned int  bx) const

Definition at line 87 of file LumiDetails.cc.

References l1GtPatternGenerator_cfi::bx, and m_beam1Intensities.

87 { return m_beam1Intensities.at(bx); }
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:87

◆ lumiBeam2Intensities()

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

Definition at line 111 of file LumiDetails.cc.

References m_beam2Intensities.

Referenced by operator<<().

111 { return m_beam2Intensities; }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88

◆ lumiBeam2Intensity()

float LumiDetails::lumiBeam2Intensity ( unsigned int  bx) const

Definition at line 89 of file LumiDetails.cc.

References l1GtPatternGenerator_cfi::bx, and m_beam2Intensities.

89 { return m_beam2Intensities.at(bx); }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:88

◆ lumiError()

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

Definition at line 77 of file LumiDetails.cc.

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

77  {
80 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:136
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83

◆ lumiErrorsForAlgo()

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

Definition at line 97 of file LumiDetails.cc.

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

Referenced by operator<<().

97  {
98  checkAlgo(algo);
100  m_allErrors.begin() + m_algoToFirstIndex[algo + 1U]);
101 }
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
std::vector< float > m_allErrors
Definition: LumiDetails.h:85
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ErrorRange
Definition: LumiDetails.h:29
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83

◆ lumiQualitiesForAlgo()

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

Definition at line 103 of file LumiDetails.cc.

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

Referenced by operator<<().

103  {
104  checkAlgo(algo);
106  m_allQualities.begin() + m_algoToFirstIndex[algo + 1U]);
107 }
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
std::pair< std::vector< short >::const_iterator, std::vector< short >::const_iterator > QualityRange
Definition: LumiDetails.h:30
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86

◆ lumiQuality()

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

Definition at line 82 of file LumiDetails.cc.

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

82  {
85 }
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:136
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83
std::vector< short > m_allQualities
Definition: LumiDetails.h:86

◆ lumiValue()

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

Definition at line 72 of file LumiDetails.cc.

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

Referenced by TrackCount::analyze(), IsoTrig::analyze(), DigiLumiCorrHistogramMaker::fill(), and VertexHistogramMaker::fill().

72  {
75 }
std::vector< float > m_allValues
Definition: LumiDetails.h:84
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:136
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83

◆ lumiValuesForAlgo()

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

Definition at line 91 of file LumiDetails.cc.

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

Referenced by operator<<().

91  {
92  checkAlgo(algo);
94  m_allValues.begin() + m_algoToFirstIndex[algo + 1U]);
95 }
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ValueRange
Definition: LumiDetails.h:28
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:129
std::vector< float > m_allValues
Definition: LumiDetails.h:84
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:83

◆ lumiVersion()

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

Definition at line 42 of file LumiDetails.cc.

References m_lumiVersion.

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

42 { return m_lumiVersion; }
std::string m_lumiVersion
Definition: LumiDetails.h:74

◆ setLumiVersion()

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

Definition at line 40 of file LumiDetails.cc.

References lumiVersion(), and m_lumiVersion.

std::string m_lumiVersion
Definition: LumiDetails.h:74
std::string const & lumiVersion() const
Definition: LumiDetails.cc:42

Member Data Documentation

◆ m_algoNames

std::vector< std::string > const 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().