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;
74 , m_floatParams( FSIZE )
75 , m_timeParams( TSIZE )
76 , m_stringParams( SSIZE )
110 template <
typename T>
const T&
getParams(
const std::vector<T>& params,
size_t index ){
111 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
112 return params[
index];
115 template <
typename T>
const T&
getOneParam(
const std::vector< std::vector<T> >& params,
size_t index ){
116 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
118 if( inner.empty() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" has no value stored.");
123 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
128 if( index >= params.size() )
throw std::out_of_range(
"Parameter with index "+std::to_string(index)+
" is out of range.");
261 throw std::out_of_range(
"0 not allowed" );
267 throw std::out_of_range(
"0 not allowed" );
391 ,
unsigned short const & bunches2
399 ,
float const & intensity1
400 ,
float const & intensity2
413 ,std::vector<float>
const &
beam1VC 414 ,std::vector<float>
const &
beam2VC 415 ,std::vector<float>
const &
beam1RF 416 ,std::vector<float>
const &
beam2RF 417 ,std::bitset<bunchSlots+1>
const & bunchConf1
418 ,std::bitset<bunchSlots+1>
const & bunchConf2 ) {
451 ss <<
"LHC fill: " << this->
fillNumber() << std::endl
455 <<
"Target bunches at IP5: " <<this->
targetBunches() << std::endl
459 <<
"Crossing angle (urad): " << this->
crossingAngle() << std::endl
460 <<
"Beta star (cm): " << this->
betaStar() << std::endl
461 <<
"Average Intensity for Beam 1 (number of charges): " << this->
intensityForBeam1() << std::endl
462 <<
"Average Intensity for Beam 2 (number of charges): " << this->
intensityForBeam2() << std::endl
463 <<
"Energy (GeV): " << this->
energy() << std::endl
464 <<
"Delivered Luminosity (max): " << this->
delivLumi() << std::endl
465 <<
"Recorded Luminosity (max): " << this->
recLumi() << std::endl
469 <<
"Injection scheme as given by LPC: " << this->
injectionScheme() << std::endl
470 <<
"LHC State: " << this->
lhcState() << std::endl
471 <<
"LHC Comments: " << this->
lhcComment() << std::endl
472 <<
"CTPPS Status: " << this->
ctppsStatus() << std::endl
473 <<
"Lumi sections: " << this->
lumiSection() << std::endl;
475 ss <<
"Luminosity per bunch (total " << this->
lumiPerBX().size() <<
"): ";
479 ss <<
"Beam 1 VC (total " << this->
beam1VC().size() <<
"): ";
483 ss <<
"Beam 2 VC (total " <<
beam2VC().size() <<
"): ";
487 ss <<
"Beam 1 RF (total " <<
beam1RF().size() <<
"): ";
491 ss <<
"Beam 2 RF (total " <<
beam2RF().size() <<
"): ";
497 ss <<
"Bunches filled for Beam 1 (total " << bunchVector1.size() <<
"): ";
498 std::copy( bunchVector1.begin(), bunchVector1.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
500 ss <<
"Bunches filled for Beam 2 (total " << bunchVector2.size() <<
"): ";
501 std::copy( bunchVector2.begin(), bunchVector2.end(), std::ostream_iterator<unsigned short>( ss,
", " ) );
524 std::stringstream ss;
525 beamInfo.
print( ss );
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 setEnergy(float const &energy)
FillTypeId const fillType() const
bool isBunchInBeam1(size_t const &bunch) const
void setParticleTypeForBeam2(ParticleTypeId const &particleType)
unsigned short const targetBunches() const
std::string const & injectionScheme() const
std::bitset< bunchSlots+1 > m_bunchConfiguration1
static std::string particleTypeToString(LHCInfo::ParticleTypeId const &particleType)
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, 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 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
void setFill(unsigned short const &lhcFill, bool const &fromData)
float const delivLumi() const
float const crossingAngle() 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
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
bool const isData() const
void setRecLumi(float const &recLumi)
cond::Time_t const endTime() const
static std::string fillTypeToString(LHCInfo::FillTypeId const &fillType)
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)
std::bitset< bunchSlots+1 > m_bunchConfiguration2
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)