CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

typedef unsigned int LumiDetails::AlgoType

Definition at line 34 of file LumiDetails.h.

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

Definition at line 36 of file LumiDetails.h.

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

Definition at line 37 of file LumiDetails.h.

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

Definition at line 35 of file LumiDetails.h.

Member Enumeration Documentation

Enumerator
kOCC1 
kOCC2 
kET 
kPLT 
kMaxNumAlgos 

Definition at line 27 of file LumiDetails.h.

Constructor & Destructor Documentation

LumiDetails::LumiDetails ( )

Definition at line 21 of file LumiDetails.cc.

21  :
22  m_lumiVersion("-1"),
24  m_allValues(),
25  m_allErrors(),
29 {
30 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
std::string m_lumiVersion
Definition: LumiDetails.h:83
std::vector< float > m_allValues
Definition: LumiDetails.h:93
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
LumiDetails::LumiDetails ( std::string const &  lumiVersion)
explicit

Definition at line 32 of file LumiDetails.cc.

32  :
35  m_allValues(),
36  m_allErrors(),
40 {
41 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
std::string m_lumiVersion
Definition: LumiDetails.h:83
std::vector< float > m_allValues
Definition: LumiDetails.h:93
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
std::string const & lumiVersion() const
Definition: LumiDetails.cc:52
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
LumiDetails::~LumiDetails ( )

Definition at line 43 of file LumiDetails.cc.

43  {
44 }

Member Function Documentation

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

Definition at line 151 of file LumiDetails.cc.

References assert(), kMaxNumAlgos, and m_algoNames.

Referenced by operator<<().

151  {
152  assert(m_algoNames.size() == kMaxNumAlgos);
153  return m_algoNames;
154 }
assert(m_qm.get())
static std::vector< std::string > const m_algoNames
Definition: LumiDetails.h:81
void LumiDetails::checkAlgo ( AlgoType  algo) const
private

Definition at line 176 of file LumiDetails.cc.

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

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

176  {
177  if (algo >= kMaxNumAlgos) {
179  << "Algorithm type argument out of range in a call to a function in LumiDetails\n";
180  }
181 }
void LumiDetails::checkAlgoAndBX ( AlgoType  algo,
unsigned int  bx 
) const
private

Definition at line 184 of file LumiDetails.cc.

References checkAlgo(), Exception, edm::errors::LogicError, and m_algoToFirstIndex.

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

184  {
185  checkAlgo(algo);
186  if (bx >= (m_algoToFirstIndex[algo + 1U] - m_algoToFirstIndex[algo])) {
188  << "Branch crossing argument out of range in call to a function in LumiDetails\n";
189  }
190 }
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:176
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< std::string > const & LumiDetails::dipalgoNames ( )
static

Definition at line 157 of file LumiDetails.cc.

References s_dipalgoNames.

Referenced by operator<<().

157  {
158  return s_dipalgoNames;
159 }
static std::vector< std::string > const s_dipalgoNames
Definition: LumiDetails.cc:19
void LumiDetails::fill ( AlgoType  algo,
std::vector< float > const &  values,
std::vector< float > const &  errors,
std::vector< short > const &  qualities 
)

Definition at line 62 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgo(), Exception, i, kMaxNumAlgos, edm::errors::LogicError, m_algoToFirstIndex, m_allErrors, m_allQualities, and m_allValues.

65  {
66  checkAlgo(algo);
67  if (values.size() != errors.size() ||
68  values.size() != qualities.size() ||
71  << "Illegal input values passed to LumiDetails::fill.\n"
72  << "The current implementation of LumiDetails only allows filling\n"
73  << "vectors for each algorithm once and the input vectors must\n"
74  << "all be the same size.\n";
75  }
76  m_allValues.insert(m_allValues.begin() + m_algoToFirstIndex[algo], values.begin(), values.end());
77  m_allErrors.insert(m_allErrors.begin() + m_algoToFirstIndex[algo], errors.begin(), errors.end());
78  m_allQualities.insert(m_allQualities.begin() + m_algoToFirstIndex[algo], qualities.begin(), qualities.end());
79  for (unsigned i = algo + 1U; i <= kMaxNumAlgos; ++i) {
80  m_algoToFirstIndex[i] += values.size();
81  }
82 }
int i
Definition: DBlmapReader.cc:9
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::vector< float > m_allValues
Definition: LumiDetails.h:93
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:176
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
void LumiDetails::fillBeamIntensities ( std::vector< float > const &  beam1Intensities,
std::vector< float > const &  beam2Intensities 
)

Definition at line 85 of file LumiDetails.cc.

References m_beam1Intensities, and m_beam2Intensities.

86  {
87  m_beam1Intensities = beam1Intensities;
88  m_beam2Intensities = beam2Intensities;
89 }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
bool LumiDetails::isProductEqual ( LumiDetails const &  lumiDetails) const

Definition at line 161 of file LumiDetails.cc.

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

161  {
162 
163  if (m_lumiVersion == lumiDetails.m_lumiVersion &&
164  m_algoToFirstIndex == lumiDetails.m_algoToFirstIndex &&
165  m_allValues == lumiDetails.m_allValues &&
166  m_allErrors == lumiDetails.m_allErrors &&
167  m_allQualities == lumiDetails.m_allQualities &&
168  m_beam1Intensities == lumiDetails.m_beam1Intensities &&
169  m_beam2Intensities == lumiDetails.m_beam2Intensities) {
170  return true;
171  }
172  return false;
173 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
std::string m_lumiVersion
Definition: LumiDetails.h:83
std::vector< float > m_allValues
Definition: LumiDetails.h:93
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
bool LumiDetails::isValid ( void  ) const

Definition at line 57 of file LumiDetails.cc.

References m_allValues.

Referenced by ntuple._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

57  {
58  return m_allValues.size()!=0;
59 }
std::vector< float > m_allValues
Definition: LumiDetails.h:93
std::vector< float > const & LumiDetails::lumiBeam1Intensities ( ) const

Definition at line 141 of file LumiDetails.cc.

References m_beam1Intensities.

Referenced by operator<<().

141  {
142  return m_beam1Intensities;
143 }
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
float LumiDetails::lumiBeam1Intensity ( unsigned int  bx) const

Definition at line 110 of file LumiDetails.cc.

References m_beam1Intensities.

110  {
111  return m_beam1Intensities.at(bx);
112 }
std::vector< float > m_beam1Intensities
Definition: LumiDetails.h:96
std::vector< float > const & LumiDetails::lumiBeam2Intensities ( ) const

Definition at line 146 of file LumiDetails.cc.

References m_beam2Intensities.

Referenced by operator<<().

146  {
147  return m_beam2Intensities;
148 }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
float LumiDetails::lumiBeam2Intensity ( unsigned int  bx) const

Definition at line 115 of file LumiDetails.cc.

References m_beam2Intensities.

115  {
116  return m_beam2Intensities.at(bx);
117 }
std::vector< float > m_beam2Intensities
Definition: LumiDetails.h:97
float LumiDetails::lumiError ( AlgoType  algo,
unsigned int  bx 
) const

Definition at line 98 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgoAndBX(), m_algoToFirstIndex, and m_allErrors.

98  {
99  checkAlgoAndBX(algo, bx);
100  return m_allErrors[m_algoToFirstIndex[algo] + bx];
101 }
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:184
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
LumiDetails::ErrorRange LumiDetails::lumiErrorsForAlgo ( AlgoType  algo) const

Definition at line 127 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgo(), m_algoToFirstIndex, and m_allErrors.

Referenced by operator<<().

127  {
128  checkAlgo(algo);
129  return ErrorRange(m_allErrors.begin() + m_algoToFirstIndex[algo],
130  m_allErrors.begin() + m_algoToFirstIndex[algo + 1U]);
131 }
std::vector< float > m_allErrors
Definition: LumiDetails.h:94
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ErrorRange
Definition: LumiDetails.h:36
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:176
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
LumiDetails::QualityRange LumiDetails::lumiQualitiesForAlgo ( AlgoType  algo) const

Definition at line 134 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgo(), m_algoToFirstIndex, and m_allQualities.

Referenced by operator<<().

134  {
135  checkAlgo(algo);
137  m_allQualities.begin() + m_algoToFirstIndex[algo + 1U]);
138 }
std::pair< std::vector< short >::const_iterator, std::vector< short >::const_iterator > QualityRange
Definition: LumiDetails.h:37
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:176
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
short LumiDetails::lumiQuality ( AlgoType  algo,
unsigned int  bx 
) const

Definition at line 104 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgoAndBX(), m_algoToFirstIndex, and m_allQualities.

104  {
105  checkAlgoAndBX(algo, bx);
106  return m_allQualities[m_algoToFirstIndex[algo] + bx];
107 }
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:184
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::vector< short > m_allQualities
Definition: LumiDetails.h:95
float LumiDetails::lumiValue ( AlgoType  algo,
unsigned int  bx 
) const

Definition at line 92 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgoAndBX(), m_algoToFirstIndex, and m_allValues.

92  {
93  checkAlgoAndBX(algo, bx);
94  return m_allValues[m_algoToFirstIndex[algo] + bx];
95 }
void checkAlgoAndBX(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:184
std::vector< float > m_allValues
Definition: LumiDetails.h:93
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
LumiDetails::ValueRange LumiDetails::lumiValuesForAlgo ( AlgoType  algo) const

Definition at line 120 of file LumiDetails.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, checkAlgo(), m_algoToFirstIndex, and m_allValues.

Referenced by operator<<().

120  {
121  checkAlgo(algo);
122  return ValueRange(m_allValues.begin() + m_algoToFirstIndex[algo],
123  m_allValues.begin() + m_algoToFirstIndex[algo + 1U]);
124 }
std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > ValueRange
Definition: LumiDetails.h:35
std::vector< float > m_allValues
Definition: LumiDetails.h:93
void checkAlgo(AlgoType algo) const
Definition: LumiDetails.cc:176
std::vector< unsigned int > m_algoToFirstIndex
Definition: LumiDetails.h:92
std::string const & LumiDetails::lumiVersion ( ) const

Definition at line 52 of file LumiDetails.cc.

References m_lumiVersion.

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

52  {
53  return m_lumiVersion;
54 }
std::string m_lumiVersion
Definition: LumiDetails.h:83
void LumiDetails::setLumiVersion ( std::string const &  lumiVersion)

Definition at line 47 of file LumiDetails.cc.

References lumiVersion(), and m_lumiVersion.

47  {
49 }
std::string m_lumiVersion
Definition: LumiDetails.h:83
std::string const & lumiVersion() const
Definition: LumiDetails.cc:52

Member Data Documentation

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

Definition at line 81 of file LumiDetails.h.

Referenced by algoNames().

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

Definition at line 94 of file LumiDetails.h.

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

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

Definition at line 95 of file LumiDetails.h.

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

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

Definition at line 93 of file LumiDetails.h.

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

std::vector<float> LumiDetails::m_beam1Intensities
private
std::vector<float> LumiDetails::m_beam2Intensities
private
std::string LumiDetails::m_lumiVersion
private

Definition at line 83 of file LumiDetails.h.

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