CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
55  : BXIdx(idx), lumivalue(value), lumierr(err), lumiquality(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
unsigned long long startorbit() const
void setLumiAverage(float lumiavg)
std::vector< BunchCrossingInfo >::const_iterator BunchCrossingIterator
TriggerInfo(const std::string &trgname, int trgcount, int deadcount, int p)
uint32_t const *__restrict__ Quality * quality
TriggerIterator trgEnd() const
void setBunchCrossingData(const std::vector< BunchCrossingInfo > &BXs, const LumiAlgoType algotype)
void setQualityFlag(short qualityflag)
std::string lumiVersion() const
std::vector< HLTInfo > m_hlt
float lumiAverage() const
BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const
HLTIterator hltEnd() const
tuple result
Definition: mps_fire.py:311
size_t nHLTPath() const
HLTIterator hltBegin() const
std::vector< TriggerInfo > m_trigger
float lumiError() const
static const BunchCrossingInfo BXNULL
std::string pathname
HLTInfo(const std::string &pathnameIN, int i, int a, int p)
float deadFraction() const
std::vector< TriggerInfo >::const_iterator TriggerIterator
bool HLThasData() const
void bunchCrossingInfo(const LumiAlgoType lumialgotype, std::vector< BunchCrossingInfo > &result) const
static const int LUMIALGOMAX
TriggerIterator trgBegin() const
void setStartOrbit(unsigned long long orbtnumber)
list lumi
Definition: dqmdumpme.py:53
size_t nBunchCrossing() const
std::vector< BunchCrossingInfo > m_bx
short qualityFlag() const
void setTriggerData(const std::vector< TriggerInfo > &triggerinfo)
BunchCrossingInfo(int idx, float value, float err, int quality)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
bool TriggerhasData() const
static const int BXMAX
void print(std::ostream &s) const
void setLumiSectionId(int sectionid)
double a
Definition: hdecay.h:119
void setLumiError(float lumierr)
int lumisectionID() const
BunchCrossingIterator bunchCrossingBegin(const LumiAlgoType lumialgotype) const
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)