CMS 3D CMS Logo

LumiSectionData.h
Go to the documentation of this file.
1 #ifndef CondFormats_Luminosity_LumiSectionData_h
2 #define CondFormats_Luminosity_LumiSectionData_h
3 
16 
17 #include <vector>
18 #include <string>
19 
20 namespace lumi {
21  static const int BXMIN = 1;
22  static const int BXMAX = 3564;
23  static const int LUMIALGOMAX = 3;
24 
25  typedef enum { ET = 0, OCCD1 = 1, OCCD2 = 2 } LumiAlgoType;
26  typedef enum { ALGO = 0, TECH = 1 } TriggerType;
27 
28  struct HLTInfo {
29  HLTInfo() : pathname(""), inputcount(-99), acceptcount(-99), prescale(-99) {}
30  HLTInfo(const std::string& pathnameIN, int i, int a, int p)
31  : pathname(pathnameIN), inputcount(i), acceptcount(a), prescale(p) {}
35  int prescale;
36 
38  };
39 
40  struct TriggerInfo {
41  TriggerInfo() : name(""), triggercount(-99), deadtimecount(-99), prescale(-99) {}
42  TriggerInfo(const std::string& trgname, int trgcount, int deadcount, int p)
43  : name(trgname), triggercount(trgcount), deadtimecount(deadcount), prescale(p) {}
46  int deadtimecount; //max 2**20*3564=3737124864, so wrong type
47  int prescale;
48 
50  };
51 
54  BunchCrossingInfo(int idx, float value, float err, int quality)
56  int BXIdx; //starting from 1
57  float lumivalue;
58  float lumierr;
60 
62  };
63 
64  static const BunchCrossingInfo BXNULL = BunchCrossingInfo(-99, -99.0, -99.0, -99);
65  typedef std::vector<BunchCrossingInfo>::const_iterator BunchCrossingIterator;
66  typedef std::vector<HLTInfo>::const_iterator HLTIterator;
67  typedef std::vector<TriggerInfo>::const_iterator TriggerIterator;
68 
70  public:
73 
74  public:
78  std::string lumiVersion() const;
79  int lumisectionID() const;
80  size_t nBunchCrossing() const;
81  //radom access to instant LumiAverage
82  float lumiAverage() const;
83  float lumiError() const;
84  float deadFraction() const;
85  int lumiquality() const;
86  unsigned long long startorbit() const;
87  //get bunchCrossingInfo by algorithm
88  void bunchCrossingInfo(const LumiAlgoType lumialgotype, std::vector<BunchCrossingInfo>& result) const;
89  //random access to bunchCrossingInfo by bunchcrossing index
90  const BunchCrossingInfo bunchCrossingInfo(const int BXIndex, const LumiAlgoType lumialgotype) const;
91  //sequential access to bunchCrossingInfo
92  BunchCrossingIterator bunchCrossingBegin(const LumiAlgoType lumialgotype) const;
93  BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const;
94  //total number of HLT paths
95  size_t nHLTPath() const;
96  bool HLThasData() const;
97  HLTIterator hltBegin() const;
98  HLTIterator hltEnd() const;
99 
100  bool TriggerhasData() const;
101  TriggerIterator trgBegin() const;
102  TriggerIterator trgEnd() const;
103 
104  short qualityFlag() const;
108  void setLumiNull(); //set versionid number to -99, signal no lumi data written.
109  void setLumiVersion(const std::string& versionid);
110  void setLumiSectionId(int sectionid);
111  void setLumiAverage(float lumiavg);
112  void setLumiQuality(int lumiquality);
113  void setDeadFraction(float deadfrac);
114  void setLumiError(float lumierr);
115  void setStartOrbit(unsigned long long orbtnumber);
116  void setBunchCrossingData(const std::vector<BunchCrossingInfo>& BXs, const LumiAlgoType algotype);
117  void setHLTData(const std::vector<HLTInfo>& hltdetail);
118  void setTriggerData(const std::vector<TriggerInfo>& triggerinfo);
119  void setQualityFlag(short qualityflag);
120  void print(std::ostream& s) const;
121 
122  private:
123  std::vector<BunchCrossingInfo> m_bx; //Lumi detail info sorted by algoright+BX number stored as blob
124  int m_sectionid; //LS id counting from 1 as required by evt. Instead from 0
125  std::string m_versionid; //Lumi version
126  float m_lumiavg; //instant lumi , selected from best algo
127  float m_lumierror; //instant lumi err,
128  short m_quality; //use 7 bits PIXEL,STRIP,MUON,HCAL,ECAL,HF,HLX
129  float m_deadfrac; //deadtime fraction
130  unsigned long long m_startorbit; //first orbit number of this LS
131  std::vector<HLTInfo> m_hlt; //hlt scaler information sorted by hltpath independent of lumiversion
132  std::vector<TriggerInfo> m_trigger; //trigger scaler sorted by bit number 128algo+64tech independent of lumiversion
133 
135  };
136 } // namespace lumi
137 #endif
void setLumiQuality(int lumiquality)
unsigned long long m_startorbit
void setLumiAverage(float lumiavg)
std::vector< BunchCrossingInfo >::const_iterator BunchCrossingIterator
TriggerInfo(const std::string &trgname, int trgcount, int deadcount, int p)
void setBunchCrossingData(const std::vector< BunchCrossingInfo > &BXs, const LumiAlgoType algotype)
void setQualityFlag(short qualityflag)
std::vector< HLTInfo > m_hlt
float lumiAverage() const
TriggerIterator trgEnd() const
bool TriggerhasData() const
string quality
unsigned long long startorbit() const
short qualityFlag() const
std::vector< TriggerInfo > m_trigger
static const BunchCrossingInfo BXNULL
BunchCrossingIterator bunchCrossingBegin(const LumiAlgoType lumialgotype) const
std::string pathname
HLTInfo(const std::string &pathnameIN, int i, int a, int p)
std::vector< TriggerInfo >::const_iterator TriggerIterator
HLTIterator hltEnd() const
static const int LUMIALGOMAX
Definition: value.py:1
void setStartOrbit(unsigned long long orbtnumber)
std::string lumiVersion() const
std::vector< BunchCrossingInfo > m_bx
void print(std::ostream &s) const
size_t nBunchCrossing() const
TriggerIterator trgBegin() const
float deadFraction() const
void setTriggerData(const std::vector< TriggerInfo > &triggerinfo)
BunchCrossingInfo(int idx, float value, float err, int quality)
void bunchCrossingInfo(const LumiAlgoType lumialgotype, std::vector< BunchCrossingInfo > &result) const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
static const int BXMAX
void setLumiSectionId(int sectionid)
double a
Definition: hdecay.h:119
void setLumiError(float lumierr)
void setHLTData(const std::vector< HLTInfo > &hltdetail)
void setLumiVersion(const std::string &versionid)
static const int BXMIN
std::vector< HLTInfo >::const_iterator HLTIterator
void setDeadFraction(float deadfrac)
size_t nHLTPath() const
BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const
HLTIterator hltBegin() const