CMS 3D CMS Logo

LHCInfo.h
Go to the documentation of this file.
1 #ifndef CondFormats_RunInfo_LHCInfo_H
2 #define CondFormats_RunInfo_LHCInfo_H
3 
6 #include <bitset>
7 #include <iostream>
8 #include <string>
9 #include <sstream>
10 #include <vector>
11 
12 class LHCInfo {
13 public:
14  enum FillType { UNKNOWN = 0, PROTONS = 1, IONS = 2, COSMICS = 3, GAP = 4 };
15  enum ParticleType { NONE = 0, PROTON = 1, PB82 = 2, AR18 = 3, D = 4, XE54 = 5 };
16 
18  LHC_FILL = 0,
19  BUNCHES_1 = 1,
20  BUNCHES_2 = 2,
23  FILL_TYPE = 5,
27  ISIZE = 9
28  };
31  BETA_STAR = 1,
34  ENERGY = 4,
36  REC_LUMI = 7,
38  BEAM1_VC = 9,
39  BEAM2_VC = 10,
40  BEAM1_RF = 11,
41  BEAM2_RF = 12,
42  INST_LUMI = 13,
44  FSIZE = 15
45  };
46  enum TimeParamIndex { CREATE_TIME = 0, BEGIN_TIME = 1, END_TIME = 2, TSIZE = 3 };
48 
51  LHCInfo();
52  LHCInfo(const LHCInfo& rhs);
53  ~LHCInfo();
54 
55  LHCInfo* cloneFill() const;
56 
57  //constant static unsigned integer hosting the maximum number of LHC bunch slots
58  static size_t const bunchSlots = 3564;
59 
60  //constant static unsigned integer hosting the available number of LHC bunch slots
61  static size_t const availableBunchSlots = 2808;
62 
63  void setFillNumber(unsigned short lhcFill);
64 
65  //getters
66  unsigned short const fillNumber() const;
67 
68  unsigned short const bunchesInBeam1() const;
69 
70  unsigned short const bunchesInBeam2() const;
71 
72  unsigned short const collidingBunches() const;
73 
74  unsigned short const targetBunches() const;
75 
76  FillTypeId const fillType() const;
77 
79 
81 
82  float const crossingAngle() const;
83 
84  float const betaStar() const;
85 
86  float const intensityForBeam1() const;
87 
88  float const intensityForBeam2() const;
89 
90  float const energy() const;
91 
92  float const delivLumi() const;
93 
94  float const recLumi() const;
95 
96  float const instLumi() const;
97 
98  float const instLumiError() const;
99 
100  cond::Time_t const createTime() const;
101 
102  cond::Time_t const beginTime() const;
103 
104  cond::Time_t const endTime() const;
105 
106  std::string const& injectionScheme() const;
107 
108  std::vector<float> const& lumiPerBX() const;
109 
110  std::string const& lhcState() const;
111 
112  std::string const& lhcComment() const;
113 
114  std::string const& ctppsStatus() const;
115 
116  unsigned int const& lumiSection() const;
117 
118  std::vector<float> const& beam1VC() const;
119 
120  std::vector<float> const& beam2VC() const;
121 
122  std::vector<float> const& beam1RF() const;
123 
124  std::vector<float> const& beam2RF() const;
125 
126  std::vector<float>& beam1VC();
127 
128  std::vector<float>& beam2VC();
129 
130  std::vector<float>& beam1RF();
131 
132  std::vector<float>& beam2RF();
133 
134  //returns a boolean, true if the injection scheme has a leading 25ns
135  //TODO: parse the circulating bunch configuration, instead of the string.
136  bool is25nsBunchSpacing() const;
137 
138  //returns a boolean, true if the bunch slot number is in the circulating bunch configuration
139  bool isBunchInBeam1(size_t const& bunch) const;
140 
141  bool isBunchInBeam2(size_t const& bunch) const;
142 
143  //member functions returning *by value* a vector with all filled bunch slots
144  std::vector<unsigned short> bunchConfigurationForBeam1() const;
145 
146  std::vector<unsigned short> bunchConfigurationForBeam2() const;
147 
148  //setters
149  void setBunchesInBeam1(unsigned short const& bunches);
150 
151  void setBunchesInBeam2(unsigned short const& bunches);
152 
153  void setCollidingBunches(unsigned short const& collidingBunches);
154 
155  void setTargetBunches(unsigned short const& targetBunches);
156 
157  void setFillType(FillTypeId const& fillType);
158 
160 
162 
163  void setCrossingAngle(float const& angle);
164 
165  void setBetaStar(float const& betaStar);
166 
167  void setIntensityForBeam1(float const& intensity);
168 
169  void setIntensityForBeam2(float const& intensity);
170 
171  void setEnergy(float const& energy);
172 
173  void setDelivLumi(float const& delivLumi);
174 
175  void setRecLumi(float const& recLumi);
176 
177  void setInstLumi(float const& instLumi);
178 
179  void setInstLumiError(float const& instLumiError);
180 
182 
183  void setBeginTime(cond::Time_t const& beginTime);
184 
185  void setEndTime(cond::Time_t const& endTime);
186 
188 
189  void setLumiPerBX(std::vector<float> const& lumiPerBX);
190 
191  void setLhcState(std::string const& lhcState);
192 
193  void setLhcComment(std::string const& lhcComment);
194 
196 
197  void setLumiSection(unsigned int const& lumiSection);
198 
199  void setBeam1VC(std::vector<float> const& beam1VC);
200 
201  void setBeam2VC(std::vector<float> const& beam2VC);
202 
203  void setBeam1RF(std::vector<float> const& beam1RF);
204 
205  void setBeam2RF(std::vector<float> const& beam2RF);
206 
207  //sets all values in one go
208  void setInfo(unsigned short const& bunches1,
209  unsigned short const& bunches2,
210  unsigned short const& collidingBunches,
211  unsigned short const& targetBunches,
212  FillTypeId const& fillType,
213  ParticleTypeId const& particleType1,
214  ParticleTypeId const& particleType2,
215  float const& angle,
216  float const& beta,
217  float const& intensity1,
218  float const& intensity2,
219  float const& energy,
220  float const& delivLumi,
221  float const& recLumi,
222  float const& instLumi,
223  float const& instLumiError,
224  cond::Time_t const& createTime,
225  cond::Time_t const& beginTime,
226  cond::Time_t const& endTime,
227  std::string const& scheme,
228  std::vector<float> const& lumiPerBX,
229  std::string const& lhcState,
230  std::string const& lhcComment,
231  std::string const& ctppsStatus,
232  unsigned int const& lumiSection,
233  std::vector<float> const& beam1VC,
234  std::vector<float> const& beam2VC,
235  std::vector<float> const& beam1RF,
236  std::vector<float> const& beam2RF,
237  std::bitset<bunchSlots + 1> const& bunchConf1,
238  std::bitset<bunchSlots + 1> const& bunchConf2);
239 
240  bool equals(const LHCInfo& rhs) const;
241 
242  bool empty() const;
243 
244  //dumping values on output stream
245  void print(std::stringstream& ss) const;
246 
247  std::bitset<bunchSlots + 1> const& bunchBitsetForBeam1() const;
248 
249  std::bitset<bunchSlots + 1> const& bunchBitsetForBeam2() const;
250 
251  void setBunchBitsetForBeam1(std::bitset<bunchSlots + 1> const& bunchConfiguration);
252 
253  void setBunchBitsetForBeam2(std::bitset<bunchSlots + 1> const& bunchConfiguration);
254 
255 private:
256  bool m_isData = false;
257  std::vector<std::vector<unsigned int> > m_intParams;
258  std::vector<std::vector<float> > m_floatParams;
259  std::vector<std::vector<unsigned long long> > m_timeParams;
260  std::vector<std::vector<std::string> > m_stringParams;
261  std::bitset<bunchSlots + 1> m_bunchConfiguration1, m_bunchConfiguration2;
262 
264 };
265 
266 std::ostream& operator<<(std::ostream&, LHCInfo lhcInfo);
267 
268 #endif // CondFormats_RunInfo_LHCInfo_H
LHCInfo::LUMI_PER_B
Definition: LHCInfo.h:37
LHCInfo::beginTime
const cond::Time_t beginTime() const
Definition: LHCInfo.cc:202
LHCInfo::energy
const float energy() const
Definition: LHCInfo.cc:190
LHCInfo::FloatParamIndex
FloatParamIndex
Definition: LHCInfo.h:29
LHCInfo::setTargetBunches
void setTargetBunches(unsigned short const &targetBunches)
Definition: LHCInfo.cc:282
LHCInfo::m_floatParams
std::vector< std::vector< float > > m_floatParams
Definition: LHCInfo.h:258
LHCInfo::cloneFill
LHCInfo * cloneFill() const
Definition: LHCInfo.cc:96
LHCInfo::bunchesInBeam2
unsigned const short bunchesInBeam2() const
Definition: LHCInfo.cc:162
LHCInfo::setBunchesInBeam1
void setBunchesInBeam1(unsigned short const &bunches)
Definition: LHCInfo.cc:270
LHCInfo::intensityForBeam2
const float intensityForBeam2() const
Definition: LHCInfo.cc:188
LHCInfo::UNKNOWN
Definition: LHCInfo.h:14
LHCInfo::LHC_FILL
Definition: LHCInfo.h:18
LHCInfo::bunchConfigurationForBeam1
std::vector< unsigned short > bunchConfigurationForBeam1() const
Definition: LHCInfo.cc:257
LHCInfo::beam2RF
std::vector< float > const & beam2RF() const
Definition: LHCInfo.cc:226
LHCInfo::GAP
Definition: LHCInfo.h:14
LHCInfo::lhcComment
std::string const & lhcComment() const
Definition: LHCInfo.cc:214
LHCInfo::setBeginTime
void setBeginTime(cond::Time_t const &beginTime)
Definition: LHCInfo.cc:326
LHCInfo::setBunchBitsetForBeam1
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
Definition: LHCInfo.cc:505
LHCInfo::setBeam1RF
void setBeam1RF(std::vector< float > const &beam1RF)
Definition: LHCInfo.cc:364
LHCInfo::REC_LUMI
Definition: LHCInfo.h:36
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8686
LHCInfo::setEndTime
void setEndTime(cond::Time_t const &endTime)
Definition: LHCInfo.cc:330
Time.h
LHCInfo::setCtppsStatus
void setCtppsStatus(std::string const &ctppsStatus)
Definition: LHCInfo.cc:348
LHCInfo::INJECTION_SCHEME
Definition: LHCInfo.h:47
LHCInfo::intensityForBeam1
const float intensityForBeam1() const
Definition: LHCInfo.cc:186
LHCInfo::~LHCInfo
~LHCInfo()
Definition: LHCInfo.cc:94
LHCInfo::isBunchInBeam1
bool isBunchInBeam1(size_t const &bunch) const
Definition: LHCInfo.cc:244
LHCInfo::setBeam2RF
void setBeam2RF(std::vector< float > const &beam2RF)
Definition: LHCInfo.cc:368
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
LHCInfo::D
Definition: LHCInfo.h:15
LHCInfo::BETA_STAR
Definition: LHCInfo.h:31
LHCInfo
Definition: LHCInfo.h:12
LHCInfo::PROTON
Definition: LHCInfo.h:15
LHCInfo::setEnergy
void setEnergy(float const &energy)
Definition: LHCInfo.cc:310
LHCInfo::setFillNumber
void setFillNumber(unsigned short lhcFill)
Definition: LHCInfo.cc:265
LHCInfo::CROSSING_ANGLE
Definition: LHCInfo.h:30
LHCInfo::setCollidingBunches
void setCollidingBunches(unsigned short const &collidingBunches)
Definition: LHCInfo.cc:278
LHCInfo::injectionScheme
std::string const & injectionScheme() const
Definition: LHCInfo.cc:206
LHCInfo::m_stringParams
std::vector< std::vector< std::string > > m_stringParams
Definition: LHCInfo.h:260
LHCInfo::BUNCHES_1
Definition: LHCInfo.h:19
LHCInfo::ParticleTypeId
ParticleType ParticleTypeId
Definition: LHCInfo.h:50
LHCInfo::ISIZE
Definition: LHCInfo.h:27
LHCInfo::setParticleTypeForBeam1
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
Definition: LHCInfo.cc:290
LHCInfo::COSMICS
Definition: LHCInfo.h:14
LHCInfo::fillNumber
unsigned const short fillNumber() const
Definition: LHCInfo.cc:158
LHCInfo::BEAM2_VC
Definition: LHCInfo.h:39
LHCInfo::setLumiPerBX
void setLumiPerBX(std::vector< float > const &lumiPerBX)
Definition: LHCInfo.cc:336
LHCInfo::IONS
Definition: LHCInfo.h:14
LHCInfo::INTENSITY_2
Definition: LHCInfo.h:33
LHCInfo::setBunchBitsetForBeam2
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
Definition: LHCInfo.cc:509
LHCInfo::LHCInfo
LHCInfo()
Definition: LHCInfo.cc:73
LHCInfo::setParticleTypeForBeam2
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
Definition: LHCInfo.cc:294
LHCInfo::CREATE_TIME
Definition: LHCInfo.h:46
LHCInfo::TSIZE
Definition: LHCInfo.h:46
LHCInfo::bunchBitsetForBeam1
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam1() const
Definition: LHCInfo.cc:500
LHCInfo::availableBunchSlots
static const size_t availableBunchSlots
Definition: LHCInfo.h:61
LHCInfo::TimeParamIndex
TimeParamIndex
Definition: LHCInfo.h:46
LHCInfo::TARGET_BUNCHES
Definition: LHCInfo.h:22
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
LHCInfo::m_intParams
std::vector< std::vector< unsigned int > > m_intParams
Definition: LHCInfo.h:257
LHCInfo::BEAM2_RF
Definition: LHCInfo.h:41
LHCInfo::PARTICLES_2
Definition: LHCInfo.h:25
LHCInfo::equals
bool equals(const LHCInfo &rhs) const
Definition: LHCInfo.cc:520
LHCInfo::collidingBunches
unsigned const short collidingBunches() const
Definition: LHCInfo.cc:164
LHCInfo::XE54
Definition: LHCInfo.h:15
LHCInfo::setFillType
void setFillType(FillTypeId const &fillType)
Definition: LHCInfo.cc:286
LHCInfo::FillTypeId
FillType FillTypeId
Definition: LHCInfo.h:49
LHCInfo::bunchBitsetForBeam2
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam2() const
Definition: LHCInfo.cc:502
LHCInfo::lhcState
std::string const & lhcState() const
Definition: LHCInfo.cc:212
LHCInfo::setInjectionScheme
void setInjectionScheme(std::string const &injectionScheme)
Definition: LHCInfo.cc:332
LHCInfo::crossingAngle
const float crossingAngle() const
Definition: LHCInfo.cc:182
LHCInfo::StringParamIndex
StringParamIndex
Definition: LHCInfo.h:47
LHCInfo::setCreationTime
void setCreationTime(cond::Time_t const &createTime)
Definition: LHCInfo.cc:322
LHCInfo::particleTypeForBeam2
const ParticleTypeId particleTypeForBeam2() const
Definition: LHCInfo.cc:178
LHCInfo::CTPPS_STATUS
Definition: LHCInfo.h:47
LHCInfo::FillType
FillType
Definition: LHCInfo.h:14
LHCInfo::BUNCHES_2
Definition: LHCInfo.h:20
LHCInfo::BEAM1_RF
Definition: LHCInfo.h:40
LHCInfo::setIntensityForBeam2
void setIntensityForBeam2(float const &intensity)
Definition: LHCInfo.cc:306
LHCInfo::m_bunchConfiguration1
std::bitset< bunchSlots+1 > m_bunchConfiguration1
Definition: LHCInfo.h:261
LHCInfo::print
void print(std::stringstream &ss) const
Definition: LHCInfo.cc:437
LHCInfo::isBunchInBeam2
bool isBunchInBeam2(size_t const &bunch) const
Definition: LHCInfo.cc:250
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LHCInfo::END_TIME
Definition: LHCInfo.h:46
LHCInfo::m_isData
bool m_isData
Definition: LHCInfo.h:256
LHCInfo::COLLIDING_BUNCHES
Definition: LHCInfo.h:21
LHCInfo::setBeam1VC
void setBeam1VC(std::vector< float > const &beam1VC)
Definition: LHCInfo.cc:356
LHCInfo::INST_LUMI_ERR
Definition: LHCInfo.h:43
LHCInfo::beam1RF
std::vector< float > const & beam1RF() const
Definition: LHCInfo.cc:224
LHCInfo::empty
bool empty() const
Definition: LHCInfo.cc:538
LHCInfo::lumiSection
unsigned int const & lumiSection() const
Definition: LHCInfo.cc:218
LHCInfo::DELIV_LUMI
Definition: LHCInfo.h:35
cond::Time_t
unsigned long long Time_t
Definition: Time.h:14
LHCInfo::setInfo
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 &angle, float const &beta, 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, unsigned int const &lumiSection, 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)
Definition: LHCInfo.cc:373
LHCInfo::instLumiError
const float instLumiError() const
Definition: LHCInfo.cc:198
LHCInfo::recLumi
const float recLumi() const
Definition: LHCInfo.cc:194
LHCInfo::AR18
Definition: LHCInfo.h:15
Serializable.h
LHCInfo::instLumi
const float instLumi() const
Definition: LHCInfo.cc:196
LHCInfo::setInstLumiError
void setInstLumiError(float const &instLumiError)
Definition: LHCInfo.cc:318
LHCInfo::setIntensityForBeam1
void setIntensityForBeam1(float const &intensity)
Definition: LHCInfo.cc:302
LHCInfo::beam2VC
std::vector< float > const & beam2VC() const
Definition: LHCInfo.cc:222
LHCInfo::delivLumi
const float delivLumi() const
Definition: LHCInfo.cc:192
LHCInfo::PB82
Definition: LHCInfo.h:15
LHCInfo::m_timeParams
std::vector< std::vector< unsigned long long > > m_timeParams
Definition: LHCInfo.h:259
LHCInfo::is25nsBunchSpacing
bool is25nsBunchSpacing() const
Definition: LHCInfo.cc:238
LHCInfo::setInstLumi
void setInstLumi(float const &instLumi)
Definition: LHCInfo.cc:316
LHCInfo::PARTICLES_1
Definition: LHCInfo.h:24
generator_cfi.scheme
scheme
Definition: generator_cfi.py:22
LHCInfo::NONE
Definition: LHCInfo.h:15
LHCInfo::BEGIN_TIME
Definition: LHCInfo.h:46
LHCInfo::FILL_TYPE
Definition: LHCInfo.h:23
LHCInfo::setLhcComment
void setLhcComment(std::string const &lhcComment)
Definition: LHCInfo.cc:344
LHCInfo::bunchConfigurationForBeam2
std::vector< unsigned short > bunchConfigurationForBeam2() const
Definition: LHCInfo.cc:261
LHCInfo::bunchSlots
static const size_t bunchSlots
Definition: LHCInfo.h:58
LHCInfo::endTime
const cond::Time_t endTime() const
Definition: LHCInfo.cc:204
LHCInfo::fillType
const FillTypeId fillType() const
Definition: LHCInfo.cc:170
LHCInfo::lumiPerBX
std::vector< float > const & lumiPerBX() const
Definition: LHCInfo.cc:210
LHCInfo::targetBunches
unsigned const short targetBunches() const
Definition: LHCInfo.cc:168
LHCInfo::setCrossingAngle
void setCrossingAngle(float const &angle)
Definition: LHCInfo.cc:298
LHCInfo::m_bunchConfiguration2
std::bitset< bunchSlots+1 > m_bunchConfiguration2
Definition: LHCInfo.h:261
LHCInfo::setBetaStar
void setBetaStar(float const &betaStar)
Definition: LHCInfo.cc:300
LHCInfo::particleTypeForBeam1
const ParticleTypeId particleTypeForBeam1() const
Definition: LHCInfo.cc:174
LHCInfo::LHC_STATE
Definition: LHCInfo.h:47
LHCInfo::BEAM1_VC
Definition: LHCInfo.h:38
angle
T angle(T x1, T y1, T z1, T x2, T y2, T z2)
Definition: angle.h:11
LHCInfo::INTENSITY_1
Definition: LHCInfo.h:32
LHCInfo::LHC_COMMENT
Definition: LHCInfo.h:47
LHCInfo::setLhcState
void setLhcState(std::string const &lhcState)
Definition: LHCInfo.cc:340
LHCInfo::setBeam2VC
void setBeam2VC(std::vector< float > const &beam2VC)
Definition: LHCInfo.cc:360
LHCInfo::beam1VC
std::vector< float > const & beam1VC() const
Definition: LHCInfo.cc:220
LHCInfo::LUMI_SECTION
Definition: LHCInfo.h:26
LHCInfo::setRecLumi
void setRecLumi(float const &recLumi)
Definition: LHCInfo.cc:314
PbPb_ZMuSkimMuonDPG_cff.particleType
particleType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:27
LHCInfo::PROTONS
Definition: LHCInfo.h:14
LHCInfo::ENERGY
Definition: LHCInfo.h:34
LHCInfo::betaStar
const float betaStar() const
Definition: LHCInfo.cc:184
LHCInfo::createTime
const cond::Time_t createTime() const
Definition: LHCInfo.cc:200
LHCInfo::IntParamIndex
IntParamIndex
Definition: LHCInfo.h:17
LHCInfo::INST_LUMI
Definition: LHCInfo.h:42
operator<<
std::ostream & operator<<(std::ostream &, LHCInfo lhcInfo)
Definition: LHCInfo.cc:513
LHCInfo::SSIZE
Definition: LHCInfo.h:47
LHCInfo::setLumiSection
void setLumiSection(unsigned int const &lumiSection)
Definition: LHCInfo.cc:352
LHCInfo::ParticleType
ParticleType
Definition: LHCInfo.h:15
LHCInfo::setBunchesInBeam2
void setBunchesInBeam2(unsigned short const &bunches)
Definition: LHCInfo.cc:274
LHCInfo::bunchesInBeam1
unsigned const short bunchesInBeam1() const
Definition: LHCInfo.cc:160
LHCInfo::ctppsStatus
std::string const & ctppsStatus() const
Definition: LHCInfo.cc:216
LHCInfo::FSIZE
Definition: LHCInfo.h:44
LHCInfo::setDelivLumi
void setDelivLumi(float const &delivLumi)
Definition: LHCInfo.cc:312