Go to the documentation of this file.00001 #ifndef DataFormats_Luminosity_LumiDetails_h
00002 #define DataFormats_Luminosity_LumiDetails_h
00003
00015 #include <utility>
00016 #include <vector>
00017 #include <string>
00018 #include <iosfwd>
00019
00020 class LumiDetails {
00021 public:
00022
00023
00024
00025
00026
00027 enum Algos {
00028 kOCC1,
00029 kOCC2,
00030 kET,
00031 kPLT,
00032 kMaxNumAlgos
00033 };
00034 typedef unsigned int AlgoType;
00035 typedef std::pair<std::vector<float>::const_iterator, std::vector<float>::const_iterator> ValueRange;
00036 typedef std::pair<std::vector<float>::const_iterator, std::vector<float>::const_iterator> ErrorRange;
00037 typedef std::pair<std::vector<short>::const_iterator, std::vector<short>::const_iterator> QualityRange;
00038
00039 LumiDetails();
00040 explicit LumiDetails(std::string const& lumiVersion);
00041 ~LumiDetails();
00042
00043 void setLumiVersion(std::string const& lumiVersion);
00044 std::string const& lumiVersion() const;
00045 bool isValid() const;
00046
00047
00048
00049
00050 void fill(AlgoType algo,
00051 std::vector<float> const& values,
00052 std::vector<float> const& errors,
00053 std::vector<short> const& qualities);
00054
00055 void fillBeamIntensities(std::vector<float> const& beam1Intensities,
00056 std::vector<float> const& beam2Intensities);
00057
00058 float lumiValue(AlgoType algo, unsigned int bx) const;
00059 float lumiError(AlgoType algo, unsigned int bx) const;
00060 short lumiQuality(AlgoType algo, unsigned int bx) const;
00061 float lumiBeam1Intensity(unsigned int bx) const;
00062 float lumiBeam2Intensity(unsigned int bx) const;
00063
00064 ValueRange lumiValuesForAlgo(AlgoType algo) const;
00065 ErrorRange lumiErrorsForAlgo(AlgoType algo) const;
00066 QualityRange lumiQualitiesForAlgo(AlgoType algo) const;
00067 std::vector<float> const& lumiBeam1Intensities() const;
00068 std::vector<float> const& lumiBeam2Intensities() const;
00069
00070 bool isProductEqual(LumiDetails const& lumiDetails) const;
00071
00072 static std::vector<std::string> const& algoNames();
00073
00074 private:
00075
00076 void checkAlgo(AlgoType algo) const;
00077 void checkAlgoAndBX(AlgoType algo, unsigned int bx) const;
00078
00079 static std::vector<std::string> m_algoNames;
00080
00081 std::string m_lumiVersion;
00082
00083
00084
00085
00086
00087
00088
00089
00090 std::vector<unsigned int> m_algoToFirstIndex;
00091 std::vector<float> m_allValues;
00092 std::vector<float> m_allErrors;
00093 std::vector<short> m_allQualities;
00094 std::vector<float> m_beam1Intensities;
00095 std::vector<float> m_beam2Intensities;
00096 };
00097
00098 std::ostream& operator<<(std::ostream & s, LumiDetails const& lumiDetails);
00099
00100 #endif