9 static std::vector<unsigned short>
bitsetToVector(std::bitset<LHCInfo::bunchSlots + 1>
const& bs) {
10 std::vector<unsigned short> vec;
12 vec.reserve(bs.count());
13 for (
size_t i = 0;
i < bs.size(); ++
i) {
15 vec.push_back((
unsigned short)
i);
48 switch (particleType) {
70 return s_particleType;
78 m_floatParams[
BEAM2_VC] = std::vector<float>();
79 m_floatParams[
BEAM1_RF] = std::vector<float>();
80 m_floatParams[
BEAM2_RF] = std::vector<float>();
116 template <
typename T>
118 if (index >= params.size())
119 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" is out of range.");
120 return params[
index];
123 template <
typename T>
125 if (index >= params.size())
126 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" is out of range.");
127 return params[
index];
130 template <
typename T>
132 if (index >=
params.size())
133 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" is out of range.");
136 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" type=" +
typeid(
T).
name() +
137 " has no value stored.");
141 template <
typename T>
143 if (index >=
params.size())
144 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" is out of range.");
148 template <
typename T>
150 if (index >= params.size())
151 throw std::out_of_range(
"Parameter with index " + std::to_string(index) +
" is out of range.");
246 throw std::out_of_range(
"0 not allowed");
252 throw std::out_of_range(
"0 not allowed");
374 unsigned short const& bunches2,
382 float const& intensity1,
383 float const& intensity2,
398 std::vector<float>
const&
beam1VC,
399 std::vector<float>
const&
beam2VC,
400 std::vector<float>
const&
beam1RF,
401 std::vector<float>
const&
beam2RF,
402 std::bitset<bunchSlots + 1>
const& bunchConf1,
403 std::bitset<bunchSlots + 1>
const& bunchConf2) {
438 ss <<
"LHC fill: " << this->
fillNumber() << std::endl
442 <<
"Target bunches at IP5: " << this->
targetBunches() << std::endl
448 <<
"Crossing angle (urad): " << this->
crossingAngle() << std::endl
449 <<
"Beta star (cm): " << this->
betaStar() << std::endl
450 <<
"Average Intensity for Beam 1 (number of charges): " << this->
intensityForBeam1() << std::endl
451 <<
"Average Intensity for Beam 2 (number of charges): " << this->
intensityForBeam2() << std::endl
452 <<
"Energy (GeV): " << this->
energy() << std::endl
453 <<
"Delivered Luminosity (max): " << this->
delivLumi() << std::endl
454 <<
"Recorded Luminosity (max): " << this->
recLumi() << std::endl
455 <<
"Instantaneous Luminosity: " << this->
instLumi() << std::endl
456 <<
"Instantaneous Luminosity Error: " << this->
instLumiError() << std::endl
457 <<
"Creation time of the fill: " 459 <<
"Begin time of Stable Beam flag: " 463 <<
"Injection scheme as given by LPC: " << this->
injectionScheme() << std::endl
464 <<
"LHC State: " << this->
lhcState() << std::endl
465 <<
"LHC Comments: " << this->
lhcComment() << std::endl
466 <<
"CTPPS Status: " << this->
ctppsStatus() << std::endl
467 <<
"Lumi section: " << this->
lumiSection() << std::endl;
469 ss <<
"Luminosity per bunch (total " << this->
lumiPerBX().size() <<
"): ";
473 ss <<
"Beam 1 VC (total " << this->
beam1VC().size() <<
"): ";
477 ss <<
"Beam 2 VC (total " <<
beam2VC().size() <<
"): ";
481 ss <<
"Beam 1 RF (total " <<
beam1RF().size() <<
"): ";
485 ss <<
"Beam 2 RF (total " <<
beam2RF().size() <<
"): ";
491 ss <<
"Bunches filled for Beam 1 (total " << bunchVector1.size() <<
"): ";
492 std::copy(bunchVector1.begin(), bunchVector1.end(), std::ostream_iterator<unsigned short>(
ss,
", "));
494 ss <<
"Bunches filled for Beam 2 (total " << bunchVector2.size() <<
"): ";
495 std::copy(bunchVector2.begin(), bunchVector2.end(), std::ostream_iterator<unsigned short>(
ss,
", "));
514 std::stringstream
ss;
bool equals(const LHCInfo &rhs) const
std::string const & lhcState() const
void setBeam1RF(std::vector< float > const &beam1RF)
cond::Time_t const beginTime() const
void setLumiSection(unsigned int const &lumiSection)
unsigned short const bunchesInBeam1() const
void setBeginTime(cond::Time_t const &beginTime)
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam1() const
void print(std::stringstream &ss) const
void setInstLumi(float const &instLumi)
void setEnergy(float const &energy)
FillTypeId const fillType() const
bool isBunchInBeam1(size_t const &bunch) const
ret
prodAgent to be discontinued
LHCInfo * cloneFill() const
void setInstLumiError(float const &instLumiError)
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
unsigned short const targetBunches() const
std::string const & injectionScheme() const
static std::string particleTypeToString(LHCInfo::ParticleTypeId const &particleType)
void setDelivLumi(float const &delivLumi)
const T & getOneParam(const std::vector< std::vector< T > > ¶ms, size_t index)
void setParams(std::vector< T > ¶ms, size_t index, const T &value)
std::string const & ctppsStatus() const
void setBeam1VC(std::vector< float > const &beam1VC)
std::vector< std::vector< float > > m_floatParams
bool equal(const T &first, const T &second)
void setBunchesInBeam1(unsigned short const &bunches)
void setLhcComment(std::string const &lhcComment)
void setOneParam(std::vector< std::vector< T > > ¶ms, size_t index, const T &value)
std::vector< std::vector< unsigned long long > > m_timeParams
float const delivLumi() const
void setFillNumber(unsigned short lhcFill)
float const crossingAngle() const
float const instLumiError() const
bool is25nsBunchSpacing() const
unsigned long long Time_t
std::string const & lhcComment() const
void setBetaStar(float const &betaStar)
std::vector< float > const & beam1VC() const
T & accessParams(std::vector< T > ¶ms, size_t index)
std::vector< float > const & beam2RF() const
std::ostream & operator<<(std::ostream &os, LHCInfo beamInfo)
unsigned short const bunchesInBeam2() const
bool isBunchInBeam2(size_t const &bunch) const
void setLumiPerBX(std::vector< float > const &lumiPerBX)
void setBunchesInBeam2(unsigned short const &bunches)
std::vector< float > const & beam1RF() const
float const intensityForBeam2() const
void setBeam2RF(std::vector< float > const &beam2RF)
void setLhcState(std::string const &lhcState)
void setBeam2VC(std::vector< float > const &beam2VC)
void setCollidingBunches(unsigned short const &collidingBunches)
std::vector< std::vector< unsigned int > > m_intParams
unsigned int const & lumiSection() const
void setRecLumi(float const &recLumi)
std::bitset< bunchSlots+1 > m_bunchConfiguration1
std::bitset< bunchSlots+1 > m_bunchConfiguration2
float const instLumi() const
cond::Time_t const endTime() const
static std::string fillTypeToString(LHCInfo::FillTypeId const &fillType)
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)
void setParticleTypeForBeam1(ParticleTypeId const &particleType)
void setInjectionScheme(std::string const &injectionScheme)
std::vector< float > const & beam2VC() const
std::vector< float > const & lumiPerBX() const
ParticleTypeId const particleTypeForBeam1() const
void setCreationTime(cond::Time_t const &createTime)
void setTargetBunches(unsigned short const &targetBunches)
const T & getParams(const std::vector< T > ¶ms, size_t index)
float const recLumi() const
void setCtppsStatus(std::string const &ctppsStatus)
std::bitset< bunchSlots+1 > const & bunchBitsetForBeam2() const
unsigned short const collidingBunches() const
float const betaStar() const
float const intensityForBeam1() const
float const energy() const
unsigned short const fillNumber() const
void setBunchBitsetForBeam1(std::bitset< bunchSlots+1 > const &bunchConfiguration)
void setBunchBitsetForBeam2(std::bitset< bunchSlots+1 > const &bunchConfiguration)
ParticleTypeId const particleTypeForBeam2() const
void setIntensityForBeam1(float const &intensity)
void setEndTime(cond::Time_t const &endTime)
void setIntensityForBeam2(float const &intensity)
void setFillType(FillTypeId const &fillType)
cond::Time_t const createTime() const
void setCrossingAngle(float const &angle)
std::vector< unsigned short > bunchConfigurationForBeam2() const
boost::posix_time::ptime to_boost(Time_t iValue)
static std::vector< unsigned short > bitsetToVector(std::bitset< LHCInfo::bunchSlots+1 > const &bs)
std::vector< unsigned short > bunchConfigurationForBeam1() const
std::vector< std::vector< std::string > > m_stringParams
T angle(T x1, T y1, T z1, T x2, T y2, T z2)