CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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{
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{
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
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)
std::vector< HLTInfo > m_hlt
tuple lumi
Definition: fjr2json.py:35
TriggerIterator trgEnd() const
void setBunchCrossingData(const std::vector< BunchCrossingInfo > &BXs, const LumiAlgoType algotype)
void setQualityFlag(short qualityflag)
std::string lumiVersion() const
float lumiAverage() const
std::vector< TriggerInfo > m_trigger
BunchCrossingIterator bunchCrossingEnd(const LumiAlgoType lumialgotype) const
HLTIterator hltEnd() const
size_t nHLTPath() const
HLTIterator hltBegin() const
float lumiError() const
static const BunchCrossingInfo BXNULL
tuple result
Definition: query.py:137
std::string pathname
HLTInfo(const std::string &pathnameIN, int i, int a, int p)
float deadFraction() const
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)
size_t nBunchCrossing() const
std::vector< BunchCrossingInfo > m_bx
std::vector< HLTInfo >::const_iterator HLTIterator
short qualityFlag() const
void setTriggerData(const std::vector< TriggerInfo > &triggerinfo)
BunchCrossingInfo(int idx, float value, float err, int quality)
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
bool TriggerhasData() const
static const int BXMAX
void print(std::ostream &s) const
void setLumiSectionId(int sectionid)
double a
Definition: hdecay.h:121
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
void setDeadFraction(float deadfrac)