CMS 3D CMS Logo

LHCInfoPerFill.h
Go to the documentation of this file.
1 #ifndef CondFormats_RunInfo_LHCInfoPerFill_H
2 #define CondFormats_RunInfo_LHCInfoPerFill_H
3 
7 #include <bitset>
8 #include <iostream>
9 #include <string>
10 #include <sstream>
11 #include <vector>
12 
14 public:
15  enum FillType { UNKNOWN = 0, PROTONS, IONS, COSMICS, GAP };
16  enum ParticleType { NONE = 0, PROTON, PB82, AR18, D, XE54 };
17 
19  LHC_FILL = 0,
28  };
43  };
46 
50 
51  LHCInfoPerFill* cloneFill() const;
52 
53  //constant static unsigned integer hosting the maximum number of LHC bunch slots
54  static size_t const bunchSlots = 3564;
55 
56  //constant static unsigned integer hosting the available number of LHC bunch slots
57  static size_t const availableBunchSlots = 2808;
58 
59  void setFillNumber(unsigned short lhcFill);
60 
61  //getters
62  unsigned short const fillNumber() const;
63 
64  unsigned short const bunchesInBeam1() const;
65 
66  unsigned short const bunchesInBeam2() const;
67 
68  unsigned short const collidingBunches() const;
69 
70  unsigned short const targetBunches() const;
71 
72  FillTypeId const fillType() const;
73 
75 
77 
78  float const intensityForBeam1() const;
79 
80  float const intensityForBeam2() const;
81 
82  float const energy() const;
83 
84  float const delivLumi() const;
85 
86  float const recLumi() const;
87 
88  float const instLumi() const;
89 
90  float const instLumiError() const;
91 
92  cond::Time_t const createTime() const;
93 
94  cond::Time_t const beginTime() const;
95 
96  cond::Time_t const endTime() const;
97 
98  std::string const& injectionScheme() const;
99 
100  std::vector<float> const& lumiPerBX() const;
101 
102  std::string const& lhcState() const;
103 
104  std::string const& lhcComment() const;
105 
106  std::string const& ctppsStatus() const;
107 
108  std::vector<float> const& beam1VC() const;
109 
110  std::vector<float> const& beam2VC() const;
111 
112  std::vector<float> const& beam1RF() const;
113 
114  std::vector<float> const& beam2RF() const;
115 
116  std::vector<float>& beam1VC();
117 
118  std::vector<float>& beam2VC();
119 
120  std::vector<float>& beam1RF();
121 
122  std::vector<float>& beam2RF();
123 
124  //returns a boolean, true if the injection scheme has a leading 25ns
125  //TODO: parse the circulating bunch configuration, instead of the string.
126  bool is25nsBunchSpacing() const;
127 
128  //returns a boolean, true if the bunch slot number is in the circulating bunch configuration
129  bool isBunchInBeam1(size_t const& bunch) const;
130 
131  bool isBunchInBeam2(size_t const& bunch) const;
132 
133  //member functions returning *by value* a vector with all filled bunch slots
134  std::vector<unsigned short> bunchConfigurationForBeam1() const;
135 
136  std::vector<unsigned short> bunchConfigurationForBeam2() const;
137 
138  //setters
139  void setBunchesInBeam1(unsigned short const& bunches);
140 
141  void setBunchesInBeam2(unsigned short const& bunches);
142 
143  void setCollidingBunches(unsigned short const& collidingBunches);
144 
145  void setTargetBunches(unsigned short const& targetBunches);
146 
147  void setFillType(FillTypeId const& fillType);
148 
150 
152 
153  void setIntensityForBeam1(float const& intensity);
154 
155  void setIntensityForBeam2(float const& intensity);
156 
157  void setEnergy(float const& energy);
158 
159  void setDelivLumi(float const& delivLumi);
160 
161  void setRecLumi(float const& recLumi);
162 
163  void setInstLumi(float const& instLumi);
164 
165  void setInstLumiError(float const& instLumiError);
166 
168 
169  void setBeginTime(cond::Time_t const& beginTime);
170 
171  void setEndTime(cond::Time_t const& endTime);
172 
174 
175  void setLumiPerBX(std::vector<float> const& lumiPerBX);
176 
177  void setLhcState(std::string const& lhcState);
178 
179  void setLhcComment(std::string const& lhcComment);
180 
182 
183  void setBeam1VC(std::vector<float> const& beam1VC);
184 
185  void setBeam2VC(std::vector<float> const& beam2VC);
186 
187  void setBeam1RF(std::vector<float> const& beam1RF);
188 
189  void setBeam2RF(std::vector<float> const& beam2RF);
190 
191  //sets all values in one go
192  void setInfo(unsigned short const& bunches1,
193  unsigned short const& bunches2,
194  unsigned short const& collidingBunches,
195  unsigned short const& targetBunches,
196  FillTypeId const& fillType,
197  ParticleTypeId const& particleType1,
198  ParticleTypeId const& particleType2,
199  float const& intensity1,
200  float const& intensity2,
201  float const& energy,
202  float const& delivLumi,
203  float const& recLumi,
204  float const& instLumi,
205  float const& instLumiError,
206  cond::Time_t const& createTime,
207  cond::Time_t const& beginTime,
208  cond::Time_t const& endTime,
209  std::string const& scheme,
210  std::vector<float> const& lumiPerBX,
211  std::string const& lhcState,
212  std::string const& lhcComment,
213  std::string const& ctppsStatus,
214  std::vector<float> const& beam1VC,
215  std::vector<float> const& beam2VC,
216  std::vector<float> const& beam1RF,
217  std::vector<float> const& beam2RF,
218  std::bitset<bunchSlots + 1> const& bunchConf1,
219  std::bitset<bunchSlots + 1> const& bunchConf2);
220 
221  bool equals(const LHCInfoPerFill& rhs) const;
222 
223  bool empty() const;
224 
225  //dumping values on output stream
226  void print(std::stringstream& ss) const;
227 
228  std::bitset<bunchSlots + 1> const& bunchBitsetForBeam1() const;
229 
230  std::bitset<bunchSlots + 1> const& bunchBitsetForBeam2() const;
231 
232  void setBunchBitsetForBeam1(std::bitset<bunchSlots + 1> const& bunchConfiguration);
233 
234  void setBunchBitsetForBeam2(std::bitset<bunchSlots + 1> const& bunchConfiguration);
235 
236 private:
237  std::bitset<bunchSlots + 1> m_bunchConfiguration1, m_bunchConfiguration2;
238 
240 };
241 
242 std::ostream& operator<<(std::ostream&, LHCInfoPerFill lhcInfoPerFill);
243 
244 #endif // CondFormats_RunInfo_LHCInfoPerFill_H
float const intensityForBeam1() const
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
void setInjectionScheme(std::string const &injectionScheme)
std::string const & injectionScheme() const
void setBeginTime(cond::Time_t const &beginTime)
void setInstLumiError(float const &instLumiError)
ParticleTypeId const particleTypeForBeam2() const
std::vector< float > const & beam2VC() const
unsigned short const collidingBunches() const
void setLhcComment(std::string const &lhcComment)
void setDelivLumi(float const &delivLumi)
void setInfo(unsigned short const &bunches1, unsigned short const &bunches2, unsigned short const &collidingBunches, unsigned short const &targetBunches, FillTypeId const &fillType, ParticleTypeId const &particleType1, ParticleTypeId const &particleType2, float const &intensity1, float const &intensity2, float const &energy, float const &delivLumi, float const &recLumi, float const &instLumi, float const &instLumiError, cond::Time_t const &createTime, cond::Time_t const &beginTime, cond::Time_t const &endTime, std::string const &scheme, std::vector< float > const &lumiPerBX, std::string const &lhcState, std::string const &lhcComment, std::string const &ctppsStatus, std::vector< float > const &beam1VC, std::vector< float > const &beam2VC, std::vector< float > const &beam1RF, std::vector< float > const &beam2RF, std::bitset< bunchSlots+1 > const &bunchConf1, std::bitset< bunchSlots+1 > const &bunchConf2)
cond::Time_t const beginTime() const
FillType FillTypeId
float const delivLumi() const
ParticleType ParticleTypeId
float const recLumi() const
unsigned short const bunchesInBeam1() const
unsigned short const targetBunches() const
std::string const & lhcState() const
void setBunchesInBeam1(unsigned short const &bunches)
void setEndTime(cond::Time_t const &endTime)
ParticleTypeId const particleTypeForBeam1() const
LHCInfoPerFill * cloneFill() const
void setBunchesInBeam2(unsigned short const &bunches)
void setBeam1VC(std::vector< float > const &beam1VC)
static size_t const bunchSlots
void setIntensityForBeam2(float const &intensity)
unsigned long long Time_t
Definition: Time.h:14
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam2() const
std::string const & ctppsStatus() const
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam1() const
void setTargetBunches(unsigned short const &targetBunches)
std::vector< float > const & lumiPerBX() const
void setRecLumi(float const &recLumi)
float const energy() const
std::bitset< bunchSlots+1 > m_bunchConfiguration2
void setLhcState(std::string const &lhcState)
float const intensityForBeam2() const
static size_t const availableBunchSlots
void setFillNumber(unsigned short lhcFill)
std::ostream & operator<<(std::ostream &, LHCInfoPerFill lhcInfoPerFill)
cond::Time_t const createTime() const
unsigned short const bunchesInBeam2() const
void setIntensityForBeam1(float const &intensity)
void setCtppsStatus(std::string const &ctppsStatus)
std::vector< float > const & beam1RF() const
std::string const & lhcComment() const
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
void setBeam2VC(std::vector< float > const &beam2VC)
void setBeam1RF(std::vector< float > const &beam1RF)
unsigned short const fillNumber() const
std::vector< unsigned short > bunchConfigurationForBeam2() const
std::bitset< bunchSlots+1 > m_bunchConfiguration1
float const instLumi() const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void setCollidingBunches(unsigned short const &collidingBunches)
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
bool equals(const LHCInfoPerFill &rhs) const
bool empty() const
bool isBunchInBeam2(size_t const &bunch) const
std::vector< unsigned short > bunchConfigurationForBeam1() const
FillTypeId const fillType() const
std::vector< float > const & beam2RF() const
bool isBunchInBeam1(size_t const &bunch) const
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
void setCreationTime(cond::Time_t const &createTime)
void setLumiPerBX(std::vector< float > const &lumiPerBX)
void print(std::stringstream &ss) const
void setInstLumi(float const &instLumi)
std::vector< float > const & beam1VC() const
bool is25nsBunchSpacing() const
void setBeam2RF(std::vector< float > const &beam2RF)
float const instLumiError() const
void setEnergy(float const &energy)
void setFillType(FillTypeId const &fillType)
cond::Time_t const endTime() const