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{
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):name(trgname),triggercount(trgcount),deadtimecount(deadcount),prescale(p){}
45  int deadtimecount;//max 2**20*3564=3737124864, so wrong type
46  int prescale;
47 
49 };
50 
53  BunchCrossingInfo(int idx,float value,float err,int quality):
54  BXIdx(idx),lumivalue(value),lumierr(err),lumiquality(quality){}
55  int BXIdx;//starting from 1
56  float lumivalue;
57  float lumierr;
59 
61 };
62 
63  static const BunchCrossingInfo BXNULL=BunchCrossingInfo(-99,-99.0,-99.0,-99);
64  typedef std::vector<BunchCrossingInfo>::const_iterator BunchCrossingIterator;
65  typedef std::vector< HLTInfo >::const_iterator HLTIterator;
66  typedef std::vector< TriggerInfo >::const_iterator TriggerIterator;
67 
69  public:
72  public:
76  std::string lumiVersion()const;
77  int lumisectionID()const;
78  size_t nBunchCrossing()const;
79  //radom access to instant LumiAverage
80  float lumiAverage()const;
81  float lumiError()const;
82  float deadFraction()const;
83  int lumiquality()const;
84  unsigned long long startorbit()const;
85  //get bunchCrossingInfo by algorithm
86  void bunchCrossingInfo( const LumiAlgoType lumialgotype,
87  std::vector<BunchCrossingInfo>& result )const ;
88  //random access to bunchCrossingInfo by bunchcrossing index
89  const BunchCrossingInfo bunchCrossingInfo( const int BXIndex,
90  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,
117  const LumiAlgoType algotype);
118  void setHLTData(const std::vector<HLTInfo>& hltdetail);
119  void setTriggerData(const std::vector<TriggerInfo>& triggerinfo);
120  void setQualityFlag(short qualityflag);
121  void print( std::ostream& s )const;
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 }//ns lumi
137 #endif
std::vector< TriggerInfo >::const_iterator TriggerIterator
int i
Definition: DBlmapReader.cc:9
unsigned long long m_startorbit
std::vector< BunchCrossingInfo >::const_iterator BunchCrossingIterator
TriggerInfo(const std::string &trgname, int trgcount, int deadcount, int p)
std::vector< HLTInfo > m_hlt
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
Definition: print.cc:10
std::vector< TriggerInfo > m_trigger
static const BunchCrossingInfo BXNULL
std::string pathname
HLTInfo(const std::string &pathnameIN, int i, int a, int p)
static const int LUMIALGOMAX
Definition: value.py:1
std::vector< BunchCrossingInfo > m_bx
std::vector< HLTInfo >::const_iterator HLTIterator
BunchCrossingInfo(int idx, float value, float err, int quality)
#define COND_SERIALIZABLE
Definition: Serializable.h:38
static const int BXMAX
double a
Definition: hdecay.h:121
static const int BXMIN