CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/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():triggername(""),ratecount(0),prescale(0){}
00026     std::string triggername;
00027     unsigned int ratecount;
00028     unsigned int prescale;
00029   };
00030   class HLT{
00031   public:
00032     HLT():pathname(""),ratecount(0),inputcount(0),prescale(0){}
00033     std::string pathname;
00034     unsigned int ratecount;
00035     unsigned int inputcount;
00036     unsigned int prescale;
00037   };
00038 
00039  public:
00041     LumiSummary():
00042       lumiversion_("-1"),
00043       avginsdellumi_(0.0),
00044       avginsdellumierr_(0.0),
00045       lumisecqual_(0),
00046       deadcount_(0),
00047       lsnumber_(0),
00048       startorbit_(0),
00049       numorbit_(0)
00050     { 
00051       hltdata_.reserve(100);
00052       l1data_.reserve(192);
00053     }
00054     
00056     LumiSummary(float avginsdellumi, 
00057                 float avginsdellumierr,
00058                 short lumisecqual,
00059                 unsigned long long deadcount, 
00060                 unsigned int lsnumber,
00061                 const std::vector<L1>& l1in,
00062                 const std::vector<HLT>& hltin,
00063                 unsigned int startorbit,
00064                 unsigned int numorbit,
00065                 const std::string& lumiversion):
00066       lumiversion_(lumiversion),
00067       avginsdellumi_(avginsdellumi), 
00068       avginsdellumierr_(avginsdellumierr), 
00069       lumisecqual_(lumisecqual),
00070       deadcount_(deadcount), lsnumber_(lsnumber),
00071       hltdata_(hltin), l1data_(l1in),
00072       startorbit_(startorbit),numorbit_(numorbit)
00073       { }
00074 
00076     ~LumiSummary(){}
00078     float avgInsDelLumi() const;
00080     float avgInsDelLumiErr() const;
00082     float intgDelLumi()const;
00083     short lumiSecQual() const ;
00085     unsigned long long deadcount() const;
00092     float deadFrac() const ;
00099     float liveFrac() const;
00103     float lumiSectionLength() const;
00104     unsigned int lsNumber() const;
00105     unsigned int startOrbit() const;
00106     unsigned int numOrbit() const;
00109     bool isValid() const;
00110     //retrieve trigger bit by bit number 0-191(algo,tech)
00111     L1 l1info(unsigned int idx)const;
00112     //retrieve trigger bit by bit name
00113     L1 l1info(const std::string& name) const;
00114     HLT hltinfo(unsigned int idx)const;
00115     HLT hltinfo(const std::string& pathname) const;
00116     size_t nTriggerLine()const;
00117     size_t nHLTPath()const;
00118     std::vector<std::string> HLTPaths()const;
00120     float avgInsRecLumi() const;
00122     float avgInsRecLumiErr() const;
00124     float intgRecLumi()const;
00125     bool isProductEqual(LumiSummary const& next) const;
00130     std::string lumiVersion()const;
00131     //
00132     //setters
00133     //
00134     void setLumiVersion(const std::string& lumiversion);
00135     void setLumiData(float instlumi,float instlumierr,short lumiquality);
00136     void setDeadtime(unsigned long long deadcount);
00137     void setlsnumber(unsigned int lsnumber);
00138     void setOrbitData(unsigned int startorbit,unsigned int numorbit);
00139     void swapL1Data(std::vector<L1>& l1data);
00140     void swapHLTData(std::vector<HLT>& hltdata);
00141     void copyL1Data(const std::vector<L1>& l1data);
00142     void copyHLTData(const std::vector<HLT>& hltdata);
00143 
00144   private :
00145     std::string lumiversion_;
00146     //instant lumi , selected from best algorithm
00147     float avginsdellumi_;
00148     //instant lumierror
00149     float avginsdellumierr_;
00150     //detector quality flag use HF,HLX    
00151     short lumisecqual_;
00152     unsigned long long deadcount_;
00153     unsigned int lsnumber_;
00154     //contains about 100 - 200 hlt paths
00155     std::vector<HLT> hltdata_;
00156     //contains 128 + 64 triggers
00157     std::vector<L1> l1data_;
00158     //first orbit number of this LS
00159     unsigned int startorbit_;
00160     //number of orbits in this LS
00161     unsigned int numorbit_;
00162 }; 
00163 
00164 std::ostream& operator<<(std::ostream& s, const LumiSummary& lumiSummary);
00165 
00166 #endif // DataFormats_Luminosity_LumiSummary_h