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