CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DataFormats/Luminosity/interface/LumiSummary.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Luminosity_LumiSummary_h
00002 #define DataFormats_Luminosity_LumiSummary_h
00003  
00018 #include <vector>
00019 #include <iosfwd>
00020 #include <string>
00021 class LumiSummary {
00022  public:
00023   class L1{
00024   public:
00025     L1():triggernameidx(-1),prescale(0){}
00026     int          triggernameidx;
00027     unsigned int prescale;
00028   };
00029   class HLT{
00030   public:
00031     HLT():pathnameidx(-1),prescale(0){}
00032     int          pathnameidx;
00033     unsigned int prescale;
00034   };
00035 
00036  public:
00038     LumiSummary():
00039       lumiversion_("-1"),
00040       avginsdellumi_(0.0),
00041       avginsdellumierr_(0.0),
00042       lumisecqual_(0),
00043       deadcount_(0),
00044       bitzerocount_(),
00045       lsnumber_(0),
00046       startorbit_(0),
00047       numorbit_(0)
00048     { 
00049       hltdata_.reserve(100);
00050       l1data_.reserve(192);
00051     }
00052     
00054     LumiSummary(float avginsdellumi, 
00055                 float avginsdellumierr,
00056                 short lumisecqual,
00057                 unsigned long long deadcount, 
00058                 unsigned long long bitzerocount, 
00059                 unsigned int lsnumber,
00060                 const std::vector<L1>& l1in,
00061                 const std::vector<HLT>& hltin,
00062                 unsigned int startorbit,
00063                 unsigned int numorbit,
00064                 const std::string& lumiversion):
00065       lumiversion_(lumiversion),
00066       avginsdellumi_(avginsdellumi), 
00067       avginsdellumierr_(avginsdellumierr), 
00068       lumisecqual_(lumisecqual),
00069       deadcount_(deadcount), bitzerocount_(bitzerocount), lsnumber_(lsnumber),
00070       hltdata_(hltin), l1data_(l1in),
00071       startorbit_(startorbit),numorbit_(numorbit)
00072       { }
00073 
00075     ~LumiSummary(){}
00081     float avgInsDelLumi() const;
00085     float avgInsDelLumiErr() const;
00091     float intgDelLumi()const;
00092     short lumiSecQual() const ;
00096     unsigned long long deadcount() const;
00100     unsigned long long bitzerocount() const;
00107     float deadFrac() const ;
00114     float liveFrac() const;
00118     float lumiSectionLength() const;
00119     unsigned int lsNumber() const;
00120     unsigned int startOrbit() const;
00121     unsigned int numOrbit() const;
00124     bool isValid() const;
00125     //retrieve trigger bit by bit number 0-191(algo,tech)
00126     L1 l1info(unsigned int idx)const;
00127     HLT hltinfo(unsigned int idx)const;
00128     size_t nTriggerLine()const;
00129     size_t nHLTPath()const;
00131     float avgInsRecLumi() const;
00133     float avgInsRecLumiErr() const;
00135     float intgRecLumi()const;
00136     bool isProductEqual(LumiSummary const& next) const;
00141     std::string lumiVersion()const;
00142     //
00143     //setters
00144     //
00145     void setLumiVersion(const std::string& lumiversion);
00146     void setLumiData(float instlumi,float instlumierr,short lumiquality);
00147     void setDeadCount(unsigned long long deadcount);
00148     void setBitZeroCount(unsigned long long bitzerocount);
00149     void setlsnumber(unsigned int lsnumber);
00150     void setOrbitData(unsigned int startorbit,unsigned int numorbit);
00151     void swapL1Data(std::vector<L1>& l1data);
00152     void swapHLTData(std::vector<HLT>& hltdata);
00153     void copyL1Data(const std::vector<L1>& l1data);
00154     void copyHLTData(const std::vector<HLT>& hltdata);
00155 
00156   private :
00157     std::string lumiversion_;
00158     //instant lumi , selected from best algorithm
00159     float avginsdellumi_;
00160     //instant lumierror
00161     float avginsdellumierr_;
00162     //detector quality flag use HF,HLX    
00163     short lumisecqual_;
00164     unsigned long long deadcount_;
00165     unsigned long long bitzerocount_;
00166     unsigned int lsnumber_;
00167     //contains about 100 - 200 hlt paths
00168     std::vector<HLT> hltdata_;
00169     //contains 128 + 64 triggers
00170     std::vector<L1> l1data_;
00171     //first orbit number of this LS
00172     unsigned int startorbit_;
00173     //number of orbits in this LS
00174     unsigned int numorbit_;
00175 }; 
00176 
00177 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary);
00178 
00179 #endif // DataFormats_Luminosity_LumiSummary_h