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
lumi::ALGO
Definition: LumiSectionData.h:26
lumi::LUMIALGOMAX
static const int LUMIALGOMAX
Definition: LumiSectionData.h:23
lumi::LumiSectionData::setLumiVersion
void setLumiVersion(const std::string &versionid)
Definition: LumiSectionData.cc:41
lumi::BunchCrossingInfo::lumivalue
float lumivalue
Definition: LumiSectionData.h:57
lumi::LumiSectionData::m_lumierror
float m_lumierror
Definition: LumiSectionData.h:127
lumi::TriggerType
TriggerType
Definition: LumiSectionData.h:26
lumi::LumiSectionData::m_quality
short m_quality
Definition: LumiSectionData.h:128
mps_fire.i
i
Definition: mps_fire.py:428
lumi::BunchCrossingInfo::BunchCrossingInfo
BunchCrossingInfo(int idx, float value, float err, int quality)
Definition: LumiSectionData.h:54
lumi::TriggerInfo::deadtimecount
int deadtimecount
Definition: LumiSectionData.h:46
lumi::HLTInfo::prescale
int prescale
Definition: LumiSectionData.h:35
lumi::LumiSectionData::lumiquality
int lumiquality() const
Definition: LumiSectionData.cc:13
lumi::HLTInfo::HLTInfo
HLTInfo()
Definition: LumiSectionData.h:29
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
lumi::BunchCrossingInfo::BXIdx
int BXIdx
Definition: LumiSectionData.h:56
lumi::LumiSectionData::hltBegin
HLTIterator hltBegin() const
Definition: LumiSectionData.cc:34
lumi::LumiSectionData::m_hlt
std::vector< HLTInfo > m_hlt
Definition: LumiSectionData.h:131
lumi::BXNULL
static const BunchCrossingInfo BXNULL
Definition: LumiSectionData.h:64
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
lumi::LumiSectionData::setLumiError
void setLumiError(float lumierr)
Definition: LumiSectionData.cc:46
lumi::LumiSectionData
Definition: LumiSectionData.h:69
lumi::LumiSectionData::m_versionid
std::string m_versionid
Definition: LumiSectionData.h:125
lumi::TriggerInfo::triggercount
int triggercount
Definition: LumiSectionData.h:45
lumi::HLTInfo::inputcount
int inputcount
Definition: LumiSectionData.h:33
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
lumi::LumiSectionData::hltEnd
HLTIterator hltEnd() const
Definition: LumiSectionData.cc:35
lumi::LumiSectionData::lumiAverage
float lumiAverage() const
Definition: LumiSectionData.cc:9
alignCSCRings.s
s
Definition: alignCSCRings.py:92
lumi::TriggerInfo::prescale
int prescale
Definition: LumiSectionData.h:47
lumi::LumiSectionData::lumiVersion
std::string lumiVersion() const
Definition: LumiSectionData.cc:6
lumi::LumiSectionData::TriggerhasData
bool TriggerhasData() const
Definition: LumiSectionData.cc:36
lumi::LumiSectionData::setQualityFlag
void setQualityFlag(short qualityflag)
Definition: LumiSectionData.cc:58
lumi::BunchCrossingInfo::lumierr
float lumierr
Definition: LumiSectionData.h:58
lumi::TriggerInfo::TriggerInfo
TriggerInfo()
Definition: LumiSectionData.h:41
lumi::LumiSectionData::setLumiAverage
void setLumiAverage(float lumiavg)
Definition: LumiSectionData.cc:43
lumi::LumiSectionData::bunchCrossingBegin
BunchCrossingIterator bunchCrossingBegin(const LumiAlgoType lumialgotype) const
Definition: LumiSectionData.cc:26
lumi::TriggerIterator
std::vector< TriggerInfo >::const_iterator TriggerIterator
Definition: LumiSectionData.h:67
lumi::OCCD1
Definition: LumiSectionData.h:25
lumi::LumiSectionData::lumisectionID
int lumisectionID() const
Definition: LumiSectionData.cc:7
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
lumi::LumiSectionData::setBunchCrossingData
void setBunchCrossingData(const std::vector< BunchCrossingInfo > &BXs, const LumiAlgoType algotype)
Definition: LumiSectionData.cc:48
lumi::LumiSectionData::setStartOrbit
void setStartOrbit(unsigned long long orbtnumber)
Definition: LumiSectionData.cc:47
lumi::LumiSectionData::setTriggerData
void setTriggerData(const std::vector< TriggerInfo > &triggerinfo)
Definition: LumiSectionData.cc:55
a
double a
Definition: hdecay.h:119
lumi::LumiAlgoType
LumiAlgoType
Definition: LumiSectionData.h:25
lumi::LumiSectionData::print
void print(std::ostream &s) const
Definition: LumiSectionData.cc:59
lumi::LumiSectionData::startorbit
unsigned long long startorbit() const
Definition: LumiSectionData.cc:12
lumi::BunchCrossingInfo
Definition: LumiSectionData.h:52
Serializable.h
lumi::HLTInfo::pathname
std::string pathname
Definition: LumiSectionData.h:32
lumi::LumiSectionData::LumiSectionData
LumiSectionData()
Definition: LumiSectionData.cc:3
value
Definition: value.py:1
lumi::LumiSectionData::nBunchCrossing
size_t nBunchCrossing() const
Definition: LumiSectionData.cc:8
lumi::LumiSectionData::setLumiQuality
void setLumiQuality(int lumiquality)
Definition: LumiSectionData.cc:44
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
prescale
Definition: PrescaleEventFilter.cc:32
lumi::LumiSectionData::qualityFlag
short qualityFlag() const
Definition: LumiSectionData.cc:39
lumi::LumiSectionData::m_trigger
std::vector< TriggerInfo > m_trigger
Definition: LumiSectionData.h:132
lumi::LumiSectionData::m_startorbit
unsigned long long m_startorbit
Definition: LumiSectionData.h:130
lumi::LumiSectionData::deadFraction
float deadFraction() const
Definition: LumiSectionData.cc:11
lumi::LumiSectionData::trgBegin
TriggerIterator trgBegin() const
Definition: LumiSectionData.cc:37
lumi::HLTInfo::acceptcount
int acceptcount
Definition: LumiSectionData.h:34
lumi::LumiSectionData::HLThasData
bool HLThasData() const
Definition: LumiSectionData.cc:33
lumi::LumiSectionData::bunchCrossingEnd
BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const
Definition: LumiSectionData.cc:29
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
lumi::BunchCrossingIterator
std::vector< BunchCrossingInfo >::const_iterator BunchCrossingIterator
Definition: LumiSectionData.h:65
lumi::LumiSectionData::setLumiNull
void setLumiNull()
Definition: LumiSectionData.cc:40
lumi::BXMAX
static const int BXMAX
Definition: LumiSectionData.h:22
lumi::LumiSectionData::~LumiSectionData
~LumiSectionData()
Definition: LumiSectionData.h:72
lumi::BunchCrossingInfo::BunchCrossingInfo
BunchCrossingInfo()
Definition: LumiSectionData.h:53
lumi::HLTInfo::HLTInfo
HLTInfo(const std::string &pathnameIN, int i, int a, int p)
Definition: LumiSectionData.h:30
lumi::LumiSectionData::m_deadfrac
float m_deadfrac
Definition: LumiSectionData.h:129
lumi::LumiSectionData::setLumiSectionId
void setLumiSectionId(int sectionid)
Definition: LumiSectionData.cc:42
lumi::LumiSectionData::lumiError
float lumiError() const
Definition: LumiSectionData.cc:10
mps_fire.result
result
Definition: mps_fire.py:311
lumi::OCCD2
Definition: LumiSectionData.h:25
lumi::LumiSectionData::nHLTPath
size_t nHLTPath() const
Definition: LumiSectionData.cc:32
lumi::TriggerInfo::name
std::string name
Definition: LumiSectionData.h:44
lumi::BunchCrossingInfo::lumiquality
int lumiquality
Definition: LumiSectionData.h:59
lumi::LumiSectionData::bunchCrossingInfo
void bunchCrossingInfo(const LumiAlgoType lumialgotype, std::vector< BunchCrossingInfo > &result) const
Definition: LumiSectionData.cc:14
lumi::LumiSectionData::m_bx
std::vector< BunchCrossingInfo > m_bx
Definition: LumiSectionData.h:123
lumi::LumiSectionData::setDeadFraction
void setDeadFraction(float deadfrac)
Definition: LumiSectionData.cc:45
lumi::HLTInfo
Definition: LumiSectionData.h:28
lumi::TECH
Definition: LumiSectionData.h:26
lumi::TriggerInfo::TriggerInfo
TriggerInfo(const std::string &trgname, int trgcount, int deadcount, int p)
Definition: LumiSectionData.h:42
lumi::HLTIterator
std::vector< HLTInfo >::const_iterator HLTIterator
Definition: LumiSectionData.h:66
lumi::LumiSectionData::setHLTData
void setHLTData(const std::vector< HLTInfo > &hltdetail)
Definition: LumiSectionData.cc:52
lumi::LumiSectionData::m_lumiavg
float m_lumiavg
Definition: LumiSectionData.h:126
lumi
Definition: LumiSectionData.h:20
lumi::TriggerInfo
Definition: LumiSectionData.h:40
lumi::LumiSectionData::trgEnd
TriggerIterator trgEnd() const
Definition: LumiSectionData.cc:38
lumi::LumiSectionData::m_sectionid
int m_sectionid
Definition: LumiSectionData.h:124
lumi::ET
Definition: LumiSectionData.h:25
lumi::BXMIN
static const int BXMIN
Definition: LumiSectionData.h:21